Path planning method, device and storage medium
Through the method of sparse road network and non-important way points, the efficiency of path planning and storage space utilization are improved, the problem of low path planning efficiency caused by the large amount of geographical information data is solved, and efficient search of path planning is realized.
Patent Information
- Application Number
- CN202410891159.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-07-04
AI Technical Summary
The amount of geographical information data in the existing technology is huge, resulting in low path planning efficiency.
By obtaining the sparse road network of the target area and the non-important way point set of each road segment, determine the transfer way points and path length between the starting point and the end point of the path planning, splice the transfer path, front path and back path, and select the path The candidate path with the shortest length is used as the target path.
It improves the calculation efficiency of path planning, saves storage space, and finds the shortest target path through transfer points when the starting point or end point of the path planning is an unimportant way point.
Smart Images

Figure CN118408569B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of path planning, and in particular to a path planning method, device and storage medium. Background Art
[0002] Path planning has a wide range of applications in many fields. Applications in the field of high-tech include: autonomous collision-free actions of robots, obstacle avoidance and penetration flight of drones, radar search avoidance of cruise missiles, anti-rebound attacks, and completion of penetration and blasting tasks. Applications in the field of daily life include: GPS navigation, road planning based on GIS systems, urban road network planning and navigation, etc. When performing path planning analysis on a certain area, the geographic information of all roads in the area is usually input into the algorithm for calculation, but the amount of data is too large, resulting in extremely low efficiency of path planning. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a path planning method, device and storage medium to solve the technical problem in the prior art that the amount of geographic information data is huge, resulting in low efficiency of path planning.
[0004] In order to achieve the above-mentioned object, the present application provides a path planning method in a first aspect, the method comprising:
[0005] Obtain a sparse road network corresponding to the target area and a set of non-important waypoints corresponding to each road section in the sparse road network. Any road section in the sparse road network is defined by two important waypoints at both ends and the distance between the two important waypoints. The set of non-important waypoints corresponding to any road section is a waypoint sequence consisting of non-important waypoints between the important waypoints at both ends of the road section.
[0006] Acquire a path planning task, where the path planning task includes a path planning starting point and a path planning end point, wherein at least one of the path planning starting point and the path planning end point is a non-important waypoint;
[0007] Based on the path planning starting point, the path planning end point, the sparse road network and the set of non-important waypoints corresponding to each road section, determine the starting transfer waypoint corresponding to the path planning starting point and the last transfer waypoint corresponding to the path planning end point;
[0008] Determine the transfer path and its path length between any starting transfer waypoint and any final transfer waypoint according to the preset path planning algorithm and the sparse road network;
[0009] Determine the preceding path and the succeeding path corresponding to each transfer path, wherein the preceding path corresponding to any transfer path is the path between the path planning starting point and the first transfer waypoint among the two end points of any transfer path, and the succeeding path corresponding to any transfer path is the path between the last transfer waypoint among the two end points of any transfer path and the path planning end point;
[0010] Determine the corresponding candidate path and its path length based on each transit path, wherein the candidate path corresponding to any transit path is obtained by splicing the any transit path and the preceding path and the succeeding path corresponding to the any transit path, and the path length of the candidate path corresponding to any transit path is the sum of the lengths of the any transit path and the preceding path and the succeeding path corresponding to the any transit path;
[0011] The candidate path with the shortest path length is determined as the target path between the path planning starting point and the path planning end point.
[0012] In an embodiment of the present application, determining the starting transfer waypoint corresponding to the starting point of path planning and the last transfer waypoint corresponding to the end point of path planning includes: when the starting point of path planning is an important waypoint in the sparse road network, determining the starting point of path planning as the starting transfer waypoint corresponding to the starting point of path planning; when the starting point of path planning is included in the set of non-important waypoints corresponding to any road section, determining two important waypoints at both ends of any road section as the starting transfer waypoint; when the end point of path planning is an important waypoint in the sparse road network, determining the end point of path planning as the last transfer waypoint corresponding to the end point of path planning; when the starting point of path planning is included in the set of non-important waypoints corresponding to any road section, determining two important waypoints at both ends of any road section as the last transfer waypoint.
[0013] In an embodiment of the present application, obtaining a sparse road network corresponding to a target area includes: obtaining map data of the target area, the map data including a plurality of roads, each road being a sequence of waypoints consisting of a plurality of waypoints; determining waypoints simultaneously included in at least two roads, starting waypoints and ending waypoints on each road as important waypoints; for any important waypoint, searching for other important waypoints adjacent to any important waypoint in each road including any important waypoint; adding a road section between each important waypoint of the other adjacent important waypoints and any important waypoint to a neighborhood road section set corresponding to any important waypoint, wherein any road section is defined by two important waypoints at both ends thereof and the distance between the two important waypoints; and generating a sparse road network corresponding to the target area according to the neighborhood road section set corresponding to each important waypoint.
[0014] In an embodiment of the present application, determining waypoints simultaneously included in at least two roads, starting waypoints and ending waypoints on each road as important waypoints includes: obtaining the latitude and longitude coordinates of each waypoint; traversing each waypoint on each road based on the latitude and longitude coordinates; for each waypoint, determining the waypoint as an important waypoint if the number of traversals of the waypoint is greater than or equal to a preset threshold.
[0015] In an embodiment of the present application, the method further includes: for each waypoint, when the number of traversal times of the waypoint is less than a preset threshold and the waypoint is not a starting waypoint or an ending waypoint, determining that the waypoint is indeed a non-important waypoint.
[0016] In an embodiment of the present application, obtaining a sparse road network corresponding to a target area and a set of non-important waypoints corresponding to each road section in the sparse road network includes: determining waypoints other than important waypoints as non-important waypoints; determining the current road where each waypoint is located; for each waypoint, if the waypoint is a non-important waypoint, searching the current road for two important waypoints closest to the waypoint; for each waypoint, adding the waypoint to the set of non-important waypoints corresponding to the road section between the two important waypoints closest to the waypoint, so as to obtain a set of non-important waypoints corresponding to each road section.
[0017] In an embodiment of the present application, the method also includes: determining a set of non-important waypoints corresponding to each section of the target path in the sparse road network; inserting the set of non-important waypoints corresponding to each section of the target path as a sequence into each section of the target path to generate a detailed target path between the path planning starting point and the path planning end point.
[0018] In an embodiment of the present application, the method also includes: obtaining a first cross-level path planning task, the first cross-level path planning task includes a first cross-level path planning starting point and a first cross-level path planning end point, wherein the first cross-level path planning starting point is in a sparse road network, and the first cross-level path planning end point is in a road network other than the sparse road network; respectively determining a first cross-level central node in the sparse road network, and a second cross-level central node in other road networks, wherein the first cross-level central node and the second cross-level central node are in the same secondary road network; generating and executing a first path planning task, a second path planning task and a third path planning task based on the first cross-level path planning task; wherein, after execution, the first path planning task is used to determine the first cross-level path planning starting point and the first cross-level central node based on the sparse road network and a preset path planning algorithm. The first starting point side target path between nodes, the second path planning task is used to determine the secondary transit path between the first cross-level hub node and the second cross-level hub node based on the secondary road network and the preset path planning algorithm after execution, and the third path planning task is used to determine the first terminal side target path between the second cross-level hub node and the first cross-level path planning terminal based on other road networks and the preset path planning algorithm after execution; the first cross-level target path obtained by splicing the first starting point side target path, the secondary transit path and the first terminal side target path is determined as the execution result corresponding to the first cross-level path planning task; obtaining the path planning task, including: determining the first path planning task as the path planning task, wherein the path planning starting point is the first cross-level path planning starting point and is a non-important waypoint, and the path planning terminal is the first cross-level hub node and is an important waypoint.
[0019] In an embodiment of the present application, the method also includes: obtaining a second cross-level path planning task, the second cross-level path planning task includes a second cross-level path planning starting point and a second cross-level path planning end point, wherein the second cross-level path planning end point is in a sparse road network, and the second cross-level path planning starting point is in a road network other than the sparse road network; respectively determining a third cross-level central node in the sparse road network, and a fourth cross-level central node in other road networks, wherein the third cross-level central node and the fourth cross-level central node are in the same secondary road network; generating and executing a fourth path planning task, a fifth path planning task and a sixth path planning task based on the second cross-level path planning task; wherein the fourth path planning task is used to determine the second cross-level path planning starting point and the fourth cross-level central node based on other road networks and a preset path planning algorithm after execution. The second starting point side target path between the points, the fifth path planning task is used to determine the secondary transit path between the fourth cross-level hub node and the third cross-level hub node based on the secondary road network and the preset path planning algorithm after execution, and the sixth path planning task is used to determine the second terminal side target path between the third cross-level hub node and the second cross-level path planning terminal point based on the sparse road network and the preset path planning algorithm after execution; the second cross-level target path obtained by splicing the second starting point side target path, the secondary transit path and the second terminal side target path is determined as the execution result corresponding to the second cross-level path planning task; the path planning task is obtained, including: determining the sixth path planning task as a path planning task, wherein the path planning starting point is the third cross-level hub node and is an important waypoint, and the path planning terminal point is the second cross-level path planning terminal point and is a non-important waypoint.
[0020] A second aspect of the present application provides a path planning device, comprising:
[0021] a memory configured to store instructions; and
[0022] The processor is configured to call instructions from the memory and implement the path planning method described above when executing the instructions.
[0023] A third aspect of the present application provides a machine-readable storage medium, characterized in that the machine-readable storage medium stores instructions, which are used to enable a machine to execute the path planning method described above.
[0024] Through the above technical solution, in a sparse road network composed of important waypoints, at least one path planning task for a non-important waypoint is performed, and the starting transfer waypoint corresponding to the path planning starting point and the final transfer waypoint corresponding to the path planning end point are found in the sparse road network, so as to determine the transfer path and its path length between any starting transfer waypoint and any final transfer waypoint based on the preset path planning algorithm, further determine the preceding path and the following path corresponding to each transfer path, and splice the transfer path, the preceding path and the following path to obtain a candidate path, so as to select the candidate path with the shortest path length from multiple candidate paths as the target path between the path planning starting point and the path planning end point. The above solution searches for the target path of the path planning task based on the preset path planning algorithm in the sparse road network, which can improve the computing efficiency and save storage space. At the same time, considering that the path planning starting point or the path planning end point is a non-important waypoint and is not in the sparse road network, the initial transfer waypoint corresponding to the path planning starting point and the final transfer waypoint corresponding to the path planning end point are determined, so as to search for the shortest target path between the path planning starting point and the path planning end point through these transfer waypoints.
[0025] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:
[0027] Figure 1 A schematic diagram of a process flow of a path planning method according to an embodiment of the present application is shown;
[0028] Figure 2 A structural block diagram of a path planning device according to an embodiment of the present application is schematically shown;
[0029] Figure 3 The schematic diagram shows a structure of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0031] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back...), such directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0032] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0033] Figure 1 The following schematically shows a flow chart of a path planning method according to an embodiment of the present application. Figure 1 As shown, an embodiment of the present application provides a path planning method, which may include the following steps.
[0034] S102, obtaining a sparse road network corresponding to the target area and a set of non-important waypoints corresponding to each road section in the sparse road network, wherein any road section in the sparse road network is defined by two important waypoints at both ends thereof and the distance between the two important waypoints, and the set of non-important waypoints corresponding to any road section is a waypoint sequence consisting of non-important waypoints between the important waypoints at both ends of the road section.
[0035] It can be understood that the target area is a designated geographical area or administrative geographical area. The sparse road network is a road network that is simplified in the target area. The sparse road network retains the important waypoints in the map data and simplifies the roads in the road network according to these important waypoints. That is to say, the sparse road network retains each original road, but discards the non-important waypoints in the road. Among them, the important waypoints are the more critical waypoints among the waypoints on the road, including the starting point waypoint and the end point waypoint of each road, that is, the two endpoints of each road. The important waypoints also include the waypoints that are simultaneously included in at least two roads, that is, the intersection points between the roads. Then, the waypoints other than the important waypoints in the map data can be regarded as non-important waypoints. The important waypoints on each road can divide the road into multiple continuous sections. The two endpoints of each section are two adjacent important waypoints, and the length of the section is calculated according to the latitude and longitude coordinates of the two adjacent important waypoints. Furthermore, the non-important waypoints between two adjacent important waypoints may constitute a waypoint sequence in order and be added to the non-important waypoint set corresponding to the road section.
[0036] In an embodiment of the present application, obtaining a sparse road network corresponding to a target area and a set of non-important waypoints corresponding to each road section in the sparse road network includes: obtaining map data of the target area, the map data including multiple roads, each road being a sequence of waypoints consisting of multiple waypoints; determining waypoints simultaneously included in at least two roads, starting waypoints and ending waypoints on each road as important waypoints; for any important waypoint, searching for other important waypoints adjacent to any important waypoint in each road including any important waypoint; adding the road section between each important waypoint of the other adjacent important waypoints and any important waypoint to the set of adjacent road sections corresponding to any important waypoint, wherein any road section is defined by two important waypoints at both ends thereof and the distance between the two important waypoints; generating a sparse road network corresponding to the target area according to the set of adjacent road sections corresponding to each important waypoint.
[0037] It can be understood that the map data includes multiple roads in the target area, wherein each road is a sequence of waypoints consisting of multiple waypoints. It can be understood that the waypoints in the road are vector data, and each waypoint has its position information in the road. The data form of the map data is stored in a hierarchical directory, which can also be understood as a tree structure, and is composed of some uncommon file formats. The vector data stored in these formats cannot be directly read into the memory by the program code, so the Global Mapper map software can be used to convert these vector data into files that can be directly read by the program. Important waypoints are more critical waypoints among the waypoints on the road, including the starting point waypoint and the end point waypoint of each road, that is, the two end points of each road. Important waypoints also include waypoints that are simultaneously included in at least two roads, that is, intersection points between roads. Since the amount of waypoints in the map data is too large, if all the waypoints on the roads in the map data are input into the algorithm for calculation, the efficiency will be extremely low. Therefore, these waypoints can be screened, and the starting waypoints, the end waypoints and the intersection points can be screened out as important waypoints. For subsequent path planning, this method greatly reduces the data volume and improves the calculation efficiency. In the road containing any important waypoint, other important waypoints adjacent to any important waypoint can be the starting waypoint, the end waypoint or the waypoints included in at least two roads at the same time. The important waypoints on each road can divide the road into multiple continuous sections. For each important waypoint, the multiple sections corresponding to the multiple other important waypoints adjacent to it can constitute the neighborhood section set corresponding to the important waypoint. That is to say, when locking any important waypoint, other important waypoints adjacent to the important waypoint can be searched according to the neighborhood section set, as well as the distance between the sections. Moreover, the distance between the important waypoint and other adjacent important waypoints can be calculated based on the longitude and latitude coordinates. After obtaining the neighborhood road segment set corresponding to each important waypoint in the target area, each important waypoint has been associated with other important waypoints in its vicinity, then, a sparse road network corresponding to the target area can be generated based on all the neighborhood road segment sets. The sparse road network is a road network that is simplified in the target area, and the neighborhood road segment set is stored in the data structure of the adjacency list, which can save storage space. The sparse road network retains the important waypoints in the map data, and simplifies the roads in the road network based on these important waypoints, that is, the sparse road network retains each original road, but discards the non-important waypoints in the road. In this way, the data volume of the map data can be greatly reduced, and the computing efficiency can be improved.
[0038] In an embodiment of the present application, determining waypoints simultaneously included in at least two roads, starting waypoints and ending waypoints on each road as important waypoints includes: obtaining the latitude and longitude coordinates of each waypoint; traversing each waypoint on each road based on the latitude and longitude coordinates; for each waypoint, determining the waypoint as an important waypoint if the number of traversals of the waypoint is greater than or equal to a preset threshold.
[0039] It can be understood that each waypoint in the map data has its corresponding longitude and latitude coordinates, and the position of each waypoint in the road can be determined based on the longitude and latitude coordinates. In addition, the waypoints in the road are vector data, and the waypoints constitute a waypoint sequence in the road based on the longitude and latitude coordinates. Then, each waypoint of each road can be traversed one by one based on the longitude and latitude coordinates. It can be understood that there are waypoints with the same longitude and latitude coordinates in different roads, which will be traversed many times. After all roads are traversed, the number of traversals of each waypoint can be counted. When the number of traversals is greater than or equal to a preset threshold, the waypoint is determined to be an important waypoint. Among them, the preset threshold can be set to a positive integer greater than or equal to 2. It can be understood that only waypoints that are simultaneously included in at least two roads will be traversed many times, so the important waypoints in the road can be accurately determined by the number of traversals.
[0040] In an embodiment of the present application, the method further includes: for each waypoint, when the number of traversal times of the waypoint is less than a preset threshold and the waypoint is not a starting waypoint or an ending waypoint, determining that the waypoint is indeed a non-important waypoint.
[0041] In an embodiment of the present application, a sparse road network corresponding to a target area is obtained and includes: determining waypoints other than important waypoints as non-important waypoints; determining the current road where each waypoint is located; for each waypoint, if the waypoint is a non-important waypoint, searching the current road for two important waypoints closest to the waypoint; for each waypoint, adding the waypoint to a set of non-important waypoints corresponding to a road section between the two important waypoints closest to the waypoint, so as to obtain a set of non-important waypoints corresponding to each road section.
[0042] It can be understood that after determining the important waypoints in the map data, the remaining waypoints are all non-important waypoints. Then, for any road section, the waypoint sequence composed of non-important waypoints between the important waypoints at both ends of the road section can be used as the non-important waypoint set corresponding to the road section. It is understandable that waypoints other than important waypoints are not useless. In the general steps of path planning, the last step is route optimization. The path searched out with important waypoints as input may not be completely consistent with the actual map road. Further processing and optimization are required to make it an actually passable route. Therefore, the non-important waypoint set is stored in the road section in the code for smoothing.
[0043] Specifically, as a specific implementation method, waypoints other than important waypoints are determined as non-important waypoints, and then each waypoint can be traversed. In the case where the waypoint is a non-important waypoint, the waypoint can be searched forward and backward on the road where it is located to search for the two important waypoints closest to the waypoint, and the waypoint is added to the non-important waypoint set corresponding to the road section between the two important waypoints closest to the waypoint, and the waypoints are arranged in order according to the latitude and longitude coordinates of the waypoints to form a waypoint sequence, thereby obtaining a non-important waypoint set corresponding to each road section.
[0044] S104, obtaining a path planning task, where the path planning task includes a path planning starting point and a path planning end point, wherein at least one of the path planning starting point and the path planning end point is a non-important waypoint.
[0045] It can be understood that the path planning task refers to the task of planning the target path from the path planning starting point to the path planning end point. The target path here can be planned based on various factors such as time, distance, safety, etc. If the path planning starting point and / or the path planning end point are non-important waypoints, and the non-important waypoints do not exist in the sparse road network, it is necessary to call the non-important waypoint set corresponding to each road section to determine the non-important waypoint corresponding to the path planning starting point and / or the non-important waypoint corresponding to the path planning end point.
[0046] S106, based on the path planning starting point, the path planning end point, the sparse road network and the set of non-important waypoints corresponding to each road section, determine the initial transfer waypoint corresponding to the path planning starting point and the final transfer waypoint corresponding to the path planning end point.
[0047] The starting point or the end point of the path planning may be an important waypoint or a non-important waypoint. If it is a non-important waypoint, it is necessary to call the non-important waypoint set corresponding to each road section and find the non-important waypoint set corresponding to the starting point or the end point of the path planning. Determine the corresponding road section through the non-important waypoint set to determine the important waypoints that can be used as the starting transfer waypoints corresponding to the starting point of the path planning in the sparse road network, as well as the important waypoints that can be used as the last transfer waypoints corresponding to the end point of the path planning.
[0048] In an embodiment of the present application, determining the starting transfer waypoint corresponding to the starting point of path planning and the last transfer waypoint corresponding to the end point of path planning includes: when the starting point of path planning is an important waypoint in the sparse road network, determining the starting point of path planning as the starting transfer waypoint corresponding to the starting point of path planning; when the starting point of path planning is included in the set of non-important waypoints corresponding to any road section, determining two important waypoints at both ends of any road section as the starting transfer waypoint; when the end point of path planning is an important waypoint in the sparse road network, determining the end point of path planning as the last transfer waypoint corresponding to the end point of path planning; when the starting point of path planning is included in the set of non-important waypoints corresponding to any road section, determining two important waypoints at both ends of any road section as the last transfer waypoint.
[0049] If the path planning starting point or the path planning end point belongs to an important waypoint in the sparse road network, the path planning starting point can be directly used as the corresponding starting transfer waypoint, and the path planning end point can be used as the corresponding final transfer waypoint. If the path planning starting point or the path planning end point are both non-important waypoints, for the path planning starting point, it is necessary to first call the non-important waypoint set corresponding to each road section to determine the non-important waypoint corresponding to the path planning starting point. For each path planning end point, it is necessary to call the non-important waypoint set corresponding to each road section to determine the non-important waypoint corresponding to the path planning end point. Further, for the path planning points, the important waypoints at both ends of the road where the non-important waypoints corresponding to the path planning starting point are located are determined, that is, the starting transfer waypoints corresponding to the path planning starting point. Then the important waypoints at both ends of the road where the non-important waypoints corresponding to the path planning end point are located are the final transfer waypoints corresponding to the path planning end point. That is to say, in the sparse road network, the starting transfer waypoints or the final transfer waypoints are both important waypoints in the sparse road network, and the number can be two.
[0050] S108, determining a transfer path and its path length between any starting transfer waypoint and any ending transfer waypoint according to a preset path planning algorithm and a thinned road network.
[0051] In a sparse road network, a transfer path between any starting transfer point and any final transfer point can be planned based on a preset path planning algorithm, and the path length of each transfer path can be obtained. The preset path planning algorithm is a path planning algorithm preset by a technician. Specifically, the path planning algorithm includes but is not limited to the Dijkstra algorithm, the A star algorithm, the ant colony algorithm, the genetic algorithm, the neural network algorithm, etc. In a specific embodiment of the present application, the Dijkstra algorithm is used as the preset path planning algorithm, which calculates all paths between any starting transfer point and any final transfer point by traversing, and selects the path with the lowest cost as the transfer path. The global optimal path can be obtained by this algorithm, but it takes a long time. In addition, the original Dijkstra algorithm has a high time complexity, and an adjacency matrix is used for data storage. For dense road networks, the adjacency matrix is still feasible in terms of space utilization, but for sparse road networks, it greatly wastes memory space. Therefore, in the embodiment of the present application, the path planning is performed through the simplified sparse road network, and the adjacency list structure is used for data storage to optimize the Dijkstra algorithm to search for transit paths. The simplified sparse road network includes each neighborhood road segment set that is only related to important waypoints, removes non-important waypoints, reduces time complexity, and also reduces space complexity.
[0052] S110, determining a preceding path and a succeeding path corresponding to each transfer path, wherein the preceding path corresponding to any transfer path is a path between a path planning starting point and an initial transfer waypoint among two end points of any transfer path, and the succeeding path corresponding to any transfer path is a path between a final transfer waypoint among two end points of any transfer path and a path planning end point.
[0053] If the starting point of the path planning is a non-important waypoint, the preceding path corresponding to each transfer path is the path between the starting point of the path planning and each starting transfer waypoint, and its path length can be calculated based on the longitude and latitude coordinates of the starting point of the path planning and each starting transfer waypoint. Similarly, if the end point of the path planning is a non-important waypoint, the following path corresponding to each transfer path is the path between the end point of the path planning and each last transfer waypoint, and its path length can be calculated based on the longitude and latitude coordinates of the end point of the path planning and each last transfer waypoint. If the starting point or the end point of the path planning is an important waypoint, then the starting transfer waypoint is the starting point of the path planning, the path length of the preceding path between the starting transfer waypoint and the starting point of the path planning is 0, and the path length of the following path between the last transfer waypoint and the end point of the path planning is 0.
[0054] S112, determining the corresponding candidate path and its path length based on each transit path, wherein the candidate path corresponding to any transit path is obtained by concatenating the any transit path and the preceding path and the succeeding path corresponding to the any transit path, and the path length of the candidate path corresponding to any transit path is the sum of the lengths of the any transit path and the preceding path and the succeeding path corresponding to the any transit path.
[0055] Specifically, for each transit path, it is spliced with any preceding path and any succeeding path to obtain a candidate path between the path planning starting point and the path planning end point. It is understandable that for each transit path, multiple candidate paths can be generated. The path length of each candidate path is the sum of the lengths of the transit path, preceding, succeeding and succeeding paths corresponding to the candidate path. For a preceding path whose path planning starting point is an important waypoint, the path length of its preceding path is 0; for a succeeding path whose path planning end point is an important waypoint, the path length of its succeeding path is 0. Then, when both the path planning starting point and the path planning end point are important waypoints, the candidate path is the transit path.
[0056] S114: Determine the candidate path with the shortest path length as the target path between the path planning starting point and the path planning end point.
[0057] For example, the starting point of the planned route is A1, and the end point of the planned route is A2. A1 and A2 are both non-important waypoints. The starting transfer points at both ends of A1 are B1 and B2, and the ending transfer points at both ends of A2 are C1 and C2. Then, the transfer routes include B1-C1, B2-C1, B1-C2, and B2-C2. For the transfer path B1-C1, its preceding path is A1-B1, its following path is C1-A2, and the candidate path is A1-B1-C1-A2; for the transfer path B2-C1, its preceding path is A1-B2, its following path is C1-A2, and the candidate path is A1-B2-C1-A2; for the transfer path B1-C2, its preceding path is A1-B1, its following path is C2-A2, and the candidate path is A1-B1-C2-A2; for the transfer path B2-C2, its preceding path is A1-B2, its following path is C2-A2, and the candidate path is A1-B2-C2-A2. Further, the path lengths of the above four candidate paths are calculated, and the candidate path with the shortest path length is taken as the target path between A1 and A2.
[0058] Through the above technical solution, in a sparse road network composed of important waypoints, at least one path planning task for a non-important waypoint is performed, and the starting transfer waypoint corresponding to the path planning starting point and the final transfer waypoint corresponding to the path planning end point are found in the sparse road network, so as to determine the transfer path and its path length between any starting transfer waypoint and any final transfer waypoint based on the preset path planning algorithm, further determine the preceding path and the following path corresponding to each transfer path, and splice the transfer path, the preceding path and the following path to obtain a candidate path, so as to select the candidate path with the shortest path length from multiple candidate paths as the target path between the path planning starting point and the path planning end point. The above solution searches for the target path of the path planning task based on the preset path planning algorithm in the sparse road network, which can improve the computing efficiency and save storage space. At the same time, considering that the path planning starting point or the path planning end point is a non-important waypoint and is not in the sparse road network, the initial transfer waypoint corresponding to the path planning starting point and the final transfer waypoint corresponding to the path planning end point are determined, so as to search for the shortest target path between the path planning starting point and the path planning end point through these transfer waypoints.
[0059] In an embodiment of the present application, the method also includes: determining a set of non-important waypoints corresponding to each section of the target path in the sparse road network; inserting the set of non-important waypoints corresponding to each section of the target path as a sequence into each section of the target path to generate a detailed target path between the path planning starting point and the path planning end point.
[0060] After obtaining the non-important waypoint set corresponding to each road section according to the aforementioned scheme and determining the target path between the path planning starting point and the path planning end point, the non-important waypoint set stored in each road section of the target path can be called, and the non-important waypoint set can be inserted as a sequence into each road section included in the target path, and the target path is smoothed to generate a detailed target path between the path planning starting point and the path planning end point, so that it becomes an actually passable route.
[0061] In an embodiment of the present application, searching for other important waypoints adjacent to any important waypoint in each road including any important waypoint includes: for any important waypoint, in a sequence of waypoints included in each road including the important waypoint, searching each waypoint one by one towards the front and back of the important waypoint according to the sequence number of the important waypoint, and determining the important waypoints searched for the first time in the process of searching one by one towards the back and forth as other important waypoints adjacent to any important waypoint.
[0062] It can be understood that each waypoint in the map data has its corresponding serial number, and the distance between each waypoint and the waypoints with adjacent serial numbers in each road is the shortest. Among them, the distance is determined according to the longitude and latitude coordinates of the waypoints. Then, in each road, each waypoint is searched one by one in front of and behind the serial number of the important waypoint, and the important waypoints that are searched first in advance or first in the back during the search process are determined as other important waypoints adjacent to any important waypoint.
[0063] In a specific embodiment, the Global Mapper map software is used to convert these vector data in the map data into files that can be directly read by the program. First, piece together the maps and then convert the format. For example, all the map data at the district and county level of a province can be imported into Global Mapper, piece together the complete map information of the province, and then export it in the form of geojson format. The converted file is still stored in the form of a folder hierarchy directory. Each city in the province corresponds to a folder, which contains the geojson files of each city-level map in the area. From the perspective of data structure, the geojson file can be seen as a json object, which contains two key-value pairs, the key of one key-value pair is type, the value is FeatureCollection, and the key of the other key-value pair is features, and the value is a JsonArray array. Each json object in the array is a route in the current area. Each route contains three key-value pairs, one of which is type, the value is Feature, and the other key is properties. The value is the route name stored in the form of a key-value pair. The last key is geometry, which represents the geographic information of the route, and the value is a json object again. There are two key-value pairs in this object. One represents the route form, with key being type and value being LineString. The other contains the discrete coordinate points on the route, with key being coordinates and value being a two-dimensional JsonArray array. Each element in the array is a one-dimensional array with a length of 2, which are longitude coordinates and latitude coordinates, representing a location coordinate point on the earth. From a differential point of view, the two points in the array can be considered as a straight line, and the distance error depends on the accuracy of the map data. The output detailed target path can be imported into Global Mapper for verification to check whether it is an actual passable path.
[0064] In an embodiment of the present application, the method also includes: obtaining a first cross-level path planning task, the first cross-level path planning task includes a first cross-level path planning starting point and a first cross-level path planning end point, wherein the first cross-level path planning starting point is in a sparse road network, and the first cross-level path planning end point is in a road network other than the sparse road network; respectively determining a first cross-level central node in the sparse road network, and a second cross-level central node in other road networks, wherein the first cross-level central node and the second cross-level central node are in the same secondary road network; generating and executing a first path planning task, a second path planning task and a third path planning task based on the first cross-level path planning task; wherein, after execution, the first path planning task is used to determine the first cross-level path planning starting point and the first cross-level central node based on the sparse road network and a preset path planning algorithm. The first starting point side target path between nodes, the second path planning task is used to determine the secondary transit path between the first cross-level hub node and the second cross-level hub node based on the secondary road network and the preset path planning algorithm after execution, and the third path planning task is used to determine the first terminal side target path between the second cross-level hub node and the first cross-level path planning terminal based on other road networks and the preset path planning algorithm after execution; the first cross-level target path obtained by splicing the first starting point side target path, the secondary transit path and the first terminal side target path is determined as the execution result corresponding to the first cross-level path planning task; obtaining the path planning task, including: determining the first path planning task as the path planning task, wherein the path planning starting point is the first cross-level path planning starting point and is a non-important waypoint, and the path planning terminal is the first cross-level hub node and is an important waypoint.
[0065] It can be understood that the cross-level path planning task refers to the path planning task performed in a multi-level road network scenario. Among them, the multi-level road network scenario includes multiple road networks with different attributes, for example, railway networks and highway networks, and the highway network includes a secondary road network, a highway network, a main road network, etc. The road network can also be divided according to the region, and different regions can have their corresponding railway networks and highway networks. Specifically, the starting point of the first cross-level path task planning belongs to the target area and is in the sparse road network corresponding to the target area, and the end point of the first cross-level path planning is in other road networks except the sparse road network of the target area. Then, the first cross-level hub node corresponding to the sparse road network and the second cross-level hub node corresponding to other road networks can be determined respectively. It can be understood that since the first cross-level path planning starting point and the first cross-level path planning end point are not in the same road network, it is very likely that there is no connectivity in the road networks where the two are respectively located, so the path can be found in the road network of the upper level. For example, when the starting point of the first cross-level path planning and the end point of the first cross-level path planning are in highway networks in different areas, the path can be searched for in the corresponding railway network of the previous level. The first cross-level hub node refers to a waypoint in the road network of the previous level that is connected to the sparse road network of the target area, that is, the waypoint belongs to both the sparse road network and the road network of the previous level. Similarly, the second cross-level hub node refers to a waypoint in the road network of the previous level that is connected to other road networks. The sparse road network and other road networks belong to the first-level road network. After searching for the hub node in the road network of the previous level, the searched first cross-level hub node and the second cross-level hub node are in the same second-level road network. Then, multiple path planning tasks can be generated based on the first cross-level path planning task. Specifically, the first path planning task: determine the first starting point side target path between the first cross-level path planning starting point and the first cross-level hub node in the sparse road network according to the preset path planning algorithm, the second path planning task: determine the secondary transit path between the first cross-level hub node and the second cross-level hub node in the secondary road network according to the preset path planning algorithm, the third path planning task: determine the first terminal side target path between the second cross-level hub node and the first cross-level path planning terminal in other road networks according to the preset path planning algorithm. Among them, the first path planning task is determined as the path planning task in the aforementioned scheme, the path planning starting point is the first cross-level path planning starting point and is a non-important waypoint, and the path planning terminal is the first cross-level hub node and is an important waypoint. Specifically, for the secondary road network and other road networks, the aforementioned scheme can be used to determine the important waypoints in the road network to establish the corresponding sparse road network, so as to search for the shortest first terminal side target path and the secondary transit path in their respective sparse road networks through the preset path planning algorithm.In addition, a set of non-important waypoints for each section in the road network can be found, and the non-important waypoints for each section corresponding to the first destination side target path and the secondary transit path can be respectively called, and added to each section to generate a detailed path. The first cross-level target path obtained by splicing the first starting point side target path, the secondary transit path and the first destination side target path is determined as the execution result corresponding to the first cross-level path planning task.
[0066] In an embodiment of the present application, the method also includes: obtaining a second cross-level path planning task, the second cross-level path planning task includes a second cross-level path planning starting point and a second cross-level path planning end point, wherein the second cross-level path planning end point is in a sparse road network, and the second cross-level path planning starting point is in a road network other than the sparse road network; respectively determining a third cross-level hub node in the sparse road network, and a fourth cross-level hub node in other road networks, wherein the third cross-level hub node and the fourth cross-level hub node are in the same secondary road network; generating and executing a fourth path planning task, a fifth path planning task and a sixth path planning task based on the second cross-level path planning task; wherein, after execution, the fourth planning task is used to determine the second cross-level path planning starting point and the fourth cross-level hub node based on other road networks and a preset path planning algorithm. The second starting point side target path between the nodes, the fifth planning task is used to determine the secondary transit path between the fourth cross-level hub node and the third cross-level hub node based on the secondary road network and the preset path planning algorithm after execution, and the sixth planning task is used to determine the second terminal side target path between the third cross-level hub node and the second cross-level path planning terminal based on the sparse road network and the preset path planning algorithm after execution; the second cross-level target path obtained by splicing the second starting point side target path, the secondary transit path and the second terminal side target path is determined as the execution result corresponding to the second cross-level path planning task; the path planning task is obtained, including: determining the sixth path planning task as a path planning task, wherein the path planning starting point is the third cross-level hub node and is an important waypoint, and the path planning terminal is the second cross-level path planning terminal and is a non-important waypoint.
[0067] Specifically, the end point of the second cross-level path task planning belongs to the target area and is in the sparse road network corresponding to the target area, while the starting point of the first cross-level path planning is in other road networks except the sparse road network of the target area. Then, the third cross-level hub node corresponding to the sparse road network and the fourth cross-level hub node corresponding to other road networks can be determined respectively. It can be understood that since the starting point of the first cross-level path planning and the end point of the first cross-level path planning are not in the same road network, it is very likely that there is no connectivity in the road networks where the two are respectively located, so the path can be found in the road network of the upper level. For example, when the starting point of the first cross-level path planning and the end point of the first cross-level path planning are in highway networks in different regions, the path can be searched for in the railway network corresponding to the upper level. The third cross-level hub node refers to a waypoint in the road network of the upper level that is connected to the sparse road network of the target area, that is, the waypoint belongs to both the sparse road network and the road network of the upper level. Similarly, the fourth cross-level hub node refers to a waypoint in the road network of the previous level that is connected to other road networks. The sparse road network and other road networks belong to the first-level road network. After searching for the hub node in the road network of the previous level, the searched third cross-level hub node and the fourth cross-level hub node are in the same second-level road network. Then, multiple path planning tasks can be generated based on the second cross-level path planning task. Specifically, the fourth path planning task: determine the second starting point side target path between the second cross-level path planning starting point and the fourth cross-level hub node according to the preset path planning algorithm in other road networks, the fifth path planning task: determine the secondary transit path between the fourth cross-level hub node and the third cross-level hub node according to the preset path planning algorithm in the secondary road network, and the sixth path planning task: determine the second terminal side target path between the third cross-level hub node and the second cross-level path planning terminal according to the preset path planning algorithm in the sparse road network. Among them, the sixth path planning task is determined as a path planning task, the path planning starting point is the third cross-level hub node and is an important waypoint, and the path planning end point is the second cross-level path planning end point and is a non-important waypoint. Specifically, for the secondary road network and other road networks, the above-mentioned scheme can be used to determine the important waypoints in the road network to establish a corresponding sparse road network, so as to search for the second starting point side target path and the secondary transit path with the shortest path in each sparse road network through a preset path planning algorithm. In addition, it is also possible to find out the non-important waypoint set of each section in the road network, and call the non-important waypoint set of each section corresponding to the second starting point side target path and the secondary transit path respectively, and add it to each section to generate a detailed path. The second cross-level target path obtained by splicing the second starting point side target path, the secondary transit path and the second terminal side target path is determined as the execution result corresponding to the second cross-level path planning task.
[0068] Figure 1FIG. 1 is a flow chart of a method for path planning in one embodiment. It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0069] Figure 2 The structure block diagram of a path planning device according to an embodiment of the present application is schematically shown. Figure 2 As shown, an embodiment of the present application provides a path planning device, which may include:
[0070] Memory 210, configured to store instructions; and
[0071] The processor 220 is configured to call instructions from the memory 210 and implement the above-mentioned path planning method when executing the instructions.
[0072] Specifically, in an embodiment of the present application, the processor 220 may be configured to:
[0073] Obtain a sparse road network corresponding to the target area and a set of non-important waypoints corresponding to each road section in the sparse road network. Any road section in the sparse road network is defined by two important waypoints at both ends and the distance between the two important waypoints. The set of non-important waypoints corresponding to any road section is a waypoint sequence consisting of non-important waypoints between the important waypoints at both ends of the road section.
[0074] Acquire a path planning task, where the path planning task includes a path planning starting point and a path planning end point, wherein at least one of the path planning starting point and the path planning end point is a non-important waypoint;
[0075] Based on the path planning starting point, the path planning end point, the sparse road network and the set of non-important waypoints corresponding to each road section, determine the starting transfer waypoint corresponding to the path planning starting point and the last transfer waypoint corresponding to the path planning end point;
[0076] Determine the transfer path and its path length between any starting transfer waypoint and any final transfer waypoint according to the preset path planning algorithm and the sparse road network;
[0077] Determine the preceding path and the succeeding path corresponding to each transfer path, wherein the preceding path corresponding to any transfer path is the path between the path planning starting point and the first transfer waypoint among the two end points of any transfer path, and the succeeding path corresponding to any transfer path is the path between the last transfer waypoint among the two end points of any transfer path and the path planning end point;
[0078] Determine the corresponding candidate path and its path length based on each transit path, wherein the candidate path corresponding to any transit path is obtained by splicing the any transit path and the preceding path and the succeeding path corresponding to the any transit path, and the path length of the candidate path corresponding to any transit path is the sum of the lengths of the any transit path and the preceding path and the succeeding path corresponding to the any transit path;
[0079] The candidate path with the shortest path length is determined as the target path between the path planning starting point and the path planning end point.
[0080] In the embodiment of the present application, the processor 220 may also be configured to:
[0081] When the starting point of path planning is an important waypoint in the sparse road network, the starting point of path planning is determined as the starting transfer waypoint corresponding to the starting point of path planning; when the starting point of path planning is included in the set of non-important waypoints corresponding to any road section, the two important waypoints at both ends of any road section are determined as the starting transfer waypoints; when the end point of path planning is an important waypoint in the sparse road network, the end point of path planning is determined as the last transfer waypoint corresponding to the end point of path planning; when the starting point of path planning is included in the set of non-important waypoints corresponding to any road section, the two important waypoints at both ends of any road section are determined as the last transfer waypoints.
[0082] In the embodiment of the present application, the processor 220 may also be configured to:
[0083] Obtain map data of a target area, the map data including a plurality of roads, each road being a sequence of waypoints consisting of a plurality of waypoints; determine waypoints simultaneously included in at least two roads, starting waypoints and ending waypoints on each road as important waypoints; for any important waypoint, search for other important waypoints adjacent to any important waypoint in each road including any important waypoint; add a road section between each important waypoint of other adjacent important waypoints and any important waypoint to a neighborhood road section set corresponding to any important waypoint, wherein any road section is defined by two important waypoints at both ends thereof and a distance between the two important waypoints; generate a sparse road network corresponding to the target area according to the neighborhood road section set corresponding to each important waypoint.
[0084] In the embodiment of the present application, the processor 220 may also be configured to:
[0085] Obtain the latitude and longitude coordinates of each waypoint; traverse each waypoint of each road based on the latitude and longitude coordinates; for each waypoint, if the number of traversals of the waypoint is greater than or equal to a preset threshold, determine that the waypoint is an important waypoint.
[0086] In the embodiment of the present application, the processor 220 may also be configured to:
[0087] For each waypoint, when the number of traversal times of the waypoint is less than a preset threshold and the waypoint is not a starting waypoint or an ending waypoint, it is determined that the waypoint is indeed a non-important waypoint.
[0088] In the embodiment of the present application, the processor 220 may also be configured to:
[0089] Determine waypoints other than important waypoints as non-important waypoints; determine the current road where each waypoint is located; for each waypoint, if the waypoint is a non-important waypoint, search for two important waypoints closest to the waypoint in the current road; for each waypoint, add the waypoint to the non-important waypoint set corresponding to the road section between the two important waypoints closest to the waypoint, so as to obtain the non-important waypoint set corresponding to each road section.
[0090] In the embodiment of the present application, the processor 220 may also be configured to:
[0091] Determine a set of non-important waypoints corresponding to each road segment included in the target path in the sparse road network; insert the set of non-important waypoints corresponding to each road segment included in the target path as a sequence into each road segment included in the target path to generate a detailed target path between a path planning start point and a path planning end point.
[0092] In the embodiment of the present application, the processor 220 may also be configured to:
[0093] Obtain a first cross-level path planning task, the first cross-level path planning task includes a first cross-level path planning starting point and a first cross-level path planning end point, wherein the first cross-level path planning starting point is in a sparse road network, and the first cross-level path planning end point is in a road network other than the sparse road network; respectively determine a first cross-level hub node in the sparse road network, and a second cross-level hub node in other road networks, wherein the first cross-level hub node and the second cross-level hub node are in the same secondary road network; generate and execute a first path planning task, a second path planning task and a third path planning task based on the first cross-level path planning task; wherein, after execution, the first path planning task is used to determine the first starting point between the first cross-level path planning starting point and the first cross-level hub node based on the sparse road network and a preset path planning algorithm. point-side target path, the second path planning task is used to determine the secondary transit path between the first cross-level hub node and the second cross-level hub node based on the secondary road network and the preset path planning algorithm after execution, and the third path planning task is used to determine the first terminal-side target path between the second cross-level hub node and the first cross-level path planning terminal based on other road networks and the preset path planning algorithm after execution; the first cross-level target path obtained by splicing the first starting point side target path, the secondary transit path and the first terminal side target path is determined as the execution result corresponding to the first cross-level path planning task; the path planning task is obtained, including: determining the first path planning task as a path planning task, wherein the path planning starting point is the first cross-level path planning starting point and is a non-important waypoint, and the path planning terminal is the first cross-level hub node and is an important waypoint.
[0094] In the embodiment of the present application, the processor 220 may also be configured to:
[0095] Obtain a second cross-level path planning task, the second cross-level path planning task includes a second cross-level path planning starting point and a second cross-level path planning end point, wherein the second cross-level path planning end point is in a sparse road network, and the second cross-level path planning starting point is in a road network other than the sparse road network; respectively determine the third cross-level hub node in the sparse road network and the fourth cross-level hub node in other road networks, wherein the third cross-level hub node and the fourth cross-level hub node are in the same secondary road network; generate and execute a fourth path planning task, a fifth path planning task and a sixth path planning task based on the second cross-level path planning task; wherein, after execution, the fourth path planning task is used to determine the second starting point between the second cross-level path planning starting point and the fourth cross-level hub node based on other road networks and a preset path planning algorithm. side target path, the fifth path planning task is used to determine the secondary transit path between the fourth cross-level hub node and the third cross-level hub node based on the secondary road network and the preset path planning algorithm after execution, and the sixth path planning task is used to determine the second terminal side target path between the third cross-level hub node and the second cross-level path planning terminal based on the sparse road network and the preset path planning algorithm after execution; the second cross-level target path obtained by splicing the second starting point side target path, the secondary transit path and the second terminal side target path is determined as the execution result corresponding to the second cross-level path planning task; the path planning task is obtained, including: determining the sixth path planning task as a path planning task, wherein the path planning starting point is the third cross-level hub node and is an important waypoint, and the path planning terminal is the second cross-level path planning terminal and is a non-important waypoint.
[0096] Through the above technical solution, in a sparse road network composed of important waypoints, at least one path planning task for a non-important waypoint is performed, and the starting transfer waypoint corresponding to the path planning starting point and the last transfer waypoint corresponding to the path planning end point are found in the sparse road network, so as to determine the transfer path and its path length between any starting transfer waypoint and any last transfer waypoint based on a preset path planning algorithm, further determine the preceding path and the following path corresponding to each transfer path, and splice the transfer path, the preceding path and the following path to obtain a candidate path, so as to select the candidate path with the shortest path length from multiple candidate paths as the target path between the path planning starting point and the path planning end point. The above scheme searches for the target path of the path planning task based on the preset path planning algorithm in the sparse road network, which can improve the operation efficiency. At the same time, considering that the path planning starting point or the path planning end point is a non-important waypoint and is not in the sparse road network, the starting transfer waypoint corresponding to the path planning starting point and the last transfer waypoint corresponding to the path planning end point are determined, so as to search for the shortest target path of the path planning starting point and the path planning end point through these transfer waypoints. When performing path planning, the set of non-important waypoints of each section included in the target path can be called and inserted into each section included in the target path as a sequence to generate a detailed target path and make it an actual passable route. In addition, a path planning scheme is provided for multi-level road network scenarios with different levels of road networks, taking into account the connectivity of different levels of road networks in different regions, and performing cross-level path planning tasks combining different vehicles to improve transportation efficiency.
[0097] An embodiment of the present application also provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the above-mentioned path planning method.
[0098] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor A01, a network interface A02, a memory (not shown in the figure) and a database (not shown in the figure) connected through a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02 and a database (not shown in the figure). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A04. The database of the computer device is used to store path planning data. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program B02 is executed by the processor A01, a path planning method is implemented.
[0099] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0100] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0101] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0102] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0103] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0104] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0105] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0106] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0107] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0108] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A path planning method, It is characterized in that The method comprises: Obtaining a sparse road network corresponding to a target area and a set of non-important waypoints corresponding to each road section in the sparse road network, wherein any road section in the sparse road network is defined by two important waypoints at both ends thereof and the distance between the two important waypoints, and the set of non-important waypoints corresponding to any road section is a waypoint sequence consisting of non-important waypoints between the important waypoints at both ends of the road section, wherein the important waypoints include the starting point waypoint and the ending point waypoint of each road, and the waypoints simultaneously included in at least two roads, and the non-important waypoints refer to waypoints other than the important waypoints in the map data of the target area; Acquire a path planning task, wherein the path planning task includes a path planning starting point and a path planning end point, wherein at least one of the path planning starting point and the path planning end point is a non-important waypoint; Based on the path planning starting point, the path planning end point, the sparse road network and the set of non-important waypoints corresponding to each road section, determining the starting transfer waypoint corresponding to the path planning starting point and the last transfer waypoint corresponding to the path planning end point; Determine the transfer path and its path length between any starting transfer waypoint and any ending transfer waypoint according to the preset path planning algorithm and the thinned road network; Determine a preceding path and a succeeding path corresponding to each transfer path, wherein the preceding path corresponding to any transfer path is a path between the path planning starting point and the first transfer waypoint among the two end points of any transfer path, and the succeeding path corresponding to any transfer path is a path between the last transfer waypoint among the two end points of any transfer path and the path planning end point; Determine the corresponding candidate path and its path length based on each transit path, wherein the candidate path corresponding to any transit path is obtained by splicing the any transit path and the preceding path and the succeeding path corresponding to the any transit path, and the path length of the candidate path corresponding to any transit path is the sum of the lengths of the any transit path and the preceding path and the succeeding path corresponding to the any transit path; The candidate path with the shortest path length is determined as the target path between the path planning starting point and the path planning end point.
2. The path planning method according to claim 1, It is characterized in that The determining of the initial transfer waypoint corresponding to the starting point of the path planning and the final transfer waypoint corresponding to the end point of the path planning includes: In the case where the path planning starting point is an important waypoint in the sparse road network, determining the path planning starting point as the initial transfer waypoint corresponding to the path planning starting point; In the case where the starting point of the route planning is included in the set of non-important waypoints corresponding to any road section, two important waypoints at both ends of the any road section are determined as the starting and transferring waypoints; In the case where the path planning end point is an important waypoint in the sparse road network, determining the path planning end point as the last transit waypoint corresponding to the path planning end point; In the case where the starting point of the route planning is included in the set of non-important waypoints corresponding to any road section, two important waypoints at both ends of the any road section are determined as the non-transfer waypoints.
3. The path planning method according to claim 1, It is characterized in that The obtaining of the sparse road network corresponding to the target area includes: Acquire map data of a target area, wherein the map data includes a plurality of roads, each road being a waypoint sequence consisting of a plurality of waypoints; The waypoints included in at least two roads at the same time, the starting waypoints and the ending waypoints on each road are determined as important waypoints; For any important waypoint, searching for other important waypoints adjacent to the important waypoint in each road including the important waypoint; Adding the road section between each of the other adjacent important waypoints and the any important waypoint to the neighborhood road section set corresponding to the any important waypoint, wherein any road section is defined by the two important waypoints at both ends thereof and the distance between the two important waypoints; A sparse road network corresponding to the target area is generated according to a set of neighborhood road segments corresponding to each important waypoint.
4. The path planning method according to claim 3, It is characterized in that The step of determining the waypoints simultaneously included in at least two roads, the starting waypoints and the ending waypoints on each road as important waypoints comprises: Get the longitude and latitude coordinates of each waypoint; Traversing each waypoint of each road based on the latitude and longitude coordinates; For each waypoint, when the number of traversal times of the waypoint is greater than or equal to a preset threshold, the waypoint is determined to be the important waypoint.
5. The path planning method according to claim 4, It is characterized in that The method further comprises: For each waypoint, when the number of traversal times of the waypoint is less than a preset threshold and the waypoint is not the starting waypoint or the ending waypoint, it is determined that the waypoint is indeed the non-important waypoint.
6. The path planning method according to claim 1, It is characterized in that The obtaining of the sparse road network corresponding to the target area and the set of non-important waypoints corresponding to each road section in the sparse road network include: Determine waypoints other than important waypoints as non-important waypoints; Determine the current road on which each waypoint is located; For each waypoint, if the waypoint is the non-important waypoint, searching for two important waypoints closest to the waypoint in the current road; For each waypoint, the waypoint is added to a set of non-important waypoints corresponding to a road segment between two important waypoints closest to the waypoint, so as to obtain a set of non-important waypoints corresponding to each road segment.
7. The path planning method according to claim 1, It is characterized in that The method further comprises: Determine a set of non-important waypoints corresponding to each road segment included in the target path in the thinned road network; A set of non-important waypoints corresponding to each road segment included in the target path is inserted into each road segment included in the target path as a sequence to generate a detailed target path between the path planning starting point and the path planning end point.
8. The path planning method according to claim 1, It is characterized in that The method further comprises: Acquire a first cross-level path planning task, wherein the first cross-level path planning task includes a first cross-level path planning starting point and a first cross-level path planning end point, wherein the first cross-level path planning starting point is in the sparse road network, and the first cross-level path planning end point is in a road network other than the sparse road network; Respectively determining a first cross-level hub node in the sparse road network and a second cross-level hub node in the other road network, wherein the first cross-level hub node and the second cross-level hub node are in the same secondary road network; Based on the first cross-level path planning task, a first path planning task, a second path planning task and a third path planning task are generated and executed; wherein, after execution, the first path planning task is used to determine the first starting point side target path between the starting point of the first cross-level path planning and the first cross-level hub node based on the sparse road network and the preset path planning algorithm, and after execution, the second path planning task is used to determine the secondary transit path between the first cross-level hub node and the second cross-level hub node based on the secondary road network and the preset path planning algorithm, and after execution, the third path planning task is used to determine the first terminal side target path between the second cross-level hub node and the terminal of the first cross-level path planning based on the other road networks and the preset path planning algorithm; Determine a first cross-level target path obtained by concatenating the first starting point side target path, the secondary transit path and the first terminal side target path as an execution result corresponding to the first cross-level path planning task; The obtaining of the path planning task includes: The first path planning task is determined as the path planning task, wherein the path planning starting point is the first cross-level path planning starting point and is a non-important waypoint, and the path planning end point is the first cross-level hub node and is an important waypoint.
9. The path planning method according to claim 1, It is characterized in that The method further comprises: Acquire a second cross-level path planning task, wherein the second cross-level path planning task includes a second cross-level path planning starting point and a second cross-level path planning end point, wherein the second cross-level path planning end point is in the sparse road network, and the second cross-level path planning starting point is in a road network other than the sparse road network; Respectively determine a third cross-level hub node in the thinned road network and a fourth cross-level hub node in the other road network, wherein the third cross-level hub node and the fourth cross-level hub node are in the same secondary road network; Based on the second cross-level path planning task, a fourth path planning task, a fifth path planning task and a sixth path planning task are generated and executed; wherein, after execution, the fourth path planning task is used to determine the second starting point side target path between the starting point of the second cross-level path planning and the fourth cross-level hub node based on the other road network and the preset path planning algorithm, and after execution, the fifth path planning task is used to determine the secondary transit path between the fourth cross-level hub node and the third cross-level hub node based on the secondary road network and the preset path planning algorithm, and after execution, the sixth path planning task is used to determine the second terminal side target path between the third cross-level hub node and the second cross-level path planning terminal based on the sparse road network and the preset path planning algorithm; Determine a second cross-level target path obtained by concatenating the second starting point side target path, the secondary transit path and the second terminal side target path as the execution result corresponding to the second cross-level path planning task; The obtaining of the path planning task includes: The sixth path planning task is determined as the path planning task, wherein the path planning starting point is the third cross-level hub node and is an important waypoint, and the path planning end point is the second cross-level path planning end point and is a non-important waypoint.
10. A path planning device, It is characterized in that include: a memory configured to store instructions; as well as A processor is configured to call the instructions from the memory and implement the path planning method according to any one of claims 1 to 9 when executing the instructions.
11. A machine-readable storage medium, It is characterized in that The machine-readable storage medium stores instructions for causing a machine to execute the path planning method according to any one of claims 1 to 9.
