Data processing method, device, computer equipment and computer readable storage medium
By building a hierarchical map and performing path planning on it, the problem of low path planning efficiency in the existing technology is solved, and efficient path planning is achieved in large or complex map scenarios.
Patent Information
- Application Number
- CN202210139625.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-15
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2042-02-15
AI Technical Summary
Existing path planning algorithms such as A-star algorithms are inefficient in large or complex map scenarios and may lead to traversing the entire map, resulting in path planning time consumption proportional to the square of the distance.
By building a hierarchical map, including high-level maps and low-level maps, determine the baseline hierarchical map based on the starting point and end point, and perform path planning in that hierarchical map, and then refine the path to obtain the target path.
It improves the efficiency and accuracy of path planning, is suitable for large and complex map scenarios, and reduces the computational cost and time consumption of path planning.
Smart Images

Figure CN116637371B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, a data processing device, a computer equipment, and a computer-readable storage medium. Background Art
[0002] With the continuous development and application of computer technology, more and more scenarios require the use of data processing technology to analyze and process map data for path planning and to guide the movement of targets. For example, in a game scenario, a path planning method is used to plan a moving path for the player. At present, the commonly used path planning algorithm is the A-star algorithm. However, when the A-star algorithm is applied to path planning in large maps or complex map scenarios, the time consumed is proportional to the square of the distance between the starting point and the end point, and the entire map may be traversed during the planning process, resulting in low path planning efficiency. Therefore, how to improve the efficiency of path planning has become a current research hotspot. Summary of the invention
[0003] The present application provides a data processing method, apparatus, computer device and computer-readable storage medium, which can improve the efficiency of path planning.
[0004] In a first aspect, the present application provides a data processing method, the method comprising:
[0005] A hierarchical map is constructed according to an original map and a set of grid division rules, wherein the hierarchical map includes at least one high-level map and a low-level map corresponding to the original map; a base hierarchical map is determined in order from the low-level map to the high-level map according to the hierarchical map, a starting point and an ending point, and a first path between the starting point and the ending point in the base hierarchical map; a target path between the starting point and the ending point is determined according to K hierarchical maps in the hierarchical map and the first path, wherein the levels of the K hierarchical maps are lower than the level of the base hierarchical map, and K is an integer greater than or equal to 0.
[0006] In a second aspect, the present application provides a data processing device, the device comprising:
[0007] A construction module, used to construct a hierarchical map according to the original map and the grid division rule set, wherein the hierarchical map includes at least one high-level map and a low-level map corresponding to the original map;
[0008] An analysis module, configured to determine a reference level map and a first path between the starting point and the ending point in the reference level map in a sequence from a low level map to a high level map according to the hierarchical map, the starting point and the ending point;
[0009] A refinement module is used to determine the target path between the starting point and the end point according to K level maps in the hierarchical map and the first path, the levels of the K level maps are lower than the level of the reference level map, and K is an integer greater than or equal to 0.
[0010] In a third aspect, the present application provides a computer device, comprising: a memory and a processor, wherein a data processing program is stored in the memory, and when the data processing program is executed by the processor, it is used to implement the data processing method as described above.
[0011] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the program instructions are executed by a processor to implement the data processing method as described above.
[0012] In a fifth aspect, the present application provides a computer program product, which includes a computer program or computer instructions, and the computer program or computer instructions are executed by a processor to implement the data processing method as described above.
[0013] The present application constructs a hierarchical map according to the original map and grid division rules. The hierarchical map includes at least one high-level map and a low-level map corresponding to the original map. Each level map in the hierarchical map corresponds to a different division granularity, that is, the original map is mapped at different granularities, which is convenient for subsequent data processing. Path planning based on the hierarchical map can be applied to large and complex maps, thereby improving applicability. Then, a reference level map is determined according to the hierarchical map, the starting point and the ending point. A connected path between the starting point and the ending point can be queried in the reference level map, which is the first path. Since the first path may not be the path at the finest granularity, the first path can be further refined according to the next level map of the reference level map in the hierarchical map, thereby determining the target path between the starting point and the ending point. Compared with directly performing path planning on the original map, this method improves the efficiency and accuracy of path planning. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0015] Figure 1a is a schematic diagram of a map representation method provided by an exemplary embodiment of the present application;
[0016] Figure 1b is a schematic diagram of another map representation method provided by an exemplary embodiment of the present application;
[0017] Figure 1c is a schematic diagram of another map representation method provided by an exemplary embodiment of the present application;
[0018] Figure 1d is a schematic diagram of another map representation method provided by an exemplary embodiment of the present application;
[0019] Figure 1e is a schematic diagram of the architecture of a data processing system provided by an exemplary embodiment of the present application;
[0020] Figure 2 It is a flowchart of a data processing method provided by an exemplary embodiment of the present application;
[0021] Figure 3a is a schematic diagram of a grid map provided by an exemplary embodiment of the present application;
[0022] Figure 3b is a schematic diagram of another grid map provided by an exemplary embodiment of the present application;
[0023] Figure 3c is a schematic diagram of another grid map provided by an exemplary embodiment of the present application;
[0024] Figure 3d is a schematic diagram of another grid map provided by an exemplary embodiment of the present application;
[0025] Figure 3e is a schematic diagram of another grid map provided by an exemplary embodiment of the present application;
[0026] Figure 3f It is a schematic diagram of node division of a hierarchical map provided by an exemplary embodiment of the present application;
[0027] Figure 3g It is a schematic diagram of node division of another hierarchical map provided by an exemplary embodiment of the present application;
[0028] Figure 3h is a schematic diagram of a hierarchical map provided by an exemplary embodiment of the present application;
[0029] Figure 4 It is a flowchart of a data processing method provided by an exemplary embodiment of the present application;
[0030] Figure 5a is a schematic diagram of path refinement provided by an exemplary embodiment of the present application;
[0031] Figure 5b is a schematic diagram of another path refinement provided by an exemplary embodiment of the present application;
[0032] Figure 5c is a schematic diagram of another path refinement provided by an exemplary embodiment of the present application;
[0033] Figure 5d is a schematic diagram of another path refinement provided by an exemplary embodiment of the present application;
[0034] Figure 5e is a schematic diagram of another path refinement provided by an exemplary embodiment of the present application;
[0035] Figure 6a is a performance display diagram of a pathfinding method provided by an exemplary embodiment of the present application;
[0036] Figure 6b It is a performance display diagram of a hierarchical map-based pathfinding method provided by an exemplary embodiment of the present application;
[0037] Figure 6c is a performance comparison chart of a pathfinding method provided by an exemplary embodiment of the present application and a pathfinding method based on a hierarchical map;
[0038] Figure 7 is a schematic block diagram of a data processing device provided by an exemplary embodiment of the present application;
[0039] Figure 8 It is a schematic block diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0041] It should be noted that the descriptions of "first", "second", etc. involved in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" or "second" may explicitly or implicitly include at least one of the features.
[0042] Artificial Intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that involves a wide range of fields, including both hardware-level technology and software-level technology. Basic artificial intelligence technologies generally include technologies such as sensors, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes several major directions such as computer vision technology, machine learning / deep learning, etc. The solution provided in the embodiment of the present application involves technologies such as machine learning under artificial intelligence technology, and machine learning technology will be described below.
[0043] Machine Learning (ML) is a multi-disciplinary cross-disciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. Machine learning specifically studies how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning and other technologies. This application mainly relates to inductive learning technology in machine learning technology. Inductive learning technology aims to summarize and extract general judgment rules and patterns from a large amount of empirical data. It is a learning method that derives general rules from special cases. Specifically, the method proposed in this application is to grid a specific map and construct a hierarchical map based on the grid map to summarize and obtain empirical data (that is, a general method for constructing a hierarchical map). When any map is obtained, a hierarchical map of the map can be automatically constructed according to the empirical data, and subsequent connectivity judgment, path planning and other processing have been performed.
[0044] With the research and progress of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, Internet of Vehicles, automatic driving, 3D games, etc. With the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0045] This application can be used in mainstream game engines as a pathfinding solution, and can adopt the open source recastnavigation (a navigation pathfinding tool set that uses a set of adjacent convex polygons to describe a 3D scene, and uses the A-star pathfinding algorithm to ensure the path accessibility in the 3D scene) based on the navigation grid navmesh (navigation grid is a technology used to achieve automatic pathfinding of dynamic objects in the 3D game world, which can simplify the complex structural organization relationship in the game scene into a grid with certain information, and then achieve automatic pathfinding through a variety of calculation methods based on these grids). The navigation grid divides the overall space into multiple convex polygons, and adjacent convex polygons are connected by shared edges.
[0046] See also Figure 1a , Figure 1a It is a schematic diagram of a map representation method based on navmesh provided by this application, that is, a map sample of navigation grid data. As can be seen from the figure, the navigation grid is non-uniformly divided (including triangular areas, rectangular areas, trapezoidal areas, etc.), the polygons filled with oblique lines are non-navigable areas (that is, obstacle areas), the white polygons are navigable areas, and the solid point in each white polygon is the center point corresponding to the white polygon (which can be used as the position point of the white polygon). The figure also includes a starting point and an ending point (represented by solid triangle symbols in the figure), which exist in two white polygons respectively.
[0047] Based on the above map example, when using this navigation mesh data to find a path from the starting point to the end point, the following steps can be included:
[0048] (1) Calculate the polygons where the starting point and the ending point are located respectively.
[0049] (2) Use the navigation grid to calculate the connected polygon path between the two polygons where the start point and the end point are located.
[0050] Exemplarily, the connected polygon path may be a list of dashed line segments as shown in the above figure.
[0051] (3) Optimize the polygonal path to obtain the target path.
[0052] Exemplarily, the target path may be a list of solid line segments shown in the above figure.
[0053] Currently, there are many solutions to reduce the consumption and improve the processing efficiency of step (1) and step (3). Therefore, in the above-mentioned path-finding solution, the time of the overall path-finding calculation is mainly consumed in step (2), that is, obtaining the connected polygon path between two polygons. The calculation process of this connected path is also the search process of the optimal reachable path.
[0054] When the overall search space is not large (that is, the amount of navigation grid data is small), a breadth-first search or a width-first search can be used to quickly calculate the connected polygon path; when the search space is large (or the search space expands due to the increase in the distance between the starting point and the end point), the efficiency of the above search method is very low, because the algorithm complexity of the two methods based on breadth-first search or breadth-first search is the square of the number of polygons in the map space. Based on the above disadvantages, the A-star algorithm can be used for path search.
[0055] The calculation of the connected polygon path (i.e., the connected path) between the starting point and the end point based on the A-star path search method can be achieved by the following steps:
[0056] (1) Create and initialize the OPEN table and the CLOSE table. The OPEN table is used to store processed path nodes, and the CLOSE table is used to store determined path nodes.
[0057] (2) Put the starting point S into the OPEN table and leave the CLOSE table empty.
[0058] (3) If the OPEN table is not empty, take a node n from the head of the table; if there is no node n, the algorithm fails.
[0059] (4) Determine whether node n is a termination point. If so, determine that a connected path has been found, put node n into the CLOSE table, and return the node path in the CLOSE table as the complete path.
[0060] (5) Expand all successor nodes of node n (that is, the child nodes that node n can be directly associated with). If they are not in the CLOSE table, put the child nodes into the OPEN table and put the starting point S into the CLOSE table. At the same time, calculate the sum F of the distance from node n to the successor node and the distance from the end point to the successor node corresponding to each successor node. Sort the OPEN table in descending order according to F, return to step (3), and repeat until a connected path is found.
[0061] See also Figure 1b , Figure 1bThis is a schematic diagram of a navmesh-based map representation method provided by the present application. In a 27*27 grid, it is stipulated that each node can only move in four directions: up, down, left, and right (all embodiments of the present application are based on this method as an example for node movement. In subsequent embodiments, the node movement method will not be described in detail). If the starting point is the node in the lower left corner of the grid and the ending point is the node in the upper right corner of the grid, the A star algorithm can be used to calculate the connected path from the starting point to the ending point, and F is set to the sum of the distance from node n to the successor node and the distance from the ending point to the successor node (for example, calculated using the Euclidean distance). The final search result is as follows: Figure 1b , where the grid area of category 1 is the CLOSE table data calculated by the A-star algorithm (referring to the grid area corresponding to the determined path node), Figure 1b The grid area of category 2 is the OPEN table data calculated by the A* algorithm (referring to the grid area corresponding to each node processed after the path nodes have been determined in the OPEN table). The OPEN table plus the CLOSE table are all the nodes processed during the A* algorithm. In the absence of obstacles, the A* algorithm gives priority to nodes with the shortest straight-line distance, so the number of nodes searched is much less than the entire node space, making the entire search process efficient.
[0062] The above-mentioned pathfinding method using the A-star algorithm has a high search efficiency (pathfinding efficiency) in the absence of obstacles, but in the presence of obstacles, the search space of the A-star algorithm pathfinding will deteriorate (that is, the number of processed nodes will increase). Figure 1c , Figure 1c The black grid area in the middle represents the obstacle area that cannot be walked. The starting point is the node in the lower left corner of the grid, and the end point is the node in the upper right corner of the grid. Based on the situation where there are obstacles, the A-star algorithm can be used again to calculate the connected path from the starting point to the end point. Among them, the grid area with category 1 is the CLOSE table data, and the grid area with category 2 is the OPEN table data. It can be seen that compared with the situation without obstacles, when there are obstacles, the nodes in the OPEN table (that is, the grid area with category 2) will increase significantly, which increases the calculation amount of path finding and reduces the path finding efficiency.
[0063] For disconnected situations, A-star search will traverse all reachable nodes from the current node (for example, node n) and calculate all reachable nodes. Figure 1d , Figure 1d The black grid area in the middle represents the obstacle area that cannot be walked (that is, the invalid node). The starting point is the node in the lower left corner of the grid, and the end point is the node in the upper right corner of the grid. The grid area of category 2 is the OPEN table data. In the disconnected state, star A searches all reachable nodes (in Figure 1dIn the above example, except for the unreachable area and the obstacle area, all other grid areas have been searched. Finally, when no feasible path is found, the search stops. At this time, the number of nodes processed by the A-star algorithm will increase greatly.
[0064] The above situation shows that when facing a large map with complex terrain, the path for the far-distance starting and ending points will deviate greatly from the straight path between them. At this time, due to the greedy exhaustive nature of the A-star algorithm, the time consumed by the A-star algorithm to calculate long-distance pathfinding is proportional to the square of the distance; and when the starting and ending points are unreachable, the worst case of traversing the entire map to search for all reachable nodes will occur. Therefore, when using the A-star algorithm, a maximum number of iterations can be added. When the number of processed nodes is greater than a specific value, the iteration stops and an empty path is returned. However, this limit on the number of iterations often causes long-distance pathfinding to return an empty path.
[0065] In order to solve the above-mentioned drawbacks when directly using A-star search to calculate the path finding path in the case of large or complex maps, this application proposes a map expression method based on hierarchical data, and proposes an efficient path finding algorithm for the path finding of the starting point and the end point on this map.
[0066] The map expression method based on hierarchical data in this solution can also be understood as a pathfinding method based on a hierarchical map. It is a universal pathfinding solution, which is applicable to the pathfinding problems of all graph systems with coordinates attached to nodes, including but not limited to the following scenarios: pathfinding of 2D grid maps, pathfinding of 3D grid maps, pathfinding of 2D polygonal networks, pathfinding of 3D polygonal navigation grids navmesh, etc. When a pathfinding request is obtained, the method proposed in this application can be used to construct hierarchical data (a hierarchical map representation with gradually coarser granularity) on the original map, and the pathfinding algorithm is executed according to the constructed hierarchical data to generate a target path between the user-specified starting point and the end point to guide the target object to move. In addition, this application also proposes an efficient solution for calculating whether two points are connected on this hierarchical map data; an efficient solution for calculating the connected path between two points on the hierarchical map data; and an efficient solution for calculating the leading part of the connected path between two points on the hierarchical map data.
[0067] This application can be applied to various scenarios such as cloud technology, artificial intelligence, and game technology. In the field of cloud technology, this application can store data such as hierarchical maps and path planning results on a cloud server. When the above different data are needed, they can be directly obtained on the cloud server; hierarchical map construction algorithms, path planning algorithms, etc. can also be deployed on the cloud server, so as to use the above algorithms for map construction and path planning in different application environments. In the field of artificial intelligence, map data can be collected first, and then a hierarchical map corresponding to the map data can be constructed based on the method proposed in this application, and then corresponding path planning, navigation and other operations can be performed. More intelligent application services can also be developed based on the method provided by this application. In the field of game technology, the method proposed in this application can be used to construct a hierarchical map to simplify the complex structural organization relationship in the game scene, and then use the hierarchical map to perform corresponding path planning when the game character performs a mobile operation, and then control the game character to automatically move to the target point. The method proposed in this application can also improve the speed of path planning, speed up the response to mobile operations, enhance the user's gaming experience, and reduce the amount of calculation for path planning.
[0068] It can be understood that in the specific implementation of this application, relevant data such as original maps are involved. When the above embodiments of this application are applied to specific products or technologies, the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0069] This application will be specifically described by the following examples:
[0070] See also Figure 1e , Figure 1e FIG. 1 is a schematic diagram of the architecture of a data processing system provided by an exemplary embodiment of the present application. Figure 1eAs shown, the data processing system may specifically include a terminal device 101 and a server 102, and the terminal device 101 and the server 102 are connected via a network, such as a wireless network connection. Based on the data processing method proposed in the present application, the terminal device 101 can obtain the original map and construct a hierarchical map based on the original map. The terminal device 101 includes a construction module and an analysis module, which can process the hierarchical map, the starting point and the end point to obtain the target path, and during the processing, the constructed hierarchical map data, the connectivity of the starting point and the end point, the target path and other data are sent to the server 102 to facilitate the server 102 to perform subsequent data management; the terminal device 101 can also obtain the original map and send the original map to the server 102. After obtaining the original map, the server 102 processes the hierarchical map, the starting point and the end point to obtain the target path. The server 102 then returns the connectivity of the starting point and the end point and the target path to the terminal device 101 to facilitate the terminal device 101 to perform subsequent operations, for example, the terminal device 101 controls the game character to move from the starting point to the end point along the target path in the map of the game scene.
[0071] The terminal device 101 is also referred to as a terminal, user equipment (UE), access terminal, user unit, mobile device, user terminal, wireless communication device, user agent or user device. The terminal device may be a smart home appliance, a handheld device with wireless communication function (such as a smart phone, a tablet computer), a computing device (such as a personal computer (PC), a vehicle terminal, an intelligent voice interaction device, a wearable device or other smart device, but is not limited thereto.
[0072] Server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.
[0073] It is understandable that the system architecture diagram described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided by the embodiment of the present application. Figure 1e In addition to the three devices shown in FIG. , more than three devices may be included; similarly, the server 102 includes Figure 1eIn addition to the one server shown in , it can also be composed of multiple servers (that is, a server cluster). Those skilled in the art will appreciate that with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0074] See also Figure 2 , Figure 2 is a flow chart of a data processing method provided by an exemplary embodiment of the present application, in which the method is applied to Figure 1e Taking the server in (referring to the above-mentioned server 102, which will be described in the following text) as an example, the method may include the following steps:
[0075] S201. Construct a hierarchical map according to an original map and a set of grid division rules. The hierarchical map includes at least one high-level map and a low-level map corresponding to the original map.
[0076] This step is to map the original map at different granularities (that is, to obtain multiple hierarchical maps corresponding to multiple division granularities). In the subsequent steps, the multiple hierarchical maps (that is, hierarchical maps) obtained in this step are processed to obtain the path planning results of the starting point and the end point. Through the multiple grid division rules in the grid division rule set, a hierarchical map including multiple hierarchical maps can be constructed.
[0077] In the embodiment of the present application, the hierarchical map corresponding to the original map is a low-level map, which is constructed based on the minimum division granularity. It can be understood that in the actual application environment, the original map needs to be divided into what granularity, and the finest granularity divided is the minimum division granularity. The high-level map is a hierarchical map divided by a granularity larger than the minimum division granularity. The high-level map can be one or more. Generally speaking, the larger the original map is and the more complex the map structure is, the more high-level maps need to be divided, so that more efficient and accurate path planning can be performed based on the multiple high-level maps divided.
[0078] In one embodiment, the grid division rule set includes a first division granularity and a granularity update gradient. Constructing a hierarchical map according to the original map and the grid division rule set can be implemented according to the following steps.
[0079] (1) The original map is divided according to the first division granularity to obtain a low-level map corresponding to the original map, where the low-level map includes a plurality of nodes matching the first division granularity.
[0080] In the embodiment of the present application, the first division granularity is the minimum division granularity, and the first division granularity needs to be pre-set according to the actual situation. The above-mentioned first division granularity divides the original map, which can be understood as dividing the original map according to the grid division rule corresponding to the first division granularity. Exemplarily, when developing a 2D game, it is necessary to plan the path for the movement of the character. In order to make the character's movement path more detailed and more accurate, the first division granularity can be set to be finer (for example, 0.1 meters * 0.1 meters in the game scene); Exemplarily, when developing a pixel game, it is also necessary to plan the path for the movement of the character, but at this time, a higher accuracy requirement is no longer imposed on the character's movement path, so the first division granularity can be increased (for example, 1 meter * 1 meter in the game scene). Based on this, when constructing a hierarchical map, the number of hierarchical maps in the hierarchical map and the setting of different division granularities need to be processed according to the actual business situation to achieve an effect that is more in line with business needs.
[0081] See also Figure 3a , Figure 3a It is a schematic diagram of a low-level map in a hierarchical map, which includes 27*27 solid line grids, each of which is a node corresponding to the first division granularity.
[0082] (2) Determine at least one second division granularity based on the first division granularity and the granularity update gradient.
[0083] In an embodiment of the present application, in order to obtain multiple high-level maps, it is necessary to process the low-level maps according to multiple division granularities, wherein there is a corresponding relationship between the multiple division granularities, which can be understood as every two adjacent division granularities having a proportional relationship.
[0084] In one embodiment, the proportional relationship between multiple division granularities can be set to a proportional relationship (for example, the ratio is 1:9, that is, the coarser division granularity of two adjacent division granularities is 9 times the size of the finer division granularity, corresponding to a ratio of 3*3:1 in the grid map).
[0085] In one embodiment, the proportional relationship between multiple division granularities can be set to a non-proportional relationship, for example, the ratio of the first high-level map to the low-level map is 3*3:1, and the ratio of the second high-level map to the first high-level map is 2*2:1, until the proportional relationship between all adjacent level maps is set. It should be noted that the proportional relationship between multiple division granularities needs to be adjusted according to the subsequent path planning effect. Generally speaking, the proportional relationship between multiple division granularities is set to a proportional relationship, which has a better effect.
[0086] (3) According to at least one second division granularity, the low-level maps are divided and processed to obtain at least one high-level map, and each high-level map in the at least one high-level map includes a plurality of nodes matching the corresponding second division granularity.
[0087] In one embodiment, the original map may be divided according to the grid division rule corresponding to each second division granularity in at least one second division granularity to obtain at least one high-level map.
[0088] See also Figure 3b , Figure 3b It is a schematic diagram of the first level map in the high-level map of the hierarchical map (the corresponding division granularity is the first granularity in the second division granularity). The figure includes 9*9 solid line grids, each of which is a node corresponding to the first granularity in the second division granularity, and the size of each node is 3*3 nodes corresponding to the first division granularity (such as Figure 3b dashed grid).
[0089] See also Figure 3c , Figure 3c It is a schematic diagram of the second level map in the high-level map of the hierarchical map (the corresponding division granularity is the second granularity in the second division granularity). The figure includes 3*3 solid line grids, each of which is a node corresponding to the second granularity in the second division granularity, and the size of each node is 3*3 nodes corresponding to the first granularity in the second division granularity (such as Figure 3c If we continue to increase the level based on the above rules, we can get the following Figure 3d The map shown in the figure includes 1*1 solid grids, each of which is a node corresponding to the third granularity in the second partition granularity, and the size of each node is 3*3 nodes corresponding to the second granularity in the second partition granularity (such as Figure 3d Since there is only one node at this time, when building a hierarchical map, you can generate a second level map (i.e. Figure 3c ), stop hierarchical map generation (e.g. Figure 3d shown on the map).
[0090] Figure 3e What is presented is a multi-layer hierarchical map structure diagram under ideal barrier-free conditions. It should be noted that Figure 3e This is just a schematic diagram of the structure of a multi-level hierarchical map. It does not represent any level map. To determine the target path using the hierarchical map, please refer to Figure 3a to Figure 3d .
[0091] In the above steps of constructing a hierarchical map, if there are obstacles in the original map (that is, there are invalid nodes in the lower-level map corresponding to the original map), the connectivity represented by each node is different. It can be understood that when a node is divided into two areas (or multiple areas) by an obstacle, when performing node mapping between different-level maps according to the subsequent node mapping method, the two divided areas should be different nodes. For example, there is a node A, and there is a node B on the right side of node A. At this time, the connection distance from node A to node B is one node distance. If there is a column of fine-grained obstacle nodes (that is, invalid nodes) in the middle of node B, node B is divided into area b1 on the left and area b2 on the right. At this time, if area b1 and area b2 are not divided, the calculated connection distance from node A to area b1 is one node distance, but the connection distance from node A to area b2 is also one node distance. This is obviously wrong, because after node B is divided, node A needs to take a detour to area b2, and the connection distance is greater than one node distance. In other words, after the node is divided by an obstacle, the meaning of the area represented by each divided area is different. Therefore, it is necessary to distinguish the segmentation status of each node and update the high-level map according to the segmentation status. The maps of each level can be updated according to the following steps.
[0092] (1) For each high-level map in at least one high-level map, map invalid nodes in the low-level map to each high-level map according to a first partitioning granularity.
[0093] See also Figure 3f , Figure 3f It is a schematic diagram of the second level map (the corresponding division granularity is the second granularity in the second division granularity) in the high-level map of the hierarchical map in the presence of obstacles. The figure includes 3*3 nodes corresponding to the second granularity in the second division granularity, and the black area is the obstacle area (that is, the invalid node). At this time, the division granularity of the invalid node is the first division granularity, and the invalid node is mapped to the corresponding position of the second level map in the high-level map.
[0094] See also Figure 3g , Figure 3g It is a schematic diagram of the first level map in the high-level map of the hierarchical map in the presence of obstacles (the corresponding division granularity is the first granularity in the second division granularity). The figure includes 3*3 nodes corresponding to the first granularity in the second division granularity, and the black area is the obstacle area (that is, the invalid node). At this time, the division granularity of the invalid node is the first division granularity, and the invalid node is mapped to the corresponding position of the second level map in the high-level map.
[0095] (2) Determine the segmentation status of each node in each high-level map according to the positional relationship between each node and the invalid node in each high-level map.
[0096] Depend on Figure 3f It can be seen that the central node is divided into two regions by the invalid node; the node on the right side of the middle is divided by the invalid node, and there is only one region except the invalid node itself; the node in the lower right corner includes an invalid node and is not divided by the invalid node.
[0097] Similarly, according to the above analysis method of segmentation, we can Figure 3g The positional relationship between each node and the invalid nodes in the high-level map is used to determine the segmentation status of each node in the high-level map.
[0098] (3) Update each high-level map according to the segmentation status and invalid nodes.
[0099] According to the above-mentioned method of analyzing the separability, the nodes in the high-level map that are divided into two or more areas by invalid nodes can be re-divided (that is, the high-level map is updated). The specific method is: if a node in the high-level map is divided into two or more areas by invalid nodes, each area is regarded as a new node; if a node in the high-level map is not divided by invalid nodes, the node state remains unchanged.
[0100] In one embodiment, if Figure 3f As shown, Figure 3f It is a schematic diagram of node division of the second level map in the high-level map of the hierarchical map, with different nodes represented by categories a, b, c and d, where categories a, b, c and d correspond to different grid patterns (in this scheme, multiple nodes with the same grid pattern do not mean that the nodes are the same, but are only for the convenience of distinguishing the relationship between adjacent nodes, for example, in Figure 3f , the node in the lower left corner and the node in the lower right corner correspond to the same grid pattern, but the node in the lower left corner and the node in the lower right corner are not the same node; the node in the lower left corner and the node to the lower right correspond to different grid patterns and are therefore different nodes).
[0101] like Figure 3f As shown, according to the above method, the central node is divided into two areas by the invalid node, so the two areas are divided into two different nodes; the node on the right middle and the node on the lower right corner are not divided into two or more areas by the invalid node, so the node is not updated.
[0102] In one embodiment, if Figure 3g As shown, Figure 3gIt is a schematic diagram of node division of the first level map in the high-level map in the hierarchical map, with different nodes represented by categories a, b, c, d and e, where categories a, b, c, d and e correspond to different grid patterns. Similarly, according to the above method, the high-level map can be updated, which will not be repeated here.
[0103] S202: Determine a reference level map and a first path between the starting point and the ending point in the reference level map in order from a low-level map to a high-level map according to the hierarchical map, the starting point and the ending point.
[0104] In an embodiment of the present application, the first path is a connected path between a starting point and an end point with a division granularity as fine as possible found in a hierarchical map. Assume that in a map scene, a path planning algorithm (such as an A-star algorithm) is required for path planning, but the map scene area is large and the map is complex. Directly using the path planning algorithm to perform path planning at a finer granularity has low accuracy and efficiency. Using the method proposed in the present application, first find a connected path (that is, the first path) between a starting point and an end point with a division granularity as fine as possible in a certain level map (that is, the reference level map) in the hierarchical map, and then refine the first path. The path planning algorithm can be used better, the applicability of the path planning algorithm can be improved, and the accuracy and efficiency of path planning can be improved.
[0105] In one embodiment, the above-mentioned determining the reference level map and the first path between the starting point and the ending point in the reference level map from the hierarchical map according to the hierarchical map, the starting point and the ending point can be implemented according to the following steps.
[0106] (1) According to the order from the low-level map to the high-level map in the hierarchical map, determine in turn whether there is a candidate path between the starting point and the end point in each level map in the hierarchical map.
[0107] (2) If there is a candidate path between the starting point and the end point in the first-level map, the candidate path between the starting point and the end point in the first-level map is used as the first path, and the first-level map is used as the reference level map; wherein the first-level map is the first level map in the hierarchical map that has a candidate path between the starting point and the end point.
[0108] Since the division granularity corresponding to each level map in the hierarchical map is different, in order to improve the search efficiency of the candidate path, the search can be started from the level map with finer granularity (that is, the low-level map). This search ensures that if one or more candidate paths can be searched out, the first candidate path searched out is the path with the finest granularity. The first candidate path searched out is used as the first path, which improves the efficiency of refinement when the first path is subsequently refined.
[0109] In one embodiment, it is possible to determine layer by layer whether there is a candidate path between the starting point and the end point in each level map in the hierarchical map in the order from the low-level map to the high-level map in the hierarchical map. When a candidate path is searched, the search is stopped and the searched candidate path is used as the first path. At the same time, the level map corresponding to the first path is used as the reference level map.
[0110] In one embodiment, each node included in each level map in the hierarchical map stores a set of shortest path information from each node to other nodes within a preset distance range. Since the distance range is specified, a variety of commonly used path planning algorithms can be used to calculate the shortest path information, and finally obtain the shortest path information set. Therefore, the application is highly applicable. The distance range can be pre-set according to the construction of the hierarchical map, the effect of the path planning algorithm, the expected effect of path planning, etc.
[0111] In one embodiment, the distance range can be preset according to the construction of the hierarchical map and the effect of the path planning algorithm. For example, the node division granularity of the low-level map in the hierarchical map is 1*1 unit, and the node division granularity of the second level map in the high-level map is 3*3 units. The direction of path planning can only be moved in four directions, up, down, left, and right, and the path planning algorithm is best within a distance of 4 units. Based on the above situation, the distance range can be set to 4 units. At this time, each node included in each level map in the hierarchical map stores the shortest path information between the node and the node within 4 units. After the starting point and the end point are given, the efficiency of searching the shortest path can be improved by finding whether there is the shortest path information between the start node corresponding to the starting point (or the end node corresponding to the end point) to the end node corresponding to the end point (or the start node corresponding to the starting point). For the sake of convenience, this application will take the distance range set to 4 units as an example to explain the scheme. In the case of setting the distance range of other values in actual application, the embodiment of this application will not be repeated.
[0112] In the above step (1), it is necessary to determine whether there is a candidate path between the starting point and the end point in each level map. Assuming that the level map to be processed is any level map in the hierarchical map, then determining whether there is a candidate path between the starting point and the end point in the level map to be processed can be achieved according to the following steps.
[0113] 1) Determine the starting node corresponding to the starting point in the level map to be processed, and the ending node corresponding to the ending point.
[0114] In path planning, the starting point or the end point is generally represented as a coordinate, and the point where the coordinate is located can be regarded as zero. Therefore, in order to map the starting point or the end point to the hierarchical map for path planning, it is necessary to find the starting node corresponding to the starting point and the end node corresponding to the end point.
[0115] In one embodiment, the starting point (for example, the starting coordinates) can be mapped to the hierarchical map to be processed, and the node containing the starting point in the hierarchical map to be processed is obtained as the starting node, and the ending point (for example, the ending coordinates) can be mapped to the hierarchical map to be processed, and the node containing the ending point in the hierarchical map to be processed is obtained as the ending node.
[0116] 2) If the shortest path information set of the starting node contains the shortest path information between the starting node and the ending node, it is determined that there is a candidate path between the starting point and the ending point in the level map to be processed, and the candidate path is determined according to the shortest path information.
[0117] Since each node in each level map of the hierarchical map stores a set of shortest path information from each node to other nodes within a preset distance range, the shortest path information set of the starting node can be directly queried. If the shortest path information between the starting node and the ending node is found, it means that there is a shortest path information between the starting point and the ending point. Based on the shortest path information, a shortest path consisting of multiple nodes in the level map to be processed can be generated as a candidate path.
[0118] In one embodiment, the shortest path information set of the terminating node may also be queried for the shortest path information between the terminating node and the starting node. If found, it is determined that there is a candidate path between the starting point and the terminating point in the hierarchical map to be processed, and the candidate path is determined based on the shortest path information.
[0119] In the above step 2), if no candidate path between the starting point and the end point exists in each level map in the hierarchical map, a path planning result in which the starting point and the end point are not connected is generated.
[0120] like Figure 3hAs shown in the figure, arrows are used to indicate the locations of the starting point and the ending point, and the starting nodes and ending nodes corresponding to the starting point and the ending point in each level map are shown, including the starting nodes and ending nodes corresponding to the low-level map (such as the nodes corresponding to the low-level grid pattern in the figure), the starting nodes and ending nodes corresponding to the first level map in the high-level map (such as the nodes corresponding to the first high-level grid pattern in the figure), and the starting nodes and ending nodes corresponding to the second level map in the high-level map (such as the nodes corresponding to the second high-level grid pattern in the figure). The process of determining candidate paths is described below. First, in the low-level map, the start node and the end node are too far apart. By querying the shortest path information set in the start node or the end node, the shortest path information between the start node and the end node cannot be found, so it rises to the first level map in the high-level map; in the first level map in the high-level map, if the start node and the end node are still too far apart and the shortest path information cannot be found, it is necessary to continue to rise the level; in the second level map in the high-level map, the start node and the end node are close to each other (at this time, the condition that the node can query the shortest path information set between the start node and the end node is met, for example, the start node and the end node meet the condition that the distance range is 4 units), so the shortest path information is found.
[0121] In one embodiment, in the order from low-level maps to high-level maps in the hierarchical map, it is determined in turn whether there is a candidate path between the starting point and the end point in each level map in the hierarchical map. If a candidate path is not found after searching all level maps in the hierarchical map, it means that there is no connected path between the starting point and the end point at different division granularities. At this time, it can be judged that there is no connectivity between the starting point and the end point, and the judgment result is displayed on the terminal device.
[0122] It should be noted that if no candidate path exists between the starting point and the end point in each level map of the hierarchical map, the starting point and the end point are judged to be not connected. This is based on the premise that the shortest path information set from the node to other nodes within the preset distance range stored in each node is accurate. Therefore, after judging that the starting point and the end point are not connected, the accuracy of the path planning algorithm used to calculate the shortest path information set can also be tested to facilitate subsequent algorithm optimization.
[0123] S203. Determine a target path between a starting point and an end point according to K level maps in the hierarchical map and the first path, wherein the levels of the K level maps are lower than the level of the reference level map, and K is an integer greater than or equal to 0.
[0124] In the embodiment of the present application, after the first path is determined, a connecting path between the starting point and the end point with the finest possible division granularity is found, but the first path may have a finer granularity (for example, the first path is found in a low-level map), and the first path may also have a coarser granularity (for example, the first path is found in a high-level map). If the first path is found in a low-level map and the granularity of the first path is already very fine, the first path can be used as the target path; if the first path is found in a high-level map and the granularity of the first path is relatively coarse and does not meet the accuracy of path planning, the first path can be refined until the refined first path meets the preset conditions (for example, the granularity of the path meets the requirements, or it is refined layer by layer until the granularity corresponding to the low-level map), and the refined first path is used as the target path.
[0125] In one embodiment, the method for refining the first path can be to refine the first path according to the next level map of the base level map in the hierarchical map (that is, the highest level map among the K level maps), and use the path planning algorithm to refine the first path into a path in the next level map of the base level map. The specific refinement method will be described in subsequent embodiments.
[0126] In one embodiment, the present application can be applied to a game scene. Assuming that the scene includes a user, a game character, a terminal device and a server, the present application can be applied by the following method: the user sends a movement request of the game character through the terminal device (at this time, the starting point is the location of the game character, and the end point is the location indicated by the user. The user can send a movement request for the end point through touch instructions, mouse clicks, voice control, etc.); when the server receives the movement request sent by the terminal device, it performs path planning according to the path planning method proposed in the present application, and sends the calculated target path data to the terminal device; after the terminal device obtains the target path data, it controls the game character to move according to the target path. During the movement of the game character, the subsequent movement requests sent by the user through the terminal device can be continuously monitored, and the positions of the starting point and the end point can be updated according to the received subsequent movement requests, and the path planning can be re-performed according to the above method to guide the game character to perform subsequent movements. It should be noted that there can also be multiple terminal devices. For example, when the present application is applied to a multiplayer online game, multiple terminal devices can be used to interact with the server to meet business needs.
[0127] The present application constructs a hierarchical map based on the original map and grid division rules. The hierarchical map includes at least one high-level map and a low-level map corresponding to the original map. Each level map in the hierarchical map corresponds to a different division granularity, that is, the original map is mapped at different granularities to facilitate subsequent data processing. Path planning based on the hierarchical map can be applied to large and complex maps, which improves applicability and is used for more efficient and accurate path planning; then a reference hierarchical map is determined based on the hierarchical map, the starting point and the end point. The reference hierarchical map first searches from a hierarchical map with a finer granularity to a hierarchical map with a coarser granularity to ensure that the first candidate path (i.e., the first path) searched out is the path with the finest granularity, thereby improving the efficiency of subsequent path refinement; when the first path is not the path with the finest granularity When the first path is refined layer by layer according to the next level map of the base level map in the hierarchical map, the target path with finer granularity between the starting point and the end point can be obtained. Compared with directly performing finer granularity path planning, this method can improve the accuracy of path planning. If no candidate path between the starting point and the end point exists in each level map in the hierarchical map, it is determined that the starting point and the end point are not connected, thereby simplifying the processing steps of path planning. In the case of obstacles, the hierarchical map is updated to further improve the accuracy of path planning. The present application also proposes that each node included in each level map in the hierarchical map stores the shortest path information set from the node to other nodes within a preset distance range, and the shortest path search between two points is performed based on the shortest path information set, thereby improving the search efficiency.
[0128] See also Figure 4 , Figure 4 is a flow chart of a data processing method provided by an exemplary embodiment of the present application, in which the method is applied to Figure 1e Taking the server in as an example, the method may include the following steps:
[0129] S401: construct a hierarchical map according to an original map and a set of grid division rules, wherein the hierarchical map includes at least one high-level map and a low-level map corresponding to the original map.
[0130] S402: Determine a reference level map and a first path between the starting point and the ending point in the reference level map in order from a low-level map to a high-level map according to the hierarchical map, the starting point and the ending point.
[0131] The specific implementation of steps S401 to S402 refers to the related description of steps S201 to S202 in the aforementioned embodiment, which will not be repeated here.
[0132] S403: Obtain a first node set included in the first path.
[0133] In the embodiment of the present application, the first path is the first connected path between the starting point and the end point with the finest possible division granularity found in the hierarchical map. According to the first path, the node set included in the path (ie, the first node set) is obtained.
[0134] S404. Determine, according to a path planning algorithm, that the first node set corresponds to a second node set in a second-level map, where the second-level map is a highest-level map among the K level maps.
[0135] In the embodiment of the present application, the second level map is the highest level map among the K level maps, that is, the second level map is the next level map of the base level map, that is, the level map with a finer division granularity than the base level map. The second node set corresponding to the first node set in the second level map is obtained through the first node set, and the second node set can be used as the original data for subsequent path refinement.
[0136] Among them, determining that the first node set corresponds to the second node set in the second-level map according to the path planning algorithm can be implemented according to the following steps.
[0137] (1) Determine that each first node in the first node set corresponds to a mapping node set in the second-level map.
[0138] In the embodiment of the present application, the first node granularity is relatively coarse, and each first node in the first node set is mapped to the second level map to obtain a mapping node with relatively fine granularity. Figure 5a As shown in the figure, hollow arrows are used to indicate the locations of the starting point and the end point, and solid arrows are used to indicate the path direction. The first node set is the nodes included in the second level map in the high-level map (such as the nodes corresponding to the second high-level grid pattern in the figure). A node in the first node set (for example Figure 5a The solid grid in the lower left corner of the middle) is 9*9 units in size, so the first node is mapped to the second-level map, and the mapping node (for example Figure 5a The size of the 9 dotted grids included in the solid grid in the lower left corner is 3*3 units. According to this method, each first node in the first node set is mapped to the second level map, and finally a plurality of mapping node sets corresponding to the plurality of first nodes are obtained.
[0139] (2) Determine the corresponding target mapping node from the mapping node set corresponding to each first node according to the path planning algorithm.
[0140] This step is to obtain a node (ie, a target mapping node) in each mapping node set that can form the shortest path between the starting point and the end point. The target path can be determined quickly based on the obtained multiple target mapping nodes.
[0141] In one embodiment, the above step (2) can be specifically implemented according to the following steps.
[0142] 1) For the first mapping node set in the mapping node set corresponding to each first node, the sum of the distance from each mapping node in the first mapping node set to the target mapping node in the second mapping node set and the distance to the end point is obtained according to the path planning algorithm, and the first node corresponding to the second mapping node set is the previous node of the first node corresponding to the first mapping node set in the first node set.
[0143] In one embodiment, the first mapping node set includes multiple first mapping nodes, and it is necessary to calculate the sum of the distance of each mapping node to the target mapping node in the second mapping node set (that is, the previous node of the first node corresponding to the first mapping node set in the order of the first node set) and the distance to the end point.
[0144] 2) Taking the mapping node with the shortest sum of distances corresponding to the first mapping node set as the target mapping node.
[0145] In one embodiment, when processing the second mapping node in the first mapping node set, the target mapping node in the second mapping node set is the node whose starting point corresponds to the current level map. The above method can be understood as, when determining the target mapping node in the first mapping node set in the first mapping node set, the sum of the distance from each mapping node in the first mapping node set to the starting point corresponding to the starting node of the current level map and the distance to the end point is obtained according to the path planning algorithm; when determining the target mapping node in the first mapping node set in the first subsequent mapping node set, the sum of the distance from each mapping node in the first mapping node set to the previous target mapping node determined in the second mapping node set and the distance to the end point is obtained according to the path planning algorithm. Exemplarily, the first node set includes node 1, node 2 and node 3, and the first mapping node sets of node 1, node 2 and node 3 respectively include 9 first mapping nodes. First, a target mapping node is found from the 9 first mapping nodes included in node 1, and the target mapping node is the node with the smallest sum of the start node and the end node among the 9 first mapping nodes; then, a target mapping node is found from the 9 first mapping nodes included in node 2, and the target mapping node is the node with the smallest sum of the target mapping nodes and the end node determined in node 1 among the 9 first mapping nodes; and then, a target mapping node is found from the 9 first mapping nodes included in node 3, and the target mapping node is the node with the smallest sum of the target mapping nodes and the end node determined in node 2 among the 9 first mapping nodes.
[0146] (3) Determine that the first node set corresponds to the second node set in the second-level map based on the node corresponding to the starting point in the second-level map, the node corresponding to the ending point in the second-level map, the target mapping node corresponding to each first node, and the corresponding shortest path information set.
[0147] After obtaining the target mapping node corresponding to each first node in the first node set, the second node set can be determined by the obtained multiple target mapping nodes. The shortest path information stored in the adjacent target mapping nodes can be queried, and all adjacent target mapping nodes are processed, and finally the following is generated: Figure 5b The second node path shown (such as Figure 5b The node path shown is composed of the first high-level grid pattern. Figure 5b In the figure, hollow arrows indicate the locations of the starting and ending points, and solid arrows indicate the direction of the path).
[0148] In one embodiment, determining, according to a path planning algorithm, that the first node set corresponds to the second node set in the second-level map may be performed by:
[0149] a1. Assume that in each level map in the recursive query process, the node corresponding to the starting point i is i(n), and the node corresponding to the ending point j is j(n), where n represents the level index of the level map;
[0150] a2. If the map level of the currently obtained path is n, set the returned path node list to p, set the node list after one level of refinement to q, q is initialized to empty, set a temporary node o, initialized to i(n-1);
[0151] a3. Get the first node p(0) of p, and determine a node r among all the nodes covered by the node p(0) in the n-1th level map, so that the sum of the distance from the node r to the node o and the distance from the node r to j(n-1) is minimized;
[0152] a4. Get the shortest path from o to r and add it to the end of the q node list;
[0153] a5. Delete the first node p(0) of p, update o to r, and jump to step a2 and repeat until the p node list is empty;
[0154] a6. Calculate the shortest path from node o to node j(n-1), and add it to the end of q to finally obtain the path information after being refined by one level.
[0155] S405: If the second-level map is a low-level map, determine a target path between the starting point and the end point according to the second node set.
[0156] S406. If the second-level map is not a low-level map, determine according to the path planning algorithm that the second node set corresponds to the third node set in the third-level map, and the third-level map is the next-level map of the second-level map; if the third-level map is a low-level map, determine the target path between the starting point and the end point according to the third node set.
[0157] In one embodiment, if Figure 5b As shown in the figure, the second-level map is not a low-level map, that is, the obtained node path is not the path with the finest granularity, which means that it can be further refined layer by layer according to the method provided in steps S403 to S405 until the processed second-level map is a low-level map (that is, the node path after refinement is the finest granularity). Figure 5b By refining the node path shown in Figure 5c The node path shown in Figure 5c In the figure, hollow arrows indicate the locations of the starting and ending points, and solid arrows indicate the direction of the path. Figure 5c The node paths shown are the finest granularity (e.g. Figure 5cThe node path composed of the low-level grid pattern shown in FIG. 1 is used as the target path.
[0158] In one embodiment, given a starting point and an end point, path planning can be performed using the method proposed in this application, but it takes a long time to plan all the paths at once. Therefore, in order to improve the response speed, leading path planning can be performed, that is, a portion of finer path information is first planned out for rapid response to pathfinding operations, and then gradually refined. When the end point is temporarily changed, this method does not calculate the complete path, but rather a leading path planning, so the path planning can be quickly re-performed, which reduces unnecessary calculations and improves the efficiency of path planning. Based on this, the above-mentioned determination of the target path between the starting point and the end point based on the K level maps in the hierarchical map and the first path can also be achieved according to the following steps.
[0159] (1) Obtain a first node set included in the first path, and extract a first node subset from the first node set.
[0160] Among them, the first node subset is a part of the first nodes in the first node set. The selection rules of the first node subset can be set according to the actual business situation. When the number of nodes in the first node subset is large, it means that the length of the path that needs to be planned each time is longer, and the number of times the entire path is planned is less; when the number of nodes in the first node subset is small, it means that the length of the path that needs to be planned each time is shorter, and the number of times the entire path is planned is more.
[0161] (2) Determine, according to the path planning algorithm, that each first node in the first node subset corresponds to a fourth node set in the second-level map, and the second-level map is the highest-level map among the K level maps.
[0162] The second level map is the highest level map among the K level maps, that is, the second level map is the next level map of the base level map, that is, the level map with a finer division granularity than the base level map. The essence of the above-mentioned method of determining that each first node in the first node subset corresponds to the fourth node set in the second level map according to the path planning algorithm is to obtain a node path after refining the first node subset, wherein the node refinement please refer to the method provided in step S404, which will not be repeated here.
[0163] (3) If the second-level map is a low-level map, a target path between the starting point and the ending point is determined based on the first node and the fourth node set in the first node set excluding the first node subset.
[0164] In one embodiment, the first node subset may consist of the first two nodes included in the first node set, such as Figure 5dAs shown, the hollow arrows indicate the locations of the starting point and the ending point. The first node set includes multiple nodes corresponding to the second granularity in the second division granularity (i.e., the nodes corresponding to the second high-level grid pattern in the figure), and the fourth node set includes multiple nodes corresponding to the first granularity in the second division granularity (i.e., the nodes corresponding to the first high-level grid pattern in the figure). The fourth node set and the first node in the first node set except the first node subset can be combined to obtain the target path, and the result is as follows Figure 5d The path planning results shown (in Figure 5d In the example, the first node set includes the first two nodes of size 9*9 which are divided into six nodes of size 3*3).
[0165] In one embodiment, if the second-level map is not a low-level map, the second node subset can be extracted from the fourth node set, and each node in the second node subset is determined to correspond to the fifth node set in the fourth-level map according to the path planning algorithm. The fourth-level map is the lower two-level map of the base level map in the hierarchical map, and then the target path between the starting point and the end point is determined according to the first node, the fourth node set, and the fifth node set except the first node subset in the first node set. Path planning can be performed according to the above method until the path of the leading processing is the finest granularity, that is, the division granularity corresponding to the low-level map. At this point, a movable polygonal path at the beginning (that is, the node path corresponding to different division granularities) can be obtained for rapid mobile response. By continuously repeating the above iterative process, a complete polygonal path can be obtained.
[0166] like Figure 5e As shown, the leading part in the fourth node set is further refined. Based on this idea, the leading part is finally refined into the finest-grained node path, and the node path corresponding to the first division granularity (i.e., the node corresponding to the low-level grid pattern in the figure), the node path corresponding to the first granularity in the second division granularity (i.e., the node corresponding to the first high-level grid pattern in the figure) and the node path corresponding to the second granularity in the second division granularity (i.e., the node corresponding to the second high-level grid pattern in the figure) are combined to obtain the following: Figure 5e The target path (in Figure 5e In the figure, the path corresponding to the previous level map includes the first two nodes of size 3*3, which are divided into six nodes of size 1*1).
[0167] Exemplarily, in a game character pathfinding scene, given a starting point and an end point, when the first segment of the finest-grained leading path is planned according to the leading path planning method provided above, the game character can respond to the movement instruction to move the character, and when it moves to the boundary of the first segment of the finest-grained leading path, the leading path planning method can be used to plan the second segment of the finest-grained leading path, and this cycle continues until the entire path is processed. This method has a very high response speed when the end point changes frequently. Every time the end point changes, the end node is re-determined, and the current node is used as the starting node to re-plan the leading path for rapid mobile response, so that each time the end point changes, only a small part of the path data needs to be calculated (because in the case of frequent changes in the end point, only the path planned in the previous segment is useful, and the subsequent path planning will be discarded), which improves the efficiency of path planning and improves the user experience.
[0168] The following is an explanation of the test results of the hierarchical map-based pathfinding method proposed in this application. In an actual project map of 3km*3km, the corresponding recastnavigation navmesh pathfinding map is exported, and the exported navmesh data is used as input to generate the hierarchical pathfinding map data. Then, 100,000 random pathfinding tests were performed on these two sets of data respectively. Among them, the detour pathfinding (an open source pathfinding engine) that comes with recastnavigation completed more than 100,000 tests due to the internal maximum number of iterations. By comparing the pathfinding results of the detour pathfinding method and the hierarchical map-based pathfinding method proposed in this application, the following results were obtained based on the pathfinding time. Figure 6a and Figure 6b Performance comparison data, Figure 6a and Figure 6b The following are the histograms of the pathfinding time of the detour pathfinding method and the pathfinding method based on the hierarchical map. The horizontal axis is the pathfinding time (in us) and the vertical axis is the frequency. As can be seen from the figure, the time distribution of the detour pathfinding method is relatively scattered, and at the same time, it has a dense distribution in a certain time area; while the pathfinding time of the pathfinding method based on the hierarchical map is similar to the compact normal distribution, and the average time is about 1 / 7 of the detour pathfinding method. Therefore, it can be concluded that the pathfinding method based on the hierarchical map has an absolute advantage in both speed and stability.
[0169] In addition to the comparison of speed and stability, this application also compares the calculated path lengths. In the 100,000 pathfinding tests previously performed, the samples for which the detour pathfinding method could not calculate a complete path were removed, and then the path lengths returned by the hierarchical map-based pathfinding method in the remaining samples were calculated, divided by the path lengths returned by the detour pathfinding method, multiplied by 100, and then subtracted by 100. The results obtained after counting the frequencies are as follows: Figure 6c As shown, the horizontal axis is the path length difference and the vertical axis is the frequency. As can be seen from the figure, the path length difference is concentrated between -3% and 10%, and there is a certain amount of long-tail data. The effect of path generation based on the hierarchical map path finding method is better. Through the comparison of the above test data, it can be concluded that the long-distance path finding problem in the large world map can be well solved by using the path finding method based on the hierarchical map proposed in this application for path planning.
[0170] The present application obtains a first path. When the first path is not the path at the finest granularity, the first path is refined by node mapping, using a path planning algorithm and a set of shortest path information stored in each node to obtain a refined path of the first path in the next-level map, that is, obtaining a second node set in the second-level map. Compared with directly performing finer-grained path planning, this method improves the accuracy of path planning; the path planning algorithm obtains the sum of the distances to the previous determined node and the end point in the node to be processed, takes the node with the smallest sum of distances as the target node, and determines the target path through the shortest path information set stored in multiple target nodes, thereby further improving the accuracy of path planning and improving efficiency; if the node path obtained after a refinement process is not the path with the finest granularity, it can be refined layer by layer according to the method provided in the present application until the refined node path is the finest granularity, and the node path with the finest granularity is used as the target path, thereby ensuring the accuracy of path planning; the present application also proposes leading path planning, that is, first planning a part of finer path information for rapid response to pathfinding operations, and then gradually refining. When the end point is temporarily changed, this method does not calculate the complete path, but a leading path planning, so the path planning can be quickly re-performed, which reduces unnecessary calculations, improves path planning efficiency, and enhances user experience.
[0171] See also Figure 7 , Figure 7 : is a schematic block diagram of a data processing device provided in an embodiment of the present application. The data processing device may specifically include:
[0172] A construction module 701 is used to construct a hierarchical map according to the original map and the grid division rule set, wherein the hierarchical map includes at least one high-level map and a low-level map corresponding to the original map;
[0173] An analysis module 702 is used to determine a reference level map and a first path between the starting point and the ending point in the reference level map in the order from the low-level map to the high-level map according to the hierarchical map, the starting point and the ending point;
[0174] The refinement module 703 is used to determine the target path between the starting point and the end point according to the K level maps in the hierarchical map and the first path, the levels of the K level maps are lower than the level of the reference level map, and K is an integer greater than or equal to 0.
[0175] Optionally, the above-mentioned grid division rule set includes a first division granularity and a granularity update gradient. When the above-mentioned construction module 701 is used to construct a hierarchical map according to the original map and the grid division rule set, it is specifically used to:
[0176] The original map is divided according to the grid division rule corresponding to the first division granularity in the at least one grid division rule to obtain a low-level map corresponding to the original map, wherein the low-level map includes a plurality of nodes matching the first division granularity;
[0177] Determine at least one second division granularity according to the first division granularity and the granularity update gradient;
[0178] According to the grid division rules corresponding to each of the at least one second division granularity, the low-level maps are divided and processed respectively to obtain at least one high-level map. Each of the at least one high-level map includes multiple nodes matching the corresponding second division granularity.
[0179] Optionally, the building block 701 is further used for:
[0180] For each high-level map in the at least one high-level map, mapping invalid nodes in the low-level map to each high-level map according to the first division granularity;
[0181] Determine the segmentation state of each node in each of the high-level maps according to the positional relationship between each node in each of the high-level maps and the invalid node;
[0182] Each of the high-level maps is updated according to the segmentation status and the invalid nodes.
[0183] Optionally, when the analysis module 702 is used to determine the reference level map and the first path between the starting point and the ending point in the reference level map in the order from the low-level map to the high-level map according to the hierarchical map, the starting point and the ending point, it is specifically used to:
[0184] In the order of the low-level map to the high-level map in the hierarchical map, determine in turn whether there is a candidate path between the starting point and the end point in each level map in the hierarchical map;
[0185] If there is a candidate path between the above-mentioned starting point and the above-mentioned end point in the first-level map, the candidate path between the above-mentioned starting point and the above-mentioned end point in the above-mentioned first-level map is used as the first path, and the above-mentioned first-level map is used as the reference level map; wherein the above-mentioned first-level map is the first level map in the above-mentioned hierarchical map in which there is a candidate path between the above-mentioned starting point and the above-mentioned end point.
[0186] Optionally, the refinement module 703, when used to determine the target path between the starting point and the end point according to the K level maps in the hierarchical map and the first path, is specifically used to:
[0187] Obtain a first node set included in the first path;
[0188] Determining, according to a path planning algorithm, that the first node set corresponds to a second node set in a second-level map, wherein the second-level map is a map of the highest level among the K level maps;
[0189] If the second-level map is the low-level map, a target path between the starting point and the end point is determined according to the second node set.
[0190] Optionally, the refinement module 703 is further used to:
[0191] If the second-level map is not the lower-level map, determining, according to the path planning algorithm, that the second node set corresponds to a third node set in a third-level map, and the third-level map is a lower-level map of the second-level map;
[0192] If the third-level map is the low-level map, a target path between the starting point and the end point is determined according to the third node set.
[0193] Optionally, when the refinement module 703 is used to determine, according to the path planning algorithm, that the first node set corresponds to the second node set in the second-level map, it is specifically used to:
[0194] Determine that each first node in the first node set corresponds to a mapping node set in the second-level map;
[0195] Determine a corresponding target mapping node from the mapping node set corresponding to each of the first nodes according to a path planning algorithm;
[0196] According to the node corresponding to the above-mentioned starting point in the above-mentioned second-level map, the node corresponding to the above-mentioned ending point in the above-mentioned second-level map, the target mapping node corresponding to each of the above-mentioned first nodes and the corresponding shortest path information set, it is determined that the above-mentioned first node set corresponds to the second node set in the above-mentioned second-level map.
[0197] Optionally, when the refinement module 703 is used to determine the corresponding target mapping node from the mapping node set corresponding to each first node according to the path planning algorithm, it is specifically used to:
[0198] For the first mapping node set in the mapping node set corresponding to each of the first nodes, the sum of the distance from each mapping node in the first mapping node set to the target mapping node in the second mapping node set and the distance to the termination point is obtained according to the path planning algorithm, and the first node corresponding to the second mapping node set is the previous node of the first node corresponding to the first mapping node set in the first node set;
[0199] The mapping node corresponding to the first mapping node set having the shortest sum of distances is used as the target mapping node.
[0200] Optionally, when the refinement module 703 is used to determine the target path between the starting point and the end point according to the next level map of the reference level map in the hierarchical map and the first path, it is specifically used to:
[0201] Acquire a first node set included in the first path, and extract a first node subset from the first node set;
[0202] Determine, according to a path planning algorithm, that each first node in the first node subset corresponds to a fourth node set in a second-level map, where the second-level map is a highest-level map among the K level maps;
[0203] If the second-level map is the low-level map, a target path between the starting point and the end point is determined based on the first node in the first node set excluding the first node subset and the fourth node set.
[0204] It should be noted that the functions of each functional module of the data processing device in the embodiment of the present application can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.
[0205] See also Figure 8 , Figure 8 801, storage device 802 and network interface 803. The processor 801, storage device 802 and network interface 803 can exchange data.
[0206] The above-mentioned storage device 802 may include a volatile memory (volatile memory), such as a random-access memory (RAM); the storage device 802 may also include a non-volatile memory (non-volatile memory), such as a flash memory, a solid-state drive (SSD), etc.; the above-mentioned storage device 802 may also include a combination of the above-mentioned types of memory.
[0207] The processor 801 may be a central processing unit (CPU). In one embodiment, the processor 801 may also be a graphics processing unit (GPU). The processor 801 may also be a combination of a CPU and a GPU. In one embodiment, the storage device 802 is used to store program instructions, and the processor 801 may call the program instructions to perform the following operations:
[0208] Constructing a hierarchical map according to the original map and the grid division rule set, wherein the hierarchical map includes at least one high-level map and a low-level map corresponding to the original map;
[0209] Determining a base level map and a first path between the start point and the end point in the base level map in order from a low level map to a high level map according to the hierarchical map, the start point and the end point;
[0210] According to the K level maps in the hierarchical map and the first path, the target path between the starting point and the end point is determined, the levels of the K level maps are lower than the level of the reference level map, and K is an integer greater than or equal to 0.
[0211] Optionally, the grid division rule set includes a first division granularity and a granularity update gradient, and the processor 801, when used to construct a hierarchical map according to the original map and the grid division rule set, is specifically used to:
[0212] The original map is divided according to the first division granularity to obtain a low-level map corresponding to the original map, wherein the low-level map includes a plurality of nodes matching the first division granularity;
[0213] Determine at least one second division granularity according to the first division granularity and the granularity update gradient;
[0214] According to the at least one second division granularity, the low-level maps are divided to obtain at least one high-level map. Each of the at least one high-level map includes a plurality of nodes matching the corresponding second division granularity.
[0215] Optionally, the processor 801 is further configured to:
[0216] For each high-level map in the at least one high-level map, mapping invalid nodes in the low-level map to each high-level map according to the first division granularity;
[0217] Determine the segmentation state of each node in each of the high-level maps according to the positional relationship between each node in each of the high-level maps and the invalid node;
[0218] Each of the high-level maps is updated according to the segmentation status and the invalid nodes.
[0219] Optionally, when the processor 801 is used to determine the reference level map according to the hierarchical map, the starting point and the ending point in the order from the low-level map to the high-level map, and the first path between the starting point and the ending point in the reference level map, it is specifically used to:
[0220] In the order of the low-level map to the high-level map in the hierarchical map, determine in turn whether there is a candidate path between the starting point and the end point in each level map in the hierarchical map;
[0221] If there is a candidate path between the above-mentioned starting point and the above-mentioned end point in the first-level map, the candidate path between the above-mentioned starting point and the above-mentioned end point in the above-mentioned first-level map is used as the first path, and the above-mentioned first-level map is used as the reference level map; wherein the above-mentioned first-level map is the first level map in the above-mentioned hierarchical map in which there is a candidate path between the above-mentioned starting point and the above-mentioned end point.
[0222] Optionally, the processor 801, when used to determine the target path between the starting point and the end point according to the K level maps in the hierarchical map and the first path, is specifically used to:
[0223] Obtain a first node set included in the first path;
[0224] Determining, according to a path planning algorithm, that the first node set corresponds to a second node set in a second-level map, wherein the second-level map is a map of the highest level among the K level maps;
[0225] If the second-level map is the low-level map, a target path between the starting point and the end point is determined according to the second node set.
[0226] Optionally, the processor 801 is further configured to:
[0227] If the second-level map is not the lower-level map, determining, according to the path planning algorithm, that the second node set corresponds to a third node set in a third-level map, and the third-level map is a lower-level map of the second-level map;
[0228] If the third-level map is the low-level map, a target path between the starting point and the end point is determined according to the third node set.
[0229] Optionally, when the processor 801 is used to determine, according to the path planning algorithm, that the first node set corresponds to the second node set in the second-level map, it is specifically used to:
[0230] Determine that each first node in the first node set corresponds to a mapping node set in the second-level map;
[0231] Determine a corresponding target mapping node from the mapping node set corresponding to each of the first nodes according to a path planning algorithm;
[0232] According to the node corresponding to the above-mentioned starting point in the above-mentioned second-level map, the node corresponding to the above-mentioned ending point in the above-mentioned second-level map, the target mapping node corresponding to each of the above-mentioned first nodes and the corresponding shortest path information set, it is determined that the above-mentioned first node set corresponds to the second node set in the above-mentioned second-level map.
[0233] Optionally, when the processor 801 is used to determine the corresponding target mapping node from the mapping node set corresponding to each first node according to the path planning algorithm, it is specifically used to:
[0234] For the first mapping node set in the mapping node set corresponding to each of the first nodes, the sum of the distance from each mapping node in the first mapping node set to the target mapping node in the second mapping node set and the distance to the termination point is obtained according to the path planning algorithm, and the first node corresponding to the second mapping node set is the previous node of the first node corresponding to the first mapping node set in the first node set;
[0235] The mapping node corresponding to the first mapping node set having the shortest sum of distances is used as the target mapping node.
[0236] Optionally, when the processor 801 is used to determine the target path between the starting point and the end point according to the K level maps in the hierarchical map and the first path, it is specifically used to:
[0237] Acquire a first node set included in the first path, and extract a first node subset from the first node set;
[0238] Determine, according to a path planning algorithm, that each first node in the first node subset corresponds to a fourth node set in a second-level map, where the second-level map is a highest-level map among the K level maps;
[0239] If the second-level map is the low-level map, a target path between the starting point and the end point is determined based on the first node in the first node set excluding the first node subset and the fourth node set.
[0240] In a specific implementation, the processor 801, the storage device 802, and the network interface 803 described in the embodiments of the present application can execute the embodiments of the present application. Figure 2 or Figure 4 The implementation method described in the relevant embodiments of the data processing method provided can also be implemented in the embodiments of the present application Figure 7 The implementation methods described in the relevant embodiments of the provided data processing device will not be repeated here.
[0241] In the several embodiments provided in the present application, it should be understood that the disclosed methods, devices and systems can be implemented in other ways. For example, the device embodiments described above are merely schematic; for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0242] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the data processing device mentioned above, and the computer program includes program instructions. When the processor executes the above program instructions, it can execute the above Figure 2 , Figure 4 The method in the corresponding embodiment, therefore, will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, the program instructions can be deployed on a computer device, or executed on multiple computer devices located in one location, or, executed on multiple computer devices distributed in multiple locations and interconnected by a communication network, and multiple computer devices distributed in multiple locations and interconnected by a communication network can constitute a blockchain system.
[0243] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device can perform the above Figure 2 , Figure 4 The method in the corresponding embodiment will therefore not be described in detail here.
[0244] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the above-mentioned program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The above-mentioned storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0245] The above disclosure is only part of the embodiments of the present application, which certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of implementing the above embodiments and making equivalent changes according to the claims of this application are still within the scope of the invention.
Claims
1. A data processing method, characterized in that: The method comprises: Dividing the original map according to the first division granularity to obtain a low-level map corresponding to the original map, wherein the low-level map includes a plurality of nodes matching the first division granularity; Determining at least one second division granularity according to the first division granularity and the granularity update gradient, and dividing the low-level map according to the at least one second division granularity to obtain at least one high-level map, wherein each high-level map in the at least one high-level map includes a plurality of nodes matching the corresponding second division granularity; For each high-level map in the at least one high-level map, mapping invalid nodes in the low-level map to each high-level map according to the first division granularity; Determining the segmentation state of each node in each high-level map according to the positional relationship between each node in each high-level map and the invalid node; updating each of the high-level maps according to the segmentation state and the invalid nodes to obtain at least one updated high-level map; determining a hierarchical map based on the low-level map and the updated at least one high-level map; Determining a reference level map and a first path between the starting point and the ending point in the reference level map in order from a low level map to a high level map according to the hierarchical map, the starting point and the ending point; A target path between the starting point and the ending point is determined based on K level maps in the hierarchical map and the first path, the levels of the K level maps are lower than the level of the reference level map, and K is an integer greater than or equal to 0.
2. The method according to claim 1, characterized in that: The determining of a reference level map and a first path between the starting point and the ending point in the reference level map in order from a low-level map to a high-level map according to the hierarchical map, the starting point and the ending point comprises: Determine in sequence whether there is a candidate path between a starting point and an end point in each level map of the hierarchical map in order from a low-level map to a high-level map of the hierarchical map; If there is a candidate path between the starting point and the end point in the first-level map, the candidate path between the starting point and the end point in the first-level map is used as the first path, and the first-level map is used as the reference level map; wherein the first-level map is the first level map in the hierarchical map in which there is a candidate path between the starting point and the end point.
3. The method according to claim 1 or 2, characterized in that: The step of determining a target path between the starting point and the end point according to the K level maps in the hierarchical map and the first path includes: Acquire a first node set included in the first path; Determining, according to a path planning algorithm, that the first node set corresponds to a second node set in a second-level map, where the second-level map is a highest-level map among the K level maps; If the second-level map is the low-level map, a target path between the starting point and the ending point is determined according to the second node set.
4. The method according to claim 3, characterized in that The method further comprises: If the second-level map is not the low-level map, determining, according to the path planning algorithm, that the second node set corresponds to a third node set in a third-level map, the third-level map being a next-level map of the second-level map; If the third-level map is the low-level map, a target path between the starting point and the ending point is determined according to the third node set.
5. The method according to claim 3, characterized in that: The determining, according to the path planning algorithm, that the first node set corresponds to a second node set in the second-level map includes: Determine that each first node in the first node set corresponds to a mapping node set in the second level map; Determine a corresponding target mapping node from a mapping node set corresponding to each first node according to a path planning algorithm; Based on the node corresponding to the starting point in the second-level map, the node corresponding to the end point in the second-level map, the target mapping node corresponding to each first node, and the corresponding shortest path information set, determine that the first node set corresponds to the second node set in the second-level map.
6. The method according to claim 5, characterized in that The determining the corresponding target mapping node from the mapping node set corresponding to each first node according to the path planning algorithm includes: For a first mapping node set in the mapping node set corresponding to each first node, obtaining, according to a path planning algorithm, a sum of a distance from each mapping node in the first mapping node set to a target mapping node in the second mapping node set and a distance to the termination point, wherein the first node corresponding to the second mapping node set is a node preceding the first node corresponding to the first mapping node set in the first node set; The mapping node corresponding to the first mapping node set and having the shortest sum of distances is taken as the target mapping node.
7. The method according to claim 1 or 2, characterized in that: The step of determining a target path between the starting point and the end point according to the K level maps in the hierarchical map and the first path includes: Acquire a first node set included in the first path, and extract a first node subset from the first node set; Determine, according to a path planning algorithm, that each first node in the first node subset corresponds to a fourth node set in a second-level map, where the second-level map is a highest-level map among the K level maps; If the second-level map is the low-level map, a target path between the starting point and the ending point is determined based on the first node in the first node set excluding the first node subset and the fourth node set.
8. A data processing device, characterized in that: The device comprises: A construction module is used to divide the original map according to a first division granularity to obtain a low-level map corresponding to the original map, wherein the low-level map includes a plurality of nodes matching the first division granularity; determine at least one second division granularity according to the first division granularity and a granularity update gradient, and divide the low-level map according to the at least one second division granularity to obtain at least one high-level map, wherein each high-level map in the at least one high-level map includes a plurality of nodes matching the corresponding second division granularity; The construction module is further used for mapping the invalid nodes in the low-level map to each high-level map according to the first division granularity for each high-level map in the at least one high-level map; determining the segmentation state of each node in each high-level map according to the positional relationship between each node in each high-level map and the invalid node; updating each high-level map according to the segmentation state and the invalid node to obtain at least one updated high-level map; and determining a hierarchical map according to the low-level map and the at least one updated high-level map; An analysis module, configured to determine a reference level map and a first path between the starting point and the ending point in the reference level map in a sequence from a low level map to a high level map according to the hierarchical map, the starting point and the ending point; A refinement module is used to determine the target path between the starting point and the end point according to K level maps in the hierarchical map and the first path, the levels of the K level maps are lower than the level of the reference level map, and K is an integer greater than or equal to 0.
9. A computer device, characterized in that: include: A memory and a processor, wherein a data processing program is stored in the memory, and when the data processing program is executed by the processor, it is used to implement the data processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the program instructions are executed by a processor to implement the data processing method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The computer program product comprises a computer program or a computer instruction, and when the computer program or the computer instruction is executed by a processor, it is used to implement the data processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Path programming method and apparatus
CN106556402A