Unmanned aerial vehicle control method and electronic device
By constructing an interaction graph structure and graph neural network model among UAVs, the interaction relationships between neighboring UAVs are explicitly modeled, solving the problems of environmental adaptability and decision stability in multi-UAV systems, and achieving stable avoidance decisions and safe trajectory generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN INSTITUTE OF INFORMATION TECHNOLOGY
- Filing Date
- 2026-02-09
- Publication Date
- 2026-05-05
AI Technical Summary
Existing multi-UAV avoidance methods lack explicit and structured modeling of dynamic interaction relationships, resulting in limited environmental adaptability and system scalability, and making it difficult to balance real-time performance and decision stability.
By constructing an interaction graph structure among UAVs, using graph neural networks to train a flight decision model, explicitly modeling the interaction relationships between neighboring UAVs, predicting flight control information, and realizing distributed dynamic avoidance and safe trajectory generation.
It improves the stability and consistency of avoidance decisions in multi-UAV systems in dense encounters and complex obstacle environments, reduces the frequency of global replanning, and enhances the robustness and environmental adaptability of the system.
Smart Images

Figure CN121680472B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of unmanned aerial vehicle (UAV) control technology, and more specifically, to a UAV control method and electronic device. Background Technology
[0002] With the rapid development of drone technology, multi-drone systems are increasingly being used in logistics delivery, emergency rescue, agricultural plant protection, and urban inspection. In these application scenarios, multiple drones often need to coordinate their tasks in the same airspace, inevitably facing the risk of approaching each other or even colliding. Therefore, how to achieve efficient and safe autonomous avoidance decision-making has become a key technical challenge to ensure the reliable operation of multi-drone systems.
[0003] In existing technologies, multi-UAV obstacle avoidance mainly employs two types of methods: centralized global path planning and trajectory scheduling methods, and distributed local avoidance methods. Specifically, centralized global path planning and trajectory scheduling methods rely on a central controller to obtain the origin and destination information of all UAVs and a global environment map, utilizing A\ D\ Alternatively, optimization algorithms can generate conflict-free global flight paths and respond to environmental changes or state deviations through periodic replanning. Distributed local avoidance methods utilize local environmental information perceived by each UAV only by its own sensors and the relative state of neighboring UAVs, combined with local strategies such as artificial potential field method, velocity obstacle method (VO) method, and dynamic window method (DWA) method, to calculate the heading or speed adjustment amount in real time in each control cycle, so as to achieve instant avoidance of obstacles and other UAVs.
[0004] However, these existing methods lack explicit and structured modeling mechanisms for the dynamic interaction relationships between multiple UAVs, resulting in limited environmental adaptability and system scalability. At the same time, they also have the problem of difficulty in balancing real-time performance and decision stability. Summary of the Invention
[0005] The purpose of this application is to provide a drone control method and electronic device to address the shortcomings of the prior art, thereby solving the problems of limited environmental adaptability and system scalability, as well as the difficulty in balancing real-time performance and decision stability in the prior art.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0007] In a first aspect, one embodiment of this application provides a drone control method applied to a first drone in a multi-drone scenario, the multi-drone scenario including: a first drone and multiple second drones, the method comprising:
[0008] Acquire the first location information of the first UAV and the second location information of each of the second UAVs;
[0009] Based on the first location information of the first UAV and the second location information of each of the second UAVs, the first neighborhood information and the first local map of the first UAV are determined.
[0010] Based on the first location information, each of the second location information, the first neighborhood information, and the first local map, a target graph structure corresponding to the first UAV is constructed, and the node feature information and edge feature information of the target graph structure are determined. The target graph structure includes multiple nodes and edges between nodes, and each node represents either the first UAV or a second UAV located in the neighborhood of the first UAV.
[0011] The target graph structure corresponding to the first UAV, the node feature information and edge feature information of the target graph structure are input into the pre-trained flight decision model, and the flight control information of the first UAV is predicted by the flight decision model.
[0012] Based on the flight control information of the first UAV, control the flight of the first UAV.
[0013] In one possible implementation, determining the first neighborhood information and the first local map of the first UAV based on the first location information of the first UAV and the second location information of each of the second UAVs includes:
[0014] Based on the first location information of the first UAV, the second location information of each of the second UAVs, and the preset communication radius, the first neighborhood information of the first UAV is determined;
[0015] Obtain a global map of the multi-drone scene, and determine the first local map based on the global map, the field of view information of the first drone, and the first position information of the first drone.
[0016] In one possible implementation, the step of constructing a target graph structure corresponding to the first UAV based on the first location information, each of the second location information, the first neighborhood information, and the first local map, and determining the node feature information and edge feature information of the target graph structure, includes:
[0017] Based on the first neighborhood information, construct the target graph structure corresponding to the first UAV;
[0018] Based on the first location information, each of the second location information, the first local map, and the first neighborhood information, the node feature information of the target graph structure is determined;
[0019] Based on the first location information, each of the second location information, and the target graph structure, the edge feature information of the target graph structure is determined.
[0020] In one possible implementation, determining the node feature information of the target graph structure based on the first location information, each of the second location information, the first local map, and the first neighborhood information includes:
[0021] The current local map of the current drone is centralized to obtain a centralized local map, wherein the current drone is the drone corresponding to any node in the target graph structure;
[0022] The centralized local map is input into a pre-trained map convolutional neural network, which extracts and encodes map features from the centralized local map to generate the current local map encoding features of the current UAV.
[0023] Obtain the target endpoint of the current UAV, and determine the direction feature of the current endpoint based on the target endpoint of the current UAV and the current position information of the current UAV;
[0024] Determine the current motion direction characteristics of the current UAV at the previous moment;
[0025] Based on the current location information and the current neighborhood information of the current drone, the current neighborhood characteristics of the current drone are determined;
[0026] The current local map encoding features, the current destination direction features, the current movement direction features, and the current neighborhood features of the current UAV are used as the node feature information corresponding to the current UAV.
[0027] In one possible implementation, determining the current neighborhood features of the current UAV based on its current location information and its current neighborhood information includes:
[0028] The number of neighbors of the current drone is determined based on the current neighborhood information of the current drone;
[0029] Based on the current neighborhood information of the current drone, the current location information of the current drone, and the location information of each drone in the multi-drone scenario, the average neighborhood distance corresponding to the current drone is determined.
[0030] The current neighborhood characteristics of the current UAV are determined based on the number of neighborhoods and the average neighborhood distance.
[0031] In one possible implementation, determining the edge feature information of the target graph structure based on the first position information, each of the second position information, and the target graph structure includes:
[0032] The nodes corresponding to each second UAV in the target graph structure are traversed. For the current node, the direction vector and distance between the first UAV and the second UAV corresponding to the current node are calculated based on the first position information and the second position information of the second UAV corresponding to the current node. Based on the direction vector and distance between the first UAV and the second UAV corresponding to the current node, the edge feature information of the edge between the current node and the node corresponding to the first UAV is determined.
[0033] In one possible implementation, the flight decision model includes: a linear transformation layer, multiple multi-head graph attention policy networks, multiple post-processing layers, and an output layer connected in sequence;
[0034] The step of inputting the target graph structure corresponding to the first UAV, the node feature information and edge feature information of the target graph structure into a pre-trained flight decision model, and having the flight decision model predict the flight control information of the first UAV, includes:
[0035] The node feature information and edge feature information of the target graph structure are input into the linear transformation layer for linear transformation to obtain linear node feature information and linear edge feature information.
[0036] The target graph structure, the linear node feature information, and the linear edge feature information are input into the multiple multi-head graph attention strategy networks and multiple post-processing layers. The multiple multi-head graph attention strategy networks perform multi-head attention processing, and each post-processing layer performs output processing to obtain the feature vector of each node in the target graph structure.
[0037] The feature vectors of each node in the target graph structure are input into the output layer to obtain the scores of the first UAV in multiple flight directions, and each flight direction and the score of each flight direction are used as the flight control information.
[0038] In one possible implementation, the flight control information includes: multiple flight directions and scores for each flight direction; controlling the flight of the first UAV based on the flight control information of the first UAV includes:
[0039] Determine the flight trajectory constraint information of the first UAV in each flight direction and the target guidance constraint information of the first UAV in each flight direction;
[0040] Based on the scores corresponding to each flight direction, the flight trajectory constraint information, and the target guidance constraint information, the performance parameters of the first UAV in each flight direction are determined;
[0041] Based on the performance parameters of the first UAV in each flight direction, determine the target flight action of the first UAV;
[0042] Based on the target flight actions of the first drone, control the flight of the first drone.
[0043] In one possible implementation, determining the target flight maneuver of the first UAV based on its performance parameters in each flight direction includes:
[0044] Based on the performance parameters of the first UAV in each flight direction, the flight directions are sorted, and multiple candidate flight directions are determined according to a preset number threshold.
[0045] Based on the preset cost map, the cost value of each candidate flight direction is determined, and based on the cost value of each candidate flight direction, the target flight direction of the first UAV is determined.
[0046] The target flight action of the first UAV is determined based on the target flight direction of the first UAV.
[0047] Secondly, another embodiment of this application provides an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of any of the methods described in the first aspect above.
[0048] The beneficial effects of this application are as follows: By acquiring the first position information of the first UAV and the second position information of each second UAV, and determining the first neighborhood information and the first local map of the first UAV based on the first position information and the second position information of each second UAV, and constructing the target graph structure corresponding to the first UAV based on the first position information, the second position information, the first neighborhood information, and the first local map, the interaction relationship between neighboring UAVs can be explicitly represented as a graph structure, and the node feature information and edge feature information of the target graph structure can be determined. Thus, the target graph structure corresponding to the first UAV, the node feature information and edge feature information of the target graph structure are input into the pre-trained flight decision model, and the flight control information of the first UAV is predicted by the flight decision model. The interaction rules contained in the conflict-free trajectory can be extracted through the flight decision model, and more targeted avoidance responses can be made for key conflict sources. This realizes the distributed dynamic interactive avoidance and safe trajectory generation of the first UAV, reduces the trajectory from getting stuck in local oscillations, and thus controls the flight of the first UAV based on the flight control information of the first UAV, achieving stable flight of the first UAV in situations such as dense encounters of multiple UAVs and complex obstacles.
[0049] Meanwhile, instead of re-searching the global path at each decision moment, the system constructs a graph structure based on the current interaction relationships among multiple UAVs. UAV neighborhood information, local map data, and location information are used as node and edge features of this graph. The flight decision model then directly outputs the next direction decision through a single forward inference. Because the decision relies on local rather than globally complete information, adaptive corrections can be made through local observations even when there are local environmental disturbances or deviations from the reference route. This reduces the frequency of global replanning. Furthermore, the inference computation of the flight decision model is primarily related to the size of adjacent edges, avoiding the scalable overhead of global search on high-resolution maps. Moreover, as the interaction topology of the multiple UAVs changes during flight, the graph input can be updated in real time, allowing the flight decision model to complete decisions within the same computational framework, thus enhancing the robustness of UAV control. Attached Figure Description
[0050] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained from these drawings without creative effort.
[0051] Figure 1 A flowchart illustrating an embodiment of the unmanned aerial vehicle (UAV) control method provided in this application;
[0052] Figure 2 A flowchart illustrating the process of determining the first neighborhood information and the first local map of a first UAV in the UAV control method provided in this application embodiment;
[0053] Figure 3 This is a flowchart illustrating the process of constructing a target graph structure corresponding to a first UAV and determining the node feature information and edge feature information of the target graph structure in the UAV control method provided in this application embodiment.
[0054] Figure 4 A flowchart illustrating the process of determining node feature information of a target graph structure in the UAV control method provided in this application embodiment;
[0055] Figure 5 A schematic diagram of a map convolutional neural network in the UAV control method provided in this application embodiment;
[0056] Figure 6 This is a flowchart illustrating the process of determining the current neighborhood features of the current drone in the drone control method provided in this application embodiment;
[0057] Figure 7 A schematic diagram of a flight decision model in the UAV control method provided in this application embodiment;
[0058] Figure 8 This is a schematic flowchart illustrating the process of predicting and obtaining flight control information of a first UAV in the UAV control method provided in this application embodiment.
[0059] Figure 9 A flowchart illustrating the control of a first UAV flight in the UAV control method provided in this application embodiment;
[0060] Figure 10 A flowchart illustrating the process of determining the target flight action of a first UAV in the UAV control method provided in this application embodiment;
[0061] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0062] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0063] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0064] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0065] Existing multi-UAV avoidance methods struggle to effectively differentiate the influence weight of neighboring individuals on the current decision, failing to prioritize responses to high-risk conflict targets and limiting their applicability in high-density flight environments. Therefore, the lack of explicit, structured modeling mechanisms for the dynamic interactions between multiple UAVs restricts environmental adaptability and system scalability, while also presenting challenges in balancing real-time performance with decision stability.
[0066] Based on the aforementioned problems, this application proposes a UAV control method for application scenarios where multiple UAVs fly simultaneously in the same mission airspace, approach each other, and may collide. Unlike methods that rely on centralized global planning or local avoidance based solely on manual rules, this method uses explicit modeling of interaction relationships as its core idea. At each decision-making moment, an interaction graph structure is constructed based on the communication relationships between UAVs. A flight decision model is then trained using a graph neural network. The flight decision model performs message passing and feature aggregation on this interaction graph structure, adaptively fusing the influence of neighbors on the current decision while preserving individual information. This extracts the interaction patterns and avoidance modes inherent in the conflict-free flight of multiple UAVs, thereby achieving control of the UAVs. Simultaneously, it can improve the stability and consistency of avoidance decisions in situations such as dense encounters of multiple UAVs and complex obstacles, alleviating the problems of easy oscillation and local optima in existing technologies, and reducing the dependence on global information and real-time replanning calculations.
[0067] First, the application scenarios involved in the drone control method provided in the embodiments of this application will be described in detail.
[0068] It is understood that the UAV control method provided in this application relates to the field of autonomous flight and multi-agent avoidance control of UAVs, specifically to application scenarios in which multiple UAVs fly simultaneously in the same mission airspace, approach each other, and may collide.
[0069] For example, this application scenario may include multiple drones, each with a corresponding starting point and ending point, and each drone performing a task to fly from the starting point to the ending point. Each drone can execute the steps of the drone control method provided in this application embodiment within its own control cycle to achieve flight control.
[0070] Specifically, the environment of this application scenario can be represented by a cost map or an occupied grid, where obstacle areas are impassable or have extremely high costs.
[0071] The following describes the steps of the drone control method provided in the embodiments of this application, taking any drone as the first drone as an example.
[0072] In this application embodiment, in a multi-drone scenario, all drones other than the first drone are referred to as the second drone. Furthermore, the following embodiments of this application illustrate the scenario where the drone's speed amplitude is constant during the mission execution phase and the control cycle is fixed; that is, the displacement step size of each control time step is constant.
[0073] Figure 1 This is a flowchart illustrating a drone control method provided in an embodiment of this application, with reference to... Figure 1As shown, the executing entity of this method can be any electronic device with processing capabilities, such as the aforementioned first UAV. The method includes:
[0074] S101. Obtain the first position information of the first UAV and the second position information of each of the second UAVs.
[0075] Optionally, to control the timing within the cycle. For example, the first location information of the first drone and the second location information of each second drone at the current moment can be obtained through technologies such as drone positioning.
[0076] The first position information and each of the second position information are located in the same coordinate system.
[0077] S102. Based on the first location information of the first UAV and the second location information of each of the second UAVs, determine the first neighborhood information and the first local map of the first UAV.
[0078] Optionally, after obtaining the first location information of the first UAV and the second location information of each of the second UAVs, position calculations can be performed based on the first location information of the first UAV and the second location information of each of the second UAVs to obtain the first neighborhood information of the first UAV and the first local map.
[0079] The first neighborhood information is used to indicate the second drone within the neighborhood of the first drone. The first local map is the local field-of-view map of the first drone.
[0080] In one example, after obtaining the first location information of the first UAV and the second location information of each of the second UAVs, the first neighborhood information and the first local map of the first UAV can be determined according to the preset communication radius and the preset visible field of view.
[0081] In another example, after obtaining the first location information of the first UAV and the second location information of each second UAV, the first neighborhood information of the first UAV can be determined according to the communication range of each UAV, and the first local map of the first UAV can be determined according to the visible field of view of each UAV.
[0082] S103. Based on the first location information, each second location information, the first neighborhood information, and the first local map, construct the target graph structure corresponding to the first UAV, and determine the node feature information and edge feature information of the target graph structure.
[0083] Optionally, after obtaining the first neighborhood information and the first local map, a target map structure corresponding to the first UAV can be constructed based on the first neighborhood information, the first location information, and each second location information.
[0084] Optionally, node feature information and edge feature information of the target graph structure are calculated based on the first location information, each of the second location information, the first neighborhood information, and the first local map.
[0085] The target graph structure includes multiple nodes and edges between nodes, with each node representing either a first UAV or a second UAV located in the neighborhood of the first UAV.
[0086] Among them, node feature information is used to characterize the feature information of each node in the target graph structure. Specifically, node feature information is used to characterize the local map features, orientation features, and neighborhood features of the first UAV and each second UAV located in the neighborhood of the first UAV.
[0087] Among them, edge feature information is used to characterize the distance features of the second UAV relative to the first UAV, which is located in the neighborhood of the first UAV in the target graph structure.
[0088] S104. Input the target graph structure, node feature information and edge feature information of the target graph structure corresponding to the first UAV into the pre-trained flight decision model, and the flight control information of the first UAV is predicted by the flight decision model.
[0089] Optionally, the target graph structure corresponding to the first UAV, the node feature information of the target graph structure, and the edge feature information can be input into the pre-trained flight decision model, and the flight decision model can predict the flight control information of the first UAV based on the target graph structure corresponding to the first UAV, the node feature information of the target graph structure, and the edge feature information.
[0090] The flight decision model can be a model trained based on a Graph Attention Policy Network. Flight control information includes the flight direction of the first UAV. Optionally, the flight control information may also include the flight distance of the first UAV.
[0091] By using a flight decision model to predict based on the target graph structure corresponding to the first UAV, the node feature information of the target graph structure, and the edge feature information, each UAV can adaptively allocate attention weights based on the neighbor node features and edge geometry information when making decisions, thereby highlighting neighbor individuals with higher potential collision risk and greater impact on path planning.
[0092] S105. Based on the flight control information of the first UAV, control the flight of the first UAV.
[0093] Optionally, after obtaining the flight control information of the first UAV, the first UAV can be controlled to fly in the flight direction indicated by the flight control information.
[0094] In this embodiment, by acquiring the first position information of the first UAV and the second position information of each of the second UAVs, and determining the first neighborhood information and the first local map of the first UAV based on the first position information and the second position information of each of the second UAVs, a target graph structure corresponding to the first UAV is constructed based on the first position information, the second position information, the first neighborhood information, and the first local map. This allows the interaction relationship between neighboring UAVs to be explicitly represented as a graph structure, and the node feature information and edge feature information of the target graph structure are determined. The target graph structure corresponding to the first UAV, the node feature information and edge feature information of the target graph structure are then input into a pre-trained flight decision model. The flight decision model predicts the flight control information of the first UAV. The interaction patterns contained in the conflict-free trajectory can be extracted through the flight decision model, and more targeted avoidance responses can be made for key conflict sources. This achieves distributed dynamic interactive avoidance and safe trajectory generation of the first UAV, reducing the trajectory from getting stuck in local oscillations. Based on the flight control information of the first UAV, the flight of the first UAV is controlled, and the stable flight of the first UAV is achieved in situations such as dense encounters of multiple UAVs and complex obstacles.
[0095] Meanwhile, instead of re-searching the global path at each decision moment, the system constructs a graph structure based on the current interaction relationships among multiple UAVs. UAV neighborhood information, local map data, and location information are used as node and edge features of this graph. The flight decision model then directly outputs the next direction decision through a single forward inference. Because the decision relies on local rather than globally complete information, adaptive corrections can be made through local observations even when there are local environmental disturbances or deviations from the reference route. This reduces the frequency of global replanning. Furthermore, the inference computation of the flight decision model is primarily related to the size of adjacent edges, avoiding the scalable overhead of global search on high-resolution maps. Moreover, as the interaction topology of the multiple UAVs changes during flight, the graph input can be updated in real time, allowing the flight decision model to complete decisions within the same computational framework, thus enhancing the robustness of UAV control.
[0096] In one possible implementation, Figure 2 A flowchart illustrating the process of determining the first neighborhood information and the first local map of the first UAV in the UAV control method provided in this application embodiment is shown below. Figure 2 As shown, in step S102 above, determining the first neighborhood information and the first local map of the first UAV based on the first location information of the first UAV and the second location information of each of the second UAVs includes:
[0097] S201. Determine the first neighborhood information of the first UAV based on the first location information of the first UAV, the second location information of each second UAV, and the preset communication radius.
[0098] Optionally, the communication distance between the first UAV and each of the second UAVs can be calculated based on the first location information of the first UAV and the second location information of each of the second UAVs. The communication distance between the first UAV and each of the second UAVs can be compared with a preset communication radius. When the communication distance is less than or equal to the preset communication radius, the corresponding second UAV is determined to be within the neighborhood of the first UAV, and the second UAV is added to the first neighborhood information of the first UAV.
[0099] S202. Obtain a global map of the multi-drone scene, and determine a first local map based on the global map, the field of view information of the first drone, and the first position information of the first drone.
[0100] Optionally, a global map of a multi-drone scene can be acquired, and a first global map of the first drone can be determined from the global map based on the field of view information and the first position information of the first drone.
[0101] The global map refers to the global binary raster map of a multi-drone scene. Specifically, a 1 in the global binary raster map indicates that the corresponding raster is an obstacle and cannot be passed, while a 0 in the global binary raster map indicates that the corresponding raster is passable.
[0102] The field of vision information of the first UAV includes the visible field of vision range of the first UAV.
[0103] For example, it can be done via drones Visible field of view First location information of the first UAV and global binarized raster map Determine the drone At any moment Local map For details, please refer to the following formula (1):
[0104] (1)
[0105] in, These are the x and y coordinates of any point on the local map, respectively. , The radius of the field of view is determined by the visible field of view. , For global binarized raster maps, The length of the dimension is M1 refers to and ,at this time, In the global map, M2 refers to Outside the global map, at this time Viewed as an obstacle .
[0106] Alternatively, the steps S201-S202 above can be referred to determine the second neighborhood information and the second local map for each second UAV.
[0107] In one possible implementation, Figure 3 This is a flowchart illustrating the process of constructing a target graph structure corresponding to a first UAV and determining the node feature information and edge feature information of the target graph structure in the UAV control method provided in this application embodiment. (Refer to...) Figure 3 As shown, in S103 above, based on the first location information, each of the second location information, the first neighborhood information, and the first local map, a target graph structure corresponding to the first UAV is constructed, and the node feature information and edge feature information of the target graph structure are determined, including:
[0108] S301. Based on the first neighborhood information, construct the target graph structure corresponding to the first UAV.
[0109] Optionally, the target graph structure corresponding to the first UAV can be constructed based on the first neighborhood information.
[0110] Specifically, based on the first neighborhood information, the first UAV and each of the second UAVs in the neighborhood of the first UAV are treated as nodes, and the connection between the first UAV and each of the second UAVs is treated as the edge between the node corresponding to the first UAV and the node corresponding to each of the second UAVs, thereby obtaining the target graph structure corresponding to the first UAV.
[0111] S302. Based on the first location information, each of the second location information, the first local map, and the first neighborhood information, determine the node feature information of the target graph structure.
[0112] Optionally, after obtaining the target graph structure, based on the first location information, each second location information, the first local map, and the first neighborhood information, the local map features, orientation features, and neighborhood features of the nodes corresponding to the first UAV and the nodes corresponding to each second UAV located in the neighborhood of the first UAV are calculated, and the local map features, orientation features, and neighborhood features of each node are used as the node feature information of the target graph structure.
[0113] Among them, the local map feature is the encoded feature of the local map of the UAV corresponding to the node. The direction feature is the encoded feature used to indicate the direction of the UAV corresponding to the node. The neighborhood feature is the encoded feature of the neighborhood information of the UAV corresponding to the node.
[0114] For example, each node in the target graph structure can be traversed. For each node, the drone corresponding to each node is taken as the first drone. Based on the first location information of the first drone, the second location information of each second drone corresponding to the first drone, the first local map of the first drone, and the first neighborhood information of the first drone, the node feature information of each node can be calculated to obtain the node feature information of the target graph structure.
[0115] S303. Based on the first position information, each of the second position information and the target graph structure, determine the edge feature information of the target graph structure.
[0116] Optionally, the nodes corresponding to each second UAV in the target graph structure can be traversed, and for each node, edge feature information can be calculated based on the first position information and the second position information.
[0117] By constructing a target graph structure and determining the node and edge features of the target graph structure, the flight decision model can simultaneously consider individual states, target approach requirements, and inter-drone conflict risks. This allows each drone to focus on neighboring drones that have the greatest impact on its own safety and avoidance decisions, thereby forming interactive relationship inputs that can be used for real-time avoidance decisions without relying on global information, and improving scalability and stability in dense interaction scenarios.
[0118] In one possible implementation, Figure 4 This is a flowchart illustrating the process of determining node feature information of a target graph structure in the UAV control method provided in this application embodiment, with reference to... Figure 4 As shown, in step S302 above, the node feature information of the target graph structure is determined based on the first location information, each of the second location information, the first local map, and the first neighborhood information, including:
[0119] S401. The current local map of the current drone is centralized to obtain the centralized local map.
[0120] Optionally, taking the current drone as the first drone as an example, the first local map of the first drone can be centralized to obtain the centralized first local map.
[0121] Optionally, taking the current drone as the second drone as an example, the second local map of the second drone can be determined with reference to the aforementioned S202, and the second local map of the second drone can be centralized to obtain the centralized second local map.
[0122] For example, centralization can be an interpolation of the current local map with a preset center value.
[0123] For example, current drones At any moment The current local map after centralized processing The following formula (2) can be used as a reference:
[0124] (2)
[0125] in, For the current local map The current drone is the drone corresponding to any node in the target graph structure.
[0126] S402. Input the centralized local map into the pre-trained map convolutional neural network. The map convolutional neural network extracts and encodes the map features of the centralized local map to generate the current local map encoding features of the current UAV.
[0127] Optionally, the centered local map can be input into a pre-trained map convolutional neural network (MCNN), which will then extract and encode map features from the centered local map to generate the current local map encoding features of the UAV. .
[0128] For example, Figure 5 This is a schematic diagram of a map convolutional neural network (MCNN) in the UAV control method provided in this application embodiment. The map convolutional neural network includes: four convolutional layers (Conv2d, kernel=3), two pooling layers (MaxPool2d), an adaptive pooling layer (AdaptiveAvgPool2d), and a linear layer, representing the current local map after centralization. After passing through four convolutional layers and two pooling layers, an adaptive pooling layer and a linear layer are then applied to obtain the current local map encoding features. .
[0129] Due to the original local raster map information Typically large in size, MCNN extracts features from local maps through multiple convolutional layers, such as the shape and relative position of obstacles. This information is crucial for the drone's path planning and obstacle avoidance decisions.
[0130] Map convolutional neural networks (MCNNs) can be used to transform the current local map after centralization. This information is encoded into a low-dimensional feature vector output, enabling subsequent flight decision models to process this information more effectively.
[0131] S403. Obtain the target endpoint of the current UAV. Based on the target endpoint of the current UAV and the current position information of the current UAV, determine the direction characteristics of the current endpoint.
[0132] Optionally, taking the current drone as the first drone as an example, the target endpoint of the first drone can be obtained, and the first endpoint direction feature of the first drone can be calculated based on the target endpoint of the first drone and the first position information of the first drone.
[0133] Optionally, taking the current drone as the second drone as an example, the target endpoint of the second drone can be obtained, and the second endpoint direction feature of the second drone can be calculated based on the target endpoint of the second drone and the second position information of the second drone.
[0134] For example, based on the target endpoint of the current drone and the current position information of the current drone, the direction vector of the current endpoint of the current drone relative to the current position of the current drone can be calculated, and the obtained direction vector can be used as the direction feature of the current endpoint of the current drone. .
[0135] By anchoring the mission consistency through the current destination direction features, the drone avoids continuous deviation from the target due to excessive local avoidance, thereby reducing the trajectory jitter amplitude.
[0136] S404. Determine the current motion direction characteristics of the UAV at the previous moment.
[0137] Optionally, the motion direction vector of the current UAV at the previous moment can be determined based on the previous position information of the current UAV at the previous moment, and the motion direction vector of the current UAV at the previous moment can be used as the current motion direction feature of the current UAV at the previous moment. .
[0138] By providing explicit inertial constraints based on the current motion direction characteristics, the flight decision model can suppress abrupt changes in direction during convergence, thereby improving decision stability.
[0139] S405. Based on the current location information of the UAV and the current neighborhood information of the UAV, determine the current neighborhood characteristics of the UAV.
[0140] Optionally, the current neighborhood features of the current UAV can be calculated based on the current location information and the current neighborhood information of the current UAV. .
[0141] For example, the number of neighbors of the current drone can be determined based on the current neighborhood information of the current drone, and the current neighborhood features of the current drone can be constructed based on the average distance between the current drone and its neighbors and the number of neighbors of the current drone.
[0142] S406. Use the current local map encoding features, current destination direction features, current motion direction features, and current neighborhood features of the current UAV as the node feature information corresponding to the current UAV.
[0143] Optionally, current drones At any moment The corresponding node feature information It can be expressed as the following formula (3):
[0144] (3)
[0145] in, The current local map encoding features, The current destination direction feature, The current direction of motion is characterized. This represents the current neighborhood features.
[0146] By using the current local map encoding features, current destination direction features, current motion direction features, and current neighborhood features of the current UAV as the node feature information corresponding to the current UAV, the current neighborhood features can provide group priors, and the current destination direction features and current motion direction features can provide individual intentions. This allows for the explicit expression of key factors leading to interaction conflicts and avoidance needs at the feature level, improving the ability to discriminate and the effectiveness of decisions in dense interaction scenarios. As a result, the flight decision model can complete cross-dimensional collaborative reasoning on the graph structure, enabling each UAV to focus on neighboring UAVs that have the greatest impact on its own safety and avoidance decisions. This allows for the formation of interactive relationship inputs that can be used for real-time avoidance decisions without relying on global information, and improves the scalability and stability in dense interaction scenarios.
[0147] In one possible implementation, Figure 6 This is a flowchart illustrating the process of determining the current neighborhood features of the current drone in the drone control method provided in this application embodiment, with reference to... Figure 6 As shown, in step S405 above, the current neighborhood characteristics of the current UAV are determined based on the current location information and the current neighborhood information of the current UAV, including:
[0148] S601. Determine the number of neighbors of the current UAV based on the current neighborhood information of the current UAV.
[0149] Optionally, the number of neighbors of the current drone can be determined from the current neighborhood information of the current drone. The number of neighbors of the current drone refers to the number of second drones within the current drone's neighborhood when the current drone is used as the first drone.
[0150] S602. Based on the current neighborhood information of the current drone, the current location information of the current drone, and the location information of each drone in a multi-drone scenario, determine the average neighborhood distance corresponding to the current drone.
[0151] Optionally, taking the current drone as the first drone as an example, the distances between each second drone and the first drone in the neighborhood of the first drone can be calculated based on the first drone's first neighborhood information, the first drone's first location information, and the location information of each drone in the multi-drone scenario. These distances are then used as the neighborhood distances between each second drone and the first drone. The neighborhood distances between all second drones and the first drone are summed to obtain the sum of neighborhood distances. The ratio of the sum of neighborhood distances to the number of second drones is then calculated to obtain the average neighborhood distance of the first drone.
[0152] In other words, when determining the average neighborhood distance of the current drone, the current drone is always taken as the first drone, and the average neighborhood distance of the current drone is determined based on the first neighborhood information, the first location information, and the second location information of each second drone when the current drone is taken as the first drone.
[0153] S603. Determine the current neighborhood characteristics of the current UAV based on the number of neighborhoods and the average neighborhood distance.
[0154] Optionally, a target vector can be generated based on the number of neighbors and the average neighborhood distance, and the target vector can be used as the current neighborhood feature of the current UAV.
[0155] For example, the number of neighborhoods is used as the value of the first dimension of the target vector, and the mean neighborhood distance is used as the second dimension of the target vector.
[0156] By determining the number of neighborhoods and the mean neighborhood distance, and using these factors to determine the current neighborhood features of the UAV, a low-dimensional, fixed-length, scale-robust, and semantically clear neighborhood state summary can be obtained, thereby improving the decision-making accuracy of the flight decision model.
[0157] In one possible implementation, the step S303 above, which determines the edge feature information of the target graph structure based on the first position information, each of the second position information, and the target graph structure, includes:
[0158] Traverse the nodes corresponding to each second UAV in the target graph structure. For the current node, calculate the direction vector and distance between the first UAV and the second UAV corresponding to the current node based on the first position information and the second position information of the second UAV corresponding to the current node. Then, determine the edge feature information of the edge between the current node and the node corresponding to the first UAV based on the direction vector and distance between the first UAV and the second UAV corresponding to the current node.
[0159] Optionally, the nodes corresponding to each second UAV in the target graph structure can be traversed, and for the current traversed node, based on the first UAV... The first location information and the second drone corresponding to the current node The second location information is used to calculate the first drone. The second drone corresponding to the current node The direction vector and distance, and based on the first UAV The second drone corresponding to the current node The direction vector and distance are used to calculate the distance between the current node and the first UAV. Edge feature information of the edges between corresponding nodes.
[0160] For example, the first drone The corresponding node and the second drone Edge feature information of the edges formed by the corresponding nodes The following formula (4) can be used to obtain the result:
[0161] (4)
[0162] in, For the first drone First location information For the second drone Second location information, .
[0163] By simultaneously encoding the relative direction vector and the Euclidean distance to obtain edge feature information, the flight decision model can explicitly perceive the local geometric relationships between neighboring UAVs, thereby improving the accuracy of control.
[0164] In one possible implementation, Figure 7 This is a schematic diagram of a flight decision model in the UAV control method provided in an embodiment of this application. Figure 8 This is a flowchart illustrating the process of predicting and obtaining flight control information of a first UAV in the UAV control method provided in this application embodiment, with reference to... Figure 7 as well as Figure 8 As shown, the flight decision model includes: a linear transformation layer, multiple multi-head graph attention policy networks, multiple post-processing layers, and an output layer connected in sequence. In S104 above, the target graph structure corresponding to the first UAV, the node feature information of the target graph structure, and the edge feature information are input into the pre-trained flight decision model. The flight decision model then predicts the flight control information of the first UAV, including:
[0165] S801. Input the node feature information and edge feature information of the target graph structure into the linear transformation layer for linear transformation to obtain linear node feature information and linear edge feature information.
[0166] Optionally, the node feature information and edge feature information of the target graph structure are input into the linear transformation layer, and the linear transformation layer processes the node feature information of each node. and edge feature information for each edge. Perform linear transformation ( ), to obtain linear node feature information and linear edge feature information For details, please refer to the following formula (5):
[0167] (5)
[0168] in, and These are the weight parameters for the linear transformation layer.
[0169] S802. Input the target graph structure, linear node feature information, and linear edge feature information into multiple multi-head graph attention strategy networks and multiple post-processing layers. The multi-head graph attention strategy networks perform multi-head attention processing, and the post-processing layers perform output processing to obtain the feature vectors of each node in the target graph structure.
[0170] Optionally, the multi-head graph attention strategy network includes multiple attention heads, and the post-processing layer includes a normalization layer and a ReLU layer. The multi-head graph attention strategy network first calculates the attention score of each edge, then calculates the attention score of each head, thereby obtaining the attention weights between nodes. Based on the attention weights between nodes, the feature vector of each node is obtained. After processing by the post-processing layer, the feature vectors of each node in the target graph structure are obtained.
[0171] For example, continue to refer to Figure 7 As shown, The multi-head graph attention policy network has a certain number of layers. The attention score for each edge is calculated using the multi-head graph attention policy network, with nodes... To the node Taking the edge as an example, the features of the two nodes after the linear transformation and the connecting edge are combined, along with the first... Multi-head attention weight parameters Get the attention score of the edge corresponding to each attention. As shown in the following formula (6):
[0172] (6)
[0173] in, Indicates the first The first layer of multi-head graph attention strategy network The attention parameter vector corresponding to each attention head This represents the total number of heads of attention. It's LeakyReLU. This indicates a splicing operation.
[0174] For example, in obtaining the node After calculating the attention score of each connected head, normalization is performed to obtain the node. Relative to node Attention weights As shown in the following formula (7):
[0175] (7)
[0176] in, Represents a node The set of neighboring nodes. Based on this, based on each node's relationship to the central node. The attention weights are used to obtain the nodes of each attention head. Eigenvalues after weighted summation As shown in the following formula (8):
[0177] (8)
[0178] For example, for the output features of H attention heads, the feature values are concatenated to obtain the concatenated feature values. As shown in the following formula (9):
[0179] (9)
[0180] Based on this, residual connections are introduced, and nodes of each attention map convolutional layer are obtained through normalization and ReLU layers. The feature output is shown in the following formula (10):
[0181] (10)
[0182] in, This indicates the normalization layer.
[0183] S803. Input the feature vectors of each node in the target graph structure into the output layer to obtain the scores of the first UAV in multiple flight directions, and use each flight direction and the score of each flight direction as flight control information.
[0184] Optionally, the output layer includes a linear layer and a ReLU layer, after which... The convolutional layer of the layer graph yields the feature vector of each node. After passing through a linear layer and a ReLU layer, each node... Output vector The scores represent different actions, that is, scores for different flight directions. .
[0185] For example, the first drone may include eight flight directions, each flight direction serving as an action category to characterize the motion direction decision at each step, and the direction vectors corresponding to the eight action categories. The following formula (11) is used:
[0186] (11)
[0187] By using a multi-head graph attention strategy network to compute the target graph structure, it is possible to extract the group representation required for multi-UAV interactive avoidance by fusing neighbor information and edge features through multi-layer message passing. At the output end, it provides a decision result for the next movement direction for each UAV, enabling UAVs to quickly generate executable avoidance directions in each control cycle, forming a distributed, real-time interactive avoidance decision-making capability.
[0188] In one possible implementation, the flight control information includes: multiple flight directions and scores for each flight direction; Figure 9 This is a schematic flowchart illustrating the process of controlling the flight of a first UAV in the UAV control method provided in this application embodiment, with reference to... Figure 9 As shown, in S105 above, controlling the flight of the first UAV based on the flight control information of the first UAV includes:
[0189] S901. Determine the flight trajectory constraint information of the first UAV in each flight direction and the target guidance constraint information of the first UAV in each flight direction.
[0190] Optionally, during real-time flight, the offline-trained flight decision model obtains a score vector for each candidate flight direction. Then, the flight trajectory constraint information of the first UAV in each flight direction and the target guidance constraint information of the first UAV in each flight direction are calculated.
[0191] Among them, the flight trajectory constraint information is used to characterize the turning amplitude of the first UAV in each flight direction. The flight trajectory constraint information can constrain the UAV from sudden changes of direction or large changes of direction during flight, and encourage the UAV to move smoothly along the existing course, making it more in line with the inertial characteristics of actual flight.
[0192] Among them, the target guidance constraint information is used to describe the orientation of the first UAV relative to the target in each flight direction.
[0193] For example, the flight trajectory constraint information can be obtained by calculating the dot product of each flight direction of the first UAV at the current moment and the flight direction of the first UAV at the previous moment.
[0194] Specifically, it iterates through each flight direction and calculates the current flight direction. Flight direction at the previous moment The dot product is used as the flight trajectory constraint information in the current flight direction. .
[0195] For example, the target direction can be determined based on the first position information of the first UAV and the position of the target endpoint, and the target direction can be multiplied by the dot product of the flight directions of the first UAV at the current moment to obtain the target guidance constraint information.
[0196] Specifically, it iterates through each flight direction and calculates the current flight direction. The dot product of the current flight direction and the target direction serves as the target guidance constraint information for the current flight direction. .
[0197] S902. Based on the scores, flight trajectory constraint information, and target guidance constraint information corresponding to each flight direction, determine the performance parameters of the first UAV in each flight direction.
[0198] Optionally, after obtaining the flight trajectory constraint information and the target guidance constraint information, the performance parameters of the first UAV in each flight direction can be determined based on the score corresponding to each flight direction, the flight trajectory constraint information, and the target guidance constraint information.
[0199] For example, the first drone is in its current flight direction Performance parameters For details, please refer to the following formula (12):
[0200] (12)
[0201] in, , Current flight direction Flight direction label, These are the weighting coefficients.
[0202] S903. Based on the performance parameters of the first UAV in each flight direction, determine the target flight action of the first UAV.
[0203] Optionally, after obtaining the performance parameters of the first UAV in each flight direction, the flight directions can be filtered according to the performance parameters of the first UAV in each flight direction to determine the target flight direction, and the target flight action of the first UAV can be determined according to the target flight direction.
[0204] For example, the flight direction corresponding to the maximum value of the performance parameters of the first UAV in each flight direction can be taken as the target flight direction.
[0205] For example, continuing with the case where the displacement step size of each control time step is constant, the target flight direction and the fixed displacement step size are taken as the target flight action.
[0206] S904. Control the flight of the first UAV based on the target flight actions of the first UAV.
[0207] Optionally, the first UAV can be controlled to fly according to the target flight maneuvers.
[0208] By determining the performance parameters of the first UAV in each flight direction, and based on these parameters, the target flight maneuvers of the first UAV are determined, enabling the UAV to advance towards the target endpoint while coordinating with other UAVs, effectively alleviating local congestion and reducing the risk of collision.
[0209] In one possible implementation, Figure 10 This is a flowchart illustrating the process of determining the target flight action of the first UAV in the UAV control method provided in this application embodiment, with reference to... Figure 10As shown, S903 determines the target flight maneuvers of the first UAV based on its performance parameters in each flight direction, including:
[0210] S1001. Based on the performance parameters of the first UAV in each flight direction, sort the flight directions and determine multiple candidate flight directions according to a preset quantity threshold.
[0211] Optionally, the flight directions can be sorted from high to low according to the performance parameters of the first UAV in each flight direction to obtain the sorting results of each flight direction, and multiple candidate flight directions can be determined from the sorting results according to a preset quantity threshold.
[0212] S1002. Based on the preset cost map, determine the cost value of each candidate flight direction, and based on the cost value of each candidate flight direction, determine the target flight direction of the first UAV.
[0213] Optionally, the cost value of each candidate flight direction can be determined based on a preset cost map, and the candidate flight direction with the lowest cost can be selected as the target flight direction of the first UAV based on the cost value of each candidate flight direction.
[0214] The cost of each candidate flight direction refers to the cost of the first UAV traveling from its current position to the target destination along the candidate flight direction.
[0215] For example, a preset cost map It is possible to pre-construct a global map for multi-drone scenarios and obtain the arrival cost from any feasible location to its corresponding target.
[0216] Specifically, this cost map serves as a static global prior during the mission execution phase, providing the online decision-making module with global cost information from the current grid to the target, thereby guiding the UAV to advance more robustly toward the target area in complex terrain.
[0217] During calculation, the cumulative cost of reaching any grid cell can be calculated using Dijkstra's algorithm, starting from the target endpoint. Specifically, starting from the target endpoint, Dijkstra's algorithm iteratively updates the cumulative cost of reaching each grid cell. Each step has a cost of 1 if moving horizontally or vertically, and a cost of 0 if moving diagonally. If a neighboring grid is an obstacle, then no edge is created from the current grid to that neighbor (equivalent to incurring an infinite cost).
[0218] For any position on the grid Corresponding cost map The cost from this location to the target can be described by the following formula (13):
[0219] (13)
[0220] in, Indicates position The cost value at the endpoint is 0 in the 8-directional neighborhood. From position arrive The single-step cost is 1 or Neighboring obstacles are considered unreachable. Through the above iterations, the cost distribution of all locations on the entire grid map can be obtained, resulting in a cost map. .
[0221] S1003. Determine the target flight action of the first UAV based on the target flight direction of the first UAV.
[0222] For example, continuing with the case where the displacement step size of each control time step is constant, the fixed displacement step size is used as the flight distance, and the target flight direction and the fixed displacement step size are used as the target flight action.
[0223] By introducing a cost map, we can avoid the result from a single greedy choice getting stuck in a local optimum, while retaining a certain degree of decision diversity, so that the drone can continue to move towards the global goal under the premise of local safety and feasibility.
[0224] Optionally, the flight decision model can be obtained in advance through offline training. In the offline training stage, training samples are first constructed from the flight trajectories of multiple UAVs, and the relative relationship between environmental information and neighboring UAVs is organized into graph structure data. Then, the initial flight decision model is used to perform representation learning and feature extraction on the samples until the training is completed, and the flight decision model is obtained.
[0225] Specifically, set This refers to drones At any moment The location coordinates, at the same time For direction decision, the position update can be expressed as the following formula (14):
[0226] (14)
[0227] in, Indicates directional decision The corresponding unit direction vector, This indicates a fixed step size.
[0228] Then, A is used based on the global map. The planning method generates a collision-free reference path for each drone, thus generating a collision-free trajectory for each drone. The following formula (15) is given:
[0229] (15)
[0230] Among them, there are , Indicates the number of drones, and They represent drones The starting and ending coordinates, the trajectory includes different drones from the starting point to the ending point at different times. Position coordinates and unit direction vector .
[0231] Subsequently, the trajectory sequence of each drone swarm was expanded into multiple training samples over time, with one sample corresponding to each time step. The sample contains the current position coordinates Unit direction vector And maps showing local areas .
[0232] Based on this, a supervisory label is generated for each sample according to the drone trajectory generated offline.
[0233] Specifically, the first Reference motion unit direction at each time step It is quantized into a discrete direction category in a predefined set of actions and used as the label for the sample at that time step.
[0234] For example, eight basic directions are predefined as action categories to represent the motion direction decision for each step. The direction vectors corresponding to the eight action categories are... This can be expressed as the following formula (11):
[0235] (11)
[0236] Calculate the unit direction vector for each category Then, the direction of the reference motion unit in the drone's flight trajectory. By performing a comparative calculation, the category corresponding to the closest direction is obtained, which is the label after discretization of the direction vector. The calculation is as follows (16):
[0237] (16)
[0238] in, That is, time. The discrete motion label corresponding to the reference motion unit direction has .
[0239] Based on this, using the time step as the basic sample unit, at time... The state information of all drones in the swarm and their corresponding action labels are combined to form a single sample. As the trajectory progresses along the time dimension, data from each moment in the same trajectory generation process can sequentially form multiple samples for that iteration. Thus, each sample contains information from a specific time step. Current position coordinates of all corresponding drones and local maps and sample labels ( ).
[0240] It is understandable that after obtaining multiple samples, the initial flight decision model can be trained using these samples. During training, each node can be obtained by referring to S701-S703. Output vector The policy distribution is then obtained through Softmax. Simultaneously, target action labels provided by offline conflict-free reference trajectories. As a supervisory signal, a classification loss function is constructed. The difference between the model prediction and the label is measured using the following formula (17):
[0241] (17)
[0242] By minimizing the aforementioned cross-entropy loss, the complex multi-UAV cooperative obstacle avoidance problem is transformed into a stable and trainable supervised learning task, enabling the graph attention-based distributed policy network to reproduce the decision-making behavior of centralized expert policies as much as possible, relying only on local observations and neighbor information.
[0243] Training samples are constructed based on offline-generated conflict-free reference trajectories at time steps. The reference motion direction at each time step is determined according to the position changes at adjacent time points, and this direction is quantized into a predefined direction category as a supervision label. This forms a training dataset with interaction relationship graph features as input and avoidance direction category as output. Supervised training is used to obtain model parameters for online interactive avoidance decision-making, thereby improving the stability and safety of online decision-making.
[0244] Based on the same inventive concept, this application also provides a drone control device corresponding to the drone control method. Since the principle of the device in this application is similar to that of the drone control method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0245] The device is applied to the first drone in a multi-drone scenario, which includes the first drone and multiple second drones. The device includes an acquisition module, a determination module, a construction module, a prediction module, and a control module.
[0246] The acquisition module is used to acquire the first position information of the first UAV and the second position information of each of the second UAVs;
[0247] The determination module is used to determine the first neighborhood information and the first local map of the first UAV based on the first location information of the first UAV and the second location information of each second UAV.
[0248] The construction module is used to construct the target graph structure corresponding to the first UAV based on the first location information, each second location information, the first neighborhood information and the first local map, and to determine the node feature information and edge feature information of the target graph structure. The target graph structure includes multiple nodes and edges between nodes, and each node represents the first UAV or a second UAV located in the neighborhood of the first UAV.
[0249] The prediction module is used to input the target graph structure corresponding to the first UAV, the node feature information of the target graph structure, and the edge feature information into the pre-trained flight decision model, and the flight decision model predicts the flight control information of the first UAV.
[0250] The control module is used to control the flight of the first UAV based on the flight control information of the first UAV.
[0251] In one possible implementation, a module is defined, specifically for:
[0252] Based on the first location information of the first UAV, the second location information of each second UAV, and the preset communication radius, the first neighborhood information of the first UAV is determined.
[0253] Obtain a global map of the multi-drone scene, and determine a first local map based on the global map, the field of view information of the first drone, and the first position information of the first drone.
[0254] In one possible implementation, the building module is specifically used for:
[0255] Based on the first neighborhood information, construct the target graph structure corresponding to the first UAV;
[0256] Based on the first location information, each second location information, the first local map, and the first neighborhood information, determine the node feature information of the target graph structure;
[0257] Based on the first position information, each of the second position information, and the target graph structure, determine the edge feature information of the target graph structure.
[0258] In one possible implementation, the building module is specifically used for:
[0259] The current local map of the current drone is centralized to obtain the centralized local map, where the current drone is the drone corresponding to any node in the target graph structure.
[0260] The centralized local map is input into a pre-trained map convolutional neural network, which extracts and encodes map features from the centralized local map to generate the current local map encoding features of the current UAV.
[0261] Obtain the target endpoint of the current drone, and determine the directional characteristics of the current endpoint based on the target endpoint and the current position information of the current drone.
[0262] Determine the current motion direction characteristics of the drone in the previous moment;
[0263] Based on the current location information and the current neighborhood information of the drone, determine the current neighborhood characteristics of the drone.
[0264] The current local map encoding features, current destination direction features, current motion direction features, and current neighborhood features of the current UAV are used as the node feature information corresponding to the current UAV.
[0265] In one possible implementation, the building module is specifically used for:
[0266] Determine the number of neighbors for the current drone based on its current neighborhood information;
[0267] Based on the current neighborhood information of the current drone, the current location information of the current drone, and the location information of each drone in a multi-drone scenario, determine the average neighborhood distance corresponding to the current drone;
[0268] The current neighborhood characteristics of the current drone are determined based on the number of neighborhoods and the average neighborhood distance.
[0269] In one possible implementation, the building module is specifically used for:
[0270] Traverse the nodes corresponding to each second UAV in the target graph structure. For the current node, calculate the direction vector and distance between the first UAV and the second UAV corresponding to the current node based on the first position information and the second position information of the second UAV corresponding to the current node. Then, determine the edge feature information of the edge between the current node and the node corresponding to the first UAV based on the direction vector and distance between the first UAV and the second UAV corresponding to the current node.
[0271] In one possible implementation, the flight decision model includes: a linear transformation layer, multiple multi-head graph attention policy networks, multiple post-processing layers, and an output layer connected in sequence; a prediction module, specifically used for:
[0272] The node and edge feature information of the target graph structure is input into the linear transformation layer for linear transformation to obtain linear node and linear edge feature information;
[0273] The target graph structure, linear node feature information, and linear edge feature information are input into multiple multi-head graph attention strategy networks and multiple post-processing layers. The multi-head graph attention strategy networks perform multi-head attention processing, and the post-processing layers perform output processing to obtain the feature vectors of each node in the target graph structure.
[0274] The feature vectors of each node in the target graph structure are input into the output layer to obtain the scores of the first UAV in multiple flight directions. Each flight direction and its score are used as flight control information.
[0275] In one possible implementation, the flight control information includes: multiple flight directions and scores for each flight direction; the control module is specifically used for:
[0276] Determine the flight trajectory constraint information of the first UAV in each flight direction and the target guidance constraint information of the first UAV in each flight direction;
[0277] Based on the scores, flight trajectory constraint information, and target guidance constraint information corresponding to each flight direction, the performance parameters of the first UAV in each flight direction are determined;
[0278] Based on the performance parameters of the first UAV in each flight direction, determine the target flight maneuver of the first UAV;
[0279] Control the flight of the first UAV based on the target flight actions of the first UAV.
[0280] In one possible implementation, the control module is specifically used for:
[0281] Based on the performance parameters of the first UAV in each flight direction, the flight directions are sorted, and multiple candidate flight directions are determined according to a preset number threshold.
[0282] Based on the preset cost map, the cost value of each candidate flight direction is determined, and based on the cost value of each candidate flight direction, the target flight direction of the first UAV is determined.
[0283] Based on the target flight direction of the first UAV, determine the target flight action of the first UAV.
[0284] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0285] This application also provides an electronic device, such as... Figure 11 As shown, Figure 11 A schematic diagram of an electronic device provided in this application embodiment includes: a processor 1101 and a memory 1102, and optionally, a bus 1103. The memory 1102 stores machine-readable instructions executable by the processor 1101. When the electronic device is running, the processor 1101 and the memory 1102 communicate via the bus 1103, and the processor 1101 executes the machine-readable instructions to perform the steps of the above-described UAV control method.
[0286] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for controlling an unmanned aerial vehicle (UAV), characterized in that, A first drone is applied in a multi-drone scenario, wherein the multi-drone scenario includes: a first drone and multiple second drones, and the method includes: Acquire the first location information of the first UAV and the second location information of each of the second UAVs; Based on the first location information of the first UAV and the second location information of each of the second UAVs, the first neighborhood information and the first local map of the first UAV are determined. Based on the first location information, each of the second location information, the first neighborhood information, and the first local map, a target graph structure corresponding to the first UAV is constructed, and the node feature information and edge feature information of the target graph structure are determined. The target graph structure includes multiple nodes and edges between nodes, and each node represents either the first UAV or a second UAV located in the neighborhood of the first UAV. The target graph structure corresponding to the first UAV, the node feature information and edge feature information of the target graph structure are input into the pre-trained flight decision model, and the flight decision model predicts the flight control information of the first UAV. The flight decision model is a model trained based on a graph attention policy network. Based on the flight control information of the first UAV, control the flight of the first UAV; The step of determining the node feature information and edge feature information of the target graph structure includes: centralizing the current local map of the current UAV to obtain a centralized current local map, wherein the current UAV is the UAV corresponding to any node in the target graph structure; inputting the centralized current local map into a pre-trained map convolutional neural network, whereby the map convolutional neural network extracts and encodes map features from the centralized current local map to generate the current local map encoding features of the current UAV; obtaining the target endpoint of the current UAV, and determining the current endpoint direction feature based on the target endpoint and the current position information of the current UAV; determining the current motion direction feature of the current UAV at the previous moment; determining the current neighborhood feature of the current UAV based on the current position information and the current neighborhood information of the current UAV; and using the current local map encoding features, the current endpoint direction feature, the current motion direction feature, and the current neighborhood feature of the current UAV as the node feature information corresponding to the current UAV. The nodes corresponding to each second UAV in the target graph structure are traversed. For the current node, the direction vector and distance between the first UAV and the second UAV corresponding to the current node are calculated based on the first position information and the second position information of the second UAV corresponding to the current node. Based on the calculated direction vector and distance, the edge feature information between the current node and the node corresponding to the first UAV is determined.
2. The UAV control method according to claim 1, characterized in that, The step of determining the first neighborhood information and the first local map of the first UAV based on the first location information of the first UAV and the second location information of each of the second UAVs includes: Based on the first location information of the first UAV, the second location information of each of the second UAVs, and the preset communication radius, the first neighborhood information of the first UAV is determined; Obtain a global map of the multi-drone scene, and determine the first local map based on the global map, the field of view information of the first drone, and the first position information of the first drone.
3. The UAV control method according to claim 1, characterized in that, The step of constructing a target graph structure corresponding to the first UAV based on the first location information, each of the second location information, the first neighborhood information, and the first local map, and determining the node feature information and edge feature information of the target graph structure, includes: Based on the first neighborhood information, construct the target graph structure corresponding to the first UAV; Based on the first location information, each of the second location information, the first local map, and the first neighborhood information, the node feature information of the target graph structure is determined; Based on the first location information, each of the second location information, and the target graph structure, the edge feature information of the target graph structure is determined.
4. The UAV control method according to claim 1, characterized in that, The step of determining the current neighborhood features of the current drone based on its current location information and current neighborhood information includes: The number of neighbors of the current drone is determined based on the current neighborhood information of the current drone; Based on the current neighborhood information of the current drone, the current location information of the current drone, and the location information of each drone in the multi-drone scenario, the average neighborhood distance corresponding to the current drone is determined. The current neighborhood characteristics of the current UAV are determined based on the number of neighborhoods and the average neighborhood distance.
5. The UAV control method according to claim 1, characterized in that, The flight decision model includes: a linear transformation layer, multiple multi-head graph attention policy networks, multiple post-processing layers, and an output layer connected in sequence; The step of inputting the target graph structure corresponding to the first UAV, the node feature information and edge feature information of the target graph structure into a pre-trained flight decision model, and having the flight decision model predict the flight control information of the first UAV, includes: The node feature information and edge feature information of the target graph structure are input into the linear transformation layer for linear transformation to obtain linear node feature information and linear edge feature information. The target graph structure, the linear node feature information, and the linear edge feature information are input into the multiple multi-head graph attention strategy networks and multiple post-processing layers. The multiple multi-head graph attention strategy networks perform multi-head attention processing, and each post-processing layer performs output processing to obtain the feature vector of each node in the target graph structure. The feature vectors of each node in the target graph structure are input into the output layer to obtain the scores of the first UAV in multiple flight directions, and each flight direction and the score of each flight direction are used as the flight control information.
6. The UAV control method according to claim 1, characterized in that, The flight control information includes: multiple flight directions and scores for each flight direction; The step of controlling the flight of the first UAV based on its flight control information includes: Determine the flight trajectory constraint information of the first UAV in each flight direction and the target guidance constraint information of the first UAV in each flight direction; Based on the scores corresponding to each flight direction, the flight trajectory constraint information, and the target guidance constraint information, the performance parameters of the first UAV in each flight direction are determined; Based on the performance parameters of the first UAV in each flight direction, determine the target flight action of the first UAV; Based on the target flight actions of the first drone, control the flight of the first drone.
7. The UAV control method according to claim 6, characterized in that, The step of determining the target flight maneuver of the first UAV based on its performance parameters in each flight direction includes: Based on the performance parameters of the first UAV in each flight direction, the flight directions are sorted, and multiple candidate flight directions are determined according to a preset number threshold. Based on the preset cost map, the cost value of each candidate flight direction is determined, and based on the cost value of each candidate flight direction, the target flight direction of the first UAV is determined. The target flight action of the first UAV is determined based on the target flight direction of the first UAV.
8. An electronic device, characterized in that, include: A processor and a memory, the memory storing machine-readable instructions executable by the processor, which, when the electronic device is running, are executed by the processor to perform the steps of the unmanned aerial vehicle control method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
EVTOL-oriented multipath transmission optimization and dynamic path selection method
CN120567756A
Relevance credit default early warning method based on graph neural network
CN120672452A