Edge computing layer fills the gap between cloud computing layer and terminal devices layer, having the characteristics of fast processing speed and short application response time. Because the edge nodes are highly dynamic, the first problem we need to consider is how to allocate these resources reasonably so that the system can achieve a continuous stable state. In this paper, we study the resource allocation problem of network services in edge computing environment, and proposing a resource allocation model based on stochastic differential equation. We use the predator-prey model to analyze the resource strategy for the system to reach a stable state. We also quantitatively analyze the relationship between cloud computing resources and edge computing resources providing services to users, and prove the existence, uniqueness as well as stability of the model solution. Numerical simulation results show the correctness and effectiveness of the model.