# Mean-Field Stackelberg Game-Based Security Defense and Resource Optimization in Edge Computing
## 4 Mean-Field Games Equilibrium and Optimal Strategies
### Mean-Field Game Equilibrium Algorithm
At the beginning of the game, the intensity of the attack is high and continues to increase with time. Then, the intensity of the attack begins to decrease because the defense mechanism has been activated. The result shows that the intensity of the attack reduces rapidly when effective defense strategies are implemented. Ultimately, there is a slight variation in attack intensity within a specific range due to the underlying attack behavior in edge devices. Figure 4: The optimal resource consumption state of defenders. Figure 5: The evolution of the number of attackers. Figure 3: The evolution of the defense strategy. We compare the resource consumption level of the proposed model and the energy optimization strategy [28] in Figure 7. As shown in Figure 7, the proposed scheme consumes more energy than the energy-optimized strategy at the beginning because of the level of attacks, but then the resource consumption level is gradually reduced, which indicates that the node has an optimal strategy with a minimum resource consumption at this time. ## 6 Conclusions

In this article, we focused on a security strategy with limited resources in edge computing systems. We proposed a mean-field Stackelberg game-based model to optimize the defense strategies and minimize the cost of the defense mechanisms for defenders. The analysis developed in this model focused on scenarios with one attacker and multiple defenders. The attacker first chooses and then announces the optimal strategy to the defenders. Each defender will choose its optimal defense strategy to minimize the loss based on the leader's observed strategy. We achieved the optimal strategies for the defenders and attackers by solving the local optimal control problem. Using the mean-field approximation, we also determined the corresponding optimal consumption of resources of the defenders. We demonstrated that the optimal local control solutions for the defenders and attackers constitute an \((\varepsilon_{1},\varepsilon_{2})\)-Nash equilibrium with the approximated mean-field equilibrium, where \((\varepsilon_{1},\varepsilon_{2})\) converges to zero as \(N\rightarrow\infty\). Finally, we compared the proposed model with another scheme. The simulation results illustrated the dynamic evolution of the defense strategy given the optimal trajectory of the attackers. In this paper, we considered the number of attackers as one player, and we evaluated the proposed model through numerical simulation. In future work, we will extend the

Figure 6: The evolution of the attack level. Table 1.0 Resource consumption level comparison between the proposed scheme and the energy-optimized strategy. proposed mean-field game model to problems with multiple attackers and defenders. In these cases, the optimal control problems of the attackers will be more complex due to the multiple influences on the mean-field behavior, and we will evaluate the game model in the real edge computing environment. L.M., writing draft manuscript and game model and performance; S.L. and B.L., simulations and the objective function; X.W., project management; and all authors contributed to system analysis, simulations, and the writing of this paper. All authors have read and agreed to the published version of the manuscript. This work is supported by the Natural Science Foundation of Ningxia (No. 2021 AAC03068 and No. 2023 AAC05010), the Key R&D Program of Ningxia (No. 2021 BEB04004), the National Natural Science Foundation of China (No. 62362056), and the Henan Province science and technology research project (No. 232102211087). Not applicable. Data Availability StatementData are contained within the article. The authors would like to thank the editor and the reviewers for their valuable comments and suggestions that improved the quality of this paper. The authors declare no conflicts of interest. The founding sponsors had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.