Heuristic search path planning method and system for large-scale grid maps

CN122590892APending Publication Date: 2026-08-18GUANGZHOU EASTER EGG INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610843722.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-11
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

然而,该方法在面对大规模地图时存在计算资源消耗高、搜索节点数量急剧膨胀的问题,尤其在复杂地形的地图中,算法会不可避免地遍历大量无效区域,导致响应延迟不可预测,同时难以适应动态变化的通行代价环境,在实时性要求较高的应用场景中表现出明显的局限性

Benefits of technology

[0015]拟通过本申请提出的面向大规模网格地图的启发式搜索路径规划方法及系统,首先对网格地图进行连通分量标记和死胡同深度标记,然后根据包含起点、终点及单位属性的路径规划请求,基于起点与终点的连通分量标记进行可达判定,根据判定结果确定启发式搜索策略,最后根据确定的启发式搜索策略,以死胡同深度标记为惩罚项执行路径搜索,并实时监测计算开销,当计算开销超出预设阈值时,反馈当前已确定的最佳部分路径,同时在搜索过程中动态更新网格地图的实时通行代价,将更新后的代价实时反馈至所述启发式搜索策略的代价函数中,通过迭代搜索,确定最终的最佳路径。通过上述过程,本申请所提出的方法及系统达到了在有限计算资源内提升搜索效率、保障路径质量并实现环境动态自适应调整的技术效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122590892A_ABST
    Figure CN122590892A_ABST
Patent Text Reader

Abstract

The application discloses a heuristic search path planning method and system for a large-scale grid map, relates to the field of data processing, and comprises the following steps: marking a connected component and a dead end depth of a grid map; determining reachability according to the connected component marking of a start point and an end point based on a path planning request, and determining a heuristic search strategy according to a result; performing path search with the dead end depth marking as a penalty term and monitoring computation overhead in real time, feeding back a best partial path determined at present when the computation overhead exceeds a preset threshold, dynamically updating a real-time passing cost in a search process and feeding back the real-time passing cost to a cost function of the heuristic search strategy, and determining a best path through iterative search. The application solves the problem that existing path planning cannot simultaneously consider search efficiency, path quality and environmental dynamic adaptability within limited computation resources, and achieves the effect of improving search efficiency, guaranteeing path quality and realizing environmental dynamic self-adaptive adjustment within limited computation resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, and in particular to a heuristic search path planning method and system for large-scale grid maps. Background Technology

[0002] Path planning plays a fundamental supporting role in large-scale grid map applications, and its efficiency and quality directly affect the overall performance of the upper-layer system. Current common methods for solving this problem employ graph search-based heuristic algorithms, specifically calculating Manhattan or Euclidean distances on grid cells as heuristic values ​​and expanding node-by-node through a priority queue to find the path with the minimum cost. However, this method suffers from high computational resource consumption and a rapid increase in the number of search nodes when dealing with large-scale maps. Especially in maps with complex terrain, the algorithm inevitably traverses a large number of invalid areas, leading to unpredictable response delays. Furthermore, it struggles to adapt to dynamically changing travel costs, exhibiting significant limitations in applications with high real-time requirements.

[0003] At present, path planning under large-scale grid maps faces the technical challenge of balancing search efficiency, path quality, and dynamic environmental adaptability within limited computing resources. Summary of the Invention

[0004] This application provides a heuristic search path planning method and system for large-scale grid maps. By marking connected components and dead-end depths on the grid map, upon receiving a path planning request, it performs reachability determination based on the connected component markings of the start and end points, determines a heuristic search strategy based on the determination result, and executes path search according to the determined strategy, using dead-end depth markings as a penalty. Simultaneously, it monitors computational costs in real time, and when the cost exceeds a threshold, it provides feedback on the currently determined optimal partial path. Furthermore, it dynamically updates the real-time travel cost of the grid map during the search process and feeds it back into the cost function. Through iterative search, it determines the final optimal path. These technical means solve the technical problem of existing path planning methods for large-scale grid maps, which struggle to balance search efficiency, path quality, and dynamic environmental adaptability within limited computing resources. This achieves the technical effect of improving search efficiency, ensuring path quality, and realizing dynamic environmental adaptive adjustment within limited computing resources.

[0005] This application provides a heuristic search path planning method for large-scale grid maps, including: marking connected components and dead-end depths on the grid map; based on a path planning request containing start point, end point, and unit attributes, performing reachability determination based on the connected component markings of the start point and end point, and determining a heuristic search strategy based on the determination result; performing path search according to the determined heuristic search strategy, using dead-end depth markings as a penalty, and monitoring computational cost in real time; when the computational cost exceeds a preset threshold, providing feedback on the currently determined optimal partial path; and dynamically updating the real-time travel cost of the grid map during the search process, feeding the updated cost back to the cost function of the heuristic search strategy in real time; and determining the final optimal path through iterative search.

[0006] In a possible implementation, the grid map is labeled with connected components and dead-end depths, and the following processing is performed: the grid map is divided into blocks to obtain multiple region blocks; based on the multiple region blocks, a breadth-first search is performed within each region block to label the connected components of each grid cell within the region block; a depth-first search is performed within each region block to calculate the number of steps from each grid cell to the nearest dead-end, which is used as the dead-end depth value for dead-end depth labeling.

[0007] In a possible implementation, the following processing is also performed: traverse the common boundary grid cells of each pair of adjacent region blocks, record the connectivity between adjacent region blocks, wherein if the two grid cells on both sides of the boundary belong to the passable cells in their respective region blocks, it is determined that there is a connectivity relationship between this pair of adjacent region blocks, record all adjacent region block pairs with connectivity relationships, and establish a region block-level connectivity index.

[0008] In a possible implementation, reachability is determined based on the connected component labels of the start and end points, and the following processing is performed: obtain the connected component labels of the grid cell where the start point is located and the connected component labels of the grid cell where the end point is located; compare whether the connected component labels of the start point and the end point are equal, wherein if they are equal, it is determined that there is a reachable path between the start point and the end point; if they are not equal, it is determined that there is no reachable path between the start point and the end point, terminate the current path planning and return the result of no feasible path; when the start point or the end point itself is an inaccessible grid cell, it is directly determined as unreachable.

[0009] In possible implementations, a heuristic search strategy is determined based on the judgment result, and the following processing is performed: when the Manhattan distance between the starting point and the ending point is less than a preset first threshold, or when the requested unit type is a hero unit directly controlled by the player, a fine-grained search algorithm is selected as the main search algorithm to obtain better path quality; when the Manhattan distance between the starting point and the ending point is greater than a preset second threshold, and the requested unit type is a non-player character located outside the player's field of vision, a coarse-grained search algorithm is selected as the main search algorithm to reduce computational overhead; when neither the first nor the second threshold condition is met, the current CPU utilization is obtained. If the utilization is higher than a preset load threshold, a coarse-grained search algorithm is selected; otherwise, a fine-grained search algorithm is selected.

[0010] In possible implementations, the following processing is performed: the fine-grained search algorithm is a heuristic search algorithm that uses a single grid cell as the basic search node and expands node by node within the global grid; the coarse-grained search algorithm is a hierarchical heuristic search algorithm that uses pre-divided regional blocks as the basic search nodes, first performs high-level path planning at the regional block level, and then performs low-level path refinement at the grid cell level within each regional block.

[0011] In a possible implementation, computational overhead is monitored in real time. When the computational overhead exceeds a preset threshold, the currently determined optimal partial path is fed back, and the following processing is performed: In the main search loop, for each node expanded, the number of CPU clock cycles consumed or the number of expanded nodes is accumulated; when the accumulated value exceeds a preset time threshold or node number threshold, the current search is paused, the node with the lowest current generation value is taken from the priority queue as the endpoint of the optimal partial path, and a path from the starting point to the endpoint of the current optimal partial path is generated as a temporary result output; at the same time, the current search state, including the priority queue content, the set of expanded nodes, and the cost information of each node, is serialized and saved in an idle memory pool for subsequent computation cycles to resume.

[0012] In a possible implementation, path search is performed using dead-end depth marking as a penalty term, and the following processing is performed: the dead-end depth value of each grid cell is normalized to the [0,1] interval, multiplied by a preset penalty coefficient, and added to the original passage cost of the corresponding grid cell to obtain a corrected cost, wherein the penalty coefficient is dynamically adjusted according to the unit type; when the dead-end depth value exceeds the preset maximum tolerable depth threshold, the corresponding grid cell is temporarily marked as impassable, so that the corresponding grid cell is forcibly bypassed when planning the path; wherein, during the search process, the actual cost of each node is accumulated according to the corrected cost of the grid cell in which it belongs, and the heuristic estimate of each node remains unchanged or is added with the penalty cost.

[0013] In a possible implementation, the real-time access cost of the grid map is dynamically updated during the search process, and the updated cost is fed back to the cost function of the heuristic search strategy in real time. Through iterative search, the final optimal path is determined, and the following processing is performed: During the search process, dynamic events are continuously monitored, including the appearance or disappearance of dynamic obstacles, changes in unit density within a region block, and the activation or deactivation of time slice costs; When a dynamic event exists, the affected grid cell is located, the new access cost of the affected grid cell is calculated, and compared with the old cost. If the cost changes, the current search priority queue is traversed to find all nodes containing the affected grid cell, the actual cost and total cost are updated, and the priority queue order is readjusted; After the cost update is completed, the search loop continues until the termination condition is met, including: the priority queue is empty, no feasible path is determined, and failure is returned; the process is extended to the endpoint node, and a complete path is generated backtracking as the final optimal path; After obtaining the final optimal path, the optimal path and the corresponding start coordinates, endpoint coordinates, and unit type are stored in an LRU cache for reuse in subsequent identical or similar requests.

[0014] This application also provides a heuristic search path planning system for large-scale grid maps, including: a map marking module for marking connected components and dead-end depths on the grid map; a reachability determination module for determining reachability based on the connected component markings of the start and end points according to a path planning request containing start, end, and unit attributes, and determining a heuristic search strategy based on the determination result; and an optimal path search module for performing path search with dead-end depth markings as a penalty term according to the determined heuristic search strategy, and monitoring the computational cost in real time. When the computational cost exceeds a preset threshold, the module provides feedback on the currently determined optimal partial path, and dynamically updates the real-time travel cost of the grid map during the search process, feeding the updated cost back to the cost function of the heuristic search strategy in real time, and determining the final optimal path through iterative search.

[0015] The proposed heuristic search path planning method and system for large-scale grid maps first labels the grid map with connected components and dead-end depths. Then, based on a path planning request including start, end, and unit attributes, reachability is determined based on the connected component labels of the start and end points. A heuristic search strategy is determined based on the determination result. Finally, path searching is performed according to the determined heuristic search strategy, with dead-end depth labels as a penalty, and computational costs are monitored in real time. When the computational cost exceeds a preset threshold, the currently determined optimal partial path is fed back. Simultaneously, the real-time travel cost of the grid map is dynamically updated during the search process, and the updated cost is fed back into the cost function of the heuristic search strategy. Through iterative search, the final optimal path is determined. Through the above process, the proposed method and system achieve the technical effects of improving search efficiency, ensuring path quality, and realizing dynamic adaptive adjustment of the environment within limited computing resources. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings of the embodiments of the present invention will be briefly described below. Flowcharts are used in this application to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed precisely in sequence. Instead, various steps can be processed in reverse order or simultaneously as needed. Furthermore, other operations can be added to these processes, or one or more steps can be removed from these processes.

[0017] Figure 1 This is a flowchart illustrating the heuristic search path planning method for large-scale grid maps provided in an embodiment of this application.

[0018] Figure 2 This is a schematic diagram of the structure of a heuristic search path planning system for large-scale grid maps provided in an embodiment of this application.

[0019] Attached image labeling: Map labeling module 10, Reachability determination module 20, Optimal path search module 30. Detailed Implementation

[0020] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.

[0021] This application provides a heuristic search path planning method for large-scale grid maps, such as... Figure 1 As shown, the method includes: Step S100: Mark the connected components and dead-end depths on the grid map.

[0022] Specifically, a connected component label is an integer identifier assigned to each walkable grid cell in the grid map, uniquely identifying the connected region to which that grid cell belongs. A path consisting of walkable grid cells exists between any two walkable grid cells belonging to the same connected component. A dead-end depth label is an integer value calculated and stored for each walkable grid cell in the grid map, representing the number of steps required to reach the nearest dead end along a walkable path from the current grid cell. The process involves acquiring the 2D grid map data to be processed, where each grid cell has either a walkable or impassable state. Two labeling operations are performed on all walkable grid cells, in the order of connected component labeling followed by dead-end depth labeling. Connected component labeling identifies all isolated walkable regions in the map, while dead-end depth labeling quantifies the degree to which each grid cell is located within a dead end.

[0023] In one possible implementation, the grid map is marked with connected components and dead-end depths. Step S100 further includes step S110, which divides the grid map into blocks to obtain multiple region blocks. Specifically, a fixed-size sliding window method is used to divide the original grid map into blocks. The size parameters of the region blocks are set; for example, the horizontal block size is set to 64, and the vertical block size is set to 64. Starting from the top-left corner of the map, the blocks are divided sequentially to the right and downwards according to this size. For map edges smaller than a complete region block size, they are treated as independent incomplete region blocks. Each region block is uniquely determined by the coordinates of its top-left and bottom-right grid cells. After block division, a list of region blocks is generated as units for parallel processing.

[0024] Step S120: Based on multiple region blocks, perform a breadth-first search within each region block, marking the connected component markers of each grid cell within the region block. Specifically, for each region block obtained in step S110, perform the following independent processing: Initialize a two-dimensional integer array of the same size as the current region block to store connected component markers, with all elements initialized to 0. Establish an integer variable: current component index, initialized to 1. Traverse each grid cell within the current region block. If the cell is walkable and its connected component marker is 0, then start from this cell and perform a breadth-first search within its region block. Specifically, create a first-in-first-out queue, enqueue the starting cell and mark its connected component as: current component index. When the queue is not empty, pop the first cell from the queue and check its four-neighbor or eight-neighbor neighboring cells. For each neighboring cell, if the cell is located within the boundary of the current region block, is walkable, and its connected component marker is 0, then enqueue the neighboring cell and assign it the same connected component index as the current cell. After the breadth-first search is completed, the current component index is incremented by 1. Once all walkable cells within a region block have been marked, the connectivity component marking for that region block is complete. Since each region block is independent, this step can be executed in parallel using multi-threading or distributed computing to improve processing efficiency.

[0025] Step S130: Perform a depth-first search within each region block, calculate the number of steps from each grid cell to the nearest dead end, and use this as the dead end depth value for dead end depth marking. Specifically, the calculation of dead end depth is based on an iterative stripping process of traversable regions, which is executed independently within each region block. First, for each traversable grid cell within the current region block, calculate the number of its traversable neighbors. The definition of a traversable neighbor is consistent with the neighborhood definition in step S120, such as a four-neighborhood. If the number of traversable neighbors of a traversable grid cell is equal to 1, then the cell is identified as a boundary cell, and its current depth value is recorded as 1. These boundary cells are used as the initial set. Then, a cyclic stripping process is executed: maintain a first-in-first-out queue, and enqueue all boundary cells with a current depth value of 1. When the queue is not empty, pop the first cell from the queue and record its depth value as D. Iterate through all accessible neighboring units of the current cell. For each neighboring unit, if it has not yet been assigned a dead-end depth value, decrement its accessible neighbor count by 1. The initial value of this count was calculated and stored at the beginning of this step. If the accessible neighbor count of the neighboring unit becomes 1 after decrementing, set the dead-end depth value of the neighboring unit to D+1 and enqueue it. The loop ends when the queue is empty. At this point, all units within the block that have been marked with depth values ​​constitute all dead-end regions. The remaining unmarked units belong to non-dead-end regions, such as main roads, and their dead-end depth values ​​are set to a preset maximum value, such as 999, or a special value that indicates they are not in any dead end, such as 0. For example, a larger depth value indicates that the unit is deeper into a dead end. For example, the depth value at the end of a dead end is 1, the depth value of the unit before it is 2, and so on.

[0026] In one possible implementation, step S100 further includes step S140, which involves traversing the common boundary grid cells of each pair of adjacent region blocks, recording the connectivity between adjacent region blocks, wherein if both grid cells on both sides of the boundary belong to walkable cells within their respective region blocks, it is determined that there is a connectivity relationship between the pair of adjacent region blocks, and all pairs of adjacent region blocks with connectivity relationships are recorded to establish a region block-level connectivity index. Specifically, after completing the internal labeling of all region blocks, a global undirected graph of region block connectivity is constructed. First, the adjacency relationships of all region blocks in the map are determined. Two region blocks are adjacent in the horizontal or vertical direction, that is, the right boundary of one region block coincides with the left boundary of another region block, or the lower boundary of one region block coincides with the upper boundary of another region block, thus forming a pair of adjacent region blocks. For each pair of adjacent region blocks, all grid cell pairs on their common boundary are obtained. Specifically, for horizontally adjacent region blocks: left block C and right block B, the common boundary is the rightmost column of grid cells of block C and the leftmost column of grid cells of block B. Iterate through each row in the column, checking if both grid cells on either side of the boundary are walkable. If at least one row exists where both grid cells are walkable, then region block C and region block B are considered connected. Record this relationship, storing the identifiers of block C and block B as adjacent nodes in an adjacency list of an undirected graph in the region block-level connectivity index. Optionally, record the specific coordinates of these connected boundary grid cells. If no walkable pair of boundary cells is found after traversing all common boundary rows, then there is no direct connection between the two blocks.

[0027] Step S200: Based on the path planning request containing the start point, end point and unit attributes, reachability determination is performed based on the connected component labels of the start point and end point, and a heuristic search strategy is determined based on the determination result.

[0028] Specifically, the system receives path planning requests from upper-layer applications, such as the game logic module. These requests include at least the starting point coordinates, ending point coordinates, and unit type. The unit type refers to the attributes of the game unit initiating the path planning request, and at least includes hero units directly controlled by the player and non-player character units. First, the system queries the connected component markers of the grid cells containing the starting and ending points, calculated in step S100. Then, it compares these two marker values. If the marker values ​​are the same, it indicates that at least one feasible path exists, and the system proceeds to the subsequent search strategy selection stage. If the marker values ​​are different, or if the starting or ending point itself is an inaccessible grid cell, it directly determines that there is no feasible path, returns a path-not-existing result to the requester, and terminates the current planning process. Only after the reachability determination is passed does the system decide which heuristic search strategy to adopt based on the specific information in the request.

[0029] In one possible implementation, reachability determination is performed based on the connected component markers of the start and end points. Step S200 further includes step S210, which involves obtaining the connected component markers of the grid cell containing the start point and the grid cell containing the end point. Specifically, the marker values ​​corresponding to the start and end point coordinates are read from the connected component marker matrix in memory. This marker matrix is ​​a two-dimensional array with the same size as the original grid map, and each element stores an integer value. For impassable grid cells, their connected component markers are invalid values, such as -1. The read operation is a constant-time array indexing operation.

[0030] Step S220 compares the connected component markers of the starting point and the ending point for equality. If they are equal, a reachable path exists between the starting point and the ending point; if they are not equal, no reachable path exists, the current path planning is terminated, and a result indicating no feasible path is returned. When the starting point or the ending point itself is an inaccessible grid cell, it is directly determined to be unreachable. Specifically, the two integer values ​​obtained in step S210 are compared. If they are equal and not equal to an invalid value, a reachable path exists between the starting point and the ending point. If they are not equal or either is an invalid value, no reachable path exists. When unreachable is determined, the current path planning is immediately terminated, and a response message explicitly indicating no feasible path is returned to the requester. Furthermore, as a preliminary check, before obtaining the connected component markers, it can be checked whether the starting point and the ending point cells themselves are inaccessible cells. For example, check the obstacle markers at the starting point coordinates in the map data; if there is an obstacle, it is directly determined to be unreachable.

[0031] In one possible implementation, a heuristic search strategy is determined based on the judgment result. Step S200 further includes step S230: when the Manhattan distance between the starting point and the ending point is less than a preset first threshold, or when the requested unit type is a hero unit directly controlled by the player, a fine-grained search algorithm is selected as the main search algorithm to obtain better path quality; when the Manhattan distance between the starting point and the ending point is greater than a preset second threshold, and the requested unit type is a non-player character located outside the player's field of vision, a coarse-grained search algorithm is selected as the main search algorithm to reduce computational overhead; when neither the first nor the second threshold condition is met, the current CPU utilization is obtained. If the utilization is higher than a preset load threshold, a coarse-grained search algorithm is selected; otherwise, a fine-grained search algorithm is selected. The fine-grained search algorithm is a heuristic search algorithm that uses a single grid cell as the basic search node and expands node by node within the global grid; the coarse-grained search algorithm is a hierarchical heuristic search algorithm that uses pre-divided region blocks as basic search nodes, first performs high-level path planning at the region block level, and then refines low-level paths at the grid cell level within each region block.

[0032] Specifically, a multi-condition-based strategy selector is employed. First, the Manhattan distance between the starting and ending points is calculated using the formula: Manhattan distance = |starting point x-coordinate - ending point x-coordinate| + |starting point y-coordinate - ending point y-coordinate|. A first threshold, such as 50, is preset for short-distance path planning; a second threshold, such as 200, is preset for long-distance path planning. The unit type is directly given by the request parameters and is an enumerated value. Player field-of-view information is queried in real-time from the game state management module to determine whether a non-player character is included within a rectangular area centered on the current player character, with dimensions of, for example, 100 grid units. CPU utilization is obtained by calling the application programming interface provided by the operating system; for example, using the GetSystemTimes function in Windows and reading the / proc / stat file in Linux. A load threshold, such as 70%, is preset.

[0033] The specific logic for strategy selection is as follows: First, determine if the Manhattan distance is less than the first threshold or if the unit type is a hero unit directly controlled by the player. If so, the fine-grained A* search algorithm is directly selected as the main search algorithm. The fine-grained search algorithm refers to a search algorithm that uses a single grid cell as the basic search node and uses a heuristic function, such as Manhattan distance, to guide node expansion within the global grid. If this condition is not met, further determine if the Manhattan distance is greater than the second threshold and if the unit type is a non-player character and the character is outside the player's field of vision. If so, the coarse-grained hierarchical search algorithm is selected to prioritize computational efficiency. The coarse-grained search algorithm is a hierarchical heuristic search algorithm that first uses region blocks as basic search nodes, performs high-level path planning based on region block-level connectivity indexes to obtain the sequence of traversed region blocks; then, within each traversed region block, a fine-grained search is performed using grid cells as nodes to connect the local paths within each region block, forming a complete path. If neither of the above two combined conditions is met, the current CPU utilization is queried. If the CPU utilization is higher than the 70% load threshold, the system's computing resources are strained. To ensure the overall frame rate, a coarse-grained search algorithm is selected. Conversely, if the CPU utilization is lower than or equal to the threshold, a fine-grained search algorithm is selected to obtain theoretically better path smoothness and length.

[0034] Step S300: Based on the determined heuristic search strategy, path search is performed with dead end depth marking as a penalty term, and the computational cost is monitored in real time. When the computational cost exceeds a preset threshold, the currently determined optimal partial path is fed back. At the same time, the real-time passage cost of the grid map is dynamically updated during the search process, and the updated cost is fed back to the cost function of the heuristic search strategy in real time. Through iterative search, the final optimal path is determined.

[0035] Specifically, the search algorithm selected in step S230 is instantiated, and the dead-end depth marker calculated in step S130 is integrated as a penalty term into the cost function of both algorithms. Specifically, for any grid cell to be evaluated, its actual movement cost for the search algorithm is no longer the original passage cost, but the sum of the original passage cost and a penalty term based on the dead-end depth value. The search process is performed in the main loop, while two parallel mechanisms are established: first, a computational cost monitoring mechanism, which checks whether the consumed resources exceed a threshold after each search iteration (i.e., after expanding a node); if so, it immediately returns the currently found best path segment to avoid indefinite blocking. Second, a dynamic cost update mechanism, which listens for external events, such as the appearance of obstacles. When an event occurs, the affected grid cell is locked, its passage cost is recalculated, and the cost value of all affected nodes in the search algorithm priority queue is dynamically adjusted to ensure that the search is always based on the latest map state. The entire iterative search process continues until the destination is found or no path is determined.

[0036] In one possible implementation, path search is performed using dead-end depth markers as a penalty term. Step S300 further includes step S310, which normalizes the dead-end depth value of each grid cell to the [0,1] interval, multiplies it by a preset penalty coefficient, and adds it to the original passage cost of the corresponding grid cell to obtain a corrected cost. The penalty coefficient is dynamically adjusted according to the unit type. During the search process, the actual cost of each node is accumulated based on the corrected cost of its respective grid cell, while the heuristic estimate of each node remains unchanged or is incremented with the penalty cost. Specifically, for each passable grid cell, the dead-end depth value D calculated in step S130 is obtained. Let D be the maximum value of all dead-end depth values ​​in the entire map. max This excludes the preset maximum value representing non-dead ends. The normalized calculation formula is: Normalized depth value = min(1.0, D / D) max For example, if D maxA unit with a depth of 5 and a normalized depth of 10 has a normalized depth of 0.5; a unit with a depth of 10 has a normalized depth of 1.0. If a unit is not in any dead end and its depth is a preset maximum value such as 999, the normalized depth is clamped to 1.0. A configurable penalty coefficient P is obtained, which is dynamically adjusted according to the unit type. For example, for ordinary non-player character units, the penalty coefficient P is set to 10.0; for timid units or units that need to retreat quickly, P is set to 100.0; for hero units that have high requirements for path quality and should avoid entering dead ends as much as possible, P is set to 5.0. The formula for calculating the correction cost is: Correction Cost = Original Passage Cost + (Normalized Depth Value × Penalty Coefficient). The original passage cost is usually 1.0, and is infinite for obstacle units. During the search process, the actual cost g(n) from the starting point to the current node n is accumulated based on the correction costs of all nodes on the path. The heuristic estimate h(n), such as the Manhattan distance to the endpoint, remains constant without adding penalty costs to ensure the admissibility of the heuristic function, i.e., without overestimating the remaining cost. Thus, the algorithm prioritizes expanding nodes with the smallest total cost f(n) = g(n) + h(n). Since entering dead ends accumulates a higher g(n), the algorithm naturally tends to avoid dead-end regions.

[0037] For example, in a simplified grid map fragment, the maximum dead-end depth D max The current task is to plan a path for a non-player character unit, with a penalty coefficient P of 10.0. The initial travel cost is uniformly set to 1.0. There are four grid cells J, K, L, and M, and their dead-end depths and corresponding calculation processes are shown in Table 1. When calculating the actual cumulative cost g(n) from the starting point to any node, the path search algorithm only increases the cost by 1.0 when passing through cell J, while it increases it by 11.0 when passing through cell M. Therefore, the algorithm will prioritize avoiding areas with larger depths, thus integrating the avoidance of complex dead ends into the cost minimization objective within the framework of heuristic search.

[0038] Table 1: Example of Correction Cost Calculation

[0039] Step S320: When the dead-end depth exceeds a preset maximum tolerance depth threshold, the corresponding grid cell is temporarily marked as impassable, forcing a bypass of the corresponding grid cell during path planning. Specifically, to forcibly avoid excessively deep dead ends with no exploration value during the search, this step introduces a hard constraint. A preset maximum tolerance depth threshold, for example, 15, is used. Before path searching, a Boolean temporary obstacle array with the same size as the original grid map is created, and all elements are initialized to false. All passable grid cells are traversed; if their dead-end depth is greater than 15, the value at the corresponding position in the temporary obstacle array is set to true. In the subsequent path search algorithm, when expanding nodes, for any neighboring node, the temporary obstacle array is checked first. If the array is marked as true, the neighboring node is considered an impassable cell and is not further expanded or enqueued. This marking is temporary, and its lifespan is only related to the current path planning request; it does not modify the original grid map data. This mechanism ensures that the planned path does not enter a dead end of more than 15 steps, thereby avoiding invalid calculations and low-quality paths.

[0040] In one possible implementation, computational overhead is monitored in real time. When the computational overhead exceeds a preset threshold, the currently determined optimal partial path is fed back. Step S300 further includes step S330, in which, in the main search loop, the number of CPU clock cycles consumed or the number of nodes expanded is accumulated for each node expanded. Specifically, to achieve predictable computational overhead monitoring, this step inserts monitoring points in the core loop of the search algorithm. Taking the fine-grained A* algorithm as an example, its main loop is: take the node with the smallest cost from the priority queue (open set). If the node is the endpoint, then end; otherwise, expand the node, generate its neighboring nodes and calculate the cost, and add the neighboring nodes that meet the conditions to the priority queue. In this loop, each time a node is successfully taken from the queue and processing begins, i.e., a node is expanded, one of the following accumulation operations or both are performed: Method 1, by calling the processor's timestamp counter to read the instruction, such as the RDTSC instruction under the x86 architecture, the current number of CPU clock cycles is obtained, and it is subtracted from the value read last time. The difference is accumulated in a variable named total consumed cycles. Method two involves incrementing an integer variable named "Expanded Node Counter" by 1. These two methods correspond to monitoring strategies based on time and those based on the number of iterations, respectively.

[0041] Step S340: When the accumulated value exceeds a preset time threshold or node count threshold, pause the current search, retrieve the node with the smallest current cost value from the priority queue as the endpoint of the optimal partial path, and backtrack to generate a path from the starting point to the endpoint of the current optimal partial path as a temporary result output. Specifically, after the accumulation in step S330, a threshold judgment is performed immediately. If the total number of cycles consumed is greater than the preset time threshold, such as 1 million CPU clock cycles, or the expanded node counter is greater than the preset node count threshold, such as 5000 nodes, then the early termination logic is triggered. The specific process is as follows: First, pause the main search loop, then access the priority queue of the current search algorithm. This queue is always sorted according to the total cost value f(n) of the nodes. Retrieve the first node from the queue, i.e., the node with the smallest cost value f(n), and take this node as the current optimal node. Then, starting from this node, backtrack to the starting point along the reverse pointer through the parent node pointer stored in each node, until the starting node is reached. Record the coordinates of the nodes passed during the backtracking process in order from the starting point to the current optimal node to form a complete path. Finally, this path is returned to the requester as a provisional result. This mechanism ensures that even if the search cannot be completed quickly, the system can provide a currently optimal executable path, rather than remaining completely unresponsive.

[0042] Step S350: Serialize and save the current search state, including the priority queue contents, the expanded node set, and the cost information of each node, storing it in the free memory pool for recovery in subsequent computation cycles. Specifically, to support interruptible and recoverable searches, after triggering early termination and outputting a partial path in step S340, the incomplete search context is persisted. Define a state serialization protocol, first creating a data structure: a search state object, which contains the following fields: 1. A serialized representation of the priority queue, i.e., outputting all nodes in the queue in their order as a linear list, each node containing its coordinates, g(n), h(n), f(n), and a parent node pointer. 2. A serialized representation of the expanded node set (i.e., the closed set), typically a hash set recording the coordinates of all expanded nodes, outputting it as a coordinate list. 3. A cost information table for each node, i.e., the mapping from node coordinates to their g(n) and f(n) values, serialized as a list of key-value pairs. The serialization process can employ binary packing, such as using Google's Protocol Buffers or a custom compact binary format. The serialized byte stream is stored in a pre-allocated, thread-safe memory pool. This memory pool can be managed using a linked list or free list structure. Each serialized object is associated with a unique path planning request identifier upon storage. When subsequent computing resources become available, the system can use this identifier to read the byte stream from the memory pool and deserialize it, reconstructing the priority queue, closing set, and cost table, thereby accurately resuming the search from the last paused point without restarting.

[0043] In one possible implementation, the real-time passage cost of the grid map is dynamically updated during the search process, and the updated cost is fed back to the cost function of the heuristic search strategy in real time. Through iterative search, the final optimal path is determined. Step S300 further includes step S360, continuously monitoring dynamic events during the search process. These dynamic events include the appearance or disappearance of dynamic obstacles, changes in unit density within a region, and the activation or deactivation of time-slice costs. Specifically, an event listening and distribution mechanism is adopted, creating an event queue to receive real-time dynamic events from the game engine or other modules. The event type is defined as an enumeration type, including: dynamic obstacle appearance, dynamic obstacle disappearance, region density change, and time-slice cost change. The dynamic obstacle appearance event carries the coordinates of the affected single grid cell or a rectangular region; the dynamic obstacle disappearance event is similar. The region density change event carries a region identifier and a new density value, an integer from 0 to 100. The time-slice cost change event carries a list of grid cells and their new passage costs; for example, a region becomes a high-threat region at a certain game time, and the cost increases. The main loop of the path planning module or a dedicated thread periodically checks this event queue. When a new event is found, the update logic in step S370 is immediately triggered.

[0044] Step S370: When a dynamic event occurs, locate the affected grid cells, calculate the new access cost for the affected grid cells, and compare it with the old cost. If the cost changes, traverse the current search priority queue, find all nodes containing the affected grid cells, update the actual cost and total cost, and readjust the priority queue order. Specifically, once an event is retrieved from the event queue in step S360, the following update process is executed: First, locate the affected area. Based on the event type and the parameters it carries, determine the list of grid cells whose costs need to be recalculated. For example, a dynamic obstacle occurrence event carries coordinates (X=100, Y=200), so the list only contains this cell; a region density change event calculates the coordinates of all grid cells within the region block based on the region block identifier. Second, for each grid cell in the list, recalculate its original access cost based on the latest map state. The formula for calculating the original access cost is: Original access cost = Basic access cost + Density influence factor × Density value + Time slice influence factor. The third step is to compare the newly calculated original travel cost with the original travel cost of the cell stored in memory. If they are not equal, proceed to the fourth step: update the internal state of the currently ongoing path planning search. Specifically, iterate through all nodes in the current search algorithm's priority queue. For each node, if its coordinates are the same as the coordinates of the affected grid cell, recalculate the actual cost g(n) of that node. Since g(n) is the sum of the path costs from the starting point to the current node, if the cost of the node's coordinates changes, g(n) and f(n) of that node and all its successors need to be updated. An efficient method is to find the node, remove it from the priority queue, modify its g(n) value (e.g., new g(n) = old g(n) - old cell cost + new cell cost), recalculate f(n) = g(n) + h(n), and then reinsert the node into the priority queue. The priority queue will be automatically reordered according to the new f(n) value. For the ancestor nodes of this node in the closing set, since their g(n) values ​​depend on the fixed path segments, they are usually not updated. After all affected nodes have been updated, the search loop continues.

[0045] Step S380: After the cost update, the search loop continues until the termination condition is met. The termination condition includes: the priority queue is empty, indicating no feasible path exists, and a failure is returned; or the path is expanded to the endpoint node, and a complete path is generated backtrackingly as the final optimal path. Specifically, after the dynamic update in step S370 or in the normal search process without dynamic events, the algorithm continues to execute its main loop. The termination condition of the main loop is one of the following two, judged in order of priority: First, the priority queue (open set) becomes empty, which means that all reachable nodes from the starting point have been expanded, but the endpoint has not yet been reached. Therefore, it is determined that there is no feasible path between the starting point and the endpoint, and a termination state of search failure is returned. Second, the node to be expanded taken from the priority queue is exactly the endpoint node. At this time, a path from the starting point to the endpoint has been successfully found. By using the parent node pointer of the endpoint node, backtracking continuously until the starting node, and reversing the node coordinates on the backtracking path in order, a complete path from the starting point to the endpoint can be generated. This path is recognized as the final optimal path, and the iterative search process ends here.

[0046] In step S390, after obtaining the final optimal path, the optimal path and its corresponding start-point coordinates, end-point coordinates, and unit type are stored in an LRU cache for reuse in subsequent identical or similar requests. Specifically, to accelerate future path planning requests, a cache based on the Least Recently Used (LRU) strategy is adopted. An LRU cache container is created, with a preset maximum capacity of 128 records. The key of each cache record is a string or hash value composed of the start-point coordinates, end-point coordinates, and unit type. The value of each cache record includes: the final optimal path, the total cost of the path, and a timestamp. When a path is successfully returned in step S380, a key-value pair is immediately constructed and inserted or updated in the LRU cache. When a new path planning request is received subsequently, before step S200, a key is first constructed using the request parameters and searched in the LRU cache. If a valid cached path is found, the path is returned directly without re-executing the search process in step S300. If the cache is not found, the normal planning process continues. When the cache capacity reaches its limit, the insertion of a new record will trigger the LRU eviction mechanism, which deletes the record that has not been accessed for the longest time.

[0047] This application's embodiments address the technical problem of balancing search efficiency, path quality, and dynamic environmental adaptability within limited computing resources in existing path planning on large-scale grid maps by marking connected components and dead-end depths on a grid map. Upon receiving a path planning request, reachability is determined based on the connected component markings of the start and end points. A heuristic search strategy is then determined based on the determination result. Following the determined strategy, path search is performed with dead-end depth markings as a penalty. Simultaneously, computational costs are monitored in real time. When the cost exceeds a threshold, the currently determined optimal partial path is fed back. The real-time travel cost of the grid map is dynamically updated during the search process and fed back into the cost function. The final optimal path is determined through iterative search. These technical means solve the problem of balancing search efficiency, path quality, and dynamic environmental adaptability within limited computing resources in existing path planning on large-scale grid maps. This achieves the technical effect of improving search efficiency, ensuring path quality, and realizing dynamic adaptive adjustment of the environment within limited computing resources.

[0048] In the above text, refer to Figure 1 A heuristic search path planning method for large-scale grid maps according to embodiments of the present invention is described in detail. Next, reference will be made to... Figure 2 A heuristic search path planning system for large-scale grid maps according to an embodiment of the present invention is described.

[0049] The heuristic search path planning system for large-scale grid maps according to embodiments of the present invention addresses the technical problem of existing path planning methods for large-scale grid maps, which struggle to balance search efficiency, path quality, and dynamic environmental adaptability within limited computing resources. It achieves the technical effect of improving search efficiency, ensuring path quality, and realizing dynamic adaptive adjustment within limited computing resources. The heuristic search path planning system for large-scale grid maps includes: a map marking module 10, a reachability determination module 20, and an optimal path search module 30.

[0050] The map marking module 10 is used to mark connected components and dead-end depths on the grid map; the reachability determination module 20 is used to determine reachability based on the connected component markings of the start and end points according to the path planning request containing start, end, and unit attributes, and to determine a heuristic search strategy based on the determination result; the optimal path search module 30 is used to perform path search with dead-end depth markings as a penalty item according to the determined heuristic search strategy, and to monitor the computational cost in real time. When the computational cost exceeds a preset threshold, it provides feedback on the currently determined optimal partial path. At the same time, it dynamically updates the real-time travel cost of the grid map during the search process and feeds the updated cost back to the cost function of the heuristic search strategy in real time. Through iterative search, the final optimal path is determined.

[0051] The detailed description of the specific configuration of the map marking module 10 is explained as follows: As mentioned above, the map marking module 10 can further include the following components for marking connected components and dead-end depths of the grid map: a map segmentation unit for segmenting the grid map into multiple regions; a breadth-first search unit for performing a breadth-first search within each region block to mark the connected components of each grid cell within the region block; and a depth-first search unit for performing a depth-first search within each region block to calculate the number of steps from each grid cell to the nearest dead-end, which is used as the dead-end depth value for marking the dead-end depth.

[0052] The map marking module 10 may further include: a connectivity recording unit for traversing the common boundary grid cells of each pair of adjacent area blocks and recording the connectivity between adjacent area blocks. If both grid cells on both sides of the boundary belong to passable cells within their respective area blocks, it is determined that there is a connectivity relationship between the pair of adjacent area blocks. All pairs of adjacent area blocks with connectivity relationships are recorded, and a connectivity index at the area block level is established.

[0053] The detailed description of the specific configuration of the reachability determination module 20 is explained as follows: As mentioned above, reachability determination is performed based on the connected component markers of the starting point and the ending point. The reachability determination module 20 may further include: a connected component marker acquisition unit for acquiring the connected component markers of the grid cell where the starting point is located and the connected component markers of the grid cell where the ending point is located; a comparison determination unit for comparing whether the connected component markers of the starting point and the ending point are equal, wherein if they are equal, it is determined that there is a reachable path between the starting point and the ending point; if they are not equal, it is determined that there is no reachable path between the starting point and the ending point, the current path planning is terminated and the result of no feasible path is returned; when the starting point or the ending point itself is an inaccessible grid cell, it is directly determined to be unreachable.

[0054] The heuristic search strategy determined based on the judgment result, and the reachability judgment module 20 may further include: a main search algorithm selection unit, used to select a fine-grained search algorithm as the main search algorithm to obtain better path quality when the Manhattan distance between the starting point and the ending point is less than a preset first threshold, or when the requested unit type is a hero unit directly controlled by the player; when the Manhattan distance between the starting point and the ending point is greater than a preset second threshold, and the requested unit type is a non-player character and located outside the player's field of vision, a coarse-grained search algorithm is selected as the main search algorithm to reduce computational overhead; when neither the first nor the second threshold condition is met, the current CPU utilization is obtained, and if the utilization is higher than a preset load threshold, a coarse-grained search algorithm is selected, otherwise a fine-grained search algorithm is selected.

[0055] The main search algorithm selection unit may further include: the fine-grained search algorithm is a heuristic search algorithm that uses a single grid cell as the basic search node and expands node by node within the global grid; the coarse-grained search algorithm is a hierarchical heuristic search algorithm that uses pre-divided regional blocks as the basic search nodes, first performs high-level path planning at the regional block level, and then performs low-level path refinement at the grid cell level within each regional block.

[0056] The detailed description of the specific configuration of the optimal path search module 30 is explained as follows: As mentioned above, it monitors the computational cost in real time. When the computational cost exceeds a preset threshold, it provides feedback on the currently determined optimal partial path. The optimal path search module 30 may further include: an accumulation unit for accumulating the number of CPU clock cycles consumed or the number of expanded nodes for each node expanded in the main search loop; a temporary result output unit for pausing the current search when the accumulated value exceeds a preset time threshold or node number threshold, taking the node with the smallest current generation value from the priority queue as the endpoint of the optimal partial path, and backtracking to generate a path from the starting point to the endpoint of the current optimal partial path as a temporary result output; and a current search state saving unit for simultaneously serializing and saving the current search state, including the priority queue content, the set of expanded nodes, and the cost information of each node, storing it in an idle memory pool for subsequent computation cycle recovery.

[0057] The optimal path search module 30, which uses dead-end depth marking as a penalty term for path search, may further include: a cost correction unit for normalizing the dead-end depth value of each grid cell to the [0,1] interval, multiplying it by a preset penalty coefficient, and adding it to the original passage cost of the corresponding grid cell to obtain a corrected cost. The penalty coefficient is dynamically adjusted according to the unit type. During the search process, the actual cost of each node is accumulated according to the corrected cost of its grid cell, and the heuristic estimate of each node remains unchanged or is added with a penalty cost. An impassable marking unit is used to temporarily mark the corresponding grid cell as impassable when the dead-end depth value exceeds a preset maximum tolerable depth threshold, so that the corresponding grid cell is forcibly bypassed when planning the path.

[0058] The search process dynamically updates the real-time access cost of the grid map, feeding the updated cost back to the cost function of the heuristic search strategy in real time. Through iterative searching, the final optimal path is determined. The optimal path search module 30 may further include: a dynamic event monitoring unit for continuously monitoring dynamic events during the search process, including the appearance or disappearance of dynamic obstacles, changes in unit density within a region block, and the activation or deactivation of time-slice costs; and a cost update unit for locating affected grid cells when dynamic events occur, calculating the new access cost of the affected grid cells, and comparing it with the old cost. If the cost changes, the current search priority queue is traversed to find all nodes containing the affected grid cells, the actual cost and total cost are updated, and the priority queue order is readjusted. The search loop unit is used to continue the search loop after the cost update is completed until the termination condition is met. The termination condition includes: the priority queue is empty, it is determined that there is no feasible path, and failure is returned; the process is expanded to the endpoint node, and a complete path is generated backtracking as the final optimal path. The caching unit is used to store the optimal path and the corresponding start coordinates, endpoint coordinates, and unit type into the LRU cache after obtaining the final optimal path for reuse in subsequent identical or similar requests.

[0059] The heuristic search path planning system for large-scale grid maps provided in this embodiment of the invention can execute the heuristic search path planning method for large-scale grid maps provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0060] Although this application makes various references to certain modules in the system according to the embodiments of this application, any number of different modules can be used and run on user terminals and / or servers. The various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy distinction between each other and are not used to limit the scope of protection of this invention.

[0061] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A heuristic search path planning method for large-scale grid maps, characterized in that, include: Mark connected components and dead-end depths on the grid map; Based on the path planning request containing the start point, end point, and unit attributes, reachability determination is made based on the connectivity component labels of the start point and end point, and a heuristic search strategy is determined based on the determination result. Based on the determined heuristic search strategy, path search is performed with dead end depth marking as a penalty, and the computational cost is monitored in real time. When the computational cost exceeds a preset threshold, the currently determined optimal partial path is fed back. At the same time, the real-time passage cost of the grid map is dynamically updated during the search process, and the updated cost is fed back to the cost function of the heuristic search strategy in real time. Through iterative search, the final optimal path is determined.

2. The heuristic search path planning method for large-scale grid maps according to claim 1, characterized in that, Perform connectivity component labeling and dead end depth labeling on the grid map, including: The grid map is divided into blocks to obtain multiple region blocks; Based on multiple regions, perform a breadth-first search within each region and mark the connected components of each grid cell within the region. Perform a depth-first search within each region block, calculate the number of steps from each grid cell to the nearest dead end, and use this as the dead end depth value to mark the dead end depth.

3. The heuristic search path planning method for large-scale grid maps according to claim 2, characterized in that, Also includes: Traverse the common boundary grid cells of each pair of adjacent regions and record the connectivity between adjacent regions. If both grid cells on both sides of the boundary belong to the passable cells within their respective regions, it is determined that there is a connectivity relationship between the pair of adjacent regions. Record all pairs of adjacent regions with connectivity and establish a connectivity index at the region level.

4. The heuristic search path planning method for large-scale grid maps according to claim 1, characterized in that, Reachability determination is performed based on the connectivity component labels of the start and end points, including: Obtain the connected component labels of the grid cell containing the starting point and the grid cell containing the ending point; Compare the connected component labels of the starting point and the ending point to see if they are equal. If they are equal, it is determined that there is a reachable path between the starting point and the ending point; if they are not equal, it is determined that there is no reachable path between the starting point and the ending point, the current path planning is terminated and the result of no feasible path is returned. When the starting point or ending point is itself an impassable grid cell, it is directly determined as unreachable.

5. The heuristic search path planning method for large-scale grid maps according to claim 1, characterized in that, Based on the judgment results, a heuristic search strategy is determined, including: When the Manhattan distance between the starting point and the ending point is less than the preset first threshold, or when the requested unit type is a hero unit directly controlled by the player, the fine-grained search algorithm is selected as the main search algorithm to obtain better path quality. When the Manhattan distance between the starting point and the ending point is greater than the preset second threshold, and the requested unit type is a non-player character and is outside the player's field of vision, the coarse-grained search algorithm is selected as the main search algorithm to reduce computational overhead. If neither the first nor the second threshold condition is met, the current CPU utilization is obtained. If the utilization is higher than the preset load threshold, the coarse-grained search algorithm is selected; otherwise, the fine-grained search algorithm is selected.

6. The heuristic search path planning method for large-scale grid maps according to claim 5, characterized in that, The fine-grained search algorithm is a heuristic search algorithm that uses a single grid cell as the basic search node and expands node by node within the global grid. The coarse-grained search algorithm is a hierarchical heuristic search algorithm that uses pre-divided regional blocks as the basic search nodes, first performs high-level path planning at the regional block level, and then performs low-level path refinement at the grid cell level within each regional block.

7. The heuristic search path planning method for large-scale grid maps according to claim 1, characterized in that, Real-time monitoring of computational overhead; when computational overhead exceeds a preset threshold, feedback is provided on the currently determined optimal partial path, including: In the main search loop, for each node expanded, the number of CPU clock cycles consumed or the number of nodes expanded is incremented. When the cumulative value exceeds the preset time threshold or node number threshold, the current search is paused, the node with the smallest value in the current generation is taken from the priority queue as the endpoint of the best partial path, and the path from the starting point to the endpoint of the current best partial path is generated as a temporary result output. Meanwhile, the current search state is serialized and saved, including the contents of the priority queue, the expanded set of nodes, and the cost information of each node, and stored in the idle memory pool for recovery in subsequent calculation cycles.

8. The heuristic search path planning method for large-scale grid maps according to claim 1, characterized in that, Path searching is performed with dead-end depth as the penalty, including: The dead end depth value of each grid cell is normalized to the range of [0,1], multiplied by a preset penalty coefficient, and added to the original passage cost of the corresponding grid cell to obtain the corrected cost. The penalty coefficient is dynamically adjusted according to the unit type. When the depth of a dead end exceeds the preset maximum tolerable depth threshold, the corresponding grid cell will be temporarily marked as impassable, forcing the planning of a route to bypass the corresponding grid cell. During the search process, the actual cost of each node is accumulated based on the corrected cost of its grid cell, while the heuristic estimate of each node remains unchanged or is subject to a penalty cost.

9. The heuristic search path planning method for large-scale grid maps according to claim 8, characterized in that, During the search process, the real-time travel cost of the grid map is dynamically updated, and the updated cost is fed back into the cost function of the heuristic search strategy in real time. Through iterative search, the final optimal path is determined, including: During the search process, dynamic events are continuously monitored, including the appearance or disappearance of dynamic obstacles, changes in unit density within a region block, and the activation or deactivation of time slice costs. When a dynamic event occurs, the affected grid cell is located, the new passage cost of the affected grid cell is calculated and compared with the old cost. If the cost changes, the current search priority queue is traversed to find all nodes containing the affected grid cell, the actual cost and the total cost are updated, and the priority queue order is readjusted. After the cost update is completed, the search loop continues until the termination condition is met. The termination condition includes: the priority queue is empty, it is determined that there is no feasible path, and failure is returned; the search is expanded to the endpoint node, and the complete path is backtracked to be the final best path. After obtaining the final optimal path, the optimal path and its corresponding start coordinates, end coordinates, and unit type are stored in the LRU cache for reuse in subsequent identical or similar requests.

10. A heuristic search path planning system for large-scale grid maps, characterized in that, The system is used to implement the heuristic search path planning method for large-scale grid maps as described in any one of claims 1-9, and the system comprises: The map marking module is used to mark connected components and dead-end depths on grid maps. The reachability determination module is used to determine the reachability of a path planning request that includes the start point, end point, and unit attributes, based on the connected component labels of the start point and end point, and to determine a heuristic search strategy based on the determination result. The optimal path search module is used to perform path search with dead end depth marking as a penalty term according to a determined heuristic search strategy, and monitor the computational cost in real time. When the computational cost exceeds a preset threshold, it provides feedback on the currently determined optimal partial path. At the same time, it dynamically updates the real-time passage cost of the grid map during the search process and feeds the updated cost back to the cost function of the heuristic search strategy in real time. Through iterative search, the final optimal path is determined.