A device selection and resource allocation method based on federated learning

By using multi-agent reinforcement learning algorithms in the industrial Internet of Things to collaboratively optimize device selection and resource allocation, the problem of excessive communication overhead in federated learning is solved, and the effects of high-precision distributed machine learning and reduced signaling overhead are achieved.

CN114598667BActive Publication Date: 2024-09-06HEQUAN TECHNOLOGY (ZHANJIANG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210236158.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-04
Publication Date
2024-09-06
Estimated Expiration
2042-03-04

AI Technical Summary

Technical Problem

In the industrial Internet of Things scenario, the communication overhead during the federated learning process is too high. The existing optimization solutions focus on optimizing communication frequency, but cannot be widely used in industrial environments, increase the complexity of the system algorithm, and cannot effectively solve resource allocation and The question of equipment selection.

Method used

By using edge servers and cloud servers to optimally allocate device selection and link bandwidth spectrum resources in the mobile edge computing network, and using multi-agent reinforcement learning algorithms, the edge agents run on the edge controller to minimize losses. Function and maximum entropy reinforcement learning, collaboratively optimize device selection and resource allocation, and reduce communication overhead.

Benefits of technology

Realize high-precision distributed machine learning in the scenario of massive industrial IoT devices, reduce system signaling overhead, avoid the risk of data privacy leakage between devices, and effectively reduce federated learning communication overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114598667B
    Figure CN114598667B
Patent Text Reader

Abstract

The present invention relates to an efficient device selection and resource allocation method based on federated learning, which belongs to the field of mobile communications and comprises the following steps: S1: at the beginning of the centralized training phase, the actor and critic network parameters of all edge agents are initialized, and updated according to the learning steps to instantiate the experience replay pool; S2: the experience replay pool is deployed, in which the experience of all edge agents is stored in the sampling phase, and in the training phase, each edge agent randomly extracts a batch of experience from the experience pool to train the network parameters in a non-strategic manner; S3: in the parameter updating phase, the edge agents are coordinated to perform alternating updates between the experience collected from all individual environments and the strategy of the current agent, and the parameters are updated in the multidimensional tuple converted from the batch experience pool sampled from the initial experience pool; S4: the updated parameters are used for the agent target network update, and the global optimal joint decision is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of mobile communications and relates to a device selection and resource allocation method based on federated learning. Background Art

[0002] In recent years, many federated learning schemes have been successfully used in mobile edge computing (MEC) network scenarios, especially in industrial Internet of Things scenarios. The application of federated learning can effectively improve the utilization of industrial data while ensuring data privacy. Smart factories of industrial Internet of Things are generally located in different geographical areas, and data distribution is also heterogeneous. In order to provide services for all factories, such as abnormal traffic identification, a global detection model is required to achieve efficient performance of data generated by each factory. However, the traditional two-tier architecture, namely the cloud-end architecture, has too much parameter transmission and the amount of data is uploaded to the cloud, which leads to excessive backbone network communication overhead.

[0003] To address the problem of excessive communication overhead in the federated learning process, the main solution is usually to reduce the frequency of gradient exchange communications and the total number of bits uploaded in a single round of communication. Using a model optimization algorithm that reduces the communication frequency can indeed effectively reduce the communication overhead of federated learning, but it also greatly increases the complexity of the system algorithm. In addition, due to the limited computing resources and power of the edge devices themselves, this optimization method has great limitations and cannot be widely used.

[0004] The existing main optimization schemes all focus on optimizing communication frequency, but in fact they cannot be widely used in industrial environments. Therefore, there is an urgent need for a joint algorithm that can reasonably allocate communication resources and device selection to solve the problem of excessive communication overhead in federated learning. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a resource allocation and edge collaborative optimization strategy method based on federated learning, which reduces the communication overhead of federated learning by reasonably selecting device participation and resource allocation.

[0006] In order to achieve the above object, the present invention provides the following technical solutions:

[0007] A device selection and resource allocation method based on federated learning. In a mobile edge computing network scenario, in order to reduce the communication overhead of federated learning in an industrial Internet of Things scenario, edge servers and cloud servers are used to optimally allocate device selection and link bandwidth spectrum resources in federated learning. An edge controller is deployed in each edge server, and a corresponding edge agent runs on the edge controller. The loss value F calculated on the edge server e (ω m) is transmitted to the cloud server, which calculates the average loss Fc(wm) and sends it to each edge server as a reward for the edge agent. The specific steps to obtain the global optimal joint decision are as follows:

[0008] S1: Initialization parameters: At the beginning of the centralized training phase, the parameters of the actor and critic networks of all edge agents are initialized and updated according to the learning steps. In addition, an experience replay pool is instantiated;

[0009] S2: Experience sampling: Using off-policy technology based on experience replay technology, deploy an experience replay pool with a certain memory capacity. In the sampling phase, the experience of all edge agents is stored in it. In the training phase, each edge agent randomly extracts a batch of experience from the experience pool to train the network parameters in a non-strategic way.

[0010] S3: Parameter Update: In the parameter update phase, the edge agents are coordinated to alternate between the experience collected from all individual environments and the current agent’s strategy, and update the parameters in the converted multidimensional tuples based on the batch experience pool sampled from the initial experience pool;

[0011] S4: Use the parameters updated in step S3 to update the agent target network and obtain the global optimal joint decision.

[0012] Furthermore, in step S1, each of the edge agents runs on its corresponding edge controller respectively, adopting a centralized training and decentralized execution mechanism. Each edge agent can only observe local environmental state information from its individual environment, including its own remaining available value and remaining energy consumption under the available delay limit. The decisions made by the edge agent are insensitive to other edge agents.

[0013] Furthermore, in the centralized training phase, the edge agents obtain information about other edge agents from each other, including the states and actions of all edge agents; the edge agent's actor network captures environmental dynamics only from the local environmental state information observed by itself, and then makes decisions for a single environment; the edge agent's critic network generates Q values ​​through the behavior-state pairs of all edge agents to evaluate decisions; in the decentralized execution phase, the network parameters of the edge agent's actors and critics are no longer updated.

[0014] Furthermore, in step S2, the experience of the edge agent is represented by a multi-dimensional tuple of selected actions, state transitions, and feedback rewards, and is obtained by the following steps:

[0015] S21: Each edge agent observes the local environment state information from its own environment, including its own remaining available value and remaining energy consumption under the available delay constraint;

[0016] S22: The agent's actor network independently generates decisions using its own strategy based on local environment state information;

[0017] S23: The agent gets rewarded and the individual environment evolves to the next state;

[0018] S24: Store the formulated transformation tuple in the experience replay pool for algorithm parameter updating.

[0019] Furthermore, in step S3, the maximum entropy reinforcement learning method is adopted, which requires the actor network to maximize the entropy of both the expectation and the strategy distribution, and hopes that the strategy is as random as possible while ensuring the task results;

[0020] The actor-critic architecture of each edge agent consists of an actor network, a pair of evaluation-critic networks, and a pair of target-critic networks; the actor network generates actions with its own strategy, and the critic network calculates a pair of Q-values ​​to evaluate the strategy of the actor network respectively.

[0021] Furthermore, for edge agent m, the specific update steps are as follows:

[0022] Step 1) By minimizing the loss function L(φ m,v ) to independently update the parameters φ of the critic network m,v , v represents the optimization factor:

[0023]

[0024] in,

[0025]

[0026] Expressed as the target Q value, where and Represent the current and next state sets of all agents respectively; m is the index of the number of agents, t is the index of the iteration round; log(·) is the function that returns the action entropy value; Υ() is the function that returns the minimum value of the state function; and are the state-action Q values ​​calculated by the evaluation network and the target evaluation network respectively;

[0027] Two parameters φ are set in the evaluation critic network and the target critic network respectively. m,v ,φ′ m,v , To alleviate the positive bias in policy improvement, the loss calculation uses only the minimum of these two Q values ​​to obtain the stochastic gradient used to update the critic network parameters:

[0028]

[0029] Among them, ▽ represents gradient calculation; α m is the maximum entropy target weight; Represents the real-time strategy of agent m.

[0030] Step 2) Update the actor network through the policy gradient method, and the objective function is defined as:

[0031]

[0032] Among them, the policy function is re-parameterized through the FCNN network as follows: Where E() represents the expected function, with a noise ε added t , thus obtaining a lower variance estimate, formula (4) is reformulated as:

[0033]

[0034] where ε t Obeying the Gaussian distribution, the gradient of the strategy is calculated:

[0035]

[0036] Step 3) Use FCNN to automatically set the weight α of the maximum entropy target m , α m The gradient of is calculated using the following objective:

[0037]

[0038] Among them is The decision set of all agents, H′ is the value of the target entropy;

[0039] Using a soft update method, the critic's parameter φ is evaluated m,v Update the parameters φ′ of the target critic network m,v :

[0040] φ′ m,v =τφ m,v +(1-τ)φ′ m,v (8)

[0041] Where τ∈(0,1) is the update factor.

[0042] Furthermore, the Markov process of each edge agent is defined as a multi-tuple M = <S, A, P, R>, where S represents the state space, A is the action space, P represents the transition probability between different states, and R represents the reward function; the weight parameter θ is used m To describe the strategy of edge agent m The optimal strategy is expressed as

[0043] The state space S is expressed as in It is expressed as the remaining available value of the device under the available delay constraint, that is, It is expressed as the remaining energy consumption of the equipment, that is

[0044] The action space A is expressed as a m,t Defined as a binary quantity, ψ m,n,t =1, a m,t It makes sense;

[0045] When the edge agent observes the device status s m,t and take action a m,t After that, an immediate reward will be obtained to evaluate the quality of the action; in order to minimize the evaluation loss of federated learning, the reward function of the multi-agent learning algorithm is defined as:

[0046]

[0047] Among them, t represents the number of edge aggregation times, t c represents the number of cloud center aggregations, F e (ω m ) and F c (ω) are the loss functions of the models after aggregation at the edge and cloud, respectively. The loss functions in these two aggregation cases are used as the rewards of each agent, and the loss function is negative, that is, the loss minimization problem is transformed into a reward maximization problem;

[0048] First, the loss value F is calculated on the edge server m (ω m ) is transmitted to the cloud server; secondly, the cloud server calculates the average loss F e (ω m )=1 / M∑ m∈M F m (ω m ); Finally, F e (ω m) is sent to each edge server as a reward for the edge agent; U is a penalty factor, which is used to penalize decisions that cannot aggregate any model parameters under the constraints in each round of federated learning; in MDP, the goal of each edge agent is to maximize its own cumulative discounted reward through optimal device selection and resource allocation strategies.

[0049] The beneficial effect of the present invention is that the present invention can complete distributed machine learning tasks with high precision while ensuring the massive number of devices in the industrial Internet of Things, and avoid the risk of data privacy leakage between devices caused by distributed machine learning. In addition, the method runs in a distributed manner, which can effectively reduce the system signaling overhead of collecting network information, especially in resource-constrained networks.

[0050] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:

[0052] Figure 1 A flowchart of a device selection and resource allocation method based on federated learning;

[0053] Figure 2 This is a structural diagram of the multi-agent reinforcement learning algorithm. DETAILED DESCRIPTION

[0054] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0055] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.

[0056] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0057] See also Figure 1-2 , Figure 1 A flow chart of a method for device selection and resource allocation based on federated learning provided by the present invention specifically includes the following steps:

[0058] S1: Initialization parameters: At the beginning of the centralized training phase, the parameters of the edge agent’s actor and critic network are initialized and updated according to the learning steps. In addition, an experience replay pool is instantiated.

[0059] S2: Experience Sampling: The experience of edge agents is represented by a multi-dimensional tuple of selected actions, state transitions, and feedback rewards. It is obtained by the following steps. First, edge agents observe local environment state information from their respective environments. Then, the agent's actor network independently generates decisions with its own strategy based on the local environment state information. Then, the agent obtains rewards and the individual environment evolves to the next state. Finally, the formulated transition tuple is stored in the experience replay pool for algorithm parameter update.

[0060] S3: Parameter Update: In the parameter update phase, the edge agents are coordinated and the algorithm alternates between collecting experiences from all individual environments and updating the current agent’s strategy, and updating parameters in multidimensional tuples transformed from a batch experience pool sampled from the initial experience pool.

[0061] S4: Use the parameters updated in step S3 to update the agent target network and obtain the global optimal joint decision.

[0062] Optionally, each agent in this method can only observe the local environment state information from its individual environment, and the decisions it makes are insensitive to other agents. A centralized training and decentralized execution mechanism is adopted. This mechanism allows the strategy to simplify the training process by using additional information without using additional information in the execution phase. In the centralized training phase, in addition to the local environment state information, other information can be obtained from each other, including the state and actions of all agents. Specifically, the actor network of edge agents captures the environment dynamics only from the local environment state information observed by itself, and then makes decisions for a single environment. The critic network requires the behavior-state pairs of all edge agents to generate Q values ​​to evaluate the decision. In the decentralized execution phase, the network parameters of the actors and critics no longer need to be updated. Therefore, each participant of the edge agent only needs the local environment state information, and the decision can be obtained independently without knowing the state information of other agents.

[0063] Optionally, in step S2, in order to improve sampling efficiency, an off-policy technology based on experience replay technology is adopted. Specifically, an experience replay pool with a certain memory capacity is deployed. During the sampling phase, the experience of all agents is stored in In the training phase, each agent randomly extracts a batch of experiences from the experience pool and trains the network parameters in a non-strategic way, which can effectively use the sampled experience to achieve convergence.

[0064] Optionally, in step S3, two main components are introduced to improve the algorithm learning performance: maximum entropy learning; "actor-critic" network architecture; specifically as follows:

[0065] Entropy maximization: Maximum entropy reinforcement learning requires the actor network to maximize the entropy of both the expected and policy distributions, that is, while ensuring the task results, the policy is expected to be as random as possible, effectively enhancing learning stability and exploration. With this maximum entropy goal, the randomness of the agent's policy can be greatly improved, and more possible optimal decisions can be explored.

[0066] Actor-Critic Network: The actor-critic architecture of each edge agent consists of an actor network, a pair of evaluation-critic networks, and a pair of target-critic networks. The actor network uses its own strategy Generate action a m,t The critic network computes a pair of Q-values ​​to evaluate the policy.

[0067] For edge agent m, the specific update steps are as follows:

[0068] Step 1) By minimizing the loss function L(φ m,v) to independently update the parameters φ of the critic network m,v ,

[0069]

[0070] in,

[0071]

[0072] Expressed as the target Q value. and denote the current and next state sets of all agents respectively; m is the index of the number of agents, t is the index of the iteration round; log(·) is the function that returns the entropy value of the action; and are the state-action Q values ​​calculated by the evaluation network and the target evaluation network respectively. In addition, two parameters φ are set in the evaluation critic network and the target critic network respectively. m,v ,φ′ m,v , to alleviate the positive bias in policy improvement. More importantly, the loss calculation only uses the minimum of these two Q values. Therefore, the stochastic gradient used to update the critic network parameters can be obtained, namely:

[0073]

[0074] Step 2) Update the actor network through the policy gradient method, and the objective function is defined as:

[0075]

[0076] Among them, the policy function is re-parameterized through the FCNN network as follows: A noise ε is added t , thus obtaining a lower variance estimate. Therefore, formula (4) can be reformulated as:

[0077]

[0078] where ε t Obey Gaussian distribution. From this, we can calculate the gradient of the strategy, namely:

[0079]

[0080] Step 3) Do not use manual selection of weights α m , but uses FCNN to automatically set the weights of the maximum entropy objective. m The gradient of can be calculated by the following objective, namely:

[0081]

[0082] Among them is The decision set of all agents, H′ is the value of the target entropy.

[0083] In order to stabilize the learning process, a soft update method is used to evaluate the critic's parameter φ m,v Update the parameters φ′ of the target critic network m,v ,Right now:

[0084] φ′ m,v =τφ m,v +(1-τ)φ′ m,v (8)

[0085] Where τ∈(0,1) is the update factor.

[0086] The present invention optimizes the overall model performance by optimally allocating device selection and link bandwidth spectrum resources in federated learning, and establishes a stochastic optimization problem. However, this problem is a mixed integer nonlinear optimization problem, the objective function is an implicit function, and the energy consumption constraint is time-related, so it is not easy to solve using traditional methods. However, device selection and resource allocation aim to minimize long-term evaluation losses, so they can be reconverted into a Markov decision process. In order to obtain the optimal solution, deep reinforcement learning is an effective method with strong representation capabilities, which can effectively solve resource optimization problems with mixed decision variables and time-related constraints. However, single-agent based deep reinforcement algorithms usually require a global server to collect all status information of distributed devices and observe the entire network environment, which will generate backbone signaling overhead. In order to solve this problem, the present invention adopts a deep multi-agent reinforcement algorithm, in which each edge server acts as an agent to collaboratively learn dynamic resource management strategies and solve problems such as Figure 2 As shown:

[0087] Each edge server is considered as an intelligent agent. Each intelligent agent can observe the state of its own environment, such as the computing resource allocation of the device, the remaining energy, and other information, so as to learn the optimal strategy in the environment. The Markov process is defined as a multi-tuple M = <S, A, P, R>, where S represents the state space, A is the action space, P represents the transition probability between different states, and R represents the reward function. We use the weight parameter θ m To describe the strategy of edge server m The optimal strategy is expressed as

[0088] In each round of federated learning iteration, each edge agent collects state information from its respective environment, which reflects the remaining time and energy of the device. Therefore, the state space S can be expressed as in It is expressed as the remaining available value of the device under the available delay constraint, that is, It is expressed as the remaining energy consumption of the equipment, that is

[0089] The edge agent collaboratively decides on the devices participating in the current iteration based on the observed local environment status information of the devices, and allocates uplink and downlink spectrum resources and computing resources on the devices to support the upload and download of federated learning parameters. Therefore, the action space A can be expressed as Here a m,t is defined as a binary quantity because only when a device chooses to participate in federated learning, i.e., ψ m,n,t =1, a m,t Only then will it be meaningful and there will be subsequent allocation of spectrum and computing resources.

[0090] When the edge agent observes the device status s m,t and take action a m,t After that, an immediate reward will be obtained to evaluate the quality of the action. In order to minimize the evaluation loss of federated learning, the reward function of the multi-agent learning algorithm can be defined as:

[0091]

[0092] Among them, F e (ω m ) and F c (ω) are the loss functions of the model after aggregation at the edge and cloud, respectively. The loss functions in these two aggregation cases are used as the rewards of each agent, and the loss function is negative, that is, the loss minimization problem is transformed into a reward maximization problem. First, the loss value F calculated on the edge server m (ω m ) is transmitted to the cloud server. Secondly, the cloud server calculates the average loss F e (ω m )=1 / M∑ m∈M F m (ω m ). Finally, F e (ω m ) is sent to each edge server as a reward for the edge agent. In addition, U is a penalty factor that takes a relatively large value to penalize decisions that cannot aggregate any model parameters under the constraints in each round of federated learning.

[0093] In an MDP, the goal of each edge agent is to maximize its own cumulative discounted reward through optimal device selection and resource allocation strategies.

[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.

Claims

1. A device selection and resource allocation method based on federated learning, characterized in that: In the mobile edge computing network scenario, in order to reduce the communication overhead of federated learning in the industrial Internet of Things scenario, edge servers and cloud servers are used to optimally allocate device selection and link bandwidth spectrum resources in federated learning. An edge controller is deployed in each edge server, and the corresponding edge agent runs on the edge controller. The loss value F is calculated on the edge server. e (ω m ) and transmit it to the cloud server, which calculates the average loss F c (w m ) and sent to each edge server as a reward for the edge agent; the specific steps to obtain the global optimal joint decision are as follows: S1: Initialization parameters: At the beginning of the centralized training phase, the parameters of the actor and critic networks of all edge agents are initialized and updated according to the learning steps. In addition, an experience replay pool is instantiated; S2: Experience sampling: Adopting off-policy technology based on experience replay technology, deploying an experience replay pool with a certain memory capacity. In the sampling phase, the experience of all edge agents is stored in it. In the training phase, each edge agent randomly extracts a batch of experience from the experience pool to train the network parameters in a non-strategic way. S3: Parameter Update: In the parameter update phase, the edge agents are coordinated to alternate between the experience collected from all individual environments and the current agent’s strategy, and update the parameters in the converted multidimensional tuples based on the batch experience pool sampled from the initial experience pool; S4: Use the parameters updated in step S3 to update the agent target network and obtain the global optimal joint decision; For edge agent m, the specific update steps are as follows: Step 1) By minimizing the loss function L(φ m,v ) to independently update the parameters of the critic network v represents the optimization factor: in, Expressed as the target Q value, where and Represent the current and next state sets of all agents respectively; m is the index of the number of agents, t is the index of the iteration round; log(·) is the function that returns the action entropy value; Υ() is the function that returns the minimum value of the state function; and The state-action Q values ​​calculated by the evaluation network and the target evaluation network are respectively; two parameters are set in the evaluation critic network and the target critic network respectively. To alleviate the positive bias in policy improvement, the loss calculation uses only the minimum of these two Q values ​​to obtain the stochastic gradient used to update the critic network parameters: Among them, ▽ represents gradient calculation; α m is the maximum entropy target weight; represents the real-time strategy of agent m; Step 2) Update the actor network through the policy gradient method, and the objective function is defined as: Among them, the policy function is re-parameterized through the FCNN network as follows: Where E() represents the expected function, to which a Gaussian noise ε is added t , thus obtaining a lower variance estimate, formula (4) is reformulated as: where ε t Obeying the Gaussian distribution, the gradient of the strategy is calculated: Step 3) Use FCNN to automatically set the weight α of the maximum entropy target m , α m The gradient of is calculated using the following objective: Among them is The decision set of all agents, H′ is the value of the target entropy; Using a soft update method, the critic's parameter φ is evaluated m,v Update the parameters φ′ of the target critic network m,v : f′ m,v =tf m,v +(1-τ)φ′ m,v (8) Where τ∈(0,1) is the update factor.

2. The method for device selection and resource allocation based on federated learning according to claim 1, characterized in that: In step S1, each of the edge agents runs on its corresponding edge controller, respectively, using a centralized training and decentralized execution mechanism. Each edge agent can only observe local environmental state information from its individual environment, including its own remaining available value and remaining energy consumption under the available delay limit. The decisions made by the edge agent are insensitive to other edge agents.

3. The method for device selection and resource allocation based on federated learning according to claim 2, characterized in that: In the centralized training phase, the edge agents obtain information about other edge agents from each other, including the states and actions of all edge agents; the edge agent's actor network captures environmental dynamics only from the local environmental state information observed by itself, and then makes decisions for a single environment; the edge agent's critic network generates Q values ​​through the behavior-state pairs of all edge agents to evaluate decisions; in the decentralized execution phase, the network parameters of the edge agent's actors and critics are no longer updated.

4. The method for device selection and resource allocation based on federated learning according to claim 1, characterized in that: In step S2, the experience of the edge agent is represented by a multi-dimensional tuple of selected actions, state transitions, and feedback rewards, and is obtained by the following steps: S21: Each edge agent observes the local environment state information from its own environment, including its own remaining available value and remaining energy consumption under the available delay constraint; S22: The actor network of edge agents independently generates decisions using their own strategies based on local environment state information; S23: The edge agent receives a reward and the individual environment evolves to the next state; S24: Store the formulated transformation tuple in the experience replay pool for algorithm parameter updating.

5. The method for device selection and resource allocation based on federated learning according to claim 1, characterized in that: In step S3, the maximum entropy reinforcement learning method is used, which requires the actor network to maximize the entropy of both the expected and the policy distribution, and hopes that the policy is as random as possible while ensuring the task results; The actor-critic architecture of each edge agent consists of an actor network, a pair of evaluation-critic networks, and a pair of target-critic networks; the actor network generates actions with its own strategy, and the critic network calculates a pair of Q-values ​​to evaluate the strategy of the actor network respectively.

6. The method for device selection and resource allocation based on federated learning according to claim 1, characterized in that: The Markov process of each edge agent is defined as a multi-tuple M = <S, A, P, R>, where S represents the state space, A is the action space, P represents the transition probability between different states, and R represents the reward function; the weight parameter θ is used m To describe the strategy of edge agent m The optimal strategy is expressed as The state space S is expressed as in It is expressed as the remaining available value of the device under the available delay constraint, that is, It is expressed as the remaining energy consumption of the equipment, that is The action space A is expressed as a m,t Defined as a binary quantity, ψ m,n,t =1, a m,t It makes sense; When the edge agent observes the device status s m,t and take action a m,t After that, an immediate reward will be obtained to evaluate the quality of the action; in order to minimize the evaluation loss of federated learning, the reward function of the multi-agent learning algorithm is defined as: Among them, t represents the number of edge aggregation times, t c represents the number of global aggregations in the cloud center, F e (ω m ) and F c (ω) are the loss functions of the models after aggregation at the edge and cloud, respectively. The loss functions in these two aggregation cases are used as the rewards of each agent, and the loss function is negative, that is, the loss minimization problem is transformed into a reward maximization problem; First, the loss value F is calculated on the edge server m (ω m ) is transmitted to the cloud server; secondly, the cloud server calculates the average loss F e (ω m )=1 / M∑ m∈M F m (ω m ); Finally, F e (ω m ) is sent to each edge server as a reward for the edge agent; U is a penalty factor that is used to penalize decisions that cannot aggregate any model parameters under constraints in each round of federated learning; in MDP, the goal of each edge agent is to maximize its own cumulative discounted reward through optimal device selection and resource allocation strategies.