Unmanned aerial vehicle network dynamic task unloading method under layered architecture

Optimizing task offloading decisions in UAV networks through layered architecture and reinforcement learning algorithms solves the problem of low UAV network processing efficiency in dynamic environments, achieves efficient task allocation and resource management, and improves task response speed and Adaptability.

CN118672673APending Publication Date: 2024-09-20UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410687599.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

It is difficult for existing UAV networks to efficiently process and offload computing-intensive tasks in dynamic environments, especially in the absence of ground infrastructure support. Traditional computing offloading methods have insufficient performance and cannot effectively cope with rapidly changing network status and data volume. .

Method used

Adopting a dynamic task offloading method for UAV networks under a layered architecture, by establishing an aerial layered network system model, monitoring and predicting the link duration and average link transmission rate between nodes in real time, and using reinforcement learning algorithms to optimize task offloading decisions. Allocate tasks to valid nodes in the offloadable list, and allocate tasks through real-time monitoring of task processing capabilities of upper-layer nodes.

Benefits of technology

It significantly improves the network efficiency and task response speed of UAVs performing computing-intensive tasks, enhances the adaptability and operational efficiency in dynamically changing environments, and optimizes task allocation and resource management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118672673A
    Figure CN118672673A
Patent Text Reader

Abstract

The invention discloses an unmanned aerial vehicle network dynamic task unloading method under a layered architecture, which comprises the following steps: monitoring the relative position, speed and direction of nodes and the resource condition of network nodes, predicting the duration of links between the nodes, updating an unloadable list with task processing capability and communication state, and introducing a two-stage task distribution mechanism to unload the network dynamic task of the unmanned aerial vehicle. Based on a reinforcement learning algorithm, unmanned aerial vehicle nodes learn and execute task unloading decisions, tasks are effectively distributed to nodes in an unloadable list, and then after upper-layer nodes receive the tasks, the tasks are handed over to the upper-layer nodes with the shortest completion time to be processed by monitoring the task processing capacity and the communication state of upper-layer neighbor nodes in real time. According to the method provided by the invention, the network efficiency and response speed of the unmanned aerial vehicle for processing and calculating intensive tasks are remarkably improved, the adaptability of a complex air hierarchical network to dynamic environment changes is enhanced, and an efficient solution strategy is provided for optimizing task allocation and resource management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computing task offloading, and in particular relates to a method for dynamic task offloading of an unmanned aerial vehicle network under a layered architecture. Background Art

[0002] With the rapid development of drone technology and its wide application in multiple fields, such as monitoring, traffic management, agricultural inspection and emergency response, higher requirements are placed on the data processing and communication capabilities of drone networks. Drones usually need to process and transmit large amounts of data, such as videos, pictures and sensor data, when performing tasks. These data processing tasks are not only computationally intensive, but also usually need to be completed within a limited time to ensure the real-time and effectiveness of task execution. In addition, drones have limited processing power and battery life. When dealing with highly complex tasks or long-term tasks, a single drone often finds it difficult to complete them independently and needs to rely on external resources, which is particularly difficult in environments far away from ground infrastructure.

[0003] In the face of natural disasters, cellular base stations and other communication infrastructure on the ground are often destroyed, which deprives drones of the ground computing and storage support they rely on. Therefore, how to provide stable computing and communication services for drones without the support of ground infrastructure has become a hot topic in current research. With the development of Mobile Edge Computing (MEC) technology, the use of small aircraft, balloons, and airships equipped with edge servers as air edge networks to provide emergency communication and computing services for mobile devices has become a research hotspot in the field of communications. These aerial platforms, with their wide coverage, low communication latency, efficient data processing, and strong network robustness, provide a flexible and rapidly deployable communication and computing solution for those who need rapid response and specific scenarios.

[0004] Due to the highly dynamic operating environment of drones, the location and status of drones and edge nodes (such as airships or edge servers) change frequently. Traditional computation offloading methods, such as genetic algorithms and particle swarm algorithms, are often based on a series of static rules that may not fully take into account the mobility of drones and the dynamic nature of mobile network environments. This may cause these algorithms to exhibit insufficient performance when faced with real-time changing network states in emergency scenarios, fail to process tasks efficiently, or cause unnecessary network delays and increase energy consumption. Existing drone data processing methods usually rely on single-hop offloading, that is, directly offloading data from drones to the nearest ground station or edge server. This approach faces many challenges in environments with dense drones or complex network conditions, such as being susceptible to network congestion and signal interference, resulting in delays in data transmission and processing. At the same time, with the increasing popularity of the Internet of Things and mobile devices, huge amounts of data are generated, and the demand for real-time processing and analysis is increasing. Existing systems often lack effective mechanisms to cope with such rapid changes and cannot optimize data offloading and processing strategies in real time.

[0005] To address this challenge, reinforcement learning, as an effective machine learning technique, is increasingly being used to solve the problem of task offloading. For example, the PPO algorithm consists of two parts: a policy network (Actor) and a value network (Critic). The policy network is responsible for outputting the probability distribution of each action in a given state, while the value network predicts the total reward that may be obtained from the current state and the current policy. The uniqueness of PPO lies in its update mechanism, which uses a special "clipping" objective function to limit the policy update step to prevent destructive large fluctuations during the learning process. This clipping mechanism is implemented by setting a limit on the probability ratio, ensuring that the policy update is carried out within a safe range, thereby maintaining the stability of learning. Although traditional PPO implementations do not rely on the experience replay pool, in some variants, such as scenarios using deep neural networks, experience replay technology may be introduced to improve sample utilization efficiency. The experience replay pool stores previous transitions (state, action, reward, new state), which can be reused to train the network, thereby reducing the correlation and variance of the data and improving learning stability. In addition, PPO uses generalized advantage estimation (GAE) to accurately calculate the advantage function, helps balance bias and variance, and optimizes the efficiency of policy gradient estimation. Through these innovative technologies, PPO can effectively handle complex decision-making environments.

[0006] Although the use of aerial edge networks to assist edge computing has been widely studied and applied, there are still many challenges. As the tasks performed by drones become increasingly complex and diverse, the computing tasks that need to be processed have also become diverse, including different requirements for data density, data volume, and time sensitivity. At the same time, the mobility of drone swarms, the differences in computing power, and the limited computing resources of edge servers have jointly posed huge challenges to the coordinated allocation of computing resources. The existence of these problems restricts the stability and efficiency of aerial edge networks. There is also an urgent need to develop a new type of drone data offloading and processing method that can achieve efficient data offloading in a complex network composed of drone networks and edge networks, dynamically optimize offloading decisions based on mission characteristics and real-time network conditions, make full use of each node in the network, balance loads, reduce congestion, improve data processing speed and accuracy, and enhance the adaptability and operational efficiency of drone networks in dynamically changing environments. Summary of the invention

[0007] In order to solve the above technical problems, the present invention proposes a UAV network dynamic task offloading method under a layered architecture, which aims to solve the data processing task challenges caused by the dynamic network environment and resource limitations in the UAV network, and at the same time improve the network efficiency and task response speed when the UAV performs computing-intensive tasks.

[0008] The technical solution adopted by the present invention is: a method for dynamic task offloading of drone networks under a layered architecture, and the specific steps are as follows:

[0009] S1. Establish an aerial hierarchical network system model, initialize the drone's ID, location, task size, minimum split unit, task time requirement, computing power and task queue size, and the aerial edge network node's ID, location, computing power and task queue size;

[0010] S2. Each drone node maintains a list of unloadable nodes, obtains real-time neighbor information through information interaction, including the location, speed, flight direction, and task processing capability of neighbor drones and upper network nodes, and predicts the link duration and average link transmission rate between nodes, and updates the obtained neighbor information to the unloadable list;

[0011] S3, taking each drone node as an intelligent agent, when the drone generates a task, it maintains the node status information in its unloadable list, uses the reinforcement learning algorithm to solve the task unloading problem, and assigns the task to the valid node in the unloadable list;

[0012] S4. Based on step S3, after receiving the task, the upper-level node monitors the upper-level neighbor network status and task processing capabilities in real time, maintains the neighbor information table, and sequentially distributes the task to the upper-level node with the shortest completion time for processing. The node returns the result after processing.

[0013] Furthermore, in step S1, the aerial hierarchical network system model is established as follows:

[0014] The aerial hierarchical network system model includes upper and lower layers. The upper layer is the aerial edge network, in which edge nodes equipped with high computing power facilities provide computing resource support for the drone swarm. The edge node deployment position is fixed above the mission area, and the connection status between nodes remains unchanged; the lower layer is the active drone swarm, which is used to perform pre-set tasks. The drone swarm flies along a planned path and generates computing tasks in each time slot. Each drone communicates with other nodes based on a mobile communication model, and the nodes process tasks through a task queue model.

[0015] The drones in the system model are assumed to be represented by a list U = {1, ..., u, ...}; the attributes of each drone i are represented by a triple {Θ i ,A i ,M i}express.

[0016] Among them, Θ i Represents task processing capability information, expressed as a list {q i ,Q i ,f i}, including: current task queue size q i , the maximum queue length Q i And computing power i ; A i Indicates the task information generated at the current moment, expressed as a list {ξ i ,T max ,ξ min}, including: task sizeξ i , task time constraint T max And the minimum unit of task ξ min , the task can be split into Quantity; M i Represents the current UAV movement information, expressed as a list {p i ,v i ,θ i}, including: drone position p i , flight speed v i and the flight direction θ i .

[0017] The edge node is a mobile edge server that provides auxiliary computing. Its attributes are represented by a two-tuple {Θ m ,p m} to describe.

[0018] Among them, Θ m Indicates the task processing capability information of the edge node; p m Indicates the location information of the edge node.

[0019] The mobile communication model and task queue model are specifically as follows:

[0020] A1. Mobile communication model;

[0021] The position of UAV i at time t is represented as p i (t) = (x i (t),y i (t),z i (t)); UAV i moves at speed v i (t) and direction θ i (t) The new position to which the plane flies at a constant speed is p i (t+1)=(x i (t)+v i (t)cosθ i (t),y i (t)+v i (t)sinθ i (t),z i (t)); At any time t, the distance d from UAV i to unloading node j i,j (t) is expressed as follows:

[0022] d i,j (t)=||p i (t)-p j (t)||

[0023] The data transmission rate r of the unloading UAV is i,j (t) is expressed as follows:

[0024]

[0025] Among them, B u represents the communication bandwidth, p u represents the communication power of the UAV, β0 represents the channel power gain at a reference distance of 1 (m), and δ 2 represents Gaussian white noise.

[0026] A2, Task queue model;

[0027] The computing power of the drone and edge nodes is denoted as f i, then the size of the computing task processed by node i in a time slot is:

[0028]

[0029] Among them, ψ represents the computing power required per bit of data.

[0030] Each drone will generate a task, and the size of the task generated by drone i is set to ξ i , and through the offloading decision, choose to execute the task locally or offload it to other drones or edge nodes.

[0031] The drone and edge node each maintain a task queue, and the tasks put into the queue are scheduled and executed according to the first-in-first-out principle; the task queue is used to store computing tasks waiting to be processed, including local tasks calculated by themselves after decision or tasks unloaded from other drone nodes; the state of the queue at any time t is expressed as:

[0032]

[0033] Where n represents the number of nodes selected to offload to node j, q j (t) represents the length of the queue at time t, represents the amount of tasks offloaded from node i to node j, Indicates the total amount of tasks that are selected to be offloaded to drones or edge nodes at the current moment.

[0034] And because the queue length is limited, if the queue length has reached its maximum value, the newly queued task will not be queued and will be directly discarded.

[0035] Furthermore, the step S2 is specifically as follows:

[0036] The uninstallable list structure is Initialize the maximum number of node information that can be stored in the uninstallable list of each drone node to Φ, initialize the Φ data in the list to its own id, f, q, Q, and set the flag to valid.

[0037] Where id represents the id of the offloadable node, f represents the computing capacity of the offloadable node, q represents the queue length of the offloadable node, Q represents the maximum queue length of the offloaded node, TLT represents the duration of the link between the current node and the offloadable node, Indicates the average link transmission rate, time indicates the latest time of receiving the offloadable node message, and flag indicates whether the current node is valid.

[0038] The drone node calculates the relative moving speed and direction between two nodes through two consecutive neighbor messages, and then predicts the duration of the communication link and the average link transmission rate between the two nodes. At the same time, it obtains the real-time resource and network status information of the neighbor node, including the node computing power and task queue information, and updates the information to the unloadable list.

[0039] The specific steps for obtaining neighbor information and updating the uninstallable list are as follows:

[0040] B1. Assume that the current node i is fixed and its neighbor node j is mobile, and calculate the relative moving speed of the two nodes;

[0041] B2, drones and edge nodes send their own node ID, computing power f i 、The current task queue length q i , the maximum length of the task queue Q i 、Location information i Put it in the hello packet and broadcast it periodically;

[0042] B3, drone node i records the time interval between two consecutive neighbor messages, and calculates the relative distances d1 and d2 between the two neighbors based on their location information;

[0043] B4, drone node i determines the angle between the neighbor position and itself according to the time Δt of two consecutive received signals Using the cosine formula Calculate the displacement d of the neighbor within time Δt Δt ;

[0044] B5. Calculate the relative speed of neighbors based on the obtained time interval and relative displacement

[0045] B6. Based on steps B1-B5, predict the link duration and average link transmission rate between nodes;

[0046] From the cosine formula Find d tt , predict the link duration between nodes Then calculate the average link transmission rate

[0047] Among them, d tt Indicates the distance of the neighbor from the current position to the signal threshold; represents the angle between the neighbor moving from the current position to the signal strength threshold position and node i; d2 represents the distance between node i and its neighbor at the current moment; d threshold represents the distance from the neighbor to the receiving strength threshold of node i; r2 represents the transmission rate at the current moment; rthreshold Indicates the transmission rate at the signal threshold.

[0048] B7, drone node i first sorts the uninstallable list according to whether the nodes in the uninstallable list are valid, putting the valid nodes in front, then calculates the completion time of the tasks generated by itself on the valid nodes in the uninstallable list, and sorts the valid nodes from small to large according to the completion time;

[0049] B8, drone node i determines whether to add the received neighbor information to the uninstallable list;

[0050] If the neighbor node information is in the unloadable list, the received neighbor computing power, task queue information, link duration, average link transmission rate information and the time when the node message was most recently received are updated, and the flag is marked as valid; if the neighbor node information is not in the unloadable list, the completion time of the task on the neighbor node is calculated. When the flag of the last data in the unloadable list is invalid, or the last data is node i itself or the completion time of the last data node is greater than that of the neighbor node, the last data is replaced with the neighbor node and the flag is marked as valid.

[0051] Furthermore, the step S3 is specifically as follows:

[0052] S31, after the node generates a task, the uninstallable list is maintained, and the task completion time is used as the optimization target to uninstall according to the current task information and the uninstallable node list;

[0053] After node i generates a task, it maintains the uninstallable list, updates its own task queue information to the record with its own node id in the uninstallable list, and traverses the time information of other nodes in the uninstallable list. If the difference between the current time cur and time is greater than TLT, it means that the node is no longer a neighbor node, and the flag of the node is set to invalid;

[0054] The computing time of the task of drone i executed locally and the task completion time T i,i (t) The expressions are as follows:

[0055]

[0056] Among them, f i (t) represents the computing power of UAV i, q i (t) represents the amount of data in the current task queue of the drone.

[0057] The transmission time for drone i to offload the computing task in time slot t The expression is as follows:

[0058]

[0059] Calculation time for unloading mission of drone and completion time T i,j (t) The expressions are as follows:

[0060]

[0061]

[0062] To optimize the task completion time, the optimization problem can be described as:

[0063]

[0064] in, represents the uninstall decision variable.

[0065] S32, taking each drone as an intelligent agent, defining the environment state, action and reward of each intelligent agent;

[0066] (1) Status;

[0067] The state includes the task queue length, computing power, and average transmission rate of the nodes in the unloadable list; then for each drone i, its system state s at any time i (t) is expressed as follows:

[0068] s i (t)={q0(t),f0(t),q1(t),f1(t),r 0,1 ,...,q j (t),f j (t),r 0,j ,...,}

[0069] Among them, q i (t) represents the queue length of the node, f i (t) represents the node computing capacity, r i,j (t) represents the transmission rate between nodes;

[0070] (2) Action;

[0071] The agent selects an action based on the environmental state observed by the system at the current time t. The action is to select the unloading node and allocate the task amount. The action space a of the drone node at time t is defined as i (t) is expressed as follows:

[0072] a i (t) = {ο1(t),ο2(t)}

[0073] Among them, ο1(t) represents the selected unloading destination node list, ο2(t) represents the task amount assigned to the unloading destination node;

[0074] (3) Rewards;

[0075] The reward is the task completion time after performing an action, and the reward r i (t) Set the expression as follows:

[0076]

[0077] S33, taking each drone as an intelligent agent, using the reinforcement learning algorithm based on proximal policy optimization PPO, initialize the policy network Actor and value function network Critic of each intelligent agent;

[0078] Add an invalid state masking layer at the input of the Actor network, and add an invalid action masking layer at the output. Through the invalid state masking layer, the task queue length of the invalid node is set to -1, the computing power is set to 0, and the link rate is set to 0; through the invalid action masking layer, the action with invalid nodes is masked.

[0079] The drone will send the current environment status i (t) is input into the Actor network to obtain the probability distribution of valid actions, and then sample to determine action a i (t), execute action a i (t), that is, after unloading the task to the destination node, update and enter the new state s i (t+1), and calculate the reward r obtained by executing the current action i (t);

[0080] S34, each drone continuously interacts with the environment, t ,a t ,r t ) are stored in their respective experience replay pools;

[0081] S35, each drone learns and updates the policy network and value function network parameters based on the experience playback pool;

[0082] Based on the experience replay pool obtained in step S34, the parameters of the Actor network and the Critic network are learned and updated as follows:

[0083] C1, Actor network update;

[0084] The update of the Actor network relies on the policy gradient method. First, the Actor network updates the input state s according to the current policy θ. t Generate the probability distribution π of each action θ(a t |s t ) and calculate the old strategy π old (a t |s t ) and the new strategy π new (a t |s t ; The probability ratio of choosing the same action under θ)

[0085] The objective function L of the Actor network C The generalized advantage estimation GAE is used as the estimation function, and the expression is as follows:

[0086] L C (θ) = E t [min(pr t (θ)A t ,clip(pr t (θ),1-ζ,1+ζ)A t )]

[0087] Among them, E t represents the calculation of the expected value at time step t, A t represents the GAE estimate, which indicates the degree of advantage of taking a certain action relative to the average action; ζ represents a small constant set in advance to limit the proportion pr t The range of variation of (θ).

[0088] Based on the experience replay pool data obtained in step S34, calculate the objective function L C (θ), use the optimizer Adam to calculate L C (θ) Gradient with respect to θ And update the parameters θ:

[0089] Among them, υ represents the learning rate, which controls the step size of parameter update;

[0090] C2, Critic network update;

[0091] The update of the Critic network is performed by minimizing the error estimated by the value function. The Critic network is based on the current input state s t , output an estimate of the state value V ω (s t ).

[0092] Among them, ω represents the parameters of the Critic network.

[0093] For each state s t , using future rewards to estimate the true value, through calculate.

[0094] in, Indicates that in state s t Next, according to the strategy The expected cumulative reward of the action, Represents the discount factor, which is used to measure the importance of future returns relative to immediate returns, and l represents the lth time step in the future starting from the current moment.

[0095] The Critic network is trained using the mean square error (MSE) loss. The goal of the Critic network is to minimize the difference between the predicted state value and the actual return. The objective function η V The expression is as follows:

[0096]

[0097] Among them, R t represents the actual return from time step t to the beginning.

[0098] Based on the above objective function η V , calculate the gradient of the Critic network parameter ω, and pass η V Finding the Gradient Update parameter ω:

[0099] S36. Loop through steps S33-S35 to implement the distributed training unloading strategy until all data in the experience replay pool are trained.

[0100] Furthermore, the step S4 is specifically as follows:

[0101] S41, the edge network node extracts the received hello message from the neighbor edge network node, extracts the neighbor's node ID and computing power f j , task queue size q j 、Location information j , and save the information to the neighbor information table;

[0102] The neighbor information table structure is {id,f,q,Q,r}.

[0103] Among them, id represents the neighbor node id, f represents the neighbor node computing power, q represents the queue length of the neighbor node, Q represents the maximum queue length of the neighbor node, and r represents the link transmission rate.

[0104] S42. Calculate the link transmission rate r between neighbor nodes based on the location information. i,j , and put it in the neighbor table;

[0105] S43. After receiving the mission from the drone, the edge node records the basic information of the mission, including the size of the mission received. Minimum unit of task min ;

[0106] S44. Divide the task into Calculate the completion time of each task;

[0107] The completion time of the node's own processing task is For edge nodes i and j, the task ξ min The communication time required for transmission from node i to node j is The computation time required is The total time for the task to be completed by the neighbors is

[0108] S45, for each task, calculate its completion time on its own node and its neighboring nodes, and assign the task to the node with the shortest completion time for processing;

[0109] S46. When a task is assigned to a node, update the task queue information of the node;

[0110] S47, repeat steps S44-S46 until all tasks are assigned;

[0111] S48. After the node calculation is completed, the results are returned to the initial unloading node in sequence, and the initial unloading node merges the results and returns them to the drone.

[0112] Beneficial effects of the present invention: The method of the present invention predicts the duration of the link between nodes by monitoring the relative position, speed, direction and resource status of the nodes in the network, and updates the unloadable list with the task processing capability and communication status, and then introduces a two-level task allocation mechanism. First, based on the reinforcement learning algorithm, the drone node learns and executes the task unloading decision, and effectively allocates the task to the nodes in the unloadable list to cope with the highly dynamic network environment and reduce the data loss during the transmission process. Then, after the upper-level node receives the task, it monitors the task processing capability and communication status of the upper-level neighbor nodes in real time, and hands the task to the upper-level node with the shortest completion time for processing, thereby enhancing the elasticity of the network and the processing speed of the task. The method of the present invention significantly improves the network efficiency and task response speed of drones when performing computationally intensive tasks, and provides an effective solution for the adaptability of complex aerial layered networks to dynamic environmental changes to optimize task allocation and resource management. BRIEF DESCRIPTION OF THE DRAWINGS

[0113] Figure 1 The present invention is a flowchart of a method for dynamic task offloading of a UAV network under a layered architecture.

[0114] Figure 2 It is a schematic diagram of the structure of the aerial layered network system model in an embodiment of the present invention.

[0115] Figure 3 This is a diagram of a task queue model in an embodiment of the present invention.

[0116] Figure 4 This is a model diagram for calculating link duration in an embodiment of the present invention. DETAILED DESCRIPTION

[0117] The method of the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0118] like Figure 1 As shown, a flowchart of a method for dynamic task offloading of a drone network under a layered architecture of the present invention is shown, and the specific steps are as follows:

[0119] S1. Establish an aerial hierarchical network system model, initialize the drone's ID, location, task size, minimum split unit, task time requirement, computing power and task queue size, and the aerial edge network node's ID, location, computing power and task queue size;

[0120] S2. Each drone node maintains a list of unloadable nodes, obtains real-time neighbor information through information interaction, including the location, speed, flight direction, and task processing capability of neighbor drones and upper network nodes, and predicts the link duration and average link transmission rate between nodes, and updates the obtained neighbor information to the unloadable list;

[0121] S3, taking each drone node as an intelligent agent, when the drone generates a task, it maintains the node status information in its unloadable list, uses the reinforcement learning algorithm to solve the task unloading problem, and assigns the task to the valid node in the unloadable list;

[0122] S4. Based on step S3, after receiving the task, the upper-level node monitors the upper-level neighbor network status and task processing capabilities in real time, maintains the neighbor information table, and sequentially distributes the task to the upper-level node with the shortest completion time for processing. The node returns the result after processing.

[0123] like Figure 2 As shown, in this embodiment, in step S1, the aerial hierarchical network system model is established as follows:

[0124] The aerial hierarchical network system model includes upper and lower layers. The upper layer is the aerial edge network, in which edge nodes equipped with high computing power facilities provide computing resource support for the drone swarm. The edge node deployment position is fixed above the mission area, and the connection status between nodes remains unchanged; the lower layer is the active drone swarm, which is used to perform pre-set tasks. The drone swarm flies along a planned path and generates computing tasks in each time slot. Each drone communicates with other nodes based on a mobile communication model, and the nodes process tasks through a task queue model.

[0125] The drones in the system model are assumed to be represented by a list U = {1, ..., u, ...}; the attributes of each drone i are represented by a triple {Θ i ,A i ,M i}express.

[0126] Among them, Θ i Represents task processing capability information, expressed as a list {q i ,Q i ,f i}, including: current task queue size q i , the maximum queue length Q i And computing power i ; A i Indicates the task information generated at the current moment, expressed as a list {ξ i ,T max ,ξ min}, including: task sizeξ i , task time constraint T max And the minimum unit of task ξ min , the task can be split into Quantity; M i Represents the current UAV movement information, expressed as a list {p i ,v i ,θ i}, including: drone position p i , flight speed v i and the flight direction θ i .

[0127] The edge node is a mobile edge server that provides auxiliary computing. Its attributes are represented by a two-tuple {Θ m ,p m} to describe.

[0128] Among them, Θ m Indicates the task processing capability information of the edge node; p m Indicates the location information of the edge node.

[0129] The mobile communication model and task queue model are specifically as follows:

[0130] A1. Mobile communication model;

[0131] The position of UAV i at time t is represented as p i (t) = (x i (t),y i (t),z i (t)); UAV i moves at speed v i (t) and direction θ i (t) The new position to which the plane flies at a constant speed is p i (t+1)=(x i (t)+v i (t)cosθ i (t),y i (t)+v i (t)sinθ i (t),z i (t)); At any time t, the distance d from UAV i to unloading node j i,j (t) is expressed as follows:

[0132] d i,j (t)=||p i (t)-p j (t)||

[0133] The data transmission rate r of the unloading UAV is i,j (t) is expressed as follows:

[0134]

[0135] Among them, B u represents the communication bandwidth, p u represents the communication power of the UAV, β0 represents the channel power gain at a reference distance of 1 (m), and δ 2 represents Gaussian white noise.

[0136] A2, Task queue model;

[0137] The task queue model is as follows Figure 3 As shown, both drones and edge nodes have certain computing capabilities, which are represented by f i , then the size of the computing task processed by node i in a time slot is:

[0138] Among them, ψ represents the computing power required per bit of data.

[0139] Each drone will generate a task, and the size of the task generated by drone i is set to ξ i, and through the offloading decision, choose to execute the task locally or offload it to other drones or edge nodes.

[0140] The drone and edge node each maintain a task queue, and the tasks put into the queue are scheduled and executed according to the first-in-first-out principle; the task queue is used to store computing tasks waiting to be processed, including local tasks calculated by themselves after decision or tasks unloaded from other drone nodes; the state of the queue at any time t is expressed as:

[0141] Where n represents the number of nodes selected to offload to node j, q j (t) represents the length of the queue at time t, represents the amount of tasks offloaded from node i to node j, Indicates the total amount of tasks that are selected to be offloaded to drones or edge nodes at the current moment.

[0142] And because the queue length is limited, if the queue length has reached its maximum value, the newly queued task will not be queued and will be directly discarded.

[0143] In this embodiment, step S2 is specifically as follows:

[0144] The uninstallable list structure is Initialize the maximum number of node information that can be stored in the uninstallable list of each drone node to Φ, initialize the Φ data in the list to its own id, f, q, Q, and set the flag to valid.

[0145] Where id represents the id of the offloadable node, f represents the computing capacity of the offloadable node, q represents the queue length of the offloadable node, Q represents the maximum queue length of the offloaded node, TLT represents the duration of the link between the current node and the offloadable node, Indicates the average link transmission rate, time indicates the latest time of receiving the offloadable node message, and flag indicates whether the current node is valid.

[0146] The drone node calculates the relative moving speed and direction between two nodes through two consecutive neighbor messages, and then predicts the duration of the communication link and the average link transmission rate between the two nodes. At the same time, it obtains the real-time resource and network status information of the neighbor node, including the node computing power and task queue information, and updates the information to the unloadable list.

[0147] The specific steps for obtaining neighbor information and updating the uninstallable list are as follows:

[0148] B1. All drone nodes are mobile. To simplify the calculation, we assume that the current node i is fixed and its neighbor node j is mobile. We calculate the relative moving speed of the two nodes.

[0149] B2, drones and edge nodes send their own node ID, computing power f i 、The current task queue length q i , the maximum length of the task queue Q i 、Location information i Put it in the hello packet and broadcast it periodically;

[0150] B3. UAV node i records the time interval between two consecutive neighbor messages, and calculates the relative distances d1 and d2 between the two neighbors based on the location information of the two neighbors. The scenario is shown in the following figure. Figure 4 As shown, the link duration model is calculated;

[0151] B4, drone node i determines the angle between the neighbor position and itself according to the time Δt of two consecutive received signals Using the cosine formula Calculate the displacement d of the neighbor within time Δt Δt (relative displacement);

[0152] B5. Calculate the relative speed of neighbors based on the obtained time interval and relative displacement

[0153] B6. Based on steps B1-B5, predict the link duration and average link transmission rate between nodes;

[0154] From the cosine formula Find d tt , predict the link duration between nodes Then calculate the average link transmission rate

[0155] Among them, d tt Indicates the distance of the neighbor from the current position to the signal threshold; represents the angle between the neighbor moving from the current position to the signal strength threshold position and node i; d2 represents the distance between node i and its neighbor at the current moment; d threshold represents the distance from the neighbor to the receiving strength threshold of node i; r2 represents the transmission rate at the current moment; r threshold Indicates the transmission rate at the signal threshold.

[0156] B7, drone node i first sorts the uninstallable list according to whether the nodes in the uninstallable list are valid, putting the valid nodes in front, then calculates the completion time of the tasks generated by itself on the valid nodes in the uninstallable list, and sorts the valid nodes from small to large according to the completion time;

[0157] B8, drone node i determines whether to add the received neighbor information to the uninstallable list;

[0158] If the neighbor node information is in the unloadable list, the received neighbor computing power, task queue information, link duration, average link transmission rate information and the time when the node message was most recently received are updated, and the flag is marked as valid; if the neighbor node information is not in the unloadable list, the completion time of the task on the neighbor node is calculated. When the flag of the last data in the unloadable list is invalid, or the last data is node i itself or the completion time of the last data node is greater than that of the neighbor node, the last data is replaced with the neighbor node and the flag is marked as valid.

[0159] In this embodiment, step S3 is specifically as follows:

[0160] S31, after the node generates a task, the uninstallable list is maintained, and the task completion time is used as the optimization target to uninstall according to the current task information and the uninstallable node list;

[0161] After node i generates a task, it maintains the uninstallable list, updates its own task queue information to the record in the uninstallable list whose node id is itself, and traverses the time information of other nodes in the uninstallable list. If the difference between the current time cur and time is greater than TLT, it means that the node is no longer a neighbor node, and the flag of the node is set to invalid.

[0162] The computing time of the task of drone i executed locally and the task completion time T i,i (t) The expressions are as follows:

[0163]

[0164] Among them, f i (t) represents the computing power of UAV i, q i (t) represents the amount of data in the current task queue of the drone.

[0165] The transmission time for drone i to offload the computing task in time slot t The expression is as follows:

[0166]

[0167] Calculation time for unloading mission of drone and completion time T i,j (t) The expressions are as follows:

[0168]

[0169] To optimize the task completion time, the optimization problem can be described as:

[0170]

[0171] in, represents the uninstall decision variable.

[0172] S32, taking each drone as an intelligent agent, defining the environment state, action and reward of each intelligent agent;

[0173] (1) Status;

[0174] The state includes the task queue length, computing power, and average transmission rate of the nodes in the unloadable list; then for each drone i, its system state s at any time i (t) is expressed as follows:

[0175] s i (t)={q0(t),f0(t),q1(t),f1(t),r 0,1 ,...,q j (t),f j (t),r 0,j ,...,}

[0176] Among them, q i (t) represents the queue length of the node, f i (t) represents the node computing capacity, r i,j (t) represents the transmission rate between nodes;

[0177] (2) Action;

[0178] The agent selects an action based on the environmental state observed by the system at the current time t. The action is to select the unloading node and allocate the task amount. The action space a of the drone node at time t is defined as i (t) is expressed as follows:

[0179] a i (t) = {ο1(t),ο2(t)}

[0180] Among them, ο1(t) represents the selected unloading destination node list, ο2(t) represents the task amount assigned to the unloading destination node;

[0181] (3) Rewards;

[0182] The reward is the task completion time after performing an action, and the reward r i (t) Set the expression as follows:

[0183]

[0184] S33, taking each drone as an intelligent agent, using the reinforcement learning algorithm based on proximal policy optimization PPO, initialize the policy network Actor and value function network Critic of each intelligent agent;

[0185] In order to solve the problem of selecting invalid nodes in the uninstallable list when selecting an action, add an invalid state masking layer at the input end of the Actor network and an invalid action masking layer at the output end. Through the invalid state masking layer, the task queue length of the invalid node is set to -1, the computing power is set to 0, and the link rate is set to 0; through the invalid action masking layer, the action with invalid nodes is shielded. The specific operations are as follows:

[0186] The number of tasks generated by the node is The action dimension for assigning tasks to the offloadable list is The action list containing invalid nodes is φ, then the Actor network will give the action list for this node. The preference degree of an action is expressed as an unstandardized score: Then, the actions with invalid nodes are shielded through the invalid action masking layer. The specific operation is to define the function expression as follows:

[0187]

[0188] Here, ε is set to represent a constant, and ε<<0. The strategy, i.e. the probability distribution of each action, can be obtained by passing the action score list that passes the invalid action masking layer through the Softmax function. The definition expression is as follows:

[0189] π′ θ (·∣s τ )=[π′ θ (a1|s τ ),π′ θ (a2|s τ ),...,π′ θ (a N ∣s τ )]=softmax(mask(l i ))

[0190] Among them, π′ θ (a i ∣s τ ) represents the probability of taking this action, and the definition expression is as follows:

[0191]

[0192] Since ε<<0, the calculated probability of the action containing an invalid node is 0. It is impossible to select the node during sampling, so the action is successfully blocked.

[0193] The drone will send the current environment status i (t) is input into the Actor network to obtain the probability distribution of valid actions, and then sample to determine action a i (t), execute action a i (t), that is, after unloading the task to the destination node, update and enter the new state s i (t+1), and calculate the reward r obtained by executing the current action i (t);

[0194] S34, each drone continuously interacts with the environment, t ,a t ,r t ) are stored in their respective experience replay pools;

[0195] S35, each drone learns and updates the policy network and value function network parameters based on the experience playback pool;

[0196] Based on the experience replay pool obtained in step S34, the parameters of the Actor network and the Critic network are learned and updated as follows:

[0197] C1, Actor network update;

[0198] The update of the Actor network relies on the policy gradient method. First, the Actor network updates the input state s according to the current policy θ. t Generate the probability distribution π of each action θ (a t |s t ) and calculate the old strategy π old (a t |s t ) and the new strategy π new (a t |s t ; The probability ratio of choosing the same action under θ)

[0199] The objective function L of the Actor network C The generalized advantage estimation GAE is used as the estimation function, and the expression is as follows:

[0200] L C (θ) = E t [min(pr t (θ)A t ,clip(pr t (θ),1-ζ,1+ζ)A t )]

[0201] Among them, E trepresents the calculation of the expected value at time step t, A t represents the GAE estimate, which indicates the degree of advantage of taking a certain action relative to the average action; ζ represents a small constant set in advance to limit the proportion pr t The range of variation of (θ).

[0202] Based on the experience replay pool data obtained in step S34, calculate the objective function L C (θ), use the optimizer Adam to calculate L C (θ) Gradient with respect to θ And update the parameters θ:

[0203] Among them, υ represents the learning rate, which controls the step size of parameter update.

[0204] C2, Critic network update;

[0205] The update of the Critic network is performed by minimizing the error estimated by the value function. The Critic network is based on the current input state s t , output an estimate of the state value V ω (s t ).

[0206] Among them, ω represents the parameters of the Critic network.

[0207] For each state s t , using future rewards to estimate the true value, through calculate.

[0208] in, Indicates that in state s t Next, according to the strategy The expected cumulative reward of the action, Represents the discount factor, which is used to measure the importance of future returns relative to immediate returns, and l represents the lth time step in the future starting from the current moment.

[0209] The Critic network is trained using the mean square error (MSE) loss. The goal of the Critic network is to minimize the difference between the predicted state value and the actual return. The objective function η V The expression is as follows:

[0210]

[0211] Among them, R t represents the actual return from time step t to the beginning.

[0212] Based on the above objective function η V, calculate the gradient of the Critic network parameter ω, and pass η V Finding the Gradient Update parameter ω:

[0213] S36, looping through steps S33-S35, and implementing the distributed training unloading strategy until all the data in the experience replay pool are trained.

[0214] By repeatedly executing steps S33-S35, the Critic network learns to predict state values ​​more accurately, which helps the Actor network make better decisions. The updating process of the Critic network ensures that the policy network can optimize action selection based on more accurate value judgments, thereby improving the overall policy performance.

[0215] In this embodiment, step S4 is specifically as follows:

[0216] S41, the edge network node extracts the received hello message from the neighbor edge network node, extracts the neighbor's node ID and computing power f j , task queue size q j 、Location information j , and save the information to the neighbor information table;

[0217] The neighbor information table structure is {id,f,q,Q,r}.

[0218] Among them, id represents the neighbor node id, f represents the neighbor node computing power, q represents the queue length of the neighbor node, Q represents the maximum queue length of the neighbor node, and r represents the link transmission rate.

[0219] S42. Calculate the link transmission rate r between neighbor nodes based on the location information. i,j , and put it in the neighbor table;

[0220] S43. After receiving the mission from the drone, the edge node records the basic information of the mission, including the size of the mission received. Minimum unit of task min ;

[0221] S44. Divide the task into Calculate the completion time of each task;

[0222] The completion time of the node's own processing task is For edge nodes i and j, the task ξ min The communication time required for transmission from node i to node j is The computation time required is The total time for the task to be completed by the neighbors is

[0223] S45, for each task, calculate its completion time on its own node and its neighboring nodes, and assign the task to the node with the shortest completion time for processing;

[0224] S46. When a task is assigned to a node, update the task queue information of the node;

[0225] S47, repeat steps S44-S46 until all tasks are assigned;

[0226] S48. After the node calculation is completed, the results are returned to the initial unloading node in sequence, and the initial unloading node merges the results and returns them to the drone.

[0227] In summary, the method of the present invention aims to optimize the task processing efficiency of a hierarchical network composed of a group of drones performing specific tasks and an upper-layer network device equipped with high computing power facilities. The lower-layer nodes obtain and update the unloadable list with the task processing capabilities and communication status of the lower-layer nodes and upper-layer nodes in real time through information interaction, and then maintain the unloadable list by predicting the duration of the link between nodes. The upper-layer nodes obtain the neighbor table with the task processing capabilities and communication status of the upper-layer neighbor nodes in real time through information interaction. The lower-layer nodes learn and execute task unloading decisions based on the reinforcement learning algorithm, and preferentially assign tasks to the nodes in the unloadable list. After receiving the task, the upper-layer node calculates the completion time of the task on each node in the neighbor table, and assigns the task to the upper-layer node with the least completion time for processing. The method of the present invention updates the unloadable list by predicting the link duration between nodes, and introduces a two-level task allocation mechanism, which reduces data loss during transmission, and provides an effective solution for the adaptability of complex aerial hierarchical networks to dynamic environmental changes, so as to optimize task allocation and resource management.

[0228] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the scope of protection of the present invention is not limited to such specific statements and embodiments. For those skilled in the art, the present invention may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of the claims of the present invention.

Claims

1. A method for dynamic task offloading of UAV networks under a layered architecture, the specific steps are as follows: S1. Establish an aerial hierarchical network system model, initialize the drone's ID, location, task size, minimum split unit, task time requirement, computing power and task queue size, and the aerial edge network node's ID, location, computing power and task queue size; S2. Each drone node maintains a list of unloadable nodes, obtains real-time neighbor information through information interaction, including the location, speed, flight direction, and task processing capability of neighbor drones and upper network nodes, and predicts the link duration and average link transmission rate between nodes, and updates the obtained neighbor information to the unloadable list; S3, taking each drone node as an intelligent agent, when the drone generates a task, it maintains the node status information in its unloadable list, uses the reinforcement learning algorithm to solve the task unloading problem, and assigns the task to the valid node in the unloadable list; S4. Based on step S3, after receiving the task, the upper-level node monitors the upper-level neighbor network status and task processing capabilities in real time, maintains the neighbor information table, and sequentially distributes the task to the upper-level node with the shortest completion time for processing. The node returns the result after processing.

2. According to the method for dynamic task offloading of UAV network under a layered architecture of claim 1, it is characterized in that: In step S1, the aerial layered network system model is established as follows: The aerial hierarchical network system model includes upper and lower layers. The upper layer is an aerial edge network, where edge nodes equipped with high computing power facilities provide computing resource support for drone swarms. The edge node deployment position is fixed above the mission area, and the connection status between nodes remains unchanged; the lower layer is an active drone swarm, which is used to perform pre-set tasks. The drone swarm flies along a planned path and generates computing tasks in each time slot. Each drone communicates with other nodes based on a mobile communication model, and the nodes process tasks through a task queue model. The drones in the system model are assumed to be represented by a list U = {1, ..., u, ...}; the attributes of each drone i are represented by a triple {Θ i ,A i ,M i }express; Among them, Θ i Represents task processing capability information, expressed as a list {q i ,Q i ,f i }, including: current task queue size q i , the maximum queue length Q i And computing power i ; A i Indicates the task information generated at the current moment, expressed as a list {ξ i ,T max ,ξ min }, including: task sizeξ i , task time constraint T max And the minimum unit of task ξ min , the task can be split into Quantity; M i Represents the current UAV movement information, expressed as a list {p i ,v i ,θ i }, including: drone position p i , flight speed v i and the flight direction θ i ; The edge node is a mobile edge server that provides auxiliary computing. Its attributes are represented by a two-tuple {Θ m ,p m } to describe; Among them, Θ m Indicates the task processing capability information of the edge node; p m Indicates the location information of edge nodes; The mobile communication model and task queue model are specifically as follows: A1. Mobile communication model; The position of UAV i at time t is represented as p i (t) = (x i (t),y i (t),z i (t)); UAV i moves at speed v i (t) and direction θ i (t) The new position to which the plane flies at a constant speed is p i (t+1)=(x i (t)+v i (t)cosθ i (t),y i (t)+v i (t)sinθ i (t),z i (t)); At any time t, the distance d from UAV i to unloading node j i,j (t) is expressed as follows: The data transmission rate r of the unloading UAV is i,j (t) is expressed as follows: Among them, B u represents the communication bandwidth, p u represents the communication power of the UAV, β0 represents the channel power gain at a reference distance of 1 (m), and δ 2 represents Gaussian white noise; A2, Task queue model; The computing power of the drone and edge nodes is denoted as f i , then the size of the computing task processed by node i in a time slot is: Among them, ψ represents the computing power required per bit of data; Each drone will generate a task, and the size of the task generated by drone i is set to ξ i , and choose to execute the task locally or offload it to other drones or edge nodes through offloading decisions; The drone and edge node each maintain a task queue, and the tasks put into the queue are scheduled and executed according to the first-in-first-out principle; the task queue is used to store computing tasks waiting to be processed, including local tasks calculated by themselves after decision or tasks unloaded from other drone nodes; the state of the queue at any time t is expressed as: Where n represents the number of nodes selected to offload to node j, q j (t) represents the length of the queue at time t, represents the amount of tasks offloaded from node i to node j, Indicates the total number of tasks that are selected to be offloaded to drones or edge nodes at the current moment; And because the queue length is limited, if the queue length has reached its maximum value, the newly queued task will not be queued and will be directly discarded.

3. The method for dynamic task offloading of a drone network under a layered architecture according to claim 1 is characterized in that: The step S2 is specifically as follows: The uninstallable list structure is Initialize the maximum number of node information that can be stored in the uninstallable list of each drone node to Φ, initialize the Φ data in the list to its own id, f, q, Q, and set the flag to valid; Where id represents the id of the offloadable node, f represents the computing capacity of the offloadable node, q represents the queue length of the offloadable node, Q represents the maximum queue length of the offloaded node, TLT represents the duration of the link between the current node and the offloadable node, Indicates the average link transmission rate, time indicates the latest time of receiving the offloadable node message, and flag indicates whether the current node is valid; The drone node calculates the relative moving speed and direction between two nodes through two consecutive neighbor messages, and then predicts the duration of the communication link and the average link transmission rate between the two nodes. At the same time, it obtains the real-time resource and network status information of the neighbor node, including the node computing power and task queue information, and updates the information to the unloadable list; The specific steps for obtaining neighbor information and updating the uninstallable list are as follows: B1. Assume that the current node i is fixed and its neighbor node j is mobile, and calculate the relative moving speed of the two nodes; B2, the drone or edge node sends its own node id and computing power f i 、The current task queue length q i , the maximum length of the task queue Q i 、Location information i Put it in the hello packet and broadcast it periodically; B3, drone node i records the time interval between two consecutive neighbor messages, and calculates the relative distances d1 and d2 between the two neighbors based on their location information; B4, drone node i determines the angle between the neighbor position and itself according to the time Δt of two consecutive received signals Using the cosine formula Calculate the displacement d of the neighbor within time Δt Δt ; B5. Calculate the relative speed of neighbors based on the obtained time interval and relative displacement B6. Based on steps B1-B5, predict the link duration and average link transmission rate between nodes; From the cosine formula Find d tt , predict the link duration between nodes Then calculate the average link transmission rate Among them, d tt Indicates the distance of the neighbor from the current position to the signal threshold; represents the angle between the neighbor moving from the current position to the signal strength threshold position and node i; d2 represents the distance between node i and its neighbor at the current moment; d threshold represents the distance from the neighbor to the receiving strength threshold of node i; r2 represents the transmission rate at the current moment; r threshold Indicates the transmission rate at the signal threshold; B7, drone node i first sorts the uninstallable list according to whether the nodes in the uninstallable list are valid, putting the valid nodes in front, then calculates the completion time of the tasks generated by itself on the valid nodes in the uninstallable list, and sorts the valid nodes from small to large according to the completion time; B8, drone node i determines whether to add the received neighbor information to the uninstallable list; If the neighbor node information is in the unloadable list, the received neighbor computing power, task queue information, link duration, average link transmission rate information and the time when the node message was most recently received are updated, and the flag is marked as valid; if the neighbor node information is not in the unloadable list, the completion time of the task on the neighbor node is calculated. When the flag of the last data in the unloadable list is invalid, or the last data is node i itself or the completion time of the last data node is greater than that of the neighbor node, the last data is replaced with the neighbor node and the flag is marked as valid.

4. The method for dynamic task offloading of a drone network under a layered architecture according to claim 1 is characterized in that: The step S3 is specifically as follows: S31, after the node generates a task, the uninstallable list is maintained, and the task completion time is used as the optimization target to uninstall according to the current task information and the uninstallable node list; After node i generates a task, it maintains the uninstallable list, updates its own task queue information to the record with its own node id in the uninstallable list, and traverses the time information of other nodes in the uninstallable list. If the difference between the current time cur and time is greater than TLT, it means that the node is no longer a neighbor node, and the flag of the node is set to invalid; The computing time of the task of drone i executed locally and the task completion time T i,i (t) The expressions are as follows: Among them, f i (t) represents the computing power of UAV i, q i (t) represents the amount of data in the current task queue of the drone; The transmission time for drone i to offload the computing task in time slot t The expression is as follows: Calculation time for unloading mission of drone and completion time T i,j (t) The expressions are as follows: To optimize the task completion time, the optimization problem can be described as: in, represents the uninstall decision variable; S32, taking each drone as an intelligent agent, defining the environment state, action and reward of each intelligent agent; (1) Status; The state includes the task queue length, computing power, and average transmission rate of the nodes in the unloadable list; then for each drone i, its system state s at any time i (t) is expressed as follows: s i (t)={q0(t),f0(t),q1(t),f1(t),r 0,1 ,...,q j (t),f j (t),r 0,j ,...,} Among them, q i (t) represents the queue length of the node, f i (t) represents the node computing capacity, r i,j (t) represents the transmission rate between nodes; (2) Action; The agent selects an action based on the environmental state observed by the system at the current time t. The action is to select the unloading node and allocate the task amount. The action space a of the drone node at time t is defined as i (t) is expressed as follows: a i (t)={ο1(t),ο2(t)} Among them, ο1(t) represents the selected unloading destination node list, ο2(t) represents the task amount assigned to the unloading destination node; (3) Rewards; The reward is the task completion time after performing an action, and the reward r i (t) Set the expression as follows: S33, taking each drone as an intelligent agent, using the reinforcement learning algorithm based on proximal policy optimization PPO, initialize the policy network Actor and value function network Critic of each intelligent agent; Add an invalid state masking layer at the input end of the Actor network, and add an invalid action masking layer at the output end; through the invalid state masking layer, set the task queue length of the invalid node to -1, the computing power to 0, and the link rate to 0; through the invalid action masking layer, shield the action with invalid nodes; The drone will send the current environment status i (t) is input into the Actor network to obtain the probability distribution of valid actions, and then sample to determine action a i (t), execute action a i (t), that is, after unloading the task to the destination node, update and enter the new state s i (t+1), and calculate the reward r obtained by executing the current action i (t); S34, each drone continuously interacts with the environment, t ,a t ,r t ) are stored in their respective experience replay pools; S35, each drone learns and updates the policy network and value function network parameters based on the experience playback pool; Based on the experience replay pool obtained in step S34, the parameters of the Actor network and the Critic network are learned and updated as follows: C1, Actor network update; The update of the Actor network relies on the policy gradient method. First, the Actor network updates the input state s according to the current policy θ. t Generate the probability distribution π of each action θ (a t |s t ), and calculate the old strategy π old (a t |s t ) and the new strategy π new (a t |s t ; The probability ratio of choosing the same action under θ) The objective function L of the Actor network C The generalized advantage estimation GAE is used as the estimation function, and the expression is as follows: L C (θ)=E t [min(pr t (i)A t ,clip(pr t (θ),1-ζ,1+ζ)A t )] Among them, E t represents the calculation of the expected value at time step t, A t represents the GAE estimate, which indicates the degree of advantage of taking a certain action relative to the average action; ζ represents a small constant set in advance to limit the proportion pr t The range of variation of (θ); Based on the experience replay pool data obtained in step S34, calculate the objective function L C (θ), use the optimizer Adam to calculate L C (θ) Gradient with respect to θ And update the parameters θ: Among them, υ represents the learning rate, which controls the step size of parameter update; C2, Critic network update; The update of the Critic network is performed by minimizing the error estimated by the value function. The Critic network is based on the current input state s t , output an estimate of the state value V ω (s t ); Among them, ω represents the parameters of the Critic network; For each state s t , using future rewards to estimate the true value, through calculate; in, Indicates that in state s t Next, according to the strategy The expected cumulative reward of the action, represents the discount factor, which is used to measure the importance of future returns relative to immediate returns, and l represents the lth time step in the future starting from the current moment; The Critic network is trained using the mean square error (MSE) loss. The goal of the Critic network is to minimize the difference between the predicted state value and the actual return. The objective function η V The expression is as follows: Among them, R t represents the actual return from time step t to the beginning; Based on the above objective function η V , calculate the gradient of the Critic network parameter ω, and pass η V Finding the Gradient Update parameter ω: S36. Loop through steps S33-S35 to implement the distributed training unloading strategy until all data in the experience replay pool are trained.

5. The method for dynamic task offloading of a drone network under a layered architecture as described in claim 1 is characterized in that: The step S4 is specifically as follows: S41, the edge network node extracts the received hello message from the neighbor edge network node, extracts the neighbor's node ID and computing power f j , task queue size q j 、Location information j , and save the information to the neighbor information table; The neighbor information table structure is {id,f,q,Q,r}; Where id represents the neighbor node id, f represents the neighbor node computing power, q represents the queue length of the neighbor node, Q represents the maximum queue length of the neighbor node, and r represents the link transmission rate; S42. Calculate the link transmission rate r between neighbor nodes based on the location information. i,j , and put it in the neighbor table; S43. After receiving the mission from the drone, the edge node records the basic information of the mission, including the size of the mission received. Minimum unit of task min ; S44. Divide the task into Calculate the completion time of each task; The completion time of the node's own processing task is For edge nodes i and j, the task ξ min The communication time required for transmission from node i to node j is The computation time required is The total time for the task to be completed by the neighbors is S45, for each task, calculate its completion time on its own node and its neighboring nodes, and assign the task to the node with the shortest completion time for processing; S46. When a task is assigned to a node, update the task queue information of the node; S47, repeat steps S44-S46 until all tasks are assigned; S48. After the node calculation is completed, the results are returned to the initial unloading node in sequence, and the initial unloading node merges the results and returns them to the drone.