A UAV route planning method based on graph neural network
Through the path planning method optimized by graph neural network and B-spline curve, the problem of high computational complexity of drones in complex urban environments is solved, fast and accurate path planning is achieved, and the flight safety and efficiency of drones are improved.
Patent Information
- Application Number
- CN202411915868.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-12-24
AI Technical Summary
Existing UAV path planning algorithms have high computational complexity when dealing with complex urban environments, and it is difficult to strike a balance between search efficiency and solution accuracy, especially in dynamically changing or uncertain environments.
Graph neural networks are used for route planning. An undirected graph is generated through a probabilistic roadmap. A graph attention network with an encoder and decoder structure is used for path selection. The path is optimized with B-spline curves to ensure the safety and consistency of the path.
It achieves fast and accurate route planning in complex urban environments, improves the safety and efficiency of UAV flights, reduces fuel consumption, and optimizes capacity utilization.
Smart Images

Figure CN119714284B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of UAV route planning, and more specifically, relates to a UAV route planning method based on graph neural network. Background Art
[0002] With the rise of the concept of Urban Air Mobility (UAM), drones are being used in increasingly diverse urban applications, encompassing a wide range of areas, including cargo transportation, emergency rescue, environmental monitoring, and urban patrols. To address the traffic congestion and environmental pressures brought on by the accelerated urbanization process, UAM, as an emerging transportation mode, has shown great potential to resolve ground transportation bottlenecks and improve transportation efficiency. As a key technology for achieving the safety and efficiency of UAM, drone route planning has become a research hotspot and one of the difficulties. The "high-efficiency service and low-cost losses" brought about by a reasonable route planning solution is a reflection of its enhanced core competitiveness. Therefore, with the reform and innovation of information technology, in order to promote the development of urban air transportation, how to design more efficient drone route planning is an urgent issue that needs to be addressed.
[0003] Currently, route planning problems are typically solved using precise and heuristic algorithms. While precise algorithms such as dynamic programming and integer linear programming can provide optimal solutions within a certain scale of constraints, they are computationally complex and, especially when dealing with large-scale problems, often require long computation times. Heuristic algorithms such as genetic algorithms and particle swarm optimization typically trade computational efficiency for solution accuracy, but their effectiveness remains limited in the face of dynamic changes or uncertain environments. Therefore, striking a balance between search efficiency and solution accuracy remains a core challenge for traditional algorithms. Summary of the Invention
[0004] In response to the above-mentioned defects or improvement needs of the existing technology, the present invention provides a UAV route planning method based on graph neural network, which can achieve efficient and accurate route planning in target areas, such as complex urban environments.
[0005] To achieve the above objectives, according to a first aspect of the present invention, a method for UAV route planning based on a graph neural network is provided, comprising:
[0006] S1, using the probabilistic roadmap method to generate an undirected graph G = (V, E) of the target area;
[0007] Where V is the node set, V={q1,q2,…,q N}, E is the edge set, E={e ij |i≠j,e ij=1}, N is the number of nodes, and each node is located in the free space of the target area;
[0008] S2, input G into the trained graph attention network to obtain the flight path of the UAV in the target area;
[0009] The graph attention network includes an encoder and a decoder;
[0010] The encoder includes an input layer and M layers of multi-head attention mechanism layers connected in sequence, wherein the input layer is used to i The two-dimensional coordinate x i Perform initial embedding to obtain After passing through the M layers of multi-head attention mechanism connected in sequence, it is updated to
[0011] is node q i The query vector, is node q j The key vector of is node q j The value vector of d key yes The dimension of j∈N(i) is q i The set of adjacent nodes, g = 1, 2, ..., H, l = 1, 2, ..., M, i = 1, 2, ..., N, H is the number of attention heads in each multi-head attention mechanism layer, b x 、W x , W′, W Q 、W K 、W V are all learnable weight parameters;
[0012] The decoder includes a single-head attention mechanism layer for k Contextual embedding Embedded with nodes From π k Select the next path point π from the adjacent nodes k+1 , until the complete path sequence π=(π0,π1,…,π m ),π0 is q1;π k+1 The probability of selection is the query vector, is the key vector, K k Dimensions, is π k-1 Node embedding, is the embedding of the entire undirected graph, u context,rThe definition of is similar, N(k) is π k The set of adjacent nodes, W Q ′ is a learnable weight parameter, k = 0, 1, 2, …, m.
[0013] According to a second aspect of the present invention, there is provided an electronic device comprising: a computer-readable storage medium and a processor;
[0014] The computer-readable storage medium is used to store executable instructions;
[0015] The processor is configured to read the executable instructions stored in the computer-readable storage medium and execute the method according to the first aspect.
[0016] According to a third aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute the method according to the first aspect.
[0017] According to a fourth aspect of the present invention, there is provided a computer program product comprising a computer program or instructions, which implement the method according to the first aspect when executed by a processor.
[0018] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:
[0019] The method provided by the present invention uses a probabilistic pathmap to randomly sample nodes and edges within the target area, taking into account safe distances from buildings, simplifying complex map structures, and converting continuous space into discrete space. Path node selection is then performed on the path network graph, addressing the problem of low search efficiency in complex spaces while ensuring the safety of drones during flight. Furthermore, the proposed encoder-decoder graph attention network uses an attention mechanism to extract features from the resulting probabilistic pathmap and assigns different weights to nodes through a self-attention mechanism, emphasizing the influence of key path-related nodes and their neighbors. The decoder uses information such as contextual node embeddings based on the node features extracted by the encoder to guide node selection, ultimately forming an optimal path. Through network training, the network can learn effective path planning strategies in complex environments, enabling rapid and accurate flight path generation during online planning.
[0020] As a preferred solution, in the method provided by the present invention, during the path generation process, the decoder adopts a mask mechanism to avoid repeated node access and limit message transmission between adjacent nodes, thereby ensuring the rationality and consistency of the path.
[0021] As a preferred solution, the method provided by the present invention uses B-spline curves to optimize the path generated by the graph attention network. Its smoothness avoids sharp turns, improves flight stability, reduces fuel consumption, and optimizes overall capacity utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A schematic diagram of a flow chart of a UAV route planning method based on a graph neural network provided by an embodiment of the present invention;
[0023] Figure 2 A flowchart of constructing an undirected graph of a target area based on a probabilistic roadmap method provided by an embodiment of the present invention;
[0024] Figure 3 A schematic diagram of graph neural network training provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
[0026] By simulating flight path data in complex environments, deep learning algorithms can autonomously learn and optimize path planning solutions, demonstrating significant advantages in solving drone path planning problems. These methods leverage the powerful learning capabilities of neural networks, training models with large amounts of data to quickly and efficiently solve complex path planning problems. Especially when dealing with diverse and dynamically changing urban environments, deep learning algorithms can achieve more timely and flexible path planning than traditional methods.
[0027] Based on this, the embodiment of the present invention provides a UAV route planning method based on graph neural network, such as Figure 1 Shown, including:
[0028] S1, using the probabilistic roadmap method to generate an undirected graph G = (V, E) of the target area;
[0029] Where V is the node set, V={q1,q2,…,q N}, E is the edge set, E={e ij |i≠j,e ij =1}, N is the number of nodes, and each node is located in the free space of the target area.
[0030] Specifically, information about building obstacles in the target area is obtained, and a simplified two-dimensional planar graph containing the obstacle information is generated. Then, based on the probabilistic roadmap method, nodes are randomly generated within the feasible area, and an undirected graph is established. The undirected graph ensures the connectivity and security of the path graph by detecting whether edges and obstacles collide.
[0031] Taking the target area as an urban area as an example, for the planned urban area, obtain the urban building obstacle information, simplify and obtain a two-dimensional plane map containing obstacle information (i.e., an environment map containing obstacle information), and construct an undirected graph based on the probabilistic roadmap method, such as Figure 2 As shown in the figure, nodes are randomly sampled and generated in the feasible area to ensure that these nodes avoid obstacles. Then, undirected edges are established between the nodes, and whether the edges and obstacles intersect is detected to ensure connectivity and security. Finally, the undirected graph constructed represents a traversable path.
[0032] By randomly sampling N nodes in the target area and connecting adjacent nodes using the K-nearest neighbor algorithm, edges are generated while ensuring that the path does not intersect with obstacles. Finally, an undirected graph G = (V, E) is obtained, where V represents the node set V = {q1, q2, ..., q N}, E represents the edge set E={e ij |i≠j,e ij =1}.
[0033] Specifically, the target urban area is first planned, and information about urban obstacles within the area is obtained. Based on this information, the area is simplified. During flight, the drone's altitude is assumed to remain constant, so its motion in three-dimensional space can be simplified to movement within a two-dimensional plane. This results in a two-dimensional planar graph containing obstacle information based on the planned urban area, which serves as the configurable space for the Probabilistic Roadmap (PRM) algorithm. The PRM method generates a path graph by randomly sampling within the configuration space, discretizing the continuous space into a series of nodes and their connected edges, transforming it into a more easily solvable graph search problem. The configurable space can be divided into free space and obstacle space. The free space represents the area where the drone can safely fly, while the obstacle space contains obstacles such as buildings that must be avoided along the flight path. Only nodes located in the free space are valid nodes.
[0034] Randomly sample and generate N nodes q1,q2,…,q in the configuration space N , where q i ∈C freeDenotes nodes located in free space. These nodes are selected through multiple random samplings to ensure uniform distribution, allowing path planning to cover the entire feasible area. The location of each node is influenced by both the probability distribution and the safety requirements of its distance from obstacles, ensuring that the drone can avoid obstacles such as buildings during flight.
[0035] For each sampling node q i , first use the K nearest neighbor algorithm to find the K nearest neighbors of the node The node distance is calculated using Euclidean distance. After finding K neighboring nodes, we need to check the connectivity between these nodes. i and its neighbors Judging from q i arrive If the path does not cross any obstacles, then the i and Create an edge between Indicates that they are connected, and the formula is as follows:
[0036]
[0037] in, Represents node q i and connectivity, Indicates that from q i arrive straight line segment.
[0038] After checking the connectivity between nodes, these nodes and edges are combined into an undirected graph G = (V, E), where V represents the node set V = {q1, q2, ..., q N}, E represents the edge set E={e ij |i≠j,e ij =1}. This undirected graph transforms the complex path planning problem into a graph search problem and also provides a structured data input format for subsequent graph neural network algorithms.
[0039] S2, input G into the trained graph attention network to obtain the flight path of the UAV in the target area;
[0040] The graph attention network includes an encoder and a decoder;
[0041] The encoder includes an input layer and M layers of multi-head attention mechanism layers connected in sequence, wherein the input layer is used to i The two-dimensional coordinate x i Perform initial embedding to obtain After passing through the M layers of multi-head attention mechanism connected in sequence, it is updated to
[0042] is node q i The query vector, is node q j The key vector of is node q j The value vector of d key is the key vector The dimension of N(i) is q i The set of adjacent nodes, g = 1, 2, ..., H, l = 1, 2, ..., M, i = 1, 2, ..., N, H is the number of attention heads in each multi-head attention mechanism layer, W ′, W Q ,W K ,W V is a learnable weight parameter;
[0043] The decoder includes a single-head attention mechanism layer for k Contextual embedding Embedded with nodes From π k Select the next path point π from the adjacent nodes k+1 , until the complete path sequence π=(π0,π1,…,π m ),π0 is q1;π k+1 The probability of selection is the query vector, is the key vector, K k Dimensions, is π k-1 Node embedding, is the embedding of the entire undirected graph, u context,r The definition of is similar, N(k) is π k The set of adjacent nodes, W Q ′ is a learnable weight parameter, k = 0, 1, 2, …, m.
[0044] In step S2, a graph attention network with an encoder-decoder structure is used to perform path selection on the undirected graph. The node features are extracted and the node importance analysis is performed through the attention mechanism, so as to select appropriate nodes and edges to generate a safe and efficient flight path for the drone.
[0045] The graph attention network consists of an encoder and a decoder. The encoder extracts information between nodes through a multi-layer attention mechanism and generates a high-dimensional embedding representation of the nodes and the graph. The decoder gradually selects the next node of the path through context information and the attention mechanism until a complete flight path is generated.
[0046] Specifically, a graph attention network is used to solve the path decision-making problem during drone flight. Route planning is modeled as a graph search problem. The graph attention network is designed as an encoder-decoder structure. The encoder extracts features from nodes in the graph and uses an attention mechanism to transfer information between adjacent nodes, ensuring that the selected path meets the drone's flight requirements. During path selection, the decoder gradually selects nodes along the path and outputs a complete path sequence, resulting in the drone's flight path.
[0047] (1) Encoder
[0048] The input of the encoder consists of nodes q i The two-dimensional coordinate x of (i∈[1,n]) i And the adjacency matrix A of the graph (used to confirm the adjacent nodes of any node), initially, the node coordinates x i It will be embedded into a high-dimensional feature space. The specific formula is:
[0049]
[0050] in, Represents node q i The initial embedding, W x is the learnable weight matrix, b x is the bias term, b x and W x These are all learnable parameters of the encoder. This embedding process transforms the two-dimensional coordinates of the node into a 128-dimensional feature vector.
[0051] In the encoder, the multi-layer attention mechanism layer allows each node to exchange information with its adjacent nodes. The node embedding of the current multi-head attention mechanism layer is updated by the query vector, key vector and value vector of the node calculated by the previous multi-head attention mechanism layer, and the priority of information transmission is determined according to the similarity of adjacent nodes. The higher the similarity, the higher the priority of information transmission.
[0052] That is, in the encoder, message passing is implemented through the multi-head attention mechanism of the M layer, which allows each node to exchange information with its neighboring nodes, thereby updating its feature representation and finally obtaining the node embedding representation Each attention head calculates and outputs independently, and then the outputs of each head are spliced together to obtain the node embedding representation of the multi-head attention mechanism layer. The specific formula is:
[0053] MultiHead(Q,K,V)=Concat(head1,head2,…,head H )W′
[0054]
[0055] Where W′ is the concatenated projection matrix, which is a learnable parameter of the encoder and can be obtained through training; Q, K, V represent the query, key, and value vectors respectively, H is the number of attention heads in each multi-head attention mechanism layer, and d key is the dimension of the key vector.
[0056] Define node q i Neighbor node q j The set of is N(i).
[0057] After layer l, node q i Embed is based on the neighbor node q j ∈N(i) is obtained by weighted summation of information, and its formula can be expressed as:
[0058]
[0059] The g-th attention head of the l-th multi-head attention mechanism layer can be expressed as:
[0060]
[0061] Attention weight The calculation formula is as follows:
[0062]
[0063] in is node q i The query vector, is node q j The key vector of is node q j The value vector of d key is the dimension of the key vector, which is used to scale the result of the dot product. Through this attention mechanism, the node q i According to the adjacent node q j The similarity between nodes is used to decide which nodes to receive information from and update their own embedding representation.
[0064] After M layers of attention and message passing, the encoder finally outputs the embedding representation of each node and the embedding of the entire graph The graph embedding is calculated by averaging the embeddings of all nodes:
[0065]
[0066] That is, through the graph convolution operations of several layers of the encoder, the node embedding is gradually updated using multi-layer attention operations, ultimately providing a high-dimensional feature representation for path selection.
[0067] (2) Decoder
[0068] The input to the decoder consists of the node embeddings generated by the encoder And the context information of each step in the path decision process. The decoder uses the context information to make path decisions. Including the embedding of the previous node, the current node and the embedding of the entire graph, which is used to guide the node selection of each step of the path to ensure the rationality and coherence of the generated path. For a certain path node, its context node embedding It consists of the following three parts:
[0069]
[0070] in is the embedding of the previous path node, is the embedding of the current path node, It is the embedding of the entire graph, representing the global information of the graph.
[0071] In the initial stage, the context node embedding combines the starting point embedding and the graph embedding, and this information is used to guide the decoder to select nodes. That is, in the initial state, the decoder takes the starting point as the current node, and its context node embedding is is 0.
[0072] Based on the above information, the decoder calculates the probability distribution of selecting the next path node at the current moment through the single-head attention mechanism.
[0073] That is, the decoder includes a single-head attention mechanism layer, which is used to take q1 as the path starting point π0, select the next path point π1 from the set of adjacent nodes of q1 according to the context embedding and node embedding of q1, and then select the next path point π2 from the set of adjacent nodes of π1 according to the context embedding and node embedding of π1, until the complete path sequence π=(π0,π1,…,π m ).
[0074] π k The next node π k+1 The probability calculation process of the selection involves the similarity between the current context embedding and the current node embedding and its neighbor node embedding. The probability is calculated by the following formula:
[0075]
[0076] in, is the current path node π k Contextual embedding Embedded with nodes The similarity measure of for The generated query vector, W Q ′ is a learnable weight parameter, for The generated key vector, u context,r The definition of is similar, where non-adjacent nodes are set u through the mask mechanism (context)j =-∞. That is, by sampling with this probability, the current node π k In the adjacent node set of The largest node is the next path node π k+1 .
[0077] Next, the new context embeds By selecting the next node π k The embedding is updated so that it can reflect the real-time path state representation, thereby guiding the decoder to select the next optimal node. This node selection process continues until the decoder selects the terminal node and generates a complete path sequence π=(π0,π1,…,π m ), the strategy p(π|s) of the entire path can be expressed as:
[0078]
[0079] Preferably, the decoder avoids repeated access to nodes by means of a masking mechanism and limits message transmission between adjacent nodes.
[0080] Specifically, the decoder adopts a mask mechanism to ensure that in the process of selecting path nodes, nodes that have been traversed are no longer selected and disconnected nodes are skipped.
[0081] During the path generation process, the decoder uses a masking mechanism to ensure the rationality and consistency of the path. This mechanism has two main functions:
[0082] One is to prevent repeated visits to nodes. At each step of the path, the decoder needs to ensure that the nodes that have been traversed are no longer selected. To this end, the mask will mark the nodes that have been visited, and when calculating the node similarity measure u (context)j When , for nodes that have been visited, their values are set to negative infinity to prevent them from being selected again. The formula can be expressed as:
[0083]
[0084] In other words, this masking process can ensure that each node is visited only once in the path, preventing the generation of loops and invalid paths.
[0085] The second is to limit the message transmission between adjacent nodes. The mask will limit the scope of message transmission according to the adjacency matrix A, ensuring that information is only transmitted between adjacent nodes. If two nodes are not adjacent, their corresponding similarity measure u (context)j It will also be masked to negative infinity. This allows disconnected nodes to be skipped when generating a path, ensuring path continuity.
[0086] Preferably, the training method of the graph attention network of the encoder-decoder structure is to perform training by combining a defined path cost L(π) with a reinforcement learning method.
[0087] The path cost L(π) can be expressed as the sum of the distances between adjacent nodes of the resulting path π, that is, the path cost function is defined as the sum of the distances between each pair of adjacent nodes. The path π is composed of the node sequence π=(π0,π1,…,π m ) represents, m is the number of nodes in the path, where π k is the kth node on the path, and its path cost L(π) can be calculated as:
[0088]
[0089] where d(π k ,π k+1 ) represents node π k and node,π k+1 The Euclidean distance between them.
[0090] In order to minimize the path cost L(π), the parameters of the graph attention network are updated by minimizing the expected cost. The loss function during training is defined as:
[0091]
[0092] p θ (π|s) is the path strategy generated by the graph attention network, π is the path, s is the current state of the graph attention network, θ is the parameter set of the graph attention network, and E is the expectation.
[0093] Considering that the training samples of the graph attention network are unlabeled, a reinforcement learning algorithm is used to train it; among them, reinforcement learning algorithms such as the PPO algorithm and the DQN algorithm can be used.
[0094] Considering computational efficiency, it is preferred to use the REINFORCE algorithm to train the graph attention network. This algorithm is a reinforcement learning algorithm based on policy gradient, which has the advantages of being simple and easy to implement, unbiased gradient estimation, and lightweight structure.
[0095] To update the parameters θ of the graph attention network, the REINFORCE gradient estimator is used, combined with the baseline b(s) to reduce the variance of the gradient, which is formulated as:
[0096]
[0097] Where b(s) is a baseline function used to reduce the variance in the gradient estimate. The specific baseline b(s) is defined by exponential moving average:
[0098] b(s)=βR+(1-β)L(π)
[0099] At the initial moment, let R = L(π), and update it by weight β in subsequent iterations.
[0100] In order to optimize the loss function, the Adam optimizer is used to update the parameters of the graph attention network. Figure 3 As shown, the complete algorithm training process can be summarized into the following steps:
[0101] Step 1: Generate training data set: Generate a probabilistic roadmap G using a given two-dimensional plane map containing obstacle information, and randomly select the starting and ending points to generate multiple sample data sets;
[0102] Step 2: Perform forward propagation, input sample data, and generate path strategy p through graph attention network θ (π|s), and use sampling decoding for path selection;
[0103] Step 3: Based on the selected path π, calculate the cost L(π) of the resulting path;
[0104] Step 4: Update baseline and gradient: Use REINFORCE to update the policy gradient and calculate the gradient of the parameters
[0105] Step 5: Parameter update: Use the Adam optimizer to update the parameters θ of the graph attention network according to the gradient.
[0106] Preferably, the method further comprises:
[0107] S3, using a B-spline curve method to smooth the route path.
[0108] Specifically, the B-spline curve method, through its smoothness, local adjustability, and high-order continuity, can provide safer and more stable path planning solutions for drones, while also being able to handle complex dynamic constraints and environmental requirements. By optimizing the path output by the graph neural network using B-spline curves, the smooth and controllable curves reduce aircraft turns, thereby smoothing the drone's flight path, optimizing flight distance, reducing sharp turns during flight, and reducing fuel consumption.
[0109] The B-spline curve is composed of a series of control points {P0, P1, ..., P n} and a set of basis functions N i,p (u), its curve can be expressed as a linear combination of control points, and the formula can be expressed as:
[0110]
[0111] Where C(u) is the parameterized representation of the curve, and u is the curve parameter, which usually varies in the interval [0, 1]. i is the i-th control point, N i,p (u) is the value of the control point P i The associated basis functions, p is the order of the B-spline curve.
[0112] Basis function N in B-spline curve i,p (u) is defined recursively, and the basis function is defined based on a node vector U = {u0,u1,…,u m}, this vector determines the influence range of each control point. For high-order basis functions, the calculation formula is:
[0113]
[0114] In summary, the method provided by the present invention obtains information about urban buildings and obstacles in the target urban area, and simplifies it to obtain a two-dimensional plane map containing obstacle information. Secondly, based on the probabilistic path map (PRM) method, an undirected graph is constructed on the plane map containing obstacle information. Nodes that avoid obstacles are randomly sampled within the feasible area, and the connectivity between nodes and the interaction between edges and obstacles are detected to ensure the safety and connectivity of the path. Subsequently, a graph attention network (GAT) with an encoder-decoder structure is used to select paths on the constructed undirected graph, and an initial feasible path is generated by analyzing the importance of the nodes. Finally, a B-spline curve is used to optimize the generated initial path, smoothing the path to reduce turns and path length, thereby reducing aircraft fuel consumption and improving path safety. This method effectively combines PRM, GAT, and B-spline curves, and can provide a safe and efficient flight path planning solution for drones in complex urban environments.
[0115] An embodiment of the present invention provides an electronic device, comprising: a computer-readable storage medium and a processor;
[0116] The computer-readable storage medium is used to store executable instructions;
[0117] The processor is configured to read the executable instructions stored in the computer-readable storage medium and execute the method described in any one of the above embodiments.
[0118] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute the method described in any of the above embodiments.
[0119] An embodiment of the present invention provides a computer program product, including a computer program or instructions, which implements the method described in any of the above embodiments when executed by a processor.
[0120] It will be easily understood by those skilled in the art that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A UAV route planning method based on graph neural network, characterized in that: include: S1, using the probabilistic roadmap method to generate an undirected graph G = (V, E) of the target area; Where V is the node set, V={q1,q2,…,q N }, E is the edge set, E={e ij |i≠j,e ij =1}, N is the number of nodes, and each node is located in the free space of the target area; S2, input G into the trained graph attention network to obtain the flight path of the UAV in the target area; The graph attention network includes an encoder and a decoder; The encoder includes an input layer and M layers of multi-head attention mechanism layers connected in sequence, wherein the input layer is used to i The two-dimensional coordinate x i Perform initial embedding to obtain After passing through the M layers of multi-head attention mechanism connected in sequence, it is updated to is node q i The query vector, is node q j The key vector of is node q j The value vector of d key yes The dimension of j∈N(i) is q i The set of adjacent nodes, g = 1, 2, ..., H, l = 1, 2, ..., M, i = 1, 2, ..., N, H is the number of attention heads in each multi-head attention mechanism layer, b x 、W x 、W ′ 、W Q 、W K 、W V are all learnable weight parameters; The decoder includes a single-head attention mechanism layer for k Contextual embedding Embedded with nodes From π k Select the next path point π from the adjacent nodes k+1 , until the complete path sequence π=(π0,π1,…,π m ),π0 is q1;π k+1 The probability of selection is the query vector, is the key vector, K k Dimensions, is π k-1 Node embedding, is the embedding of the entire undirected graph, u context,r The definition of is similar, N(k) is π k The set of adjacent nodes, W Q ′ is a learnable weight parameter, k = 0, 1, 2, …, m.
2. The method according to claim 1, wherein The decoder avoids repeated node access through a masking mechanism and limits message transmission between adjacent nodes.
3. The method according to claim 1 or 2, wherein: The graph attention network is trained using a reinforcement learning algorithm; the loss function during training is: L(π) is the path cost, d(π k ,π k+1 ) is the node π k and node,π k+1 The Euclidean distance between them, m is the number of nodes in the path, p θ (π|s) is the path strategy generated by the graph attention network, π is the path, π=(π0,π1,…,π m ), s is the current state of the graph attention network, θ is the parameter set of the graph attention network, and E is the expectation.
4. The method according to claim 3, wherein The REINFORCE algorithm is used to train the graph attention network.
5. The method according to claim 1, wherein The method further comprises: S3, using a B-spline curve method to smooth the route path.
6. An electronic device, characterized in that: include: Computer-readable storage medium and processor; The computer-readable storage medium is used to store executable instructions; The processor is configured to read the executable instructions stored in the computer-readable storage medium and execute the method according to any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute the method according to any one of claims 1 to 5.
8. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Deep map attentive adversarial variation automatic encoder training method and system
CN113361606A
Measurement viewpoint and measurement path synchronous optimization method based on reinforcement learning
CN115509224A