Path planning method, path planning model and training method of selection model

By dividing and optimizing the initial path set, the problem of slow path planning speed in large-scale vehicle path planning problems is solved, and fast and efficient path planning is achieved.

CN115933554BActive Publication Date: 2025-03-14BAIDU (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211490812.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-25
Publication Date
2025-03-14
Estimated Expiration
2042-11-25

AI Technical Summary

Technical Problem

When the prior art deals with large-scale vehicle path planning problems, the path planning speed is too slow and it is difficult to meet the needs.

Method used

By dividing the initial path set into multiple subsets, selecting the target path set, re-planning the path based on the path planning information of the target path set, obtaining the optimized path set, and updating it to the initial path set.

Benefits of technology

It has achieved rapid solution to large-scale vehicle path planning problems, and improved the speed and quality of path planning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115933554B_ABST
    Figure CN115933554B_ABST
Patent Text Reader

Abstract

The present disclosure provides a path planning method, a path planning model, and a training method for a selection model, and relates to the field of computer technology, and in particular to the fields of artificial intelligence, intelligent transportation, and deep learning technology. Among them, the specific implementation scheme of the path planning method is: divide the first path set corresponding to the first path planning information to obtain multiple second path sets; re-plan the path according to the second path planning information corresponding to the target path set to obtain an optimized third path set; and update the first path set using the third path set. According to the scheme of the embodiment of the present disclosure, a subset with a large room for improvement in path cost is selected from the multiple subsets contained in the first path set, and the corresponding local path planning problem is re-solved, thereby optimizing the current path set, improving the quality of the path set, and increasing the path planning speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to the fields of artificial intelligence, intelligent transportation, and deep learning technology. Background Art

[0002] In the field of logistics and distribution, the main vehicle route planning problem is how to serve spatially dispersed customers at the lowest cost. Optimizing the delivery route can improve work efficiency and quality. When the customer scale is large, the existing technology is too slow to plan the route and it is difficult to meet the demand. Summary of the invention

[0003] The present disclosure provides a path planning method, a path planning model, and a training method, device, equipment, and storage medium for a selection model.

[0004] According to one aspect of the present disclosure, a path planning method is provided, comprising:

[0005] Dividing the first path set corresponding to the first path planning information to obtain a plurality of second path sets; wherein the second path set is a subset of the first path set;

[0006] Selecting a target path set from a plurality of second path sets;

[0007] Re-planning the path according to the second path planning information corresponding to the target path set to obtain an optimized third path set; wherein the second path planning information includes part of the first path planning information;

[0008] The first set of paths is updated with the third set of paths.

[0009] According to another aspect of the present disclosure, a method for training a selection model is provided, comprising:

[0010] Determining first parameters of each path subset included in the sample path set, the sample path set having corresponding first path planning information;

[0011] Determine the second parameter of each path subset using the first selection model according to each path subset and its corresponding second path planning information; wherein the second path planning information corresponding to the path subset includes part of the first path planning information of the sample path set to which the path subset belongs; and

[0012] The first selection model is trained according to the difference between the first parameter and the second parameter to obtain a trained second selection model.

[0013] According to another aspect of the present disclosure, a method for training a path planning model is provided, comprising:

[0014] Inputting the path planning information sample into an encoder of the first path planning model to obtain an encoding vector corresponding to the path planning information sample, where the encoding vector includes a representation vector of at least one node in the path planning information sample;

[0015] Iteratively perform the following steps until each second path included in the training path set is obtained: input the representation vector of the node included in the second path into the decoder of the first path planning model to obtain the decoding vector of the second path; fuse the decoding vector of the second path and the encoding vector corresponding to the path planning information sample based on the attention mechanism to obtain the next node in the second path; and

[0016] The first path planning model is trained using a gradient ascent method and a cost function of a training path set to obtain a trained second path planning model.

[0017] According to another aspect of the present disclosure, there is provided a path planning device, comprising:

[0018] A division module, used for dividing the first path set corresponding to the first path planning information to obtain a plurality of second path sets; wherein the second path set is a subset of the first path set;

[0019] A selection module, used for selecting a target path set from a plurality of second path sets;

[0020] An optimization module, configured to re-plan the path according to the second path planning information corresponding to the target path set, so as to obtain an optimized third path set; wherein the second path planning information includes part of the first path planning information;

[0021] The updating module is used to update the first path set by using the third path set.

[0022] According to another aspect of the present disclosure, there is provided a training device for selecting a model, comprising:

[0023] A first determination module, used to determine a first parameter of each path subset included in a sample path set, the sample path set having corresponding first path planning information;

[0024] A second determination module is used to determine the second parameter of each path subset according to each path subset and its corresponding second path planning information using the first selection model; wherein the second path planning information corresponding to the path subset includes part of the first path planning information of the sample path set to which the path subset belongs; and

[0025] The first training module is used to train the first selection model according to the difference between the first parameter and the second parameter to obtain a trained second selection model.

[0026] According to another aspect of the present disclosure, a training device for a path planning model is provided, comprising:

[0027] An input module, used to input the path planning information sample into an encoder of the first path planning model to obtain an encoding vector corresponding to the path planning information sample, where the encoding vector includes a representation vector of at least one node in the path planning information sample;

[0028] An iteration module is used to iteratively perform the following steps until each second path included in the training path set is obtained: inputting the representation vector of the node included in the second path into the decoder of the first path planning model to obtain the decoding vector of the second path; fusing the decoding vector of the second path and the encoding vector corresponding to the path planning information sample based on the attention mechanism to obtain the next node in the second path;

[0029] The second training module is used to train the first path planning model by using a gradient ascent method and a cost function of a training path set to obtain a trained second path planning model.

[0030] According to another aspect of the present disclosure, there is provided an electronic device, comprising:

[0031] at least one processor; and

[0032] a memory communicatively connected to the at least one processor; wherein,

[0033] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of any embodiment of the present disclosure.

[0034] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method according to any embodiment of the present disclosure.

[0035] According to another aspect of the present disclosure, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method according to any one of the embodiments of the present disclosure is implemented.

[0036] According to the solution of the embodiment of the present disclosure, a subset with a large room for improvement in path cost is selected from the multiple subsets included in the first path set, and the corresponding local path planning problem is re-solved, thereby optimizing the current path set, improving the quality of the path set and increasing the path planning speed.

[0037] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0039] Figure 1 is a flow chart of a path planning method according to an embodiment of the present disclosure;

[0040] Figure 2 is an architecture diagram of a path planning model according to an embodiment of the present disclosure;

[0041] Figure 3 is a flowchart of a divide-and-conquer iterative solution according to an embodiment of the present disclosure;

[0042] Figure 4A is a schematic diagram before path fine-tuning according to an embodiment of the present disclosure;

[0043] Figure 4B is a schematic diagram of a path fine-tuned according to an embodiment of the present disclosure;

[0044] Figure 5 is a schematic diagram of the overall process of a path planning method according to an embodiment of the present disclosure;

[0045] Figure 6 is a flowchart of a training method for selecting a model according to an embodiment of the present disclosure;

[0046] Figure 7 is a schematic diagram of the principle of a training method for a selection model according to an embodiment of the present disclosure;

[0047] Figure 8 is a flowchart of a training method for a path planning model according to an embodiment of the present disclosure;

[0048] Fig. 9 is a schematic structural diagram of a path planning device according to an embodiment of the present disclosure;

[0049] Fig.10 is a structural schematic diagram of a training device for selecting a model according to an embodiment of the present disclosure;

[0050] Fig.11 is a schematic diagram of the structure of a training device for a path planning model according to an embodiment of the present disclosure;

[0051] Fig.12 is a block diagram of an electronic device for implementing an embodiment of the present disclosure. DETAILED DESCRIPTION

[0052] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0053] In the related technology, how to carry out logistics distribution faster and more intelligently has become an urgent problem to be solved in current practical applications. Taking the Capacitated Vehicle Routing Problem (CVRP) as an example, there are several customers with needs. Each customer has a location coordinate and his own demand. The coordinates of the distribution station are known. It is necessary to minimize the total cost (total path mileage or other costs) of the planned distribution route while meeting the needs of all customers. At present, open source solving tools such as OR-Tools and LKH-3 are generally used to solve the CVRP problem. However, these current solving tools can solve a good result within an acceptable time range for small-scale CVRP problems, such as solving a better feasible solution (closer to the optimal solution) for a CVRP problem of 100 customers within 300 seconds. However, when the number of customers becomes larger, such as a CVRP problem involving 1,000 customers, these solvers may take several hours to find a better solution, which is unacceptable in real scenarios.

[0054] In order to at least partially solve one or more of the above-mentioned problems and other potential problems, the embodiments of the present invention provide a path planning method, a path planning model and a training method for selecting a model. By using the technical solution of the embodiments of the present invention, a better solution to the large-scale vehicle planning problem can be solved more quickly, and it can be extended and applied to large-scale CVRP problems and VRPTW problems (Vehicle Routing Problem with Time Windows).

[0055] Figure 1 is a flow chart of a path planning method according to an embodiment of the present disclosure, such as Figure 1 As shown, the method comprises at least the following steps:

[0056] S101. Divide a first path set corresponding to first path planning information to obtain multiple second path sets; wherein the second path set is a subset of the first path set.

[0057] In the disclosed embodiments, the path planning information may be understood as path planning tasks, path planning conditions, path planning problems, etc. In one example, taking the logistics distribution scenario as an example, the first path planning information may include customer information, vehicle information, and distribution station (warehouse) information, etc. Customer information may include location information and demand information of each customer. The demand information may further include the volume of goods to be delivered, the time window for receiving goods, etc. Vehicle information may include capacity information of each delivery vehicle. Distribution station information may include location information of the distribution station.

[0058] In one example, the first path planning information may include a CVRP problem. After various types of information are digitized, the CVRP problem may be specifically as follows: there are 1000 customers, the coordinates of each customer are [[1203.76,76.78],...,[1243.98,34,62]], the demand corresponding to each customer is [27,87,...,91], the coordinates of the warehouse point are [1287.12,66,98], there are n delivery vehicles, and the capacity of each vehicle is 8000.

[0059] The first path set may include a collection of multiple paths that pass through the customer's location, and the paths included in the first path set may collectively cover all customers that the first path planning information needs to pass through. Generally speaking, the capacity of a delivery vehicle is limited, and after delivering the goods loaded in the vehicle, the delivery vehicle needs to return to the distribution station to reload the goods. A path may include: the delivery vehicle starts from the starting point and returns to the starting point after completing the delivery. The delivery vehicle delivers to the customers on the path in turn along each path, and each customer is reflected as a node on the path.

[0060] The second path set is a subset of the first path set, and the second path set may include some paths of the first path set. Different second path sets may have partial intersections or no intersections.

[0061] S102: Select a target path set from multiple second path sets.

[0062] In the disclosed embodiment, the target path set may be a path set that needs to be further processed. By selecting the target path set from multiple second path sets, a path set that can improve the distribution efficiency and reduce the distribution cost to a greater extent can be selected from the second path set. That is, by optimizing the target path set, a path set with a greater improvement can be obtained. The specific selection method is described later.

[0063] S103: re-plan the path according to the second path planning information corresponding to the target path set to obtain an optimized third path set, wherein the second path planning information includes part of the first path planning information.

[0064] In the disclosed embodiment, the second path planning information may be a subset of the first path planning information. If the first path planning information is referred to as a path planning problem, the second path planning information may also be referred to as a sub-problem of the path planning problem. Each second path set may have corresponding second path planning information. The second path planning information corresponding to the target path set, i.e., the sub-problem, may be re-path planned to obtain a third path set that is better than the target path set in a faster time. Any path planning method may be used for re-path planning, which is not limited here.

[0065] S104: Use the third path set to update the first path set.

[0066] In the embodiment of the present disclosure, replacing the original target path set in the first path set with the third path set can improve the quality of the first path set and reduce part of the delivery cost. The delivery cost is also called path cost, which can usually be determined by the length of the delivery path.

[0067] In the disclosed embodiment, S101 to S104 can be executed once or iteratively multiple times. A specific number of iterations or conditions for stopping iterations can be set. For example, each time the first path set is updated, S101 to S104 are repeatedly executed based on the updated first path set, the updated first path set is divided to obtain a second path set, a target path set is selected from the multiple second path sets, the path is replanned, and the first path set is updated using the optimized third path set. After multiple rounds of iterations, sub-problems can be selected from the path planning problem for multiple times to solve. By dividing a large problem into sub-problems and dividing and conquering them, each round of iteration optimizes the solution to a sub-problem, so that divide-and-conquer iterative solution can be achieved through multiple rounds of iterations, thereby improving the quality of the overall solution and obtaining a better feasible solution to the path planning problem.

[0068] According to the solution of the embodiment of the present disclosure, by selecting a subset that can reduce the path cost to a greater extent from the multiple subsets included in the first path set, the corresponding local path planning problem is re-solved, thereby optimizing the current path set and obtaining a better feasible solution to the path planning problem. Improving the quality of the feasible solution can improve the delivery efficiency in the delivery scenario. At the same time, since the number of customers corresponding to the sub-problem is smaller, the solution speed is faster, and a better feasible solution can be quickly obtained.

[0069] In a possible implementation, the path planning method of the embodiment of the present disclosure includes steps S101 to S104. The method may also include the following steps:

[0070] S201. Perform initial path planning according to first path planning information to obtain an initial first path set.

[0071] In the disclosed embodiment, S201 may be before S101. Path planning is performed on the path planning problem represented by the first path planning information to obtain an initial first path set, i.e., an initial solution. There is no requirement for the quality of the initial solution, as long as it is feasible, so the initial solution can also be understood as a generally feasible solution. In one example, a pre-trained path planning model can be used to generate a generally feasible solution. It should be noted that various path planning methods in related technologies can also be used to obtain a generally feasible solution.

[0072] According to the solution of the embodiment of the present disclosure, a general feasible solution is first generated for the first path planning information to obtain an initial first path set for subsequent step-by-step optimization, thereby making the path planning more efficient.

[0073] In a possible implementation, step S201 performs initial path planning according to the first path planning information to obtain an initial first path set, further comprising the steps of:

[0074] S2011. Input the first path planning information into an encoder of a path planning model to obtain a coding vector corresponding to the first path planning information, where the coding vector includes a representation vector of at least one node in the first path planning information.

[0075] In the present disclosure, Figure 2 As shown in the architecture diagram of the path planning model, the model adopts a neural network model based on a transformer structure. The model includes several encoders and decoders. The path planning problem of the first path planning information is transformed into a vector through the encoding input layer and then input into the encoder. Specifically, the encoding input layer vectorizes the location information and demand information of the node represented by each customer.

[0076] S2012, iteratively perform the following steps until each first path included in the first path set is obtained:

[0077] The representation vectors of the nodes included in the first path are input into the decoder of the path planning model to obtain the decoding vector of the first path.

[0078] The decoding vector of the first path and the encoding vector corresponding to the first path planning information are fused based on the attention mechanism to obtain the next node in the first path.

[0079] In the disclosed embodiment, the encoder is used to encode the entire path planning problem, and after encoding into a vector, it is input into the decoder to decode the problem and decode a feasible solution to the problem. Since the decoding is performed in a loop, the decoder parses a node in the path each time it loops. The input layer of the decoder inputs the vector of the client node that has been decoded, that is, the decoding vector of the existing first path. By fusing the decoding vector and the encoding vector of the entire path planning problem together through the attention mechanism, the model can output which node is the next node of the current first path in the feasible solution. Specifically, the decoder will output a probability for each node. According to the probability, the idea of ​​greedy (beam search) is used to select the node with the highest probability as the next node each time, so as to continuously iterate the decoding and finally generate a path covering each node to obtain a general feasible solution.

[0080] According to the solution of the embodiment of the present disclosure, a pre-trained model is used to generate an initial solution. The model adopts an offline training and online prediction mode. Therefore, after a path planning problem is given online, it can be solved quickly to obtain an initial first path set.

[0081] In a possible implementation, step S2011 inputs the first path planning information into an encoder of a path planning model to obtain a coding vector corresponding to the first path planning information, further comprising the steps of:

[0082] The first path planning information is converted into a first vector through an input layer of the encoder.

[0083] The first vector is processed sequentially through the encoder's multi-head attention mechanism layer, the first residual and normalization layer, the feedforward network layer, and the second residual and normalization layer to obtain a representation vector of at least one node in the first path planning information.

[0084] In the disclosed embodiment, after the path planning problem is converted into a first vector through the encoding input layer, the first vector sequentially passes through the multi-head attention mechanism layer, the first residual and normalization layer, the feedforward network layer, the second residual and normalization layer to obtain a representation vector of at least one node. If the layer structure of the encoder in the path planning model changes, the above encoding process may also change accordingly.

[0085] According to the solution of the embodiment of the present disclosure, the path planning problem is encoded using an encoder, and a vector representing the problem is obtained based on the attention mechanism, which helps to improve the quality of the initial solution obtained. The quality of the initial solution has a certain impact on the result of the iterative solution, so it can also improve the quality of the better feasible solution.

[0086] In a possible implementation, step S2011 inputs the first path planning information into an encoder of a path planning model to obtain a coding vector corresponding to the first path planning information, and further includes the steps of:

[0087] The representation vectors of multiple nodes in the first path planning information are concatenated through a fully connected layer to obtain a coding vector corresponding to the first path planning information.

[0088] In the disclosed embodiment, after obtaining the characterization vector of each node, in order to obtain the characterization vector of the entire customer, the characterization vectors of all nodes are spliced ​​together and passed through a fully connected layer to obtain the characterization vector of the entire path planning problem, that is, the first path planning information.

[0089] According to the solution of the embodiment of the present disclosure, the vectors of each node are concatenated through a fully connected layer to obtain a representation vector of the first path planning information, so that the features extracted by the model are more comprehensive.

[0090] In a possible implementation, step S102 selects a target path set from a plurality of second path sets, further comprising the steps of:

[0091] S301: Input a plurality of second path sets and second path planning information corresponding to the plurality of second path sets into a selection model, and predict respective optimization parameters of the plurality of second path sets.

[0092] In the disclosed embodiment, the optimization parameter can be understood as an estimate for evaluating the optimization effect after optimizing each second path set. Taking the optimization parameter as cost as an example, the selection model is pre-trained and can predict the cost of multiple second path sets after optimization. The cost can be determined according to the length of the path. The length of the path determines the cost to the greatest extent, and the cost can also include other factors such as the number of traffic lights on the path and the traffic volume on the road.

[0093] S302: Determine the second path set with the largest difference between the optimized parameters of the second path set and the initial parameters of the first path set as the target path set.

[0094] In the embodiment of the present disclosure, the initial parameter may be the original length of each path in the second path set before optimization. By selecting the difference between the optimized cost predicted by the model and the initial cost, the second path set with the largest difference is determined as the target path set.

[0095] According to the solution of the embodiment of the present disclosure, the optimization parameters of each second path set are predicted by selecting a model and compared with the initial optimization parameters, and the seat target path set with the largest difference is subjected to subsequent path optimization, thereby ensuring that each optimization can maximize the quality of the feasible solution and reduce the length of the delivery path.

[0096] In a possible implementation, the plurality of second path sets include: N adjacent paths in the first path set; wherein N is an integer greater than 1 and less than M, and M is the number of paths in the first path set.

[0097] In the embodiment of the present disclosure, each second path set includes N adjacent paths in the first path set. For example, M is 5 and N is 3. The first path set includes 5 paths, and each path and its two nearest paths around it constitute a second path set, so there are 5 different second path sets in total.

[0098] In one example, if Figure 3 The divide-and-conquer iterative solution process shown includes the following steps:

[0099] Step (a): Obtain a path set, which may be an initial first path set or an updated first path set. In the figure, the five-pointed stars represent distribution sites, and the circles represent nodes of each path.

[0100] Step (b): Determine the center point of each path in the path set (the diamond block in the figure).

[0101] Step (c): For each path, select two paths adjacent to it as a second path set.

[0102] Step (d): Determine the target path set by selecting the model.

[0103] Step (e): Solve the target path set to obtain an optimized third path set.

[0104] Step (f): Use the third path set to update the first path set, and return the updated first path set to step (b) for iteration.

[0105] According to the solution of the embodiment of the present disclosure, by setting the parameter N, the complexity of the sub-problems of the path planning problem can be controlled, which facilitates the adjustment of the speed and quality of solving the sub-problems.

[0106] In a possible implementation, step 103 re-plans the path according to the second path planning information corresponding to the target path set to obtain an optimized third path set, further comprising the steps of:

[0107] Extract each to-be-processed node information from the paths included in the target path set.

[0108] In the disclosed embodiment, the node information to be processed is the path planning information corresponding to each node in the target path set, including the location information and demand information of the node.

[0109] According to the second path planning information corresponding to the target path set, the open source solver is used to re-plan the path of each node to be processed to obtain an optimized third path set.

[0110] In the disclosed embodiments, the open source solver may be a solver such as OR-Tools, LKH-3, etc.

[0111] According to the solution of the embodiment of the present disclosure, an open source solver is used to solve the selected sub-problems. Since the sub-problems involve a small number of customers and the solving speed is fast, the first path set can be quickly optimized at a low cost to obtain a better feasible solution.

[0112] In a possible implementation, the path planning method of the embodiment of the present disclosure includes steps S101 to S104. The method may also include the following steps:

[0113] S401: Determine a path to be adjusted according to the distance between each node of each path in the first path set.

[0114] S402: Adjust the nodes and / or the order of the nodes that the path to be adjusted passes through to obtain an adjusted fourth path set.

[0115] In the disclosed embodiment, the path to be adjusted can be understood as a path that may be further optimized in the path set. For example, if a part of the nodes in one of the paths in the path set is far away from other nodes in the path, but closer to another path, this situation will greatly reduce the quality of the solution. Therefore, the part of the nodes can be transferred from the original path to the closer path.

[0116] It should be noted that the path to be adjusted may be generated in the initial feasible solution, or may be generated in a better feasible solution after optimization. In other words, the path set to be adjusted may exist in the first path set before updating, or may exist in the first path set after being updated with the third path set.

[0117] According to the solution of the embodiment of the present disclosure, by further adjusting the optimized first path set, the better feasible solution can be further optimized, so that the obtained fourth path set is closer to the optimal solution or becomes the optimal solution.

[0118] In a possible implementation, step S401 determines the path to be adjusted according to the distance between each node of each path in the first path set, and further includes the steps of:

[0119] S4011. Divide all nodes on each path according to the distance between each node on each path in the first path set to obtain a number of cluster nodes and a center point of each cluster node.

[0120] In the disclosed embodiment, the average value of the distance between each node on each path can be calculated. When the distance between two consecutive nodes on a path is greater than the average value of the distance between each node on the path and exceeds a preset threshold, the former and the latter of the two nodes are divided into different clusters, thereby dividing the nodes on each path into several clusters. After the division is completed, the center point of each cluster node is determined according to the position of each cluster node.

[0121] S4012. Determine the center point of each path included in the target path set.

[0122] The center point of a path can be determined based on the center point of the positions of all nodes on the path.

[0123] S4013: Determine the path to be adjusted according to the distance between the center point of each cluster node and the center point of each path.

[0124] In the present disclosure, Figure 4A As shown, Figure 4A A cluster of nodes in the box area on path 4 in the figure are far away from the center point of path 4 where they are located, but are closer to the center point of path 1. Therefore, by calculating the center point of this cluster node and then calculating the distance with the center points of all paths respectively, it is possible to determine whether the cluster node needs to be adjusted. Specifically, if this cluster node can meet the relevant conditions when added to other paths, and the adjusted cost is smaller than before, then the cluster node can be adjusted and added to path 1 that is closest to them. In this case, the path where the cluster node is located is determined as the path to be adjusted. The above-mentioned relevant conditions may include: whether the time window requirements of the cluster customers are met, whether the capacity of the delivery vehicles will exceed the standard after adjustment, etc. The schematic diagram after the adjustment of the box area is as follows Figure 4B shown.

[0125] According to the solution of the embodiment of the present disclosure, the path to be adjusted can be determined by the distance between the center point of each cluster node on each path and the center point of each path, thereby achieving further fine-tuning and correction of the path set, ensuring the superiority of the final result.

[0126] In a possible implementation, step S4013 determines the path to be adjusted according to the distance between the center point of each cluster node and the center point of each path, and further includes the steps of:

[0127] Determine the first distance between the center point of each cluster node and the center point of the path where it is located.

[0128] Determine the second distance between the center point of each cluster node and the center points of other paths.

[0129] When the first distance of any cluster node is greater than any second distance of the corresponding cluster node, the cluster node is determined as a node to be adjusted, and the path where the node to be adjusted is located is a path to be adjusted.

[0130] In one example, assume that there are three paths A, B, and C in the path set, and the nodes on the three paths are divided into 3 clusters, 2 clusters, and 4 clusters, respectively, which are recorded as: A1, A2, A3, B1, B2, C1, C2, C3, and C4. Determine the first distance between the center point of each cluster node and the center point of the path where it is located, which is to determine the distance from the center point of the three cluster nodes A1, A2, and A3 to the center point of path A respectively. The same is true for paths B and C. Determine the second distance between the center point of each cluster node and the center point of other paths, which is to determine the distance from the center point of the three cluster nodes A1, A2, and A3 to the center of path B and path C respectively. The same is true for paths B and C. If the first distance of any cluster node is greater than any second distance of the corresponding cluster node, that is, the distance from a cluster node to the center point of its own path is greater than its distance to the center of other paths, it means that the cluster node is closer to other paths and may need to be adjusted. Therefore, the cluster node is determined as the node to be adjusted, and the path where the node to be adjusted is the path to be adjusted.

[0131] According to the solution of the embodiment of the present disclosure, by determining whether each cluster node is closer to other paths other than its own path according to the first distance and the second distance of each cluster node, the path can be corrected.

[0132] In a possible implementation manner, step S402 adjusts the nodes and / or the order of the nodes that the path to be adjusted passes through to obtain an adjusted fourth path set, further comprising the steps of:

[0133] A path with the smallest second distance to the node to be adjusted is determined as the target path.

[0134] The node to be adjusted is deleted from the path to be adjusted and added to the target path.

[0135] The node order of the target path and the path to be adjusted is re-determined to obtain an adjusted fourth path set.

[0136] In the disclosed embodiment, the node order of the target path and the path to be adjusted can be re-determined based on the distance between the center point of each cluster node of the target path and the center point of the node to be adjusted. The node order of the target path. Specifically, based on the distance between each cluster node in the target path and the node to be adjusted, the two clusters with the closest distance are selected, and the node order of the node to be adjusted is set between the two cluster nodes based on the order of the two cluster nodes. It is also possible to re-plan the path based on the path planning information corresponding to the target path and the path to be adjusted, so as to determine the node order.

[0137] According to the solution of the embodiment of the present disclosure, the quality of the better feasible solution is further improved by re-determining the nodes and the order of the nodes passed by the path to be adjusted.

[0138] In a possible implementation, the path planning method of the embodiment of the present disclosure includes step S201, step S101 to step S104, and step S401 to step S402. Specifically, Figure 5 The overall flow chart of the path planning method shown. The path planning method can be executed by the following modules: an initial solution generation module, a divide-and-conquer iterative solution module, and a solution fine-tuning module. For example, for a path planning problem, the initial solution generation module (path planning model) executes steps S201, S2011 to S2012 to obtain a general feasible solution. The general feasible solution is input into the iterative solution module, and steps S101 to S104 and steps S301 to S302 are executed to obtain a better feasible solution. The better feasible solution is input into the solution fine-tuning module, and steps S401 to S402 and S4011 to S4013 are executed to obtain the optimal solution or a solution close to the optimal solution.

[0139] In one example, taking the path planning information as a CVRP problem as an example, a specific CVRP problem may include: there are 1000 customers, the coordinates of each customer are [[1203.76,76.78],...,[1243.98,34,62]], the corresponding demand of each customer is [27,87,...,91], the coordinates of the warehouse point are [1287.12,66,98], there are n vehicles, and the capacity of each vehicle is 8000. First, the information of this problem is input into the initial solution generation module, which will generate an initial general feasible solution according to the problem itself and the problem type. This solution has a certain influence on the result of the subsequent iterative solution. Therefore, a pre-trained path planning model is used to generate the initial solution of the problem; after the initial general feasible solution is generated, this solution and the current problem are input into the iterative solution module to iteratively solve the large-scale VRP problem and output a better feasible solution. The better feasible solution can be used as the final output solution. However, through practice, we found that there are still some areas that can be optimized for the optimal feasible solution, so we use a heuristic algorithm to fine-tune the optimal solution, so that the solution is closer to the optimal solution or becomes the optimal solution. This method uses the offline training and online prediction mode, so after a problem is given online, it can quickly solve and output a better solution. Compared with open source solvers, it is faster and more effective.

[0140] The specific introduction of the initial solution generation module, the divide-and-conquer iterative solution module and the solution fine-tuning module is as follows:

[0141] (I) Initial solution generation module

[0142] A good initial solution can provide a good start for the subsequent iterative divide-and-conquer problem, thereby accelerating the generation of solutions and improving the quality of solutions. Therefore, we added an initial solution generation module before iterative divide-and-conquer solution to large-scale VRP problems. The initial solution generation module is mainly based on the Transformer improvement. The overall structure of the model is as follows: Figure 2 shown.

[0143] Model structure: The entire model consists of two parts: multiple encoders and multiple decoders. Consistent with the traditional Transformer, a multi-layer encoder is used, each of which consists of an attention mechanism layer, a feedforward neural network layer, a residual and annotated layer. The input path planning problem is transformed into a vector through an encoding input layer and then input into the encoder. The vector passes through the multi-head attention mechanism, the residual and normalization layer, the feedforward network layer, the residual and normalization layer in turn to obtain the representation vector of each customer node. In order to obtain the representation vector of the entire customer, the representation vectors of all customers are spliced ​​together and passed through a fully connected neural network layer to obtain the representation vector of the entire problem. The encoder is used to encode the entire path planning problem. After encoding it into a vector, it can be input into the decoder to decode the problem and decode the feasible solution of the problem. Since the decoding is cyclic, each time the decoder parses a node in the feasible solution path, the input layer of the decoder is the vector of the customer node that has been decoded before, that is, the node that has been included in the existing path. By fusing the decoded vector with the encoding vector of the entire problem through the attention mechanism, the model can output what the next node in the current path is. The criterion for determining the next node is the probability output by the decoder. The decoder will output a probability for each client node. The idea of ​​greedy (beam search) can be used to select the node with the largest probability as the next node each time, so as to continuously iterate the decoding and finally generate a feasible solution path.

[0144] Model training: The initial solution generation model is trained using reinforcement learning. For example, when training the initial solution generation model offline, a route planning problem with 1 million customers and 1,000 customers is randomly constructed. In the reinforcement learning training, a problem is randomly selected each time to encode and decode to find a feasible solution, and then the cost of this feasible solution is calculated. Then, the gradient ascent method is used to update the network based on this cost. Because the smaller the cost, the better, -cost is passed to the model as loss to let the model learn to reduce the cost as much as possible until the model converges and the training is completed.

[0145] Model prediction: Once the model training is completed, the initial solution generation prediction of related problems can be performed online. After entering a new path planning problem, the model will quickly output a feasible solution as the initial solution to this problem.

[0146] (II) Divide and conquer iterative solution module

[0147] For a large-scale path planning problem (for example, 1,000 customer nodes), the initial solution of the problem can be obtained after the initial solution generation module. However, due to the large number of customer nodes in this problem, the initial solution generated by the simple end-to-end model may be far from the optimal solution and cannot meet the actual business needs. Therefore, it is necessary to use the divide-and-conquer iterative solution module to further solve the problem based on this initial solution.

[0148] The process of divide-and-conquer iterative solution: For a specific path planning problem P, the feasible solution X obtained contains k paths, and then the trained sub-problem selector fθ is used to select an area S on the feasible solution X, where S contains some of the k paths. Area S is a sub-problem of the path planning problem P. The trained fθ should select an area S that can greatly improve the overall solution. After that, the nodes of all paths in S are extracted, and an open source solver is used to solve this S to obtain the solution Xs′ of the sub-problem S. The solution to the sub-problem is then used to replace the solution to the corresponding sub-problem in the original feasible solution X. Then a new feasible solution X1 with a certain improvement in quality is obtained. The above operations are performed iteratively until a certain number of steps is reached or the optimal solution is obtained. How to select sub-problems is related to the quality of the solution to the final problem. The disclosed embodiment uses a Transformer-based encoder module to train a sub-problem selection model, so that sub-problems are selected at each step of the iteration. The structure of the sub-problem selection model is as follows Figure 7 shown.

[0149] Training of sub-problem selection model: For solving the path planning problem with 1000 customer nodes, 5000 path planning problems with 1000 customer nodes can be randomly generated, and then these 5000 problems are solved by iterative solution for 30,000 steps to obtain the optimal solution of the whole problem and the sub-problems in it, and the initial cost of sub-problem S and the cost corresponding to sub-problem S at the optimal solution are recorded. Since the selection training model has not been trained yet, the sub-problem is selected randomly at this time. By solving these 5000 problems, 1 million training samples can be obtained, and then these samples are used to train the sub-problem selection model. The node coordinate information and demand information of the sub-problem are input into the model, and the cost of the current sub-problem is output after passing through 6 layers of Transformer encoding layer, fully connected layer, and average pooling layer in sequence. This allows the model to fit the cost of a sub-problem at the optimal solution.

[0150] Model prediction: In the prediction stage, the subproblem selection model can be used to predict each subproblem separately. The cost predicted by the model is selected and the cost of the current initial solution is used as the difference. The subproblem with the largest difference is the one that can reduce the cost of the entire problem the most. Use an open source solver to solve the subproblem, and then replace the original solution with the solution of this subproblem. Repeat this process until a better solution is found or the set number of iterations is reached. In each round of iteration, the subproblem with the largest cost reduction is selected and solved by divide-and-conquer, which can quickly reduce the cost and improve the quality of the solution.

[0151] (III) Solution fine-tuning module

[0152] After solving a large-scale path planning problem using the divide-and-conquer iterative solution module, a better solution will be obtained. However, in actual business scenarios, it is found that the better solution may still be further optimized. For example, in one of the paths of the solution, a small number of customer nodes are far away from the majority of customer points on this path but very close to another path. This situation will greatly reduce the quality of the solution. Figure 4A The customer nodes in the box are far away from the center point of the route they are on, but close to the center points of other paths. Therefore, the center points of these small number of customers are calculated and then the distances to the center points of all paths in the current path are calculated. If these small number of customer points can be added to other paths, meet the relevant conditions, and the overall cost is smaller than before, then these small number of customer points will be adjusted and added to the path closest to them. The schematic diagram after the box area is adjusted is as follows Figure 4B shown.

[0153] Through this heuristic fine-tuning method, the better solution generated by the model can be further optimized to obtain a solution that is closer to the optimal solution or the optimal solution, ensuring the superiority of the final result.

[0154] The path planning method proposed in the embodiment of the present disclosure solves the problem through continuous iterative optimization through the synergistic effect of three modules. When dealing with large-scale path planning problems, a better solution can be solved for a large-scale path planning problem in a shorter time, and the time spent on solving the same solution on business data is reduced by more than 2 times.

[0155] Figure 6 is a flow chart of a training method for selecting a model according to an embodiment of the present disclosure, such as Figure 6 As shown, the method comprises at least the following steps:

[0156] S601. Determine a first parameter of each path subset included in a sample path set, where the sample path set has corresponding first path planning information.

[0157] S602: Determine the second parameter of each path subset using the first selection model according to each path subset and its corresponding second path planning information, wherein the second path planning information corresponding to the path subset includes part of the first path planning information of the sample path set to which the path subset belongs.

[0158] S603: Train the first selection model according to the difference between the first parameter and the second parameter to obtain a trained second selection model.

[0159] In the disclosed embodiment, the first parameter and the second parameter can be understood as the cost of the path, and the cost can usually be determined by the length of the path. The first parameter is the actual cost after optimization, that is, the true value. The second parameter is the optimized cost predicted by the model, that is, the predicted value. According to the difference between the predicted value and the true value, the first selection model can be trained. Thereby, the trained second selection model can accurately predict the optimized cost of each path subset.

[0160] like Figure 7 As shown, the selected model adopts an encoder based on a Transformer structure, and the model includes a Transformer encoder layer, a fully connected layer, and an average pooling layer. In one example, the number of Transformer encoder layers is 6 layers.

[0161] The number of customer nodes in the sample path set can be comparable to the number of customers of the path planning problem to be solved online. In one example, it can be generated specifically for the path planning problem with 1000 customer nodes. Specifically, 5000 path planning problems with 1000 customer nodes can be randomly generated, and then the 5000 problems can be solved for 30,000 steps using the above-mentioned iterative divide-and-conquer method. The optimal solution to the entire problem and the sub-problems therein can be obtained, and the cost corresponding to the sub-problem S and the sub-problem S at the optimal feasible solution can be recorded. Since the model training has not been completed at this time, the sub-problems are selected in a random manner. By solving these 5000 problems, at least hundreds of thousands of training samples can be obtained, and then these sample path sets are used to train the sub-problem selection model.

[0162] According to the scheme of the embodiment of the present disclosure, the selection model predicts the optimized cost according to the second path planning information corresponding to each path subset, so that it can be determined according to the original cost which path subset to optimize in order to reduce the cost the most, thereby improving the speed of optimizing the path set and obtaining a better feasible solution more quickly.

[0163] In a possible implementation, step S602 determines the second parameter of each path subset using the first selection model according to each path subset and the corresponding second path planning information, further comprising:

[0164] Each path subset and its corresponding second path planning information are processed in sequence through the converter encoding layer, the fully connected layer and the average pooling layer of the first selection model to obtain the second parameters of the second path planning information.

[0165] In the disclosed embodiment, each path subset and its corresponding second path planning information, that is, the node location information and demand information of each sub-problem are input into the model, and the cost fitting the current sub-problem is output after passing through 6 layers of Transformer encoder layers, fully connected layers, and average pooling layers. The Transformer encoder layer includes an encoding input layer, a fully connected layer, and a QKV multi-head attention layer.

[0166] According to the solution of the embodiment of the present disclosure, the cost of the current problem can be more accurately fitted through the Transformer encoder layer, the fully connected layer, and the average pooling layer. The feature extraction module of the model is changed from accumulating and averaging to splicing through two layers of fully connected layers, and the extracted features are more comprehensive.

[0167] Figure 8 is a flow chart of a training method for a path planning model according to an embodiment of the present disclosure, such as Figure 8 As shown, the method comprises at least the following steps:

[0168] S801. Input a path planning information sample into an encoder of a first path planning model to obtain an encoding vector corresponding to the path planning information sample, where the encoding vector includes a representation vector of at least one node in the path planning information sample.

[0169] Iteratively execute the following steps S802 and S803 until each path included in the training path set is obtained:

[0170] S802: Input the representation vector of the node of each existing path in the training path set into the decoder of the first path planning model to obtain a decoding vector of the existing path.

[0171] S803: The decoding vector of the existing path and the encoding vector corresponding to the path planning information sample are fused based on the attention mechanism to obtain the next node of the existing path.

[0172] S804: Train the first path planning model using a gradient ascent method and a cost function of the training path set to obtain a trained second path planning model.

[0173] In the disclosed embodiment, the path planning model includes multiple encoders and multiple decoders, each encoder is composed of a multi-head attention mechanism layer, a first residual and annotation layer, a feedforward neural network layer, and a second residual and annotation layer. The input path planning problem is transformed into a vector through an encoding input layer and then input into the encoder. The encoding input layer is used to vectorize the coordinate information and demand information of each customer as a node. After the vector passes through the multi-head attention mechanism layer, the first residual and normalization layer, the feedforward network layer, the second residual and normalization layer in sequence, the representation vector of each node is obtained. In order to obtain the representation vector of the entire customer, the representation vectors of all customers are spliced ​​together and passed through a fully connected neural network layer to obtain the representation vector of the entire problem. The encoder is used to encode the entire path planning problem, and after encoding into a vector, it can be input into the decoder to decode the problem and decode the feasible solution of the problem. Since the decoding is performed in a loop, each loop decoder parses a node in the feasible solution path, so the input layer of the decoder is the vector of all previously decoded customer nodes, that is, the vector of all nodes on the existing path. By fusing the decoded vector with the encoding vector of the entire problem through an attention mechanism, the model can output the next node of a feasible solution path. The criterion for determining the next node is the probability output by the decoder. The decoder outputs a probability for each client node, and uses the idea of ​​greedy (beam search) to select the node with the highest probability as the next node each time. In this way, continuous iterative decoding finally generates a feasible solution path.

[0174] The path planning model is trained using reinforcement learning. In one example, the goal of model training is to solve a path planning problem for 1,000 customers. When training the path planning model offline, 1 million path planning problems for 1,000 customers are randomly constructed. In the reinforcement learning training, a problem is randomly selected each time to encode and decode to find a feasible solution, and then the cost of this feasible solution (usually the length of the path) is calculated. Then, the gradient ascent method is used to update the network model according to the cost. The smaller the cost, the better. Therefore, -cost is passed to the model as the cost function loss for the model to learn and reduce the cost as much as possible until the model converges and the training is completed.

[0175] According to the solution of the embodiment of the present disclosure, after the model training is completed, the initial feasible solution of the related problem can be generated online. For the new path planning problem, the model can quickly output a high-quality feasible solution as the initial solution of this problem. The high-quality initial feasible solution can provide a good start for the subsequent iterative divide-and-conquer problem, thereby accelerating the generation of the solution and improving the quality of the solution. The speed and quality of constructing the initial feasible solution are faster than the solver.

[0176] In a possible implementation, step S801 inputs the path planning information sample into an encoder of the path planning model to obtain an encoding vector corresponding to the path planning information sample, further comprising the steps of:

[0177] The path planning information sample is converted into a first vector through the encoding input layer of the encoder.

[0178] The first vector is processed sequentially through the encoder's multi-head attention mechanism layer, the first residual and normalization layer, the feedforward network layer, and the second residual and normalization layer to obtain a representation vector of at least one node in the path planning information sample.

[0179] According to the solution of the embodiment of the present disclosure, the path planning problem is encoded using an encoder, and a vector representing the problem is obtained based on an attention mechanism, which helps to improve the quality of the initial feasible solution obtained.

[0180] In a possible implementation, the step S802 of inputting the path planning information sample into the encoder of the path planning model to obtain the encoding vector corresponding to the path planning information sample further includes the steps of:

[0181] The representation vectors of multiple nodes in the path planning information sample are concatenated through a fully connected layer to obtain the encoding vector corresponding to the path planning information sample.

[0182] According to the solution of the embodiment of the present disclosure, by concatenating the representation vectors of multiple nodes through a fully connected layer, the extracted features are more comprehensive, which helps to improve the quality of the solution.

[0183] Fig. 9 is a schematic diagram of the structure of a path planning device according to an embodiment of the present disclosure. Fig. 9 As shown, the device 900 at least includes:

[0184] The division module 910 is used to divide the first path set corresponding to the first path planning information into multiple second path sets, wherein the second path set is a subset of the first path set.

[0185] The selection module 920 is used to select a target path set from a plurality of second path sets.

[0186] The optimization module 930 is used to re-plan the path according to the second path planning information corresponding to the target path set to obtain an optimized third path set, wherein the second path planning information includes part of the first path planning information.

[0187] The updating module 940 is configured to update the first path set by using the third path set.

[0188] In a possible implementation manner, the device 900 further includes:

[0189] The initial path planning module is used to perform initial path planning according to the first path planning information to obtain an initial first path set.

[0190] In a possible implementation, the initial path planning module includes:

[0191] The encoding submodule is used to input the first path planning information into the encoder of the path planning model to obtain the encoding vector corresponding to the first path planning information, and the encoding vector includes the representation vector of at least one node in the first path planning information.

[0192] The iterative submodule is used to iteratively execute the following steps until each first path included in the first path set is obtained: inputting the representation vector of the node included in the first path into the decoder of the path planning model to obtain the decoding vector of the first path. The decoding vector of the first path and the encoding vector corresponding to the first path planning information are fused based on the attention mechanism to obtain the next node in the first path.

[0193] In a possible implementation, the encoding submodule is used to:

[0194] The first path planning information is converted into a first vector through an input layer of the encoder.

[0195] The first vector is processed sequentially through the encoder's multi-head attention mechanism layer, the first residual and normalization layer, the feedforward network layer, and the second residual and normalization layer to obtain a representation vector of at least one node in the first path planning information.

[0196] In a possible implementation, the encoding submodule is further used for:

[0197] The representation vectors of multiple nodes in the first path planning information are concatenated through a fully connected layer to obtain a coding vector corresponding to the first path planning information.

[0198] In a possible implementation, the selection module 920 is used to:

[0199] The plurality of second path sets and the second path planning information corresponding to the plurality of second path sets are input into the selection model to predict the optimization parameters of the plurality of second path sets respectively.

[0200] A second path set having the largest difference between the optimized parameters of the second path sets and the initial parameters of the first path set is determined as the target path set.

[0201] In a possible implementation, the plurality of second path sets include: N adjacent paths in the first path set, wherein N is an integer greater than 1 and less than M, and M is the number of paths in the first path set.

[0202] In a possible implementation, the optimization module 930 is used to:

[0203] Extract each to-be-processed node information from the paths included in the target path set.

[0204] According to the second path planning information corresponding to the target path set, the open source solver is used to re-plan the path of each node to be processed to obtain an optimized third path set.

[0205] In a possible implementation, the device 900 further includes an adjustment module, and the adjustment module includes:

[0206] The path determination submodule is used to determine the path to be adjusted according to the distance between each node of each path in the first path set.

[0207] The adjustment submodule is used to adjust the nodes and / or the order of nodes that the path to be adjusted passes through to obtain an adjusted fourth path set.

[0208] In a possible implementation, the path determination submodule is used to:

[0209] According to the distances between the nodes of each path in the first path set, all the nodes on each path are divided to obtain a number of cluster nodes and the center point of each cluster node.

[0210] Determine the center point of each path contained in the target path set.

[0211] The path to be adjusted is determined according to the distance between the center point of each cluster node and the center point of each path.

[0212] In a possible implementation manner, the path determination submodule is further used for:

[0213] Determine the first distance between the center point of each cluster node and the center point of the path where it is located.

[0214] Determine the second distance between the center point of each cluster node and the center points of other paths.

[0215] When the first distance of any cluster node is greater than any second distance of the corresponding cluster node, the cluster node is determined as a node to be adjusted, and the path where the node to be adjusted is located is the path to be adjusted.

[0216] In a possible implementation, the adjustment submodule is used to:

[0217] A path with the smallest second distance to the node to be adjusted is determined as the target path.

[0218] The node to be adjusted is deleted from the path to be adjusted and added to the target path.

[0219] The node order of the target path and the path to be adjusted is re-determined to obtain an adjusted fourth path set.

[0220] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.

[0221] Fig.10 is a schematic diagram of the structure of a training device for selecting a model according to an embodiment of the present disclosure. Fig.10 As shown, the device 1000 at least includes:

[0222] The first determination module 1010 is used to determine the first parameter of each path subset included in the sample path set, and the sample path set has corresponding first path planning information.

[0223] The second determination module 1020 is used to determine the second parameter of each path subset according to each path subset and its corresponding second path planning information using the first selection model, wherein the second path planning information corresponding to the path subset includes part of the first path planning information of the sample path set to which the path subset belongs.

[0224] The first training module 1030 is used to train the first selection model according to the difference between the first parameter and the second parameter to obtain a trained second selection model.

[0225] In a possible implementation manner, the second determining module 1020 is further configured to:

[0226] Each path subset and its corresponding second path planning information are processed in sequence through the converter encoding layer, the fully connected layer and the average pooling layer of the first selection model to obtain the second parameters of the second path planning information.

[0227] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.

[0228] Fig.11 FIG. 1 is a schematic diagram of a training device for a path planning model according to an embodiment of the present disclosure. Fig.11 As shown, the device 1100 at least includes:

[0229] The input module 1110 is used to input the path planning information sample into the encoder of the first path planning model to obtain the encoding vector corresponding to the path planning information sample, and the encoding vector includes the representation vector of at least one node in the path planning information sample.

[0230] The iteration module 1120 is used to iteratively perform the following steps until each second path included in the training path set is obtained: inputting the representation vector of the node included in the second path into the decoder of the first path planning model to obtain the decoding vector of the second path. The decoding vector of the second path and the encoding vector corresponding to the path planning information sample are fused based on the attention mechanism to obtain the next node in the second path.

[0231] The second training module 1130 is used to train the first path planning model using a gradient ascent method and a cost function of a training path set to obtain a trained second path planning model.

[0232] In a possible implementation, the input module is further used to: convert the path planning information sample into a first vector through an encoding input layer of an encoder.

[0233] The first vector is processed sequentially through the encoder's multi-head attention mechanism layer, the first residual and normalization layer, the feedforward network layer, and the second residual and normalization layer to obtain a representation vector of at least one node in the path planning information sample.

[0234] In a possible implementation, the input module 1110 is further used to: concatenate the representation vectors of multiple nodes in the path planning information sample through a fully connected layer to obtain a coding vector corresponding to the path planning information sample.

[0235] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.

[0236] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0237] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0238] Fig.12 A schematic block diagram of an example electronic device 1200 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0239] like Fig.12 As shown, the device 1200 includes a computing unit 1201, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1202 or a computer program loaded from a storage unit 1208 into a random access memory (RAM) 1203. In the RAM 1203, various programs and data required for the operation of the device 1200 can also be stored. The computing unit 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.

[0240] A number of components in the device 1200 are connected to the I / O interface 1205, including: an input unit 1206, such as a keyboard, a mouse, etc.; an output unit 1207, such as various types of displays, speakers, etc.; a storage unit 1208, such as a disk, an optical disk, etc.; and a communication unit 1209, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1209 allows the device 1200 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0241] The computing unit 1201 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1201 performs the various methods and processes described above, such as a path planning method, a training method for selecting a model, or a training method for a path planning model. For example, in some embodiments, the path planning method, the training method for selecting a model, or the training method for a path planning model may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1208. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1200 via the ROM 1202 and / or the communication unit 1209. When the computer program is loaded into RAM 1203 and executed by the computing unit 1201, one or more steps of the path planning method, the training method of the selection model, or the training method of the path planning model described above may be performed. Alternatively, in other embodiments, the computing unit 1201 may be configured to execute the path planning method, the training method of the selection model, or the training method of the path planning model by any other appropriate means (e.g., by means of firmware).

[0242] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0243] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0244] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0245] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0246] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0247] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0248] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0249] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A path planning method, comprising: Dividing the first path set corresponding to the first path planning information to obtain a plurality of second path sets; wherein the second path set is a subset of the first path set; Inputting the plurality of second path sets and the second path planning information corresponding to the plurality of second path sets into a selection model, and predicting the optimization parameters of the plurality of second path sets respectively; Determine the second path set with the largest difference between the optimization parameters in the plurality of second path sets and the initial parameters in the first path set as the target path set; Re-planning the path according to the second path planning information corresponding to the target path set to obtain an optimized third path set; wherein the second path planning information includes part of the first path planning information; The first path set is updated using the third path set.

2. The method according to claim 1, further comprising: Initial path planning is performed according to the first path planning information to obtain an initial first path set.

3. The method according to claim 2, wherein: The performing initial path planning according to the first path planning information to obtain the initial first path set includes: Inputting the first path planning information into an encoder of a path planning model to obtain an encoding vector corresponding to the first path planning information, wherein the encoding vector includes a representation vector of at least one node in the first path planning information; Iteratively perform the following steps until each first path included in the first path set is obtained: input the representation vector of the node included in the first path into the decoder of the path planning model to obtain the decoding vector of the first path; fuse the decoding vector of the first path and the encoding vector corresponding to the first path planning information based on the attention mechanism to obtain the next node in the first path.

4. The method according to claim 3, inputting the first path planning information into an encoder of a path planning model to obtain a coding vector corresponding to the first path planning information, comprising: Convert the first path planning information into a first vector through an input layer of the encoder; The first vector is processed sequentially through the multi-head attention mechanism layer, the first residual and normalization layer, the feedforward network layer, and the second residual and normalization layer of the encoder to obtain a representation vector of at least one node in the first path planning information.

5. The method according to claim 4, inputting the first path planning information into an encoder of a path planning model to obtain a coding vector corresponding to the first path planning information, further comprising: The representation vectors of multiple nodes in the first path planning information are concatenated through a fully connected layer to obtain a coding vector corresponding to the first path planning information.

6. The method according to claim 1, wherein: The multiple second path sets include: N adjacent paths in the first path set; wherein N is an integer greater than 1, and N is less than M, and M is the number of paths in the first path set.

7. The method according to claim 1, wherein: The re-planning of the path according to the second path planning information corresponding to the target path set to obtain an optimized third path set includes: Extracting each to-be-processed node information from the paths included in the target path set; According to the second path planning information corresponding to the target path set, an open source solver is used to re-plan the path of each node information to be processed to obtain the optimized third path set.

8. The method according to claim 1, further comprising: Determining a path to be adjusted according to the distances between the nodes of each path in the first path set; The nodes and / or the sequence of nodes passed by the path to be adjusted are adjusted to obtain an adjusted fourth path set.

9. The method according to claim 8, wherein determining the path to be adjusted according to the distance between the nodes of each path in the first path set comprises: According to the distance between each node of each path in the first path set, all nodes on each path are divided to obtain a plurality of cluster nodes and the center point of each cluster node; Determine the center point of each path included in the target path set; The path to be adjusted is determined according to the distance between the center point of each cluster node and the center point of each path.

10. The method according to claim 9, wherein: The determining the path to be adjusted according to the distance between the center point of each cluster node and the center point of each path includes: Determine a first distance between the center point of each cluster node and the center point of the path where it is located; Determine a second distance between the center point of each cluster node and the center point of each other path; When the first distance of any cluster node is greater than any second distance corresponding to the cluster node, the cluster node is determined as a node to be adjusted, and the path where the node to be adjusted is located is a path to be adjusted.

11. The method according to claim 10, wherein: The step of adjusting the nodes and / or the order of the nodes passed by the path to be adjusted to obtain an adjusted fourth path set includes: Determine a path with the shortest second distance to the node to be adjusted as the target path; Deleting the node to be adjusted from the path to be adjusted and adding it to the target path; The node order of the target path and the path to be adjusted is re-determined to obtain an adjusted fourth path set.

12. A method for training a selection model, comprising: Determining a first parameter of each path subset included in a sample path set, wherein the sample path set has corresponding first path planning information; wherein the first parameter is used to characterize an actual route cost after optimization; According to each path subset and its corresponding second path planning information, using the first selection model, determining a second parameter of each path subset; wherein the second path planning information corresponding to the path subset includes part of the first path planning information of the sample path set to which the path subset belongs, wherein the second parameter is used to characterize the predicted optimized route cost; and The first selection model is trained according to the difference between the first parameter and the second parameter to obtain a trained second selection model.

13. The method according to claim 12, determining the second parameter of each path subset according to each path subset and its corresponding second path planning information by using a first selection model, comprises: The respective path subsets and their corresponding second path planning information are processed sequentially through the converter encoding layer, the fully connected layer and the average pooling layer of the first selection model to obtain second parameters of the second path planning information.

14. A method for training a path planning model, comprising: Inputting the path planning information sample into an encoder of the first path planning model to obtain an encoding vector corresponding to the path planning information sample, wherein the encoding vector includes a representation vector of at least one node in the path planning information sample; Iteratively perform the following steps until each second path included in the training path set is obtained: inputting the representation vector of the node included in the second path into the decoder of the first path planning model to obtain the decoded vector of the second path; The decoded vector of the second path and the encoded vector corresponding to the path planning information sample are merged based on the attention mechanism to obtain the next node in the second path; as well as Using a gradient ascent method and a cost function of the training path set, the first path planning model is trained to obtain a trained second path planning model; Among them, the step of inputting the path planning information sample into the encoder of the first path planning model to obtain the encoding vector corresponding to the path planning information sample also includes: splicing the representation vectors of multiple nodes in the path planning information sample through a fully connected layer to obtain the encoding vector corresponding to the path planning information sample.

15. The method according to claim 14, wherein the step of inputting the path planning information sample into an encoder of the first path planning model to obtain an encoding vector corresponding to the path planning information sample comprises: Converting the path planning information sample into a first vector through the input layer of the encoder; The first vector is processed sequentially through the multi-head attention mechanism layer, the first residual and normalization layer, the feedforward network layer, and the second residual and normalization layer of the encoder to obtain a representation vector of at least one node in the path planning information sample.

16. A path planning device, comprising: A division module, used for dividing the first path set corresponding to the first path planning information to obtain a plurality of second path sets; wherein the second path set is a subset of the first path set; A selection module, configured to input the plurality of second path sets and the second path planning information corresponding to the plurality of second path sets into a selection model, and predict respective optimization parameters of the plurality of second path sets; Determine the second path set with the largest difference between the optimization parameters in the plurality of second path sets and the initial parameters in the first path set as the target path set; an optimization module, configured to re-plan the path according to the second path planning information corresponding to the target path set to obtain an optimized third path set; wherein the second path planning information includes part of the first path planning information; and An updating module is configured to update the first path set by using the third path set.

17. The apparatus according to claim 16, further comprising: An initial path planning module is used to perform initial path planning according to the first path planning information to obtain an initial first path set.

18. The device according to claim 17, wherein: The initial path planning module includes: an encoding submodule, configured to input the first path planning information into an encoder of a path planning model to obtain an encoding vector corresponding to the first path planning information, wherein the encoding vector includes a representation vector of at least one node in the first path planning information; An iterative submodule is used to iteratively execute the following steps until each first path included in the first path set is obtained: inputting the representation vector of the node already included in the first path into the decoder of the path planning model to obtain the decoding vector of the first path; fusing the decoding vector of the first path and the encoding vector corresponding to the first path planning information based on the attention mechanism to obtain the next node in the first path.

19. The apparatus according to claim 18, wherein the encoding submodule is configured to: Convert the first path planning information into a first vector through an input layer of the encoder; The first vector is processed sequentially through the multi-head attention mechanism layer, the first residual and normalization layer, the feedforward network layer, and the second residual and normalization layer of the encoder to obtain a representation vector of at least one node in the first path planning information.

20. The apparatus according to claim 19, wherein the encoding submodule is further configured to: The representation vectors of multiple nodes in the first path planning information are concatenated through a fully connected layer to obtain a coding vector corresponding to the first path planning information.

21. The device according to claim 20, wherein: The multiple second path sets include: N adjacent paths in the first path set; wherein N is an integer greater than 1, and N is less than M, and M is the number of paths in the first path set.

22. The device according to claim 16, wherein: The optimization module is used to: Extracting each to-be-processed node information from the paths included in the target path set; According to the second path planning information corresponding to the target path set, an open source solver is used to re-plan the path of each node information to be processed to obtain the optimized third path set.

23. The apparatus of claim 16, further comprising: An adjustment module, the adjustment module comprising: A path determination submodule, used to determine the path to be adjusted according to the distance between each node of each path in the first path set; The adjustment submodule is used to adjust the nodes and / or the sequence of nodes passed by the path to be adjusted to obtain an adjusted fourth path set.

24. The device according to claim 23, wherein the path determination submodule is configured to: According to the distance between each node of each path in the first path set, all nodes on each path are divided to obtain a plurality of cluster nodes and the center point of each cluster node; Determine the center point of each path included in the target path set; The path to be adjusted is determined according to the distance between the center point of each cluster node and the center point of each path.

25. The device according to claim 24, wherein: The path determination submodule is also used for: Determine a first distance between the center point of each cluster node and the center point of the path where it is located; Determine a second distance between the center point of each cluster node and the center point of each other path; When the first distance of any cluster node is greater than any second distance corresponding to the cluster node, the cluster node is determined as a node to be adjusted, and the path where the node to be adjusted is located is a path to be adjusted.

26. The device according to claim 25, wherein The adjustment submodule is used for: Determine a path with the shortest second distance to the node to be adjusted as the target path; Deleting the node to be adjusted from the path to be adjusted and adding it to the target path; The node order of the target path and the path to be adjusted is re-determined to obtain an adjusted fourth path set.

27. A training device for selecting a model, comprising: A first determination module, configured to determine a first parameter of each path subset included in a sample path set, wherein the sample path set has corresponding first path planning information; wherein the first parameter is used to characterize an actual route cost; a second determination module, configured to determine, based on each path subset and its corresponding second path planning information, a second parameter of each path subset using a first selection model; wherein the second path planning information corresponding to the path subset includes part of the first path planning information of the sample path set to which the path subset belongs, and wherein the second parameter is used to characterize the predicted optimized route cost; and The first training module is used to train the first selection model according to the difference between the first parameter and the second parameter to obtain a trained second selection model.

28. A training device for a path planning model, comprising: An input module, configured to input a path planning information sample into an encoder of a first path planning model to obtain an encoding vector corresponding to the path planning information sample, wherein the encoding vector includes a representation vector of at least one node in the path planning information sample; An iteration module, configured to iteratively execute the following steps until each second path included in the training path set is obtained: inputting the representation vector of the node included in the second path into the decoder of the first path planning model to obtain a decoding vector of the second path; The decoded vector of the second path and the encoded vector corresponding to the path planning information sample are merged based on the attention mechanism to obtain the next node in the second path; as well as A second training module, used to train the first path planning model using a gradient ascent method and a cost function of the training path set to obtain a trained second path planning model; Among them, the input module is also used to input the path planning information sample into the encoder of the first path planning model to obtain the encoding vector corresponding to the path planning information sample, and also includes: splicing the representation vectors of multiple nodes in the path planning information sample through a fully connected layer to obtain the encoding vector corresponding to the path planning information sample.

29. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 15.

30. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-15.

31. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 15.

Citation Information

Patent Citations

  • Vehicle path planning method and device

    CN114330800A

  • Path planning method based on solution of problem covering traveling salesman

    CN114330867A