Large-scale vehicle path planning method based on multi-head attention mechanism

By adopting a network of multi-head attention mechanisms in vehicle path planning, the problems of traditional algorithms degradation in large-scale problems and insufficient generalization capabilities are solved, and efficient and accurate path planning is achieved, which is suitable for large-scale capacity constraints Vehicle path planning.

CN118886576APending Publication Date: 2024-11-01CHONGQING UNIV
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410897691.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

When the existing technology deals with large-scale vehicle path planning problems with capacity constraints, the performance of traditional heuristic algorithms has deteriorated, the generalization ability of deep reinforcement learning methods is insufficient, and the real road network information is ignored, making it difficult to make efficient and accurate in a short period of time. decision making.

Method used

Using a large-scale vehicle path planning method based on multi-head attention mechanism, by building an Actor network and a Critic network, the multi-head attention module is used to process vehicle delivery requirements and road network information, and train and update network parameters to predict the optimal path.

Benefits of technology

Making efficient and accurate decisions in a shorter time improves the simplicity and flexibility of the algorithm, able to handle problems of different sizes, and perform well in unseen instances, suitable for large-scale capacity constraints Vehicle path planning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118886576A_ABST
    Figure CN118886576A_ABST
Patent Text Reader

Abstract

The invention provides a large-scale vehicle path planning method based on a multi-head attention mechanism, and the method comprises the following steps: S1, obtaining a starting point and a path node of a vehicle, and constructing an undirected map based on the starting point and the path node; s2, constructing a multi-head attention neural network, wherein the neural network comprises an Actor network and a Critic network; the Actor network is provided with an encoder and a decoder, the Critic network is provided with an encoder, and the encoders and the decoders of the Actor network and the Critic network are respectively provided with multiple attention modules; s3, taking the coordinates of each node in the undirected graph and the carrying demand quantity of the vehicle as the input of the Actor network and the Critic network to train the Actor network, wherein the output of the Critic network is used for updating the parameters of the Actor network; and S4, taking the coordinates of the starting point and the path node of the current vehicle and the carrying demand quantity of the vehicle as input, and predicting the optimal path of the next vehicle carrying task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a vehicle path planning method, and in particular to a large-scale vehicle path planning method based on a multi-head attention mechanism. Background Art

[0002] In the modern automobile manufacturing industry, research has found that the "circular pickup" model can be applied to inbound logistics. When automobile manufacturers have different parts needs, using one transport vehicle to deliver parts supplied by multiple parts suppliers to the factory warehouse at one time can effectively save transportation costs. This is very similar to the early milk transportation industry. Vehicle transportation tasks in the circular pickup scenario are as follows: Fig.12 As shown in the figure, the arrows represent the transportation routes of the vehicles. The transportation vehicles need to complete more freight tasks for suppliers while meeting the upper limit of the vehicle's carrying capacity. The goal of the cyclic pickup is to minimize the total driving distance of the vehicles in the entire transportation process.

[0003] The vehicle routing problem in the cyclic pickup scenario can be reduced to the Capacitated Vehicle Routing Problem (CVRP) with capacity constraints. The CVRP problem is a special VRP problem. The VRP problem is a type of combinatorial optimization problem that has been studied in applied mathematics and computer science for decades. It is an NP-hard problem. The calculation of this type of problem is very complex, and it is often difficult to find the optimal solution to the problem in polynomial time. Exact solutions and heuristic algorithms are usually used to solve such problems. In recent years, more and more artificial intelligence algorithms have also begun to be applied to the solution of VRP problems.

[0004] However, as the number of nodes increases, traditional heuristic algorithms are often designed for specific problems, and their performance and effectiveness may drop significantly when the problem scale increases or the problem structure changes. Although feasible solutions can be found quickly, these solutions may not be optimal, especially when the problem scale is very large, the quality gap may be more obvious; and deep reinforcement learning methods, although deep reinforcement learning models perform well on training sets, may lack generalization capabilities on unseen new problem instances. There is currently no good solution for large-scale CVRP problems, and due to the data structure, the information of the real road network is often ignored.

[0005] Therefore, in order to solve the above technical problems, it is urgent to propose a new technical means. Summary of the invention

[0006] In view of this, the purpose of the present invention is to provide a large-scale vehicle path planning method based on a multi-head attention mechanism, which uses the attention mechanism to concentrate on processing the most important information for the current decision, make decisions in a shorter time than traditional algorithms, improve efficiency, and have high accuracy. The algorithm is simpler and more flexible, and can handle problems of different scales. It can be generalized well enough to new and Wei Jianguo's large-scale vehicle path planning problems with capacity constraints.

[0007] The present invention provides a large-scale vehicle path planning method based on a multi-head attention mechanism, comprising the following steps:

[0008] S1. Obtain the starting point and path nodes of the vehicle, and construct an undirected graph map based on the starting point and path nodes;

[0009] S2. Construct a multi-head attention neural network, the neural network includes an Actor network and a Critic network; the Actor network has an encoder and a decoder, the Critic network has an encoder, and the encoders and decoders of the Actor network and the Critic network both have a multi-head attention module;

[0010] S3. The coordinates of each node in the undirected graph and the vehicle's carrying demand are used as the input of the Actor network and the Critic network to train the Actor network, and the output of the Critic network is used to update the parameters of the Actor network;

[0011] S4. Taking the coordinates of the current vehicle's starting point, the nodes along the way, and the vehicle's carrying demand as input, predict the optimal path for the next vehicle transportation task.

[0012] Furthermore, the encoder of the Actor network includes a linear layer I, an embedding layer I, a multi-head attention module I, a splicing module I, a feedforward module I, and a splicing module II;

[0013] The input end of the linear layer I inputs the coordinates of each node in the undirected graph and the carrying capacity of the vehicle, the output end of the linear layer I is connected to the input end of the embedding layer I, the output end of the embedding layer I is respectively connected to the input ends of the multi-head attention module I and the splicing module I, the output end of the splicing module I is connected to the input ends of the feedforward module I and the splicing module II, the output end of the feedforward module I is connected to the input end of the splicing module II, and the output end of the splicing module II is the output end of the encoder.

[0014] Furthermore, the decoder of the Actor network includes a linear layer II, a linear layer III, a linear layer IV, a linear layer V, a multi-head attention module II, a feedforward module II and a Softmax layer;

[0015] The input ends of the linear layer II, the linear layer III, the linear layer IV, and the linear layer V are all connected to the output end of the encoder of the Actor network. The linear layer II and the linear layer III are used to obtain the Query feature in the encoder output of the Actor network and input it into the multi-head attention module II. The linear layer IV is used to obtain the Key feature in the encoder output of the Actor network and input it into the multi-head attention module II. The linear layer V is used to obtain the Value feature in the encoder output of the Actor network and input it into the multi-head attention module II; the output end of the multi-head attention module II is connected to the input end of the feedforward module II, the output end of the feedforward module II is connected to the input end of the Softmax layer, and the input end of the Softmax layer is also connected to the encoder output end of the Actor network.

[0016] Furthermore, the encoder of the Critic network includes a linear layer VI, a linear layer VII, a linear layer VIII, an embedding layer II, a multi-head attention module III, a splicing module III, a splicing module IV, and a feedforward module III;

[0017] The input end of the linear layer VI is the input end of the encoder of the Critic network, the output end of the linear layer VI is connected to the input end of the embedding layer II, the output end of the embedding layer II is respectively connected to the input ends of the multi-head attention module III and the splicing module III, the output end of the multi-head attention module III is connected to the input end of the splicing module III, the output end of the splicing module III is respectively connected to the input ends of the feedforward module III and the splicing module IV, the output end of the feedforward module III is connected to the input end of the splicing module IV, the output end of the splicing module IV is connected to the input end of the linear layer VII, the output end of the linear layer VII is connected to the input end of the linear layer VIII, and the output end of the linear layer VIII is the output end of the encoder of the Critic network.

[0018] Furthermore, the multi-head attention neural network is trained and its parameters are updated through the following process:

[0019] The Actor network outputs the probability of the vehicle selecting the next node, and selects the node with the largest probability value among all nodes as the next node to be reached after being triggered from the current node, until all nodes are traversed to form the vehicle's access sequence Yn;

[0020] Constructing the gradient function The parameters of the Actor network are updated by the gradient function, where:

[0021] in: Represents the input sample X n Under the strategy θ, the conditional probability of the vehicle access sequence Yn is obtained, R(Y n ) is the reward function of the vehicle access sequence Yn determined by the probability value output by the Actor network, It is the reward value output by the Critic network.

[0022] Where: R(Y n ) is the reward function,

[0023] The constraints of the reward function are:

[0024]

[0025] Where: G: An undirected graph map used to store the actual distance between suppliers in the distribution area and the cargo carrying capacity requirements of each supplier, consisting of an edge set E and a point set I

[0026] I: The set of nodes in the undirected graph, that is, the set consisting of warehouse nodes and all supplier nodes

[0027] i: node i, i=0, 1, 2, ..., n

[0028] j: node j, j = 0, 1, 2, ..., m

[0029] E: The set of edges in an undirected graph, used to store the distance e between each node

[0030] Edge e: consists of two nodes connected, e = (i, j)

[0031] qi: cargo transportation demand of node i

[0032] l i,j : The distance between nodes i and j

[0033] C: Transport vehicle collection

[0034] K: Total number of transport vehicles

[0035] k: transport vehicle k, k = 0, 1, 2, ..., K

[0036] O: Maximum load limit of the transport vehicle

[0037] o ki : The remaining weight of vehicle k after loading the goods of supplier j

[0038] x ijk : Decision variable, when the transport vehicle k passes through the edge (i, j) in the task, xijk = 1, if not, xijk = 0

[0039] y ik : Decision variable, when vehicle k serves node i, y ik =1, if the transport vehicle does not serve the node, then y ik =0;

[0040] The mean square error of the Critic network is L: The Adam algorithm is used to calculate the gradient of the error L and back-propagate to optimize the Critic network.

[0041] Furthermore, the coordinates of the starting point and the path nodes of the current vehicle are preprocessed by the following method:

[0042] The latitude and longitude information of the vehicle's starting point and the nodes along the way are converted into coordinate values ​​of the plane coordinate system using the Mercator projection algorithm, and then the coordinate values ​​are normalized.

[0043] The beneficial effects of the present invention are as follows: Through the present invention, the attention mechanism is utilized to concentrate on processing the most important information for the current decision, making decisions in a shorter time than traditional algorithms, improving efficiency, and increasing accuracy. The algorithm is simpler and more flexible, and can handle problems of different scales, and can be generalized well enough to new and Wei Jianguo's large-scale vehicle path planning problem with capacity constraints. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:

[0045] Figure 1 It is a flow chart of the present invention.

[0046] Figure 2 FIG. 4 is a schematic diagram of a path sequence obtained by the present invention in the first example of the present invention.

[0047] Figure 3 This is a real path diagram in the first example of the present invention.

[0048] Figure 4 FIG. 4 is a schematic diagram of a path sequence obtained by the present invention in the second example of the present invention.

[0049] Figure 5 This is a real path diagram in the second example of the present invention.

[0050] Figure 6 FIG. 4 is a schematic diagram of a path sequence obtained by the present invention in the third example of the present invention.

[0051] Figure 7 This is a real path diagram in the third example of the present invention.

[0052] Figure 8 FIG. 4 is a schematic diagram of a path sequence obtained by the present invention in the fourth example of the present invention.

[0053] Fig. 9 This is a real path diagram in the fourth example of the present invention.

[0054] Fig.10 Actor network structure diagram of the present invention.

[0055] Fig.11 This is a schematic diagram of the Critic network structure of the present invention.

[0056] Fig.12 This is a schematic diagram of the circular pickup process. DETAILED DESCRIPTION

[0057] The present invention is further described in detail below:

[0058] The present invention provides a large-scale vehicle path planning method based on a multi-head attention mechanism, comprising the following steps:

[0059] S1. Obtain the starting point and path nodes of the vehicle, and construct an undirected graph map based on the starting point and path nodes;

[0060] S2. Construct a multi-head attention neural network, the neural network includes an Actor network and a Critic network; the Actor network has an encoder and a decoder, the Critic network has an encoder, and the encoders and decoders of the Actor network and the Critic network both have a multi-head attention module;

[0061] S3. The coordinates of each node in the undirected graph and the vehicle's carrying demand are used as the input of the Actor network and the Critic network to train the Actor network, and the output of the Critic network is used to update the parameters of the Actor network;

[0062] S4. Take the coordinates of the current vehicle's starting point, the nodes along the way, and the vehicle's carrying demand as input to predict the optimal path for the next vehicle carrying task. Through the above method, the attention mechanism is used to focus on the most important information for the current decision, making decisions in a shorter time than traditional algorithms, improving efficiency, high accuracy, and making the algorithm simpler and more flexible. It can handle problems of different scales and can be well generalized to new and large-scale vehicle path planning problems with capacity constraints.

[0063] In this embodiment, the encoder of the Actor network includes a linear layer I, an embedding layer I, a multi-head attention module I, a splicing module I, a feedforward module I and a splicing module II;

[0064] The input end of the linear layer I inputs the coordinates of each node in the undirected graph and the carrying capacity of the vehicle, the output end of the linear layer I is connected to the input end of the embedding layer I, the output end of the embedding layer I is respectively connected to the input ends of the multi-head attention module I and the splicing module I, the output end of the splicing module I is connected to the input ends of the feedforward module I and the splicing module II, the output end of the feedforward module I is connected to the input end of the splicing module II, and the output end of the splicing module II is the output end of the encoder. Among them, linear layer I is used to perform linear transformation and mapping on the input, and then the embedding layer I is used to process it to form a 128-dimensional embedding vector. The working principles of multi-head attention modules I, II and III are the same. The embedding vector will pass through three different linear layers to obtain three vectors of query (Query), key (Key), and value (Value), which are also 128 dimensions. At this time, the query (Query) of the current node will be multiplied by the key (Key) of all nodes to obtain a vector with a length of the number of nodes (cvrp nodes). Then a softmax activation function is performed on this vector, and then the weighted summation is performed with the value (Value) of all nodes to obtain a new 128-dimensional vector, which is the output of the attention mechanism module. The advantage of the attention module is that the output contains its own information, and it can efficiently see all node information in parallel, effectively avoiding gradient disappearance and enhancing deep learning capabilities.

[0065] In this embodiment, the decoder of the Actor network includes a linear layer II, a linear layer III, a linear layer IV, a linear layer V, a multi-head attention module II, a feedforward module II and a Softmax layer;

[0066] The input ends of the linear layer II, the linear layer III, the linear layer IV, and the linear layer V are all connected to the output end of the encoder of the Actor network. The linear layer II and the linear layer III are used to obtain the Query feature in the output of the encoder of the Actor network and input it into the multi-head attention module II. The linear layer IV is used to obtain the Key feature in the output of the encoder of the Actor network and input it into the multi-head attention module II. The linear layer V is used to obtain the Value feature in the output of the encoder of the Actor network and input it into the multi-head attention module II. The output end of the multi-head attention module II is connected to the input end of the feedforward module II, and the output end of the feedforward module II is connected to the input end of the Softmax layer. The input end of the Softmax layer is also connected to the output end of the encoder of the Actor network. The decoder of the Actor network outputs the probability of selecting the vehicle as the next node from all nodes. The encoder output of the previous node and the mean of the encoder output. The output of all encoders can directly calculate the key and value through two different linear layers. The query is obtained by averaging the encoder of the last selected node and the encoder of all nodes in each decoding process. Each encoder will first pass through a linear layer. A new query is obtained through a complete multi-head attention mechanism. The new query is used to calculate the probability of each point selection with the key.

[0067] In this embodiment, the encoder of the Critic network includes a linear layer VI, a linear layer VII, a linear layer VIII, an embedding layer II, a multi-head attention module III, a splicing module III, a splicing module IV, and a feedforward module III;

[0068] The input end of the linear layer VI is the input end of the encoder of the Critic network, the output end of the linear layer VI is connected to the input end of the embedding layer II, the output end of the embedding layer II is respectively connected to the input ends of the multi-head attention module III and the splicing module III, the output end of the multi-head attention module III is connected to the input end of the splicing module III, the output end of the splicing module III is respectively connected to the input ends of the feedforward module III and the splicing module IV, the output end of the feedforward module III is connected to the input end of the splicing module IV, the output end of the splicing module IV is connected to the input end of the linear layer VII, the output end of the linear layer VII is connected to the input end of the linear layer VIII, the output end of the linear layer VIII is the output end of the encoder of the Critic network, and the value of the vehicle selecting the next node output by the Critic network. The internal structure of each layer and each module mentioned above can adopt the existing technology, which will not be repeated here.

[0069] In this embodiment, the multi-head attention neural network is trained and its parameters are updated through the following process:

[0070] The Actor network outputs the probability of the vehicle selecting the next node, and selects the node with the largest probability value among all nodes as the next node to be reached after being triggered from the current node, until all nodes are traversed to form the vehicle's access sequence Yn;

[0071] Constructing the gradient function The parameters of the Actor network are updated by the gradient function, where:

[0072] in: Represents the input sample X n The conditional probability of the vehicle access sequence Yn is obtained under the strategy θ; where

[0073] Indicates that at time t, input The starting point is y t When the vehicle is at node y t+1 The probability that y0 is the triggering node is a warehouse, R(Y n ) is the reward function of the vehicle access sequence Yn determined by the probability value output by the Actor network, It is the reward value output by the Critic network.

[0074] Where: R(Y n ) is the reward function,

[0075] The constraints of the reward function are:

[0076]

[0077] Where: G: An undirected graph map used to store the actual distance between suppliers in the distribution area and the cargo carrying capacity requirements of each supplier, consisting of an edge set E and a point set I

[0078] I: The set of nodes in the undirected graph, that is, the set consisting of warehouse nodes and all supplier nodes

[0079] i: node i, i=0, 1, 2, ..., n

[0080] j: node j, j = 0, 1, 2, ..., m

[0081] E: The set of edges in an undirected graph, used to store the distance e between each node

[0082] Edge e: consists of two nodes connected, e = (i, j)

[0083] qi: cargo transportation demand of node i

[0084] l i,j : The distance between nodes i and j

[0085] C: Transport vehicle collection

[0086] K: Total number of transport vehicles

[0087] k: transport vehicle k, k = 0, 1, 2, ..., K

[0088] O: Maximum load limit of the transport vehicle

[0089] o ki : The remaining weight of vehicle k after loading the goods of supplier j

[0090] x ijk : Decision variable, when the transport vehicle k passes through the edge (i, j) in the task, xijk = 1, if not, xijk = 0

[0091] y ik : Decision variable, when vehicle k serves node i, y ik =1, if the transport vehicle does not serve the node, then y ik =0;

[0092] The mean square error of the Critic network is L: The Adam algorithm is used to calculate the gradient of the error L and back-propagate to optimize the Critic network.

[0093] In this embodiment, the coordinates of the starting point and the path nodes of the current vehicle are preprocessed by the following method:

[0094] The latitude and longitude information of the vehicle's starting point and the nodes along the way are converted into coordinate values ​​of the plane coordinate system using the Mercator projection algorithm, and then the coordinate values ​​are normalized. This step is conducive to the processing of neural networks and can solve large-scale CVRP problems in real environments.

[0095] The following further illustrates with specific examples:

[0096] First embodiment: Its planning path is as follows Figure 2 and Figure 3 As shown: In this embodiment, the location information of the warehouse and the node and the carrying capacity information are shown in Table 1, where the demand is 0 to 9 and the carrying capacity is 20:

[0097] Table 1

[0098] Longitude coordinates Latitude coordinates Projection coordinate x Projection coordinate y Demand / Carrying capacity storehouse 105.7062 29.0197 0.0307 0.1226 —— Supplier 1 109.9271 31.2606 1.0000 0.9571 0.4 Supplier 2 109.9168 28.8635 0.9976 0.0651 0.1 Supplier 3 106.6073 30.8571 0.2376 0.8054 0.2 Supplier 4 107.7537 30.8040 0.5009 0.7855 0.05 Supplier 5 106.4658 31.3745 0.2051 1.0000 0.35 Supplier 6 107.5880 31.3115 0.4628 0.9762 0.4 Supplier 7 109.7303 29.3255 0.9548 0.2354 0.05 Supplier 8 108.2232 30.8255 0.6087 0.7935 0.3 Supplier 9 107.5770 31.0980 0.4603 0.8959 0.25 Supplier 10 105.5725 28.6862 0.0000 0.0000 0.3

[0099] Second embodiment: planning path such as Figure 4-Figure 5The location information of the warehouse and the node and the carrying capacity information are shown in Table 2, where the demand is 1 to 9 and the carrying capacity is 30:

[0100] Table 2

[0101] Longitude coordinates Latitude coordinates Projection coordinate x Projection coordinate y Carrying capacity storehouse 106.2866 28.7362 0.2032 0.0786 —— Supplier 1 105.8418 31.3896 0.0948 0.8189 0.1000 Supplier 2 105.6595 31.7825 0.0503 0.9303 0.0667 Supplier 3 106.4338 31.5105 0.2390 0.8531 0.3000 Supplier 4 108.2555 31.3353 0.6830 0.8036 0.1000 Supplier 5 107.5282 28.4504 0.5057 0.0000 0.1667 Supplier 6 108.7154 29.0400 0.7950 0.1624 0.2333 Supplier 7 105.7064 29.7303 0.0617 0.3537 0.1333 Supplier 8 105.4530 30.0364 0.0000 0.4389 0.3000 Supplier 9 109.5564 28.7609 1.0000 0.0854 0.1000 Supplier 10 107.0638 29.8505 0.3926 0.3871 0.2667 Supplier 11 106.8550 31.4022 0.3417 0.8225 0.3000 Supplier 12 109.1587 32.0276 0.9031 1.0000 0.0667 Supplier 13 108.6164 30.7790 0.7709 0.6468 0.2333 Supplier 14 106.1231 31.3682 0.1633 0.8129 0.1333 Supplier 15 105.7427 29.8501 0.0706 0.3870 0.0667 Supplier 16 107.5845 28.8845 0.5195 0.1195 0.0667 Supplier 17 108.6521 31.6874 0.7796 0.9033 0.3000 Supplier 18 109.1068 30.3529 0.8904 0.5273 0.0667 Supplier 19 107.9174 29.5087 0.6006 0.2921 0.3000 Supplier 20 105.6007 28.4821 0.0360 0.0087 0.2000

[0102] Third embodiment: planning path such as Figure 6-Figure 7 The location information of the warehouse and the node and the carrying capacity information are shown in Table 3, where the demand is 1 to 9 and the carrying capacity is 40:

[0103] Table 3

[0104]

[0105]

[0106] Fourth embodiment: planning path such as Figure 8-Figure 9 The location information of the warehouse and the node and the carrying capacity information are shown in Table 4, where the demand is 1 to 9 and the carrying capacity is 40:

[0107] Table 4

[0108]

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

Claims

1. A large-scale vehicle path planning method based on a multi-head attention mechanism, characterized by: The following steps are involved: S1. Obtain the starting point and path nodes of the vehicle, and construct an undirected graph map based on the starting point and path nodes; S2. Construct a multi-head attention neural network, the neural network includes an Actor network and a Critic network; the Actor network has an encoder and a decoder, the Critic network has an encoder, and the encoders and decoders of the Actor network and the Critic network both have a multi-head attention module; S3. The coordinates of each node in the undirected graph and the vehicle's carrying demand are used as the input of the Actor network and the Critic network to train the Actor network, and the output of the Critic network is used to update the parameters of the Actor network; S4. Taking the coordinates of the current vehicle's starting point, the nodes along the way, and the vehicle's carrying demand as input, predict the optimal path for the next vehicle transportation task.

2. The large-scale vehicle path planning method based on the multi-head attention mechanism according to claim 1 is characterized in that: The encoder of the Actor network includes a linear layer I, an embedding layer I, a multi-head attention module I, a splicing module I, a feedforward module I, and a splicing module II; The input end of the linear layer I inputs the coordinates of each node in the undirected graph and the carrying capacity of the vehicle, the output end of the linear layer I is connected to the input end of the embedding layer I, the output end of the embedding layer I is respectively connected to the input ends of the multi-head attention module I and the splicing module I, the output end of the splicing module I is connected to the input ends of the feedforward module I and the splicing module II, the output end of the feedforward module I is connected to the input end of the splicing module II, and the output end of the splicing module II is the output end of the encoder.

3. The large-scale vehicle path planning method based on the multi-head attention mechanism according to claim 1 is characterized in that: The decoder of the Actor network includes a linear layer II, a linear layer III, a linear layer IV, a linear layer V, a multi-head attention module II, a feedforward module II and a Softmax layer; The input ends of the linear layer II, the linear layer III, the linear layer IV, and the linear layer V are all connected to the output end of the encoder of the Actor network. The linear layer II and the linear layer III are used to obtain the Query feature in the encoder output of the Actor network and input it into the multi-head attention module II. The linear layer IV is used to obtain the Key feature in the encoder output of the Actor network and input it into the multi-head attention module II. The linear layer V is used to obtain the Value feature in the encoder output of the Actor network and input it into the multi-head attention module II. The output of the multi-head attention module II is connected to the input of the feedforward module II, and the output of the feedforward module II is connected to the input of the Softmax layer, which is also connected to the encoder output of the Actor network.

4. The large-scale vehicle path planning method based on multi-head attention mechanism according to claim 1 is characterized in that: The encoder of the Critic network includes a linear layer VI, a linear layer VII, a linear layer VIII, an embedding layer II, a multi-head attention module III, a splicing module III, a splicing module IV, and a feedforward module III; The input end of the linear layer VI is the input end of the encoder of the Critic network, the output end of the linear layer VI is connected to the input end of the embedding layer II, the output end of the embedding layer II is respectively connected to the input ends of the multi-head attention module III and the splicing module III, the output end of the multi-head attention module III is connected to the input end of the splicing module III, the output end of the splicing module III is respectively connected to the input ends of the feedforward module III and the splicing module IV, the output end of the feedforward module III is connected to the input end of the splicing module IV, the output end of the splicing module IV is connected to the input end of the linear layer VII, the output end of the linear layer VII is connected to the input end of the linear layer VIII, and the output end of the linear layer VIII is the output end of the encoder of the Critic network.

5. The large-scale vehicle path planning method based on multi-head attention mechanism according to claim 1 is characterized in that: The multi-head attention neural network is trained and its parameters are updated through the following process: The Actor network outputs the probability of the vehicle selecting the next node, and selects the node with the largest probability value among all nodes as the next node to be reached after being triggered from the current node, until all nodes are traversed to form the vehicle's access sequence Yn; Constructing the gradient function The parameters of the Actor network are updated by the gradient function, where: in: Represents the input sample X n Under the strategy θ, the conditional probability of the vehicle access sequence Yn is obtained; R(Y n ) is the reward function of the vehicle access sequence Yn determined by the probability value output by the Actor network, It is the reward value output by the Critic network. Where: R(Y n ) is the reward function, The constraints of the reward function are: Where: G: An undirected graph map used to store the actual distance between suppliers in the distribution area and the cargo carrying capacity requirements of each supplier, consisting of an edge set E and a point set I I: The set of nodes in the undirected graph, that is, the set consisting of warehouse nodes and all supplier nodes i: node i, i=0,1,2,...,n j: node j, j = 0, 1, 2, ..., m E: The set of edges in an undirected graph, used to store the distance e between each node Edge e: consists of two nodes connected, e = (i, j) qi: cargo transportation demand of node i l i,j : The distance between nodes i and j C: Transport vehicle collection K: Total number of transport vehicles k: transport vehicle k, k = 0, 1, 2, ..., K O: Maximum load limit of the transport vehicle o ki : The remaining weight of vehicle k after loading the goods of supplier j x ijk : Decision variable, when the transport vehicle k passes through the edge (i, j) in the task, xijk = 1, if not, xijk = 0 y ik : Decision variable, when vehicle k serves node i, y ik =1, if the transport vehicle does not serve the node, then y ik =0; The mean square error of the Critic network is L: The Adam algorithm is used to calculate the gradient of the error L and back-propagate to optimize the Critic network.

6. The large-scale vehicle path planning method based on multi-head attention mechanism according to claim 1 is characterized in that: The coordinates of the current vehicle's starting point and path nodes are preprocessed by the following method: The latitude and longitude information of the vehicle's starting point and the nodes along the way are converted into coordinate values ​​of the plane coordinate system using the Mercator projection algorithm, and then the coordinate values ​​are normalized.

Citation Information

Cited By

  • Unmanned aerial vehicle route planning method based on graph neural network

    CN119714284A

  • Unmanned aerial vehicle inspection path planning method based on attention mechanism

    CN120576772A

  • Large-scale vehicle path planning method based on deep reinforcement learning

    CN120972966A

  • A large-scale vehicle path planning method based on deep reinforcement learning

    CN120972966B