Data Security Defense and Algorithm for Edge Computing Based on Mean Field Game

: With the development of the Internet of Things, the edge devices are increasing. Cyber security issues in edge computing have also emerged and caused great concern. We propose a defense strategy based on Mean field game to solve the security issues of edge user data during edge computing. Firstly, an individual cost function is formulated to build an edge user data security defense model. Secondly, we research the 𝜀𝜀 -Nash equilibrium of the individual cost function with finite players and prove the existence of the optimal defense strategy. Finally, by analyzing the stability of edge user data loss, it proves that the proposed defense strategy is effective.


Introduction
With the rapid development of mobile smart terminals such as mobile internet and smart phones, edge users frequently use smart terminals for transactions, such as shared services, mobile payments, etc. [1]. In this transaction process, the attacker can steal the edge user's private information by attacking the terminal device or analyzing the data. For example, according to the face recognition or fingerprint recognition system of mobile payment, personal facial features and fingerprint information are inferred, which will bring serious consequences to users. In addition, the edge users unload part of the computing tasks to the terminal devices, which is also one of the major factors that the data of the edge users is easy to leak [2][3][4].
In addition, in the edge computing mode [5][6], edge users, edge network devices and edge data center can interact anytime and anywhere. Edge terminal devices usually store and share many personal data. In the process of data transmission and storage, its integrity and confidentiality may be damaged. Due to the limitation of terminal device resources, some traditional cryptography algorithms are no longer applicable to edge computing environment. Therefore, how to ensure the security of edge user data in the edge computing environment has become one of the issues of edge computing defense [7]. The following is an architecture for edge computing.
The traditional defense strategies are based on the cyber security algorithm, or some research work based on game theory mainly analyze the optimal defense strategy from the static point of view. Because the interaction between the edge users is random and dynamic, and the attacker's strategy is also random. Based on this, the innovation of this paper is as follows: 1) We proposed an edge user data security defense model based on Mean field game.
2) We proposed a dynamic and efficient data security defense algorithm. The organization structure of this paper is as follows: the related issues are discussed in detail in the second section. In the third section introduces the data security defense model. In the fourth section analysis the optimality condition. The fifth section present the performance evaluation result to demonstrate the effectiveness of the proposed model and algorithm. Finally, conclusion and future work are presented in the sixth section.

Related Work
In the model of edge computing, the application of edge computing in different fields leads to the diversification and complexity of edge data. Edge users are more and more frequently using mobile applications to achieve mobile payment, shared services, etc. Due to the lack of centralized management of distributed devices, the edge user's information is easy to become the target of malicious attackers [8]. At present, most of the research on data security mechanism mainly depends on specific information security algorithm. For example, anonymity, access control and packet encryption [9][10].
In 2016, Bhardwaj et al. proposed a symmetric algorithm for cloud-based applications and services that require data and link encryption. For security reasons, they focus on symmetric and asymmetric algorithms, where symmetric algorithms are applied to cloud-based applications and services that require data and link encryption [11]. Then, in order to support the effective verification of dynamic data, Ge et al. [12] have designed a new type of cumulative authentication tag (AAT) based on symmetric keys. Verifiable and searchable symmetric encryption is an important cloud security technology that allows users to use keywords from the cloud retrieve encrypted data and verify the validity of the returned results.
In addition, edge users bring risks to their personal sensitive data while using applications to realize online services. For example, attackers can obtain their location information according to the address they visit and online transactions. Alese [13] and others proposed a game theory to design a location privacy system, which aims to analyze the user's mobile behavior in the network, so that the user can maximize their location privacy while minimizing overhead.
Nevertheless, in the above paper mainly studies the data security of edge users from the perspective of traditional information security algorithm. Because the user's behavior also affects the establishment of its defense mode, Squicciarini et al. [14] collects common behavioral data among users and analyzes user's attitudes towards disclosure of sensitive information. They establish a static game model of users' real information sharing and false information disclosure. Through the derivation of -Nash equilibrium of the model, the attitude of users to their personal data publishing and hiding is studied. From this point of view, using game theory to study the data security of edge users can motivate users to protect their personal sensitive data.

The Mean Field Game
Mean field game theory [15][16][17] is one of the most practical branches of game theory and has been used to research a class of complex problems with large number of players. Mean field game model is established by considering various assumptions, for example, players are homogeneous, and their behaviors are continuous in time, and the decision-making of each player depends on the mean field term. The homogeneity means that the subtle change among players can be negligible if the number of players is sufficiently large. The continuity leads to an approximation of the game model with many players, and the third assumption indicates that the process of decision-making of each player is affected by others through the mean field term.

Problem Description
In the edge computing mode, real-time processing of data is realized, but the privacy data of edge users is also easy to leak. In addition, for users, frequent use of third-party mobile applications for online payments increases the probability that their data will be attacked. For the security issues faced by edge user data. In this section, the edge user exposes a part of their personal data. Combined with the Mean field game theory, the edge user data loss problem and its defense strategy selection are modeled and analyzed.

Problem Formulation
Let N be the number of edge users in the edge computing environment. We use ( ) i p t to denote the data leakage probability of edge users. i at time t for 1, 2,..., i N = . We assume the data leakage probability ( ) i p t of edge users i at time t is independent of each other. Combined with the idea of information entropy, at game time t , the average loss of edge user personal data can be expressed by This means that the more data leakage probability ( ) i p t , the more average loss of personal data, the reverse is also true.
Considering that edge users take different degree of defense measures, we use ( ) i u t to denote the defensive strength of the defensive measures at t time, and ( ) v t is regard as the attack frequency of attackers. For the individual edge users, the process of their personal data loss is related to their defense intensity and attack frequency of attackers.
Thus, the data loss process of edge users is expressed as where 0 i x is the data loss of edge user i at the beginning of game, a is the influence factor of the amount of data lost which is allowed disclosed by users, b is the probability of successful detection and blocking of attackers, and c is the probability of successful attack.
In the game process, it is assumed that edge users can disclose part of their personal data. When the probability of data leakage ( ) . This shows that the change rate of user cost function ' ( ) So, let's assume that the cost function of edge users caused by their data loss is ( ) where 1 q > ,and i α is the unit cost of i user.
For edge users, the cost of computing resources consumed by responding to defense measures can be expressed by a function of defense intensity ( ( )) i i F u t . Inspired by the relationship between network node resource consumption and security patches in [2], it is written as ( For attackers, it aims to get more user data by maximizing their attack frequency. Due to the limited computing resources of terminal device, the increase of attack frequency will easily lead to edge network congestion, which will affect the normal communication of edge users. Thus, we define as the cost function of attacker caused by attack frequency, where σ is the influence factor of attack frequency on normal communication of edge users.
According to the Mean field game [11], we assume x N = = ∑ is the Mean field terms in order to describe the overall data loss changes of edge users. Because edge users usually share and store many interactive data packets in the process of information interaction, when encountering attacks, one user doesn't deploy defense measures, which may lead to the leakage of other users' data or affect the choice of other users' defense strategies. Based on this, the penalty function for edge users who do not respond to defense measures is written as ( ( ( , ), ( ))) ( ( , ), ( )) where ( ( ( ))) i h x p T is the cost of data loss of marginal users at the end of game.

Problem Description
For marginal users, when deploying defensive measures, they must consider their limited energy, computing and storage resources, and need to consider allowing some personal sensitive data to be publicly braked for convenient services. In view of the analysis of the edge user data security problem in the previous section, this section will use the first order Mean field game to analyze the equilibrium solution of the above problem.

ε -Nash Equilibrium
In addition, based on the analysis in the previous section, when edge user data tends to infinity, that is, N → +∞ , individual differences between terminal devices are ignored. This means that different users choose their state-dependent defense strategy, meanwhile, there exists , , , then the edge user's state change Eq. (1) is transformed into where * ( ) u t is the user's optimal defense strategy and * ( ) v t is the attacker's optimal attack strength.
Firstly, the relevant assumptions and equilibrium definitions are given. Combined with the Mean field game theory, the equilibrium solutions of the first order mean field game theory are analyzed.
Besides, if N → +∞ , the initial value of edge user data loss 0 ( ) f x is an absolute continuous function, that is, for where the final value function ( ( )) h x T C ∞ ∈ is bounded and satisfies the Lipschitz continuous.
, if N → +∞ , the attack frequency is bounded with * v , there exists 0 ε ≥ such that the following inequality holds where * ( ) u t is the user's optimal defense strategy.
The inequality in Eq. (5) holds for a finite number of participants, the ε -Nash equilibrium of the Mean filed game will degenerate into the general ε -Nash equilibrium as the number of player tends to infinity and ε tends to zero. Each player in our model is assumed to be rational, and the process of decision-making of each node depends on the Mean field term.

The First Order Mean Field Game
, if N → +∞ , there exists a continuously differentiable function ( ) t x ϕ , where first order differential bounded. Such that the following equation set holds where the user's optimal defense strategy * 1 ( ) ( , ) 2 Proof. For is the minimum cost of the user when the attack reaches the optimal attack frequency.
Hence, to calculate Eq. (8), we assume ( ) x t x λ ϕ = ∂ and construct the following Hamiltonian function, it can be written as Next, for Eq. (10), find the first derivative of ( ) u t and ( ) v t , and calculate the optimal defense strategy and the optimal attack strength, such that based on the Eqs. (11) and (12), Eq. (10) indicates that In addition, from Eqs. (13) and (9), we derive the HJB backward equation in formula (7). Combining the * ( , ) u x t , * ( , ) v x t and the Eq. (1 ) End of proof. The t N waypoints are evenly distributed to s N task. Then we allocate s -th task to the k -th UAV.
Before the UAV flyting form the i -th waypoint to j -th waypoint, we sort the waypoints to find the best order to find the best path to reduce the flying distance, then the UAV take off and flying by the waypoint sequence, finally arrive and land at the 0 N .

The Optimality Conditions
In the edge computing environment, the edge users minimize their data loss through response defense mechanism. For the analysis of the equilibrium solution based on the Mean field game model in the previous section, this section takes the first order Mean field game model as an example to analyze how to minimize the data loss of the edge users.
In addition, in the Mean field game model, each edge user affects other users' decision-making choices through the Mean field term in the game process. In this process, the state variables of individual edge users are gradually approximate to the state variables of the whole edge users. On the contrary, when the data loss of the whole edge users is minimized, the data loss of individual edge users is also approximate to the optimal. The following Tab. 1 shows the edge user data security defense Algorithm based on the Mean field game in the edge computing environment.  (11) and (12), calculate the optimal strategy u * and v * ; 6. End for; 7. Return the optimal defense strategy and optimal state trajectory.

Related Parameters
In this section, the edge user data security defense model and algorithm based on Mean field game are simulated and verified. Firstly, from the overall point of view of the edge users, by analyzing the optimal attack frequency * ( ) v t , the change process of edge users' defense level * ( ) u t , and then get the amount of data loss to edge users. The purpose of 1t f simulation is to reveal the process of data loss of edge users under the worst case attack intensity and the best defense strategy of edge users.
According to the above analysis, for large-scale edge users, the state variables of individual edge users are gradually approximate to the state variables of the whole edge users, thus, it can be replaced by ( )

The Trend of Attack Frequency
For the attacker, the target is to increase the attack intensity by increasing the attack frequency in unit time under the condition of fixed attack success rate, to steal more user data. However, the higher the attack intensity is, the greater the probability that the attacker will be detected. At the same time, with the change of time and the response of the edge user defense mechanism, the attack success rate will gradually decrease. Thus, attackers will choose to maximize their attack frequency in the initial stage of game time, the trend of attack frequency * ( ) v t with time is analyzed in Fig. 1 below. The attacker's attack frequency * ( ) v t decreases with time and maintains irregular changes near zero. This is because edge users can disclose part of their personal data, and without detection, attackers will still launch attacks of different frequencies.

The Trend of The Optimal Defense Strategy
In case of malicious attack, the edge users prevent the attack through the response defense mechanism. Fig. 2 analyzes the trend of the defense strategy of edge users with respect to time. From the figure, we can see that in the first 10 seconds of the game time, the defense level of edge users is increasing. The higher the attack intensity is, the greater the probability of detection is. With the increase of attack frequency, the defense intensity increases. Then with the change of time, the defense intensity decreases gradually, and finally stabilizes near a non-negative value. This is because in the edge computing environment, edge users can disclose some sensitive personal data in order to obtain convenient services such as online payment. Therefore, even when no malicious attack is detected, edge users still take defensive measures against their data. For example, permission setting and so on, which also shows that edge users improve their awareness of personal data security protection.

The Trend of Data Loss of Edge Users
In face of malicious attacks, edge users reduce their data loss through response defense mechanism. Because each edge user is coupled by the Mean field term, that is, each node affects the other node's policy choice by the Mean field term. At the same time, when the total amount of data loss of edge users is minimized, the individual edge users achieve the best amount of data loss based on their optimal defense strategy. Fig. 3 shows the trend of edge users' data loss. The data loss in the edge computing environment decreases monotonously with time, when time 80 t s ≥ , user data loss is stable at zero. This shows that in the initial stage of game time, under attack, the average loss of data of edge users increases gradually. With the response of nodes to their defense mechanism, although they may still be attacked, their data will not be leaked.

Conclusion and Future Work
This paper studies the data security defense of edge users and establishes a data security defense model for edge users based on the Mean field game. By analyzing the average loss of the edge user data, the existence of the equilibrium solution of the Mean field model is verified, and the optimal strategy is obtained. Simulation results show that when both the edge user and the attacker adopt the optimal strategy, the edge user can reduce data loss and minimize the consumption of computing resources.

Funding Statement:
The authors received no specific funding for this study.

Conflicts of Interest:
The authors declare that they have no conflicts of interest to report regarding the present study.