Path planning method and device, computer equipment and storage medium
By introducing probabilistic rules to select mutation nodes and target nodes in path planning, and combining path cost and simulated annealing algorithms, the path search process is optimized, solving the problem of insufficient global optimization capability in existing technologies and achieving more efficient path optimization.
Patent Information
- Application Number
- CN202511119195.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-11-07
AI Technical Summary
Existing technologies have poor global optimization capabilities in path planning, resulting in low path optimization efficiency and the inability to complete a path.
By introducing probabilistic rules to select mutation nodes and target nodes in path planning, and utilizing the number of adjacent nodes of intermediate nodes and the number of node selections during the iteration process, combined with path cost and simulated annealing algorithm, the path search process is optimized.
It improves the global optimization capability of path planning, reduces blind search, and improves the efficiency and accuracy of path optimization, enabling it to find the global optimal solution more quickly.
Smart Images

Figure CN120913432A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of vehicle control, in particular to a path planning method and device, computer equipment and a storage medium. BACKGROUND
[0002] The path planning technology of a vehicle is one of the core technologies of automatic driving, logistics transportation and intelligent transportation systems, and its goal is to find a safe, efficient and comfortable driving path for a vehicle in a complex dynamic environment.
[0003] In the related art, the road network is regarded as a network atlas composed of multiple nodes, and the task of path planning is to search for a path from the starting point to the destination in the road network, which can pass through some intermediate nodes, and by randomly mutating the nodes passed through by the path, an optimized path is obtained, so that the optimized path searched can meet the specific search requirements.
[0004] However, in the related art, the optimized path based on node mutation may have problems such as being unable to pass through or reducing the passing efficiency, and the global optimization ability of the optimization scheme is poor. SUMMARY
[0005] Therefore, a path planning method, device, computer equipment and storage medium are provided to improve the poor global optimization ability in the prior art.
[0006] In one aspect, a path planning method is provided, the method comprising:
[0007] obtaining a first path from a starting point to a destination, the path nodes of the first path including a starting point node, a destination node and an intermediate node;
[0008] determining a mutation node from the intermediate nodes according to a first probability rule, wherein in the first probability rule, a first probability is positively correlated with the number of adjacent nodes of the intermediate node, and the first probability is the probability of the intermediate node being determined as the mutation node;
[0009] determining a target node from idle nodes of a road network, wherein the idle nodes are nodes of the road network other than the first path;
[0010] mutating the mutation node based on the target node to obtain a second path from the starting point to the destination;
[0011] determining a target path from the first path and the second path according to a path cost;
[0012] iterating the target path as a new first path to obtain a driving path.
[0013] In one embodiment, the determining the mutation node from the intermediate nodes according to a first probability rule comprises:
[0014] determining the adjacent nodes of each of the intermediate nodes from the road network, and obtaining the number of adjacent nodes of each of the intermediate nodes and the total number of adjacent nodes of all the intermediate nodes;
[0015] determining the first probability according to the proportion of the number of adjacent nodes of each of the intermediate nodes in the total number, so as to determine the mutation node from the intermediate nodes according to the first probability.
[0016] In one embodiment, in the first probability rule, the first probability is positively correlated with the number of adjacent nodes of the intermediate nodes, comprising:
[0017] determining the first probability according to the following mathematical expression:
[0018]
[0019] wherein P1 i is the first probability of the ith intermediate node, A i is the number of adjacent nodes of the ith intermediate node, and N1 is the number of the intermediate nodes.
[0020] In one embodiment, the determining the target node from the idle nodes of the road network comprises:
[0021] determining the target node from the idle nodes of the road network according to a second probability rule, wherein in the second probability rule, the second probability is negatively correlated with the number of times that a node is determined as a path node in an iteration process, and the second probability is the probability that the idle node is determined as the target node.
[0022] In one embodiment, in the second probability rule, the second probability is negatively correlated with the number of times that a node is determined as a path node in an iteration process, comprising:
[0023] determining the second probability according to the following mathematical expression:
[0024]
[0025] wherein P2 j is the second probability of the jth idle node, q i is a degenerate optimization factor, and 0<q i <1, b is the number of times that a node is determined as a path node, and N2 is the total number of the idle nodes.
[0026] In one embodiment, the mutating the mutation node based on the target node to obtain a second path from the start point to the end point comprises:
[0027] Based on the path search algorithm, the previous path node of the mutation node and the target node are connected, and the next path node of the mutation node and the target node are connected to obtain a temporary path;
[0028] According to the repeated nodes in the temporary path, the repeated road segments are removed to obtain the second path.
[0029] In one embodiment, the determining a target path from the first path and the second path according to the path cost comprises:
[0030] In the case where the path cost of the second path is less than the path cost of the first path, the second path is determined as the target path;
[0031] Otherwise, one of the first path and the second path is determined as the target path based on a third probability rule, wherein a third probability is negatively related to a path cost increment in the third probability rule, and / or the third probability is negatively related to the number of iterations, and the third probability is the probability of determining the second path as the target path.
[0032] In another aspect, a path planning device is provided, and the device comprises:
[0033] A first selection module is configured to obtain a first path from a start point to an end point, the path nodes of the first path comprising the start point node, the end point node and intermediate nodes; and determine a mutation node from the intermediate nodes according to a first probability rule, wherein the first probability is positively related to the number of adjacent nodes of the intermediate node in the first probability rule, and the first probability is the probability of the intermediate node being determined as the mutation node.
[0034] A second selection module is configured to determine a target node from idle nodes of a road network, wherein the idle nodes are nodes of the road network other than the first path;
[0035] A mutation calculation module is configured to mutate the mutation node based on the target node to obtain a second path from the start point to the end point;
[0036] An iteration calculation module is configured to determine a target path from the first path and the second path according to a path cost, and to take the target path as a new first path for iteration to obtain a driving path.
[0037] In yet another aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the method when executing the computer program.
[0038] Also provided is a computer-readable storage medium having stored thereon a computer program, the computer program being executable by a processor to implement the method.
[0039] The path planning method, device, computer device and storage medium described above, the first path from the starting point to the ending point is obtained, the mutation node is determined from the intermediate nodes according to the first probability rule, the target node is determined from the idle nodes of the road network, the mutation node is mutated based on the target node, the second path is obtained, the target path is determined from the first path and the second path according to the path cost, and the driving path is obtained by iterating the target path. In the first probability rule in the process, the probability that the intermediate node is determined as the mutation node is positively correlated with the number of adjacent nodes of the intermediate node, that is, the more adjacent nodes, the more complex the intersection corresponding to the intermediate node, and there are more possible optimization paths, which improves the probability of being determined as the mutation node and is beneficial to improving the global optimization ability. BRIEF DESCRIPTION OF DRAWINGS
[0040] Figure 1 is a schematic diagram of a road network;
[0041] Figure 2 is a schematic diagram of the flow of the path planning method in an embodiment;
[0042] Figure 3 is a schematic diagram of node mutation in an embodiment;
[0043] Figure 4 is a schematic diagram of the flow of the path planning method in another embodiment;
[0044] Figure 5 is a block diagram of the structure of the path planning device in an embodiment;
[0045] Figure 6 is an internal structure diagram of the computer device in an embodiment. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0047] Path planning refers to determining the optimal path to be taken given a road network, a start point and an end point. Path planning plays a core role in multiple fields, for example, in autonomous driving, path planning combines dynamic environment perception to optimize speed and direction in real time, and the optimized path can reduce the cost of task execution.
[0048] As shown in Figure 1 In the related art, each intersection, signal light and other road segment landmarks of a road network are taken as nodes, and the road network is divided into a model composed of a small path. The path planning process can be simplified as searching a set of nodes connecting the start point node and the end point node, and obtaining the optimal solution of the planning problem by continuously adjusting the node selection in the node set and performing path mutation.
[0049] However, in the related art, the path mutation process is random, and blind path mutation leads to poor global optimization ability.
[0050] The present application provides a path planning method, which avoids blind search caused by random mutation by probabilistic selection of mutation nodes, and improves the global optimization ability.
[0051] For ease of understanding, the terms involved in the present application are explained as follows:
[0052] Road network: a graph structure composed of nodes and edges (line segments connecting nodes), each edge may be attached with a weight (such as distance, time, cost, slope, traffic light period, etc.), road network information can be obtained from multi-dimensional data sources, such as road network database, traffic signal control platform, geographic surveying and mapping data, etc.;
[0053] Node: a key position point in the road network, such as an intersection in the road network, a signal light, etc., representing a basic unit of path planning, a node can be a discrete graph vertex or a coordinate point in continuous space;
[0054] Path: a sequence of nodes from a start point to an end point, forming a feasible route through edges, exemplarily represented as route=[R1,R2,……,RN];
[0055] Path node: a node determined to be part of a path, including a start point node, an end point node and intermediate nodes, for example, route=[R1,R2,……,RN], wherein R1 is the start point node, RN is the end point node, and the rest are intermediate nodes, the number of intermediate nodes can be one, two or even more;
[0056] Idle node: a node in the road network other than the current path;
[0057] Adjacent node: a node directly adjacent to the current node;
[0058] Mutation: an operation to perturb the current path to generate a new path, the core purpose of which is to jump out of local optimum, and finally find the global optimal solution by exploring other areas of the solution space;
[0059] Path cost: a cost to measure the cost of driving along the path, which can be the driving distance of the vehicle along the path, energy consumption, or time, or other comprehensive factors;
[0060] Iteration: that is, the repetition of the process, which in the present invention can include the mutation of nodes and the cost measurement process of the new path after mutation.
[0061] In one embodiment, the path planning method provided is as shown in Figure 2 The steps include:
[0062] Step 110, obtaining a first path route1 from the starting point to the end point.
[0063] In the initial stage of path planning, based on the determined starting point node and end point node, one or more intermediate nodes connecting the starting point node to the end point node are searched, and the initial node sequence obtained in the driving order is arranged as the first path, for example Figure 1 In the example, taking the starting point node "7" and the end point node "21" as an example, the first path is exemplarily route1 = [7, 8, 27, 30, 29, 28, 9, 20, 21].
[0064] In the first path, in addition to the starting point node and the end point node being determined in advance, the remaining intermediate nodes can be calculated by a search algorithm, for example, a random generation algorithm: randomly finding several nodes as intermediate nodes from the nodes in the road network except the starting point node and the end point node; and for example, the nearest neighbor method: starting from the starting point node, selecting the nearest unvisited node as the next step each time until reaching the end point node.
[0065] It can be understood that the first path is the initial solution of path planning, and the requirement is relatively loose, but a good initial solution can improve efficiency. For example, if the initial solution is close to the optimal solution, the algorithm can converge faster; and if the initial solution is poor, more iterations may be needed to find a good solution. Therefore, the method of selecting the initial path needs to balance the quality of the generated path and the time required to generate it, and those skilled in the art can design the determination process of the initial solution based on the demand.
[0066] Step 120, determining a mutation node from the intermediate nodes according to a first probability rule.
[0067] Mutation of the node is an important means to generate new paths, the present application is directed to intermediate nodes, according to certain probability rules, select a certain intermediate node mutation, for example, in the embodiment, according to the first probability rule, select the intermediate node "30" as the mutation node, generate a new path that does not pass through "30".
[0068] The generation of new paths in the related art, such as simulated annealing algorithm, has randomness, and the mutation of the randomly selected intermediate node leads to blind search, low efficiency and less optimal solution.
[0069] In the present application, the first probability rule is used to guide how to determine the mutation node from the intermediate nodes, and the probability of a certain intermediate node being determined as a mutation node is defined as the first probability, and the first probability is positively correlated with the number of adjacent nodes of the intermediate node, and the more the number of adjacent nodes, the greater the probability of being selected as a mutation node.
[0070] For example, in the first path route1=[7,8,27,30,29,28,9,20,21], the adjacent nodes of the intermediate node "8" include "6", "7", "9", "27", four; the adjacent nodes of the intermediate node "27" include "8", "28", "30", three. The first probability corresponding to the intermediate node "8" is greater than that of the intermediate node "27".
[0071] The positive correlation can be embodied by establishing a positive correlation mapping relationship between the first probability and the number of adjacent nodes, for example, establishing a linear relationship, a non-linear monotonically increasing function, etc. It can be understood that the sum of the first probabilities of all intermediate nodes is 1.
[0072] The following describes the determination process of the first probability in a feasible implementation mode:
[0073] The adjacent nodes of each intermediate node are determined from the road network, and the number of adjacent nodes of each intermediate node and the total number of adjacent nodes of all intermediate nodes are obtained; the first probability is determined according to the proportion of the number of adjacent nodes of each intermediate node in the total number, and the mutation node is determined from the intermediate nodes according to the first probability.
[0074] For example, the first probability is determined according to the following mathematical expression:
[0075]
[0076] Wherein, P1 i is the first probability of the i-th intermediate node, A i is the number of adjacent nodes of the i-th intermediate node, and N1 is the number of intermediate nodes.
[0077] It is understood that the present invention selects mutation nodes from several intermediate nodes according to a first probability. The first probability corresponding to any intermediate node is not 1 (unless there is only one intermediate node). It is not that the node with the most neighboring nodes will necessarily be selected as a mutation node. The scheme of selecting according to probability makes mutation flexible and does not exclude the possibility that a node with fewer neighboring nodes may have a global optimal solution. This is beneficial for exploring other regions of the solution space and finally finding the global optimal solution.
[0078] Step 130: Determine the target node from the idle nodes of the road network.
[0079] In this embodiment, an idle node is a node outside the first path in the road network. For example, an idle node "10" is selected as the target node.
[0080] In one feasible implementation, during the initial iteration, the selection of the target node can be based on a random algorithm, with each free node having an equal probability of being selected.
[0081] Step 140: Based on the target node, mutate the mutated node to obtain the second path route2 from the starting point to the ending point.
[0082] For example, such as Figure 3 As shown, the selected mutation node "30" is replaced with the target node "10", while the other intermediate nodes remain unchanged, so that the new path passes through the target node "10".
[0083] Due to the change of nodes, in the original first path route1 = [7,8,27,30,29,28,9,20,21], the preceding path node "27" and the following path node "29" of the mutation node "30" may not be directly connected to the target node "10". It is necessary to search the path between path node "27", target node "10" and path node "29".
[0084] In one implementation, based on a path search algorithm, a temporary path is obtained by connecting the previous path node of the mutation node with the target node and the next path node of the mutation node with the target node. Based on the duplicate nodes in the temporary path, duplicate segments are removed to obtain a second path.
[0085] Among them, path search algorithms, such as Dijkstra's algorithm, use breadth-first search to solve the single-source shortest path problem in weighted directed or undirected graphs, and finally obtains a shortest path.
[0086] For example, the Dijkstra algorithm is used to search the path between the path node "27" and the target node "10", such as [27, 28, 9, 10], the path between the target node "10" and the path node "29", such as [10, 9, 28, 29], and thus the temporary path after connection is [7, 8, 27, 28, 9, 10, 9, 28, 29, 28, 9, 20, 21].
[0087] At this time, there is a back-and-forth movement in the temporary path, and the node "28" is repeated, so that a repeated path segment between multiple nodes "28" is identified (the temporary path [28, 9, 10, 9, 28, 29] is a repeated path segment), which does not conform to the actual path. Therefore, the back-and-forth repeated movement part is removed to obtain a second path route2 = [7, 8, 27, 28, 9, 20, 21].
[0088] It can be understood that there are different ways to remove the repeated nodes based on different repeated nodes, for example, there are multiple intermediate nodes "9" in the temporary path, and different or the same node sequences can be obtained by removing the repeated nodes based on different repeated nodes. The solution with smaller path cost is selected or a worse solution is accepted as the second path according to a certain probability.
[0089] It can also be understood that when the original path node changes, the front and rear path nodes can not be connected, and the Dijkstra algorithm uses a greedy strategy to select the node closest to the source node from the current unprocessed nodes for processing. This strategy ensures that the algorithm can gradually expand the known shortest path set and eventually cover all nodes. The present application uses the Dijkstra algorithm for path repair after mutation to ensure that the generated second path always meets the connectivity requirement, solves the path breaking problem, and organically combines global optimization and local accurate search while maintaining the flexibility of the algorithm and ensuring the feasibility of the solution.
[0090] In some possible implementations, the path search algorithm is also, for example, the A star algorithm, the ant colony algorithm, and the like, which will not be described here.
[0091] In step 150, the target path is determined from the first path and the second path according to the path cost.
[0092] The path cost is, for example, the driving distance, the energy consumption, or the time, and based on different path planning requirements, the path cost can be of different types, and the optimization method can use different principles, for example, the distance (Euclidean distance or actual road length) in the path is calculated as the path cost, and based on the principle of minimizing the cost, the path with shorter distance is determined as the target path.
[0093] It can be understood that the newly obtained second path can not necessarily become the target path.
[0094] The application adopts the simulated annealing algorithm to accept a poor solution as the target path with a certain probability, thereby further improving the global optimization capability. The simulated annealing algorithm is further described below.
[0095] In step 160, the target path is taken as a new first path for iteration to obtain a driving path.
[0096] The initial first path is updated, the target path is taken as a new first path, and one iteration process is completed. Then, the aforementioned steps 120 to 150 are re-executed until the end condition of iteration is met, for example, the number of iterations reaches the maximum number of iterations.
[0097] In the above embodiment, the mutation node is determined from the intermediate nodes according to the first probability rule. In the first probability rule, the probability that the intermediate node is determined as the mutation node is positively related to the number of adjacent nodes of the intermediate node. The intermediate node with more adjacent nodes has a greater impact. Such nodes are usually key hubs in the road network, and adjusting the path at this place can produce greater optimization potential. The calculation resources are concentrated in topologically complex areas such as intersections and overpasses, naturally forming a search strategy for key optimization in complex areas. Through the probability mechanism, blind search caused by random mutation is avoided, and there is a greater possibility of finding a global optimal solution.
[0098] The following also describes how to determine the target node from the idle nodes:
[0099] In the limited iteration process, some nodes may be selected multiple times, and some nodes may not be selected. This situation means that the effective area of the solution space searched is reduced, which may also lead to the inability to search for a global optimal solution. In order to ensure that each node is traversed as much as possible and improve the global optimality of the algorithm, the application sets a second probability rule to determine the target node from the idle nodes of the road network according to the second probability rule.
[0100] For example, the probability that an idle node is determined as a target node is defined as a second probability. In the second probability rule, the second probability is negatively related to the number of times the node is determined as a path node in the iteration process.
[0101] For example, each node in the road network is configured with a corresponding record unit for recording the number of times the node is selected as a path node. The recording manner is exemplarily referred to the following several embodiments:
[0102] In one possible implementation, initially, the number of times of each intermediate node in the first path is recorded as 1, and the number of times of other idle nodes is recorded as 0. When a target node is determined from the idle nodes for the first time, the second probability of each idle node is the same, and a certain idle node is randomly selected as the target node. For example, in the above process, the idle node "10" is selected as the target node, and then the number of times of the idle node "10" is increased by 1, and the number of times of the remaining nodes is not changed. In the subsequent iteration process, the above method is used to record the number of times of the idle node selected as the target node.
[0103] In another possible implementation, initially, the number of times of each intermediate node in the first path is recorded as 1, and the number of times of other idle nodes is recorded as 0. When a target node is determined from the idle nodes for the first time, the second probability of each idle node is the same, and a certain idle node is randomly selected as the target node. For example, in the above process, the idle node "10" is selected as the target node, and then the path between the previous path node "27" and the target node "10" and the path between the target node "10" and the path node "29" are connected by using the Dijkstra algorithm to obtain a temporary path [7, 8, 27, 28, 9, 10, 9, 28, 29, 28, 9, 20, 21]. Compared with the initial first path, the temporary path adds one node "10", two nodes "28", and two nodes "9". In this implementation, since "28" and "9" exist in the initial first path, the number of times is not accumulated, and the number of times of the remaining nodes is not changed. In other possible implementations, the number of times can also be accumulated according to all the added nodes and the number of added nodes. In the subsequent iteration process, the above method is used to record the number of times of the nodes added in the temporary path compared with the first path.
[0104] In another possible implementation, the number of times of all the path nodes in the temporary path is recorded as 1.
[0105] In another possible implementation, the number of times of each intermediate node in the first path is recorded as 1, the number of times of other idle nodes is recorded as 0, when the target node is determined from the idle nodes for the first time, the second probability of each idle node is the same, and a certain idle node is randomly selected as the target node, for example, in the above process, the idle node "10" is selected as the target node, and then the Dijkstra algorithm is used to connect the path between the previous path node "27" and the target node "10" and the path between the target node "10" and the path node "29", to obtain a temporary path [7, 8, 27, 28, 9, 10, 9, 28, 29, 28, 9, 20, 21], and the second path route2 = [7, 8, 27, 28, 9, 20, 21] is obtained by removing the duplicate nodes in the temporary path, and the number of times of all nodes in the second path is recorded as +1. In the subsequent iteration process, this method is used to record the number of times of the nodes in the second path obtained by mutation as +1.
[0106] The above recording method of the number of times can be implemented alone or in combination based on actual needs.
[0107] Through the recording of the number of times, the degree of repetition of the search of the solution space is reduced, the probability of determining an idle node as a target node is negatively related to the number of times of determining a node as a path node, and the fewer the number of times of recording, the easier it is to determine the node as a target node, so that the initial solution is mutated to a new solution, and the global optimization capability is improved.
[0108] In a possible implementation, the second probability is determined by the following mathematical expression:
[0109]
[0110] wherein P2 j is the second probability of the jth idle node, q i is a degenerative optimization factor, b is the number of times of determining a node as a path node, and N2 is the total number of idle nodes.
[0111] In the implementation process, the degenerative optimization factor q i so that the second probability decreases with the increase of the number of times, and generally, the degenerative optimization factor satisfies 0 < q i <1.
[0112] In the above mathematical expression, the second probability decreases with the increase of the number of times b, and the sum of the second probabilities of the idle nodes is less than 1, in some implementations, the second probability of each idle node is scaled in the range of 0 to 1 in proportion when the target node needs to be determined each time, and the sum of the second probabilities of the idle nodes is 1; in another possible implementation, other mutation methods (node exchange, node insertion, etc.) are added, and the new mutation method is used to generate a new solution in a probabilistic manner.
[0113] The following example illustrates a process of determining a target path from the first path and the second path based on a simulated annealing algorithm:
[0114] The simulated annealing algorithm simulates a process of gradually reducing the annealing temperature of a metal in a physical system to probabilistically escape from a local optimal solution and finally approach a global optimal solution.
[0115] In this embodiment, the simulated annealing algorithm determines whether to accept the second path as the target path based on the Metropolis criterion, and defines a third probability of accepting the second path as the target path. The Metropolis criterion calculates the third probability P3 as follows:
[0116]
[0117] wherein E new is the path cost of the new solution, i.e., the path cost of the second path in this embodiment; E old is the path cost of the initial solution, i.e., the path cost of the first path in this embodiment; T is the temperature of the simulated annealing, which is reduced according to a certain strategy (exponential cooling, linear cooling, etc.) during the iteration process; and e is the natural constant.
[0118] It can be understood that, in the above mathematical expression, when the path cost of the second path is less than the path cost of the first path, the second path is determined as the target path.
[0119] Otherwise, one of the first path and the second path is determined as the target path based on a third probability rule. In the third probability rule, the difference between the path cost of the second path and the path cost of the first path is defined as a path cost increment, and the third probability is negatively correlated with the path cost increment. The greater the path cost increment, the smaller the possibility of selecting the second path as the target path. On the other hand, as the iteration number increases, the temperature decreases, and the possibility of selecting the second path as the target path decreases. In the high-temperature stage, the solution space is widely explored, and in the low-temperature stage, the local area is finely searched.
[0120] In the above third probability rule, the key parameters include the path cost increment and the temperature of the simulated annealing (negatively correlated with the iteration number). In some possible implementations, one or both of the two key parameters are configured as a fixed value.
[0121] As shown in FIG. 1, Figure 4 a flow of the path planning method of the present application is exemplarily provided, Figure 4From the beginning, the first path is obtained, it is judged whether the maximum iteration number is reached, if the maximum iteration number is not reached, the intermediate node is selected as the mutation node according to the first probability rule, and the target node is selected for mutation according to the second probability rule, the Dijkstra algorithm is used to connect the mutated target node and the previous path node and the next path node of the mutation position, then the path cost of the second path is calculated, compared with the first path, and the Metropolis criterion is used to select whether to accept the second path, if accepted, the first path is updated, if not accepted, the original first path is retained for the next iteration. When the maximum iteration number is reached, the path node is output.
[0122] It should be understood that, although Figure 1 The steps in the flowchart of the present application are shown in sequence according to the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps in the present application can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily sequential, but can be alternately executed with at least part of other steps or sub-steps or stages of other steps.
[0123] In one embodiment, as Figure 5 shown, a path planning device is provided, comprising: a first selection module 210, a second selection module 220, a mutation calculation module 230 and an iteration calculation module 240, wherein:
[0124] The first selection module 210 is configured to obtain a first path from a starting point to an ending point, the path nodes of the first path including the starting point node, the ending point node and the intermediate node; and determine a mutation node from the intermediate node according to a first probability rule, wherein in the first probability rule, the first probability is positively correlated with the number of adjacent nodes of the intermediate node, and the first probability is the probability of the intermediate node being determined as the mutation node.
[0125] The second selection module 220 is configured to determine a target node from the idle nodes of the road network, wherein the idle nodes are nodes other than the first path in the road network;
[0126] The mutation calculation module 230 is configured to mutate the mutation node based on the target node to obtain a second path from the starting point to the ending point;
[0127] The iteration calculation module 240 is configured to determine a target path from the first path and the second path according to the path cost, and iterate the target path as a new first path to obtain a driving path.
[0128] With the above device, the first path from the start point to the end point is obtained, the mutation node is determined from the intermediate nodes according to the first probability rule, the target node is determined from the idle nodes of the road network, the mutation node is mutated based on the target node to obtain the second path, and the target path is determined from the first path and the second path according to the path cost. The first probability rule in the process is that the probability of the intermediate node being determined as the mutation node is positively correlated with the number of adjacent nodes of the intermediate node, that is, the more adjacent nodes, the more complex the intersection corresponding to the intermediate node, and there are more possible optimization paths, which improves the probability of being determined as the mutation node and is beneficial to improving the global optimization ability.
[0129] In one embodiment, the first selection module 210 determines the adjacent nodes of each intermediate node from the road network, and obtains the number of adjacent nodes of each intermediate node and the total number of adjacent nodes of all intermediate nodes; determines the first probability according to the proportion of the number of adjacent nodes of each intermediate node in the total number, and determines the mutation node from the intermediate nodes according to the first probability.
[0130] In a possible implementation, the first probability is determined according to the following mathematical expression:
[0131]
[0132] wherein P1 i is the first probability of the i th intermediate node, A i is the number of adjacent nodes of the i th intermediate node, and N1 is the number of intermediate nodes.
[0133] In one embodiment, the second selection module 220 is configured to determine the target node from the idle nodes of the road network according to a second probability rule, wherein in the second probability rule, the second probability is negatively correlated with the number of times that the node is determined as a path node in the iteration process, and the second probability is the probability of the idle node being determined as the target node.
[0134] In a possible implementation, the second probability is determined according to the following mathematical expression:
[0135]
[0136] wherein P2 j is the second probability of the j th idle node, q i is a degenerate optimization factor, and 0<q i <1, b is the number of times that the node is determined as a path node, and N2 is the total number of idle nodes.
[0137] In one embodiment, the mutation calculation module 230 obtains a temporary path based on a path search algorithm, connecting a previous path node of the mutation node and the target node, and connecting a next path node of the mutation node and the target node; and removes a repeated path segment according to a repeated node in the temporary path to obtain a second path.
[0138] In one embodiment, the iteration calculation module 240 is configured to determine the second path as the target path if the path cost of the second path is less than the path cost of the first path; otherwise, determine one of the first path and the second path as the target path based on a third probability rule, wherein the third probability is negatively correlated with the path cost increment and / or the third probability is negatively correlated with the iteration number, and the third probability is a probability of determining the second path as the target path.
[0139] The specific limitations of the path planning apparatus can refer to the limitations of the path planning method described above, and will not be repeated here. Each module in the path planning apparatus described above can be realized by software, hardware and their combination in whole or in part. Each module described above can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to call and execute the operation corresponding to each module by the processor.
[0140] In one embodiment, a computer device is provided, which can be a terminal, and its internal structure diagram can be as shown in Figure 6 The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The network interface of the computer device is configured to communicate with external terminals through network connection. The computer program is executed by the processor to implement a path planning method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0141] Those skilled in the art can understand that Figure 6 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0142] In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implements the following steps when executing the computer program:
[0143] A first path from the start point to the end point is obtained, the path nodes of the first path comprise the start point node, the end point node and intermediate nodes;
[0144] A mutation node is determined from the intermediate nodes according to a first probability rule, wherein in the first probability rule, a first probability is positively correlated with the number of adjacent nodes of the intermediate node, and the first probability is the probability that the intermediate node is determined as the mutation node;
[0145] A target node is determined from the idle nodes of the road network, wherein the idle nodes are nodes other than the first path in the road network;
[0146] The mutation node is mutated based on the target node to obtain a second path from the start point to the end point;
[0147] According to the path cost, a target path is determined from the first path and the second path;
[0148] The target path is taken as a new first path for iteration to obtain a driving path.
[0149] In one embodiment, the processor further implements the following steps when executing the computer program:
[0150] Adjacent nodes of each intermediate node are determined from the road network, and the number of adjacent nodes of each intermediate node and the total number of adjacent nodes of all intermediate nodes are obtained;
[0151] The first probability is determined according to the proportion of the number of adjacent nodes of each intermediate node in the total number, so as to determine the mutation node from the intermediate nodes according to the first probability.
[0152] In one embodiment, the processor further implements the following steps when executing the computer program:
[0153] The first probability is determined according to the following mathematical expression:
[0154]
[0155] Wherein, P1 i is the first probability of the i th intermediate node, A i is the number of adjacent nodes of the i th intermediate node, and N1 is the number of intermediate nodes.
[0156] In one embodiment, the processor further implements the following steps when executing the computer program:
[0157] According to a second probability rule, a target node is determined from the idle nodes of the road network, wherein in the second probability rule, a second probability is negatively related to a number of times that a node is determined as a path node in the iteration process, and the second probability is a probability that an idle node is determined as the target node.
[0158] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0159] The second probability is determined according to a mathematical expression as follows:
[0160]
[0161] wherein P2 j is the second probability of the jth idle node, q i is a degeneration optimization factor, and 0<q i <1, b is the number of times that a node is determined as a path node, and N2 is the total number of idle nodes.
[0162] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0163] Based on the path search algorithm, a previous path node of the connected mutation node and the target node, and a next path node of the mutation node and the target node are obtained, to obtain a temporary path;
[0164] According to repeated nodes in the temporary path, repeated road segments are removed to obtain a second path.
[0165] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0166] In a case where a path cost of the second path is less than a path cost of the first path, the second path is determined as the target path;
[0167] Otherwise, one of the first path and the second path is determined as the target path based on a third probability rule, wherein a third probability is negatively related to a path cost increment and / or the third probability is negatively related to the number of iterations, and the third probability is a probability that the second path is determined as the target path.
[0168] In one embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program, when executed by a processor, implements the following steps:
[0169] A first path from a starting point to an ending point is obtained, and path nodes of the first path include the starting point node, the ending point node, and intermediate nodes;
[0170] determine the mutation node from the intermediate nodes according to a first probability rule, wherein in the first probability rule, a first probability is positively related to a number of adjacent nodes of the intermediate node, and the first probability is a probability that the intermediate node is determined as the mutation node;
[0171] determine the target node from idle nodes of the road network, wherein the idle nodes are nodes of the road network other than the nodes of the first path;
[0172] mutate the mutation node based on the target node to obtain a second path from the start point to the end point;
[0173] determine a target path from the first path and the second path according to a path cost;
[0174] take the target path as a new first path for iteration to obtain the driving path.
[0175] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0176] determine adjacent nodes of each intermediate node from the road network, and obtain a number of the adjacent nodes of each intermediate node and a total number of the adjacent nodes of all the intermediate nodes;
[0177] determine the first probability according to a proportion of the number of the adjacent nodes of each intermediate node in the total number, so as to determine the mutation node from the intermediate nodes according to the first probability.
[0178] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0179] determine the first probability according to the following mathematical expression:
[0180]
[0181] wherein P1 i is the first probability of the ith intermediate node, A i is the number of the adjacent nodes of the ith intermediate node, and N1 is the number of the intermediate nodes.
[0182] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0183] determine the target node from the idle nodes of the road network according to a second probability rule, wherein in the second probability rule, a second probability is negatively related to a number of times that a node is determined as a path node in an iteration process, and the second probability is a probability that the idle node is determined as the target node.
[0184] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0185] The second probability is determined according to a mathematical expression as follows:
[0186]
[0187] wherein P2 j is the second probability of the jth idle node, q i is a degenerate optimization factor, and 0 < q i < 1, b is the number of times the node is determined as a path node, and N2 is the total number of idle nodes.
[0188] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0189] Based on the path search algorithm, the previous path node connected to the mutation node and the target node, and the next path node connected to the mutation node and the target node, a temporary path is obtained.
[0190] According to the repeated nodes in the temporary path, the repeated path segments are removed to obtain a second path.
[0191] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0192] In the case where the path cost of the second path is less than the path cost of the first path, the second path is determined as the target path.
[0193] Otherwise, one of the first path and the second path is determined as the target path based on a third probability rule, wherein the third probability is negatively correlated with the path cost increment, and / or the third probability is negatively correlated with the number of iterations, and the third probability is the probability that the second path is determined as the target path.
[0194] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiment methods can be included. Any reference to memory, storage, database or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0195] Any combination of the technical features of the above embodiments can be made, and in order to make the description simple, not all possible combinations of the technical features in the above embodiments are described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.
[0196] The above embodiments only express several embodiments of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A path planning method characterized by, The method comprises: acquiring a first path from a start point to an end point, path nodes of the first path comprising a start point node, an end point node and intermediate nodes; determining a mutation node from the intermediate nodes according to a first probability rule, wherein in the first probability rule, a first probability is positively correlated with a number of adjacent nodes of the intermediate nodes, and the first probability is a probability that the intermediate node is determined as the mutation node; determining a target node from idle nodes of a road network, wherein the idle nodes are nodes of the road network other than the first path; mutating the mutation node based on the target node to obtain a second path from the start point to the end point; determining a target path from the first path and the second path according to path costs; iterating the target path as a new first path to obtain a driving path.
2. The path planning method of claim 1, wherein, The determining of the mutation node from the intermediate nodes according to the first probability rule comprises: determining adjacent nodes of each of the intermediate nodes from the road network, obtaining a number of the adjacent nodes of each of the intermediate nodes, and obtaining a total number of the adjacent nodes of all the intermediate nodes; determining the first probability according to a proportion of the number of the adjacent nodes of each of the intermediate nodes in the total number, so as to determine the mutation node from the intermediate nodes according to the first probability.
3. The path planning method of claim 1, wherein, In the first probability rule, the first probability is positively correlated with the number of the adjacent nodes of the intermediate nodes, which comprises: determining the first probability according to a mathematical expression as follows: wherein P1 i is the first probability of the i-th intermediate node, A i is the number of adjacent nodes of the i-th intermediate node, and N1is the number of intermediate nodes.
4. The path planning method of claim 1, wherein, The determining of the target node from the idle nodes of the road network comprises: determining the target node from the idle nodes of the road network according to a second probability rule, wherein in the second probability rule, a second probability is negatively correlated with a number of times that a node is determined as a path node in an iteration process, and the second probability is a probability that the idle node is determined as the target node.
5. The path planning method of claim 4, wherein, In the second probability rule, the second probability is negatively correlated with the number of times that the node is determined as the path node in the iteration process, which comprises: determining the second probability according to a mathematical expression as follows: where P2 j is the second probability of the jth idle node, q i is a degenerate optimization factor, and 0 < q i <1, b is the number of times a node is determined to be a path node, and N2 is the total number of idle nodes.
6. The path planning method of claim 1, wherein, The mutating of the mutation node based on the target node to obtain the second path from the start point to the end point comprises: connecting a previous path node of the mutation node and the target node, and a next path node of the mutation node and the target node based on a path search algorithm to obtain a temporary path; removing repeated road segments according to repeated nodes in the temporary path to obtain the second path.
7. The path planning method of claim 1, wherein, The determining of the target path from the first path and the second path according to the path costs comprises: in a case that a path cost of the second path is less than a path cost of the first path, determining the second path as the target path; otherwise, determining one of the first path and the second path as the target path based on a third probability rule, wherein in the third probability rule, a third probability is negatively correlated with a path cost increment and / or negatively correlated with an iteration number, and the third probability is a probability that the second path is determined as the target path.
8. A route planning apparatus characterized by comprising: The device comprises: The first selection module is configured to acquire a first path from a start point to an end point, the path nodes of the first path comprising a start point node, an end point node and intermediate nodes; and determine a mutation node from the intermediate nodes according to a first probability rule, wherein in the first probability rule, a first probability is positively correlated with the number of adjacent nodes of the intermediate node, and the first probability is the probability that the intermediate node is determined as the mutation node. The second selection module is configured to determine a target node from idle nodes of a road network, wherein the idle nodes are nodes of the road network other than the first path. The mutation calculation module is configured to mutate the mutation node based on the target node to obtain a second path from the start point to the end point. The iteration calculation module is configured to determine a target path from the first path and the second path according to a path cost, and iterate the target path as a new first path to obtain a driving path.
9. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the method in any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the method in any one of claims 1 to 7.
Citation Information
Patent Citations
Mobile robot path planning method and device, computer equipment and storage medium
CN113934206A
Path planning method and device based on ant colony algorithm, equipment and storage medium
CN116859918A
Emergency command vehicle path planning method and system, vehicle-mounted terminal and storage medium
CN119085672A
Robot global path planning method and system based on probability interval division
CN119292291A
Automatic guided vehicle path planning method based on selection probability correction ant colony algorithm
CN120406454A