Method for multi-uav collaborative reasoning optimization based on dag topology generation and dynamic dnn model partitioning
By using DAG topology generation and dynamic DNN model partitioning, the task allocation and computing resources of a multi-UAV cooperative inference system are optimized, solving the challenges of real-time performance and communication latency in existing systems, and achieving efficient and stable task processing and energy management.
Patent Information
- Application Number
- CN202510797294.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2026-03-17
- Estimated Expiration
- 2045-06-16
AI Technical Summary
Existing multi-UAV collaborative reasoning systems face challenges in terms of real-time performance, communication latency, and limited computing resources, especially in scenarios such as autonomous driving and disaster response, where they struggle to meet the demands for efficient computing and data transmission.
By using a method based on DAG topology generation and dynamic DNN model partitioning, the position and task allocation of UAVs are dynamically adjusted. The topology network is constructed by combining the potential field method and the greedy clustering strategy. The non-continuous layer allocation mechanism and dynamic programming algorithm are used to optimize the computation and data chain, thereby achieving task allocation and load balancing.
It improves the overall efficiency of the system, reduces processing latency, ensures the real-time performance and efficiency of tasks, enhances the stability of communication links, and reduces energy consumption and total system latency.
Smart Images

Figure CN120706632B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of UAV collaborative reasoning technology, and in particular to a multi-UAV collaborative reasoning optimization method based on DAG topology generation and dynamic DNN model partitioning. Background Technology
[0002] With the rapid development of drone technology, multi-drone collaborative reasoning systems have demonstrated significant value in the field of intelligent traffic monitoring. In intelligent driving scenarios, vehicles often face the problem of missing road information due to blind spots when cruising long distances on highways, driving on continuous curves in mountainous areas, or at the scene of sudden traffic accidents.
[0003] Traditional solutions rely on data fusion between vehicle-mounted sensors and roadside units, but their sensing range is limited by fixed deployment density and physical obstructions. In contrast, drones can quickly respond to vehicle requests, capturing images of the road ahead from an aerial perspective and forming a dynamic, collaborative perception network with the vehicle. However, existing cloud-based multi-drone collaborative inference systems face significant challenges in real-world road scenarios.
[0004] Traditional multi-UAV collaborative inference systems typically rely on cloud computing to process large amounts of data and perform high-load inference tasks. In this architecture, the main role of the UAVs is data acquisition and preliminary processing, while complex inference and analysis are handled by the cloud. However, this cloud-based processing architecture faces several challenges.
[0005] First, cloud computing cannot meet the needs of some application scenarios with extremely high real-time requirements, such as autonomous driving and disaster response. In these scenarios, data collection, processing, and decision-making need to be completed as quickly as possible; any delay could lead to catastrophic consequences.
[0006] Secondly, the communication latency and bandwidth bottlenecks faced by cloud computing are also challenges that cannot be ignored. The communication link between drones and the cloud is usually limited by bandwidth, transmission distance, and network stability, especially in complex environments where these problems are more pronounced. Network instability and data transmission latency may prevent the system from responding quickly to external changes, affecting the overall performance and security of the system.
[0007] Furthermore, multi-UAV cooperative inference systems also face the challenge of limited computing resources. Each UAV typically has low computing power, relying mainly on lightweight processors and limited memory, making them suitable for handling lighter computational tasks. However, with the continuous development of algorithms such as deep learning and object detection, the complexity and resource requirements of computational tasks are gradually increasing. When faced with computationally demanding tasks, such as object detection, object tracking, and large-scale data analysis, the computing power of a single UAV is often insufficient. In such cases, a single UAV cannot handle the entire inference task, requiring collaboration with other UAVs to complete the mission.
[0008] To address these challenges, multi-UAV systems need to improve performance and efficiency by optimizing the compute and data chains. This requires the system to not only allocate tasks efficiently but also ensure that each UAV can perform at its maximum capacity within limited computing resources, avoiding computational bottlenecks. Optimizing the compute chain involves minimizing system latency and energy consumption through reasonable task allocation and scheduling, while optimizing the data chain involves efficiently managing and transmitting data, reducing redundancy and ineffective communication. Traditional cloud-based architectures struggle to achieve this level of efficient task and data optimization. Summary of the Invention
[0009] To address the shortcomings of existing technologies, this invention provides a multi-UAV collaborative reasoning optimization method based on DAG topology generation and dynamic DNN model partitioning. By optimizing the UAV system topology and dynamically adjusting the DNN model partitioning, this invention can intelligently allocate tasks and balance loads according to the complexity of the task and the computing power of each UAV, thereby improving the overall efficiency of the system and reducing processing latency.
[0010] The technical solution of this invention is: a multi-UAV cooperative reasoning optimization method based on DAG topology generation and dynamic DNN model partitioning, comprising the following steps:
[0011] S1) Initialize the drone and mission vehicle;
[0012] S2) When a task request from a ground vehicle is received, determine whether the cache is hit. If not, proceed to step S3).
[0013] S3) Dynamically adjust the position of the UAV based on the potential field method, and construct the topology network by combining greedy clustering and DAG topology generation strategies;
[0014] S4) Based on the discontinuous layer allocation mechanism and dynamic programming algorithm DPA, the DNN model is dynamically partitioned to allocate the discontinuous layers of the DNN to different UAVs.
[0015] S5) Perform DNN inference based on the topology and partitioning scheme;
[0016] S6) Update the cache based on priority and energy-aware strategies;
[0017] S7) Calculate latency and overhead.
[0018] Preferably, in step S3), the potential field includes task attraction and repulsion between drones. The task attraction drives drones to gather in high-value areas, while the repulsion between drones avoids collisions and interference. The scoring function of drone clustering is combined to screen high-potential nodes, generate a directed acyclic graph with minimized delay, and unify the task input source through a virtual root node.
[0019] Preferably, in step S3), the task attraction F attract (d) The gravitational field generated by the vehicle's mission request point has a strength positively correlated with mission priority, i.e.:
[0020]
[0021] In the formula, k task d is the attraction coefficient; d is the distance between the drone and the vehicle; R task Radius of influence of the task;
[0022] The repulsive force F between the unmanned aerial vehicles repel (d) Avoid collisions and communication interference; its expression is:
[0023]
[0024] In the formula, k uav d is the repulsive force coefficient; safe For safe distance.
[0025] Preferably, in step S3), under the influence of the potential field, the motion trajectory of the UAV is adjusted and moved strictly according to the motion control equation, which is expressed as:
[0026]
[0027] In the formula, For the mission machine u i The velocity vector at time t+1; This represents the resultant force of the attractive force of the mission, the repulsive force of the obstacle, and the repulsive force between drones; a and b are weighting coefficients.
[0028] This is the fastest speed in history.
[0029] Preferably, in step S3), each drone u iIt possesses heterogeneous computing and communication capabilities, with each drone... i Energy E i (t) Dynamic changes, including kinetic energy consumption E move (t) and communication energy consumption E comm (t), where the drone's motion energy consumption E move (t) is generated by flight attitude adjustment and displacement, that is:
[0030]
[0031] In the formula, P represents the change in kinetic energy. hov Δt represents hovering power consumption; m i For drones i quality; |v i (t)| represents the drone u i Speed magnitude; P hov Represents hovering power; Δt represents the time step; when |v i When (t)|<0.1, only hovering power consumption is calculated;
[0032] The communication energy consumption E comm (t) includes the energy consumption for data transmission and reception, i.e.:
[0033] E comm (t)=P tx ·t tx +P rx ·t rx (5)
[0034] In the formula, P tx Indicates transmission power; t tx Indicates the duration of transmission; P rx Indicates received power; t rx Indicates the reception duration.
[0035] Preferably, in step S3), the scoring function Score(u) for UAV clustering is... i ) is defined as:
[0036]
[0037] In the formula, α, β, and γ are weighting coefficients; P tx,i For drones i The transmit power; R comm Indicates the communication radius; C i For drones i computing power; E i For drones i Remaining energy; P max C is the maximum transmit power.max Maximum computing power; E max This represents the maximum energy.
[0038] Preferably, in step S3), the UAVs are clustered and screened based on their cluster scores. The specific process is as follows:
[0039] First, a preliminary spatial screening is conducted, selecting UAVs within a radius of L meters of the mission point as candidate targets;
[0040] Next, connectivity verification is carried out, a fully connected candidate set is constructed, and isolated nodes are removed to ensure good communication connectivity between candidate drones;
[0041] Finally, the candidate drones are ranked using a greedy algorithm based on the scoring function Score(u i The top K UAVs are selected in descending order as the clustering results.
[0042] Preferably, in step S3), the topology network is constructed using the DAG topology generation strategy, which specifically includes the following steps:
[0043] S31) Based on the selected UAV cluster set U = {u1, u2, ..., u K}, obtain the location and transmission power P of the corresponding UAV. tx,i And computing power C i And through computing power C i Sort the drones in descending order;
[0044] S32), for each drone u i Select the drone within its communication range that is ranked first as the candidate parent node;
[0045] S33) Select the two parent nodes with the smallest weights according to the link weights to form edge e. i,k ;
[0046] S34) Add a virtual root node v0 and connect it to all nodes without incoming edges, and use the virtual root node v0 as the input source for the task.
[0047] S35) Trim redundant edges and delete edges that could lead to loops to obtain a directed acyclic graph.
[0048] Preferably, in step S4), the dynamic DNN model partitioning includes inter-layer partitioning and intra-layer partitioning. Inter-layer partitioning allocates different layers of the DNN model to devices at different stages, while intra-layer partitioning further subdivides the computational task of the same layer into multiple subtasks and allocates them to different devices at the same stage for parallel computation according to the computing power ratio of the devices. Specifically, it includes the following steps:
[0049] S41) Construct a heterogeneous graph based on UAV topology network, including UAV nodes and DNN layer nodes;
[0050] S42) The UAV-DNN relationship is encoded using the graph attention network GAT, and the optimal allocation probability between the UAV and the DNN layer is generated by the node features and topological relationships of the heterogeneous graph.
[0051] S43) Based on the near-end optimization strategy, PPO dynamically adjusts the layer allocation strategy.
[0052] Preferably, in step S41), the UAV node in the heterogeneous graph is used It is indicated that its eigenvector is Among them, P i For transmit power; loc i These are the position coordinates;
[0053] The DNN layer nodes are represented as follows: Its eigenvectors Among them, Comp i For layer l i The complexity of Data; i For layer l i Output data size;
[0054] The edge types of the heterogeneous graph include UAV communication edges. Dependency edges of DNN Among them, drone communication edge Link weights in the network topology Determined, the aforementioned link weight Indicates from drone u i To drone u k The link communication capability, the link weight The formula for calculation is:
[0055]
[0056] In the formula, B represents the channel bandwidth; h i,k Indicates drone u i to u k Channel gain; δ 2 Indicates noise power;
[0057] The edge weights of the DNN model depend on the size of the data transmitted between layers. Assuming layer l... j The output is layer l m The input, then the DNN model depends on the edge weights.
[0058] Preferably, in step S42), the UAV-DNN model relationship is encoded using a graph attention network (GAT), including the following steps:
[0059] S421) Combine the feature vectors of the drone node and the DNN layer node Project them separately into a higher-dimensional space;
[0060] S422) The association weights between nodes are calculated through a multi-head attention mechanism, and each attention head independently learns the interaction relationships in different dimensions;
[0061] S423) Generate the probability matrix P for each drone's assignment to the DNN layer. i,j ,Right now:
[0062]
[0063] In the formula, Softmax represents the normalization function; and These represent the features of DNN layer nodes and UAV nodes, respectively.
[0064] Preferably, in step S43), the layer allocation strategy is dynamically adjusted based on the near-end optimization strategy PPO, which specifically includes the following steps:
[0065] S431) Generate a layer allocation scheme according to the current strategy;
[0066] S432), calculate rewards and penalties for violating constraints;
[0067] S433), optimizes the policy network through gradient descent.
[0068] Preferably, in step S431), the allocation probability P is used... i,j The allocation result z is generated using a maximum probability selection or sampling strategy. i,j :
[0069]
[0070] Finally, the complete layer allocation scheme matrix [z] is obtained. i,j This serves as the execution decision under the current strategy and is used for subsequent reward calculations and strategy optimization.
[0071] Preferably, in step S432), the reward R is calculated as follows:
[0072]
[0073] In the formula, T totalλ1 and λ2 represent the total task delay; σ(E) represents the standard deviation of the UAV's remaining energy; Comm_Cost represents the total communication cost.
[0074] The constraints are as follows:
[0075] Calculate the load: ∑ j z i,j ·Comp i ≤C i , where z i,j Represents the lth generation of the DNN model j Is the layer assigned to the drone? i ;
[0076] If the computational load exceeds the threshold, the layer tasks are redistributed using the PPO strategy.
[0077] Energy constraint: E i ≥∑ j z i,j ·(Comp i ·η i ), where η i Indicates drone u i The energy consumed to perform each unit of computational task;
[0078] If energy is insufficient, it will be allocated to drones with high remaining energy.
[0079] Cache capacity: ∑ j Data j ·Cache i,j ≤1GB; where Cache i,j =1 indicates layer l j The output is stored in the drone u i In the cache;
[0080] If the cache capacity exceeds the threshold, the cache will be updated.
[0081] The aforementioned violation penalty refers to a mechanism that provides negative feedback or punishment for behaviors or solutions that violate constraints. The purpose of the penalty is to prevent the algorithm from selecting these infeasible solutions.
[0082] Preferably, in step S433), the gradient descent formula is:
[0083]
[0084] In the formula, θ represents the parameters of the policy network; η represents the learning rate; This represents the gradient of the loss function with respect to the parameters;
[0085] Preferably, in step S5), DNN inference is performed based on the topology network and partitioning scheme, specifically including the following steps:
[0086] S51) Initialize the inference task environment: Initialize the computing state, cache state, and communication link state of each UAV, and load and allocate the DNN model layer mapping relationship;
[0087] S52) Distributed inference is executed according to the topological order of the DNN model: During the inference process, the DNN model is executed layer by layer, and each layer is executed in three stages: inference time calculation, cross-node data transmission time calculation, and cache and data management.
[0088] S53) Integrating the final inference results: The output of the last layer of the DNN model is generated by the corresponding UAV; if the task objective requires centralized results, such as returning to the vehicle-mounted equipment or control center, the results are uploaded via the 5G link;
[0089] S54), inference log and resource status updates.
[0090] Preferably, in step S52), the DNN model is executed layer by layer. The execution of each layer can be divided into three stages: inference time calculation, cross-node data transmission time calculation, and caching and data management, as detailed below:
[0091] S521), Reasoning calculation time: If the lth... j The layer is assigned to the drone u i Its computation time T comp (i,j) is:
[0092]
[0093] Among them, Comp j Presentation layer l j The required computing resources, C i For drones i Its computing power.
[0094] S522), Cross-node data transmission time: If two adjacent layers l j and l j+1 Assigned to different drones i and u i If '', then intermediate output needs to be transmitted, and the transmission time is:
[0095]
[0096] Among them, Data j Presentation layer l j The output data size, B i,i′ (t) represents the current time of the drone u i and ui The bandwidth of L' prop For fixed propagation delay; T comm (i,i′,j) represents the communication delay;
[0097] S523) Caching and Data Management: If the caching strategy requires, the output will be cached locally for use by subsequent layers. If the cache is insufficient, a cache update or cleanup mechanism will be triggered to ensure the availability and integrity of intermediate data.
[0098] Preferably, in step S53), the formula for calculating the overall reasoning completion delay is recorded as follows:
[0099]
[0100] in, Indicates the lth j Layered drones It is an indicator function that indicates whether cross-device communication exists.
[0101] Preferably, in step S54), after inference is completed, the computation and communication energy consumption of each layer is recorded, including:
[0102] Calculate energy consumption:
[0103] E comp (i,j)=Comp j ·η i (15)
[0104] In the formula, η i Energy consumption is calculated in units.
[0105] Communication power consumption:
[0106] E comm (t)=P tx ·t tx +P rx ·t rx (16)
[0107] In the formula, P tx Indicates the power consumption at the transmitting end; P rx Indicates the power consumption at the receiving end; t rx Indicates the data reception time; t tx Indicates the transmission time.
[0108] Total energy consumption:
[0109] E total =∑ j E comp (i j ,j)+E comm (17)
[0110] Information such as the drone's remaining energy, cache status, and communication latency is used for the next round of task scheduling and strategy optimization;
[0111] Preferably, in step S6), each UAV is configured with a limited cache to store intermediate results and task inputs, wherein the cache state is represented by the matrix Cache(t); the cache update based on priority and energy perception strategy is specifically as follows:
[0112] S61) Calculate the priority PR for each layer by combining complexity and data size, i.e.:
[0113] PR j =w1Comp j +w2Data j (18)
[0114] Among them, Comp j For layer l j The complexity of Data; j For layer l j Output data size; w1 and w2 are weights;
[0115] S62) Cache addition and cache eviction: If the cache is not full, the newly allocated layer result is stored directly; if the cache is full, the lowest priority layer is removed.
[0116] j * =arg min PR j (19)
[0117] In the formula, j * The lowest priority layer; PR j The priority of the j-th layer;
[0118] If the remaining energy E i <20%, prioritize retaining layers with high computational load;
[0119] S63) Perform state synchronization and broadcast the updated cache state to neighboring drones.
[0120] As a preferred option, if Cache(t) i,j =1, and layer l is required. j Then use the cached result Data. j Cache saves time Represented as:
[0121]
[0122] In the formula, B i,i′ (t) represents the time t at which the drone u... i To the target dronei′ Communication bandwidth;
[0123] The constraints are:
[0124]
[0125] In the formula, N represents the number of layers in the DNN model; Cache(t) max,i (t) represents the unmanned aerial vehicle u i The maximum cache capacity at time t.
[0126] Preferably, in step S7), the total delay T for completing the task reasoning is... total (t) includes computational delay and communication delay, i.e.:
[0127]
[0128] in, Indicates the lth j Layered drones It is an indicator function that indicates whether cross-device communication exists.
[0129] In pipelined mode, the delay T is calculated. compute (t) is determined by the slowest drone and whether a cache hit occurs, i.e.:
[0130]
[0131] In the formula, A i,j (t) represents the lth digit of the DNN model. j Is the layer assigned to the drone? i ;T cache (t) represents the total computation time saved due to the cache hit;
[0132] The communication delay T comm (t) includes uplink, grid, and downlink phase delays, i.e.:
[0133] T comm (t)=T up (t)+T mesh (t)+T down (t); (24)
[0134] In the formula, T up (t), T mesh (t), T down (t) represents the uplink, grid, and downlink phase delays, respectively;
[0135] in,
[0136]
[0137] In the formula, B 5g (t) represents the 5G network bandwidth at time t; D req Indicates the amount of data requested from the upstream; L prop Indicates the propagation delay;
[0138]
[0139] In the formula, K represents the number of drones in the cluster; T i,i′ (t) represents the drone u i With drones i′ Transmission delay factor between; B i,i′ (t) represents the drone u i To drone u i′ Communication bandwidth between them; Indicates drone u i To drone u i′ The output data;
[0140]
[0141] In the formula, D result Indicates the amount of data in the downlink result;
[0142] The time T saved by the cache cache (t) is represented as:
[0143]
[0144] The beneficial effects of this invention are as follows:
[0145] 1. This invention can dynamically allocate computing tasks among multiple drones, avoiding excessive computing load on a single drone. It can flexibly adjust the allocation strategy of tasks and data according to network status and environmental changes, ensuring the real-time performance and efficiency of tasks even in unstable network conditions.
[0146] 2. The present invention is a dynamic DAG topology generation method based on the potential field method. It drives UAVs to gather in high-value areas through the task attraction field, while avoiding collisions and interference by using the repulsion field between UAVs. It builds a stable communication link in real time, combines a scoring function to screen high-potential nodes, generates a directed acyclic graph with minimal latency, and unifies the task input source through a virtual root node. This can improve the stability of the communication link and reduce end-to-end latency.
[0147] 3. This invention introduces a discontinuous layer allocation mechanism and dynamic programming, which allows the discontinuous layers of the DNN to be dynamically allocated to different UAVs. The load distribution is optimized based on a real-time scoring function related to distance, computing power, and energy status, thereby improving the task completion rate and reducing energy consumption.
[0148] 4. This invention dynamically sorts cached content by comprehensively considering the priority indicators of computational complexity and data size, prioritizing the retention of high-value results; thereby improving the cache hit rate in dynamic task scenarios and significantly reducing the total system latency and energy consumption. Attached Figure Description
[0149] Figure 1 This is a schematic diagram of the method flow of the present invention;
[0150] Figure 2 This is a flowchart of the method of the present invention;
[0151] Figure 3 This is a schematic diagram of topology generation in this invention;
[0152] Figure 4 This is a schematic diagram of the partitioning of the DNN model of this invention. Detailed Implementation
[0153] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings:
[0154] like Figure 1 and 2 As shown, this embodiment provides a multi-UAV cooperative reasoning optimization method based on DAG topology generation and dynamic DNN model partitioning, including the following steps:
[0155] S1) Initialize the drone and mission vehicle;
[0156] S2) When a task request from a ground vehicle is received, determine whether the cache is hit. If not, proceed to step S3).
[0157] S3) Dynamically adjust the position of the UAV based on the potential field method, and construct the topology network by combining greedy clustering and DAG topology generation strategies;
[0158] In this embodiment, the potential field includes task attraction and inter-UAV repulsion. Task attraction drives UAVs to cluster towards high-value areas, while inter-UAV repulsion avoids collisions and interference. The UAVs' trajectories are strictly adjusted and moved according to motion control equations. Meanwhile, the UAVs' energy consumption dynamically changes with the conduct of communication activities and changes in their own motion state. High-potential nodes are selected using a UAV clustering scoring function to generate a directed acyclic graph with minimized latency, and a virtual root node unifies the task input source.
[0159] In this embodiment, the task attraction F attract (d) The gravitational field generated by the vehicle's mission request point has a strength positively correlated with mission priority, i.e.:
[0160]
[0161] In the formula, k task d is the attraction coefficient; d is the distance between the drone and the vehicle; R task Radius of influence of the task;
[0162] The repulsive force F between the unmanned aerial vehicles repel (d) Avoid collisions and communication interference; its expression is:
[0163]
[0164] In the formula, k uav d is the repulsive force coefficient; safe For safe distance.
[0165] Under the influence of the potential field, the motion control equation of the UAV is expressed as:
[0166]
[0167] In the formula, For the mission machine u i The velocity vector at time t+1; This represents the resultant force of the attractive force of the mission, the repulsive force of the obstacle, and the repulsive force between drones; a and b are weighting coefficients.
[0168] This is the fastest speed in history.
[0169] In this embodiment, each drone u i It possesses heterogeneous computing and communication capabilities, with each drone... i Energy E i (t) Dynamic changes, its energy consumption includes motion energy consumption E move (t) and communication energy consumption E comm (t), where the drone's motion energy consumption E move (t) is generated by flight attitude adjustment and displacement, that is:
[0170]
[0171] In the formula, P represents the change in kinetic energy. hov Δt represents hovering power consumption; m i drone i quality; |v i (t)| represents the drone u h Speed magnitude; P hov Represents hovering power; Δt represents the time step; when |v i When (t)|<0.1, only hovering power consumption is calculated;
[0172] The communication energy consumption E comm (t) includes the energy consumption for data transmission and reception, i.e.:
[0173] E comm (t)=P tx ·t tx +P rx ·t rx (5)
[0174] In the formula, P tx Indicates the power consumption at the transmitting end; P rx Indicates the power consumption at the receiving end; t rx Indicates the data reception time; t tx Indicates the transmission time.
[0175] Wherein, the transmission time t tx Determined by the data volume D and bandwidth B, that is:
[0176]
[0177] In the formula, N0 represents the noise power spectral density; h represents the channel gain.
[0178] In this embodiment, the scoring function for UAV clustering is Score(u i ) is defined as:
[0179]
[0180] In the formula, α, β, and γ are weighting coefficients; in this embodiment, α = 0.4, β = 0.4, and γ = 0.2.
[0181] P tx,i For drones i The transmit power; R comm Indicates the communication radius; C i For drones i computing power; E i For drones i Remaining energy; P max C represents the maximum possible transmit power among all drones. max E represents the maximum computing power that any drone may possess. max The maximum battery power set for all drones.
[0182] Then, the drones are clustered and filtered according to their cluster scores. The specific process is as follows:
[0183] First, a preliminary spatial screening is conducted, selecting drones within a 200-meter radius of the mission point as candidate targets;
[0184] Next, connectivity verification is carried out, a fully connected candidate set is constructed, and isolated nodes are removed to ensure good communication connectivity between candidate drones;
[0185] Finally, the candidate drones are ranked using a greedy algorithm based on the scoring function Score(u i The top K UAVs are selected in descending order as the clustering results.
[0186] The goal of the DAG topology generation strategy is to construct a directed acyclic graph (DAG) to minimize end-to-end latency, such as... Figure 3 As shown, the DAG topology generation strategy is used to construct a topology network, which specifically includes the following steps:
[0187] S31) Based on the selected UAV cluster set U = {u1, u2, ..., u K}, obtain the location and transmission power P of the corresponding UAV. tx,i And computing power C i And through computing power C i Sort the drones in descending order;
[0188] S32), for each drone u i Select the drone within its communication range that is ranked first as the candidate parent node;
[0189] S33) Select the two parent nodes with the smallest weights according to the link weights to form edge e. i,k ;
[0190] S34) Add a virtual root node v0 and connect it to all nodes without incoming edges, and use the virtual root node v0 as the input source for the task.
[0191] S35) Trim redundant edges and delete edges that could lead to loops to obtain a directed acyclic graph.
[0192] S4) Based on the discontinuous layer allocation mechanism and dynamic programming algorithm DPA, the DNN model is dynamically partitioned to allocate the discontinuous layers of the DNN to different UAVs.
[0193] The DNN model partitioning includes inter-layer partitioning and intra-layer partitioning. Inter-layer partitioning allocates different layers of the DNN model to devices at different stages, while intra-layer partitioning further subdivides the computational task of the same layer into multiple subtasks and allocates them to different devices at the same stage for parallel computation according to the computing power of the devices; for example... Figure 4 As shown, the specific steps include the following:
[0194] S41) Construct a heterogeneous graph based on UAV topology network, including UAV nodes and DNN layer nodes;
[0195] The UAV nodes in the heterogeneous graph are used It is indicated that its eigenvector is Among them, P i For transmit power; loc i These are the position coordinates;
[0196] The DNN layer nodes are represented as follows: Its eigenvectors Among them, Comp i For layer l i The complexity of Data; i For layer l i Output data size;
[0197] The edge types of the heterogeneous graph include UAV communication edges. Dependency edges of DNN Among them, drone communication edge Link weights in the network topology Determined, the aforementioned link weight Indicates from drone u i To drone u k The link communication capability, the link weight The formula for calculation is:
[0198]
[0199] In the formula, B represents the channel bandwidth; h i,k Indicates drone u i to u k Channel gain; δ 2 Indicates noise power;
[0200] The DNN-dependent edge weights are related to the amount of data transmitted between layers. Assuming layer l... j The output is layer l m The input to the DNN depends on the edge weights.
[0201] S42) Encode the UAV-DNN relationship using a graph attention network (GAT), and generate the optimal allocation probability between the UAV and the DNN layer through the node features and topological relationships of the heterogeneous graph; including the following steps:
[0202] S421) Combine the feature vectors of the drone node and the DNN layer node Project them separately into a higher-dimensional space;
[0203] S422) The association weights between nodes are calculated through a multi-head attention mechanism, and each attention head independently learns the interaction relationships in different dimensions;
[0204] In this embodiment, the attention weight is calculated based on a query-key value mechanism, which is expressed as follows:
[0205] q i =W q h i ;
[0206] k j =W k h j ;
[0207] In the formula, h i h j W represents the node feature vector; q W k q represents the trainable parameter matrix; i k j Represents the query and key-value pairs of a node;
[0208] By using the LeakyReLU activation function and Softmax normalization, we ensure that the weights can capture local feature differences while maintaining global coordination.
[0209] S423) Generate the probability matrix P for each drone's assignment to the DNN layer. i,j ,Right now:
[0210]
[0211] In the formula, Softmax represents the normalization function; and These represent the features of DNN layer nodes and UAV nodes, respectively.
[0212] S43) Dynamically adjust the layer allocation strategy based on the near-end optimization strategy PPO; specifically including the following steps:
[0213] S431) Generate a layer allocation scheme according to the current strategy;
[0214] According to the allocation probability P i,j The allocation results are generated using a maximum probability selection or sampling strategy:
[0215]
[0216] Finally, the complete layer allocation scheme matrix [z] is obtained. i,j This serves as the execution decision under the current strategy and is used for subsequent reward calculations and strategy optimization.
[0217] S432), calculate rewards and penalties for violating constraints;
[0218] The formula for calculating the reward R is as follows:
[0219]
[0220] In the formula, T total λ1 and λ2 represent the total delay of task completion; σ(E) represents the standard deviation of the UAV's remaining energy; Comm_Cost represents the total communication overhead; where, Indicates the main reward; This represents energy balance; λ2·∑Comm_Cost is the communication penalty.
[0221] The constraints are as follows:
[0222] Calculate the load: ∑ j z i,j ·Comp i ≤C i , where z i,j Represents the lth generation of the DNN model j Is the layer assigned to the drone? i ;
[0223] If the computational load exceeds the threshold, the layer tasks are redistributed using the PPO strategy.
[0224] Energy constraint: E i ≥∑ j z i,j ·(Comp i ·η i ), where η i Indicates drone u i The energy consumed to perform each unit of computational task;
[0225] If energy is insufficient, it will be allocated to drones with high remaining energy.
[0226] Cache capacity: ∑ j Data j ·Cache i,j ≤1GB; where Cache i,j =1 indicates layer l j The output is stored in the drone u i In the cache;
[0227] If the cache capacity exceeds the threshold, the cache will be updated.
[0228] The aforementioned violation penalty refers to a mechanism that provides negative feedback or punishment for behaviors or solutions that violate constraints. The purpose of the penalty is to prevent the algorithm from selecting these infeasible solutions.
[0229] S433), optimize the policy network through gradient descent;
[0230] The gradient descent formula is as follows:
[0231]
[0232] In the formula, θ represents the parameters of the policy network; η represents the learning rate; This represents the gradient of the loss function with respect to the parameters;
[0233] S5) Perform DNN inference based on the topology network and the DNN model partitioning scheme; specifically, this includes the following steps:
[0234] S51) Initialize the inference task environment.
[0235] Initialize the computing state, cache state, and communication link state of each UAV, and load and allocate the DNN model layer mapping relationship, that is, which UAV is responsible for handling each layer of task;
[0236] S52) Perform distributed inference according to the topological order of the DNN model.
[0237] During inference, the DNN model executes layer by layer, and each layer's execution can be divided into two stages: computation and data transmission.
[0238] S521), Reasoning calculation time: If the lth... j The layer is assigned to the drone u i The calculation time is:
[0239]
[0240] Among them, Comp j Presentation layer l j The required computing resources, C i For drones i Its computing power.
[0241] S522), Cross-node data transmission time: If two adjacent layers l j and l j+1 Assigned to different drones i and u i If '', then intermediate output needs to be transmitted, and the transmission time is:
[0242]
[0243] Among them, Data j Presentation layer l j The output data size, B i,i′ (t) represents the bandwidth at the current moment, L prop To fix the propagation delay.
[0244] S523) Caching and Data Management: If the caching strategy requires, the output will be cached locally for use by subsequent layers. If the cache is insufficient, a cache update or cleanup mechanism will be triggered to ensure the availability and integrity of intermediate data.
[0245] S53), integrate the final reasoning results.
[0246] The output of the last layer of the DNN model is generated by the corresponding drone. If the mission objective requires centralized results, such as returning them to onboard equipment or a control center, the results are uploaded via a 5G link. The overall inference completion delay is recorded at this stage.
[0247]
[0248] in, Indicates the lth j Layered drones It is an indicator function that indicates whether cross-device communication exists.
[0249] S54), inference log and resource status updates.
[0250] After inference is completed, record the computational and communication energy consumption of each layer, including:
[0251] Calculate energy consumption:
[0252] E comp (i,j)=Comp j ·η i (15)
[0253] In the formula, η i Energy consumption is calculated in units.
[0254] Communication power consumption:
[0255] E comm =∑ 传输 (P tx ·t tx +P rx ·t tx (16)
[0256] In the formula, P tx Indicates the power consumption at the transmitting end; P rx Indicates the power consumption at the receiving end; t rx Indicates the data reception time; t tx Indicates the transmission time.
[0257] Total energy consumption:
[0258]
[0259] Information such as the drone's remaining energy, cache status, and communication latency is used for the next round of task scheduling and strategy optimization;
[0260] S6) Update the cache based on priority and energy-aware strategies;
[0261] Each UAV is equipped with a limited cache to store intermediate results and task inputs, where the cache state is represented by the matrix Cache(t); the cache update based on priority and energy awareness strategy is as follows:
[0262] S61) Calculate the priority PR for each layer by combining complexity and data size, i.e.:
[0263] PR j =w1Comp j +w2Data j (18)
[0264] Among them, Comp j For layer l j The complexity of Data; j For layer l j Output data size; w1 and w2 are weights;
[0265] S62) Cache addition and cache eviction: If the cache is not full, the newly allocated layer result is stored directly; if the cache is full, the lowest priority layer is removed.
[0266] j * =arg min PR j (19)
[0267] In the formula, j * The lowest priority layer; PR j For the l j Layer priority;
[0268] If the remaining energy E i <20%, prioritize retaining layers with high computational load;
[0269] S63) Perform state synchronization and broadcast the updated cache state to neighboring drones.
[0270] In this embodiment, if Cache(t) i,j =1, and layer l is required. j Then use the cached result Data. j Cache saves time Represented as:
[0271]
[0272] In the formula, B i,i′(t) represents the time t at which the drone u... i To the target drone i′ Communication bandwidth;
[0273] The constraints are:
[0274]
[0275] In the formula, N represents the number of layers in the DNN model; Cache(t) max,i (t) represents the unmanned aerial vehicle u i The maximum cache capacity at time t.
[0276] S7) Calculate latency and overhead.
[0277] Total delay T for completing task reasoning total (t) includes computational delay and communication delay, i.e.:
[0278]
[0279] in, Indicates the lth j Layered drones It is an indicator function that indicates whether cross-device communication exists.
[0280] In pipelined mode, the delay T is calculated. compute (t) is determined by the slowest drone and whether a cache hit occurs, i.e.:
[0281]
[0282] In the formula, A i,j (t) represents the lth digit of the DNN model. j Is the layer assigned to the drone? i ;T cache (t) represents the total computation time saved due to the cache hit;
[0283] The communication delay t comm (t) includes uplink, grid, and downlink phase delays, i.e.:
[0284] T comm (t)=T up (t)+T mesh (t)+T down (t); (24)
[0285] In the formula, T up (t), T mesh (t), T down (t) represents the uplink, grid, and downlink phase delays, respectively;
[0286] in,
[0287]
[0288] In the formula, B 5g (t) represents the 5G uplink bandwidth from the vehicle to the drone at time t; D req Indicates the size of the data requested by the uplink task; L prop Indicates the propagation delay;
[0289]
[0290] In the formula, K represents the number of drones in the cluster; T i,i′ (t) represents the drone u i With drones i′ Transmission delay factor between; B i,i′ (t) represents the drone u i To drone u i′ Communication bandwidth between them; Indicates drone u i To drone u i′ The output data;
[0291]
[0292] In the formula, D result The amount of data representing the final inference result;
[0293] The time T saved by the cache cache (t) is represented as:
[0294]
[0295] The embodiments and descriptions above are merely illustrative of the principles and preferred embodiments of the present invention. Various changes and modifications may be made to the present invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed.
Claims
1. A method for multi-UAV collaborative inference optimization based on a DAG topology and dynamic DNN model partitioning, characterized in that, Comprising the following steps: S1), initializing the unmanned aerial vehicle and the task vehicle; S2), when receiving the task request of the ground vehicle, judging whether the cache hits, if not, then executing step S3); S3), dynamically adjusting the position of the unmanned aerial vehicle based on the potential field method, and constructing a topology network in combination with the greedy clustering and DAG topology generation strategy; According to the score of the unmanned aerial vehicle clustering, the unmanned aerial vehicle is clustered and screened, and the specific process is as follows: Firstly, space preliminary screening is carried out, and the unmanned aerial vehicles within the radius L meters of the task point are selected as candidate objects; Then, connectivity verification is carried out, a full connection candidate set is constructed, and isolated nodes are removed to ensure good communication connectivity between the candidate unmanned aerial vehicles; Finally, the candidate UAVs are sorted by a greedy algorithm, and the top K UAVs are selected as the clustering result according to the score function in descending order. descending order. The topology network is constructed by using the DAG topology generation strategy, which specifically comprises the following steps: S31)、according to the screened unmanned aerial vehicle cluster set , the position, the transmission power and the computing power of the corresponding unmanned aerial vehicle are obtained, and the unmanned aerial vehicles are sorted in descending order of computing power ; S32)、for each drone selecting a drone within its communication range and ranked first as a candidate parent node; S33), selecting the first two parent nodes with the minimum weight according to the link weight to form an edge ; S34)、 increase the virtual root node and connect it to all nodes without incoming edges, and the virtual root node as the input source for the task; S35), pruning redundant edges and deleting edges that can cause loops to obtain a directed acyclic graph; S4), dynamically partitioning the DNN model based on the non-continuous layer allocation mechanism and the dynamic programming algorithm DPA, and dynamically allocating the DNN non-continuous layer to different unmanned aerial vehicles; S5), performing DNN inference according to the topology network and the DNN model partitioning scheme; S6), updating the cache based on the priority and energy awareness strategy; S7), calculating the delay and overhead.
2. The method of claim 1, wherein the method is based on a DAG topology to generate a multi-UAV collaborative inference optimization method with dynamic DNN model partitioning. In step S3), the potential field includes task attraction and repulsion between unmanned aerial vehicles, the unmanned aerial vehicles are driven to gather in high-value areas by the task attraction, while the repulsion between unmanned aerial vehicles is used to avoid collision and interference; and high-potential nodes are screened by using the score function of the unmanned aerial vehicle clustering, a directed acyclic graph with minimized delay is generated, and a virtual root node is used to unify the task input source.
3. The method of claim 2, wherein the method is based on a DAG topology to generate a multi-UAV collaborative inference optimization method with dynamic DNN model partitioning. In step S3, the drone clustering scoring function is defined as: ; (6) In the formula, , , is a weight coefficient; is the transmission power of the unmanned aerial vehicle ; represents the communication radius; is the computing power of the unmanned aerial vehicle ; is the residual energy of the unmanned aerial vehicle ; is the maximum transmission power that can be reached in all unmanned aerial vehicles; is the maximum computing power that can be possessed in all unmanned aerial vehicles; is the maximum battery energy set in all unmanned aerial vehicles.
4. The method of claim 1, wherein the method is characterized in that: In step S4), the DNN model partitioning specifically comprises the following steps: S41), constructing a heterogeneous graph containing unmanned aerial vehicle nodes and DNN layer nodes based on the topology network of the unmanned aerial vehicle; S42), using the graph attention network GAT to encode the relationship between the unmanned aerial vehicle and the DNN model, and generating the optimal allocation probability between the unmanned aerial vehicle and the DNN layer based on the node features and topological relationship of the heterogeneous graph; S43), dynamically adjusting the layer allocation strategy based on the proximal optimization strategy PPO.
5. The method of claim 4, wherein the method is characterized in that: In step S42), the relationship between the unmanned aerial vehicle and the DNN model is encoded by using the graph attention network GAT, which comprises the following steps: S421)、projecting the feature vectors of the drone nodes and the DNN layer nodes into a high-dimensional space, respectively; , S422), calculating the correlation weight between nodes by using a multi-head attention mechanism, and each attention head independently learns the interaction relationship in different dimensions; S423) generating an allocation probability matrix for each drone pair DNN layer i.e.: ; (8) wherein, denotes a normalization function; and denote features of DNN layer nodes and drone nodes, respectively.
6. The method of claim 5, wherein the method is based on a DAG topology to generate a multi-UAV collaborative inference optimization method with dynamic DNN model partitioning. In step S43), the layer allocation strategy is dynamically adjusted based on the proximal optimization strategy PPO, which specifically comprises the following steps: S431), generating a layer allocation scheme according to the current strategy; S432), calculating the reward and constraint violation penalty; S433), optimizing the strategy network by gradient descent.
7. The method of claim 1, wherein the method further comprises: generating a DAG topology based on the dynamic DNN model partitioning. In step S6), each UAV is configured with a limited cache to store intermediate results and task inputs, where the cache state is represented by a matrix ; and the cache update is based on a priority and energy-aware strategy, specifically: S61)、calculating the priority of each layer in combination with complexity and data size i.e.: ; (18) wherein, is a layer of complexity; is a layer of output data size; , is a weight; S62), cache addition and cache elimination, if the cache is not full, directly store the newly allocated layer result, if the cache is full, remove the layer with the lowest priority; ; (19) In the formula, is the layer with the lowest priority; is the first layer with the priority; if the remaining energy , the high-computing layer is preferentially reserved; S63), state synchronization, broadcast the updated cache state to the adjacent unmanned aerial vehicles.
8. The method of claim 1, wherein the method further comprises: generating a DAG topology based on the dynamic DNN model partitioning. In step S7, the total delay time for task inference is completed including the computation delay time and the communication delay time, i.e.: ; (22) wherein, represents the layer executed by the drone, is an indicator function indicating whether there is cross-device communication; In pipeline mode, the computation latency is determined by the slowest drone and whether the cache hit, i.e.: ; (23) In the formula, denotes a layer distribution matrix; denotes a cache hit saving time; denotes a number of layers of the DNN model; denotes a complexity of the layer . The communication delay includes uplink, mesh and downlink phase delays, i.e.: ; (24) wherein , , are the uplink, grid and downlink phase delays, respectively; Wherein, ; (25) In the formula, represents the 5G uplink bandwidth from the vehicle to the UAV at the current time t; represents the size of the uplink task request data; represents the propagation delay; ; (26) wherein, denotes the number of drones in a cluster; denotes the number of drones between the drones transmission delay factor; denotes the communication bandwidth from the drones to denotes the output data from the drones to the drones ; ; (27) In the formula, the amount of data representing the final inference result; the cache saving time-consuming is represented as: ; (28) In the formula, to save time for caching; for a UAV computing power of the UAV; for a layer output data size.
Citation Information
Patent Citations
Four-network integration architecture for unmanned cluster system
CN118450403A
Unmanned aerial vehicle cluster control and navigation method based on MAPPO
CN119248009A