[go: up one dir, main page]

CN110975291B - Path extraction method and system - Google Patents

Path extraction method and system Download PDF

Info

Publication number
CN110975291B
CN110975291B CN201911139052.6A CN201911139052A CN110975291B CN 110975291 B CN110975291 B CN 110975291B CN 201911139052 A CN201911139052 A CN 201911139052A CN 110975291 B CN110975291 B CN 110975291B
Authority
CN
China
Prior art keywords
node
path
point
starting
jump
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911139052.6A
Other languages
Chinese (zh)
Other versions
CN110975291A (en
Inventor
彭勇
王鹏
尹全军
秦龙
胡越
焦鹏
鞠儒生
谢旭
许凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN201911139052.6A priority Critical patent/CN110975291B/en
Publication of CN110975291A publication Critical patent/CN110975291A/en
Application granted granted Critical
Publication of CN110975291B publication Critical patent/CN110975291B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C21/00Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
    • G01C21/26Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00 specially adapted for navigation in a road network
    • G01C21/34Route searching; Route guidance
    • G01C21/3407Route searching; Route guidance specially adapted for specific applications
    • G01C21/343Calculating itineraries
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C21/00Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
    • G01C21/26Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00 specially adapted for navigation in a road network
    • G01C21/34Route searching; Route guidance
    • G01C21/3446Details of route searching algorithms, e.g. Dijkstra, A*, arc-flags or using precalculated routes
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Remote Sensing (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Databases & Information Systems (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a path extraction method and a system, wherein the method comprises the following steps: preprocessing the positions of grid points of collapsed jump points in the uniform grid map; acquiring a starting point and an end point; when an optimal composite main sequence path needs to be found between a starting point and a terminal point, generating a starting sub-node in the connecting process; reading the optimal direction and distance from each starting sub-node to the end point based on a compressed mode database in the path extraction process, and fusing the same parts among different paths to obtain a unique path from the start point to the end point through each starting sub-node; and comparing the path distances from the starting point to the end point through all the starting sub-nodes, and obtaining and storing the optimal path between the starting point and the end point. The method and the device are used for solving the problem that in the prior art, the search speed is limited under the condition that information is compressed in the preprocessing process to cause loss, and greatly improving the path planning speed.

Description

一种路径提取方法及系统A path extraction method and system

技术领域Technical field

本发明涉及人工智能路径规划技术领域,具体是一种压缩模式数据库的路径提取方法及系统。The invention relates to the technical field of artificial intelligence path planning, specifically a path extraction method and system for a compressed pattern database.

背景技术Background technique

在人工智能领域,机器人技术和计算机游戏智能被视为建模人类在复杂环境下的感知、规划、决策和行动能力的综合领域。近年来,各类型机器人在生产生活中广泛使用,以及学界与工业界对计算机游戏智能的重视程度逐渐提高,典型的例子包括DeepMind团队开发的StarCraft游戏AI和OpenAI公司开发的Dota游戏AI等。作为机器人和游戏非玩家角色(NPC,Non-Player Characters)各方面技术的基础,基于均匀网格(uniform grids)地图的最短路径规划技术随着GPPC(Grid-based Path Planning Competitions)竞赛的举行和工业界对典型地图测试集的开放,在近十年也取得了显著的进步。作为一个基础服务,在人工智能中经典的启发式搜索问题求解技术、地图空间拓扑结构提取技术领域中,很多场景中有限的计算资源需要同时应答大量智能体的路径规划请求,因此规划技术的快速响应能力最受关注。In the field of artificial intelligence, robotics and computer game intelligence are regarded as comprehensive fields that model human perception, planning, decision-making and action capabilities in complex environments. In recent years, various types of robots have been widely used in production and life, and academia and industry have gradually paid more and more attention to computer game intelligence. Typical examples include the StarCraft game AI developed by the DeepMind team and the Dota game AI developed by OpenAI. As the basis of various technologies for robots and game non-player characters (NPC, Non-Player Characters), the shortest path planning technology based on uniform grids maps has been held with the GPPC (Grid-based Path Planning Competitions) competition and The industry's openness to typical map test sets has also made significant progress in the past decade. As a basic service, in the fields of classic heuristic search problem solving technology and map space topology extraction technology in artificial intelligence, limited computing resources in many scenarios need to respond to path planning requests of a large number of agents at the same time. Therefore, the rapid development of planning technology Responsiveness gets the most attention.

其中最为著名的一类算法称为跳点搜索(JPS,Jump Point Search),主要由澳大利亚莫纳什大学的Daniel Harabor博士提出(Harabor D,Grastien A.Online GraphPruning for Pathfinding on Grid Maps[C]//National Conference on ArtificialIntelligence.2011:1114–1119.Harabor D,Grastien A.Improving Jump Point Search[C]//International Conference on Automated Planning and Scheduling.2014.)。当智能体在网格地图上移动时,JPS在相同起点和终点、相等长度的对称路径中,将对角方向移动优先路径确定为主要偏序(diagonal-first canonical ordering),将不满足该原则的其他所有路径剔除在搜索空间之外。理论证明,任何可通行的两个位置之间都存在至少一条满足该规则的最短路径。如图1所示,被该偏序规则剔除的子节点(灰色所示)通常可以由当前节点的父节点从更短的路径或长度相同但对角移动出现更早的路径到达。通常,这样的剪枝递归使用可以使某一节点的子节点仅剩1个或0个,不仅降低了正在被扩展节点的分支因子,也减小了子节点的分支因子。One of the most famous algorithms is called Jump Point Search (JPS), which was mainly proposed by Dr. Daniel Harabor of Monash University in Australia (Harabor D, Grastien A. Online GraphPruning for Pathfinding on Grid Maps[C]// National Conference on Artificial Intelligence.2011:1114–1119.Harabor D,Grastien A.Improving Jump Point Search[C]//International Conference on Automated Planning and Scheduling.2014.). When the agent moves on the grid map, JPS determines the diagonal movement priority path as the main partial ordering (diagonal-first canonical ordering) in the symmetrical path with the same starting point and end point and equal length, which will not satisfy this principle. All other paths are excluded from the search space. The theory proves that there is at least one shortest path that satisfies this rule between any two accessible locations. As shown in Figure 1, the child nodes eliminated by this partial ordering rule (shown in gray) can usually be reached by the parent node of the current node from a shorter path or a path of the same length but with earlier diagonal movement. Usually, such recursive use of pruning can leave only 1 or 0 child nodes of a node, which not only reduces the branching factor of the node being expanded, but also reduces the branching factor of the child node.

另外,JPS应用A*算法时并不将中间节点加入Open表中,除非遇到图1(c)中需要将前进方向向其他分支扩展的节点时,才将这样的节点加入Open表中以待扩展。中间节点都将被跳过,因此图1(c)中的特殊节点称为“跳点”。In addition, when JPS applies the A* algorithm, it does not add intermediate nodes to the Open table. Unless it encounters a node in Figure 1(c) that needs to extend the forward direction to other branches, such nodes are added to the Open table for later use. Extension. All intermediate nodes will be skipped, so the special nodes in Figure 1(c) are called "jump points".

JPS算法仅需在线处理,不涉及地图预处理,相较单纯的A*算法速度提高了一个数量级。但它的一个主要缺点是扩展节点时需要进行大量的逐行逐列的中间节点扫描和判断。基于此,JPS+在离线阶段为每一可通行节点的每一可通行方向计算和存储与通过该方向可到达的第一个跳点或障碍物的距离。这一预存信息进一步提高了搜索速度。进一步地,JPS+(P)在搜索时采用中转剪枝(intermediate pruning)技术,将对角跳点视为过渡节点不加入Open表进行处理,相比JPS+一定程度降低了Open表操作次数。The JPS algorithm only requires online processing and does not involve map preprocessing. Compared with the simple A* algorithm, the speed is increased by an order of magnitude. But one of its main disadvantages is that when expanding nodes, a large number of row-by-row and column-by-column scanning and judgment of intermediate nodes are required. Based on this, JPS+ calculates and stores the distance to the first jump point or obstacle reachable in that direction for each traversable direction of each traversable node in the offline stage. This pre-stored information further speeds up searches. Furthermore, JPS+(P) uses intermediate pruning technology during search, treating diagonal jump points as transition nodes and not adding them to the Open table for processing. Compared with JPS+, the number of Open table operations is reduced to a certain extent.

通过与压缩模式数据库(CPD,Compressed Pattern Databases)技术的结合,JPS的性能得到了进一步大幅度的提升。CPD技术是用空间换时间的基于预处理的路径规划技术,它在离线阶段通过以每个可通行节点为源发起Dijkstra搜索,为当前节点找到能够以最短路径到达其他所有连通节点的出边(outgoing edge)。若以矩阵M表示这一预处理得到的数据,则M[i,j]表示从第i个节点到达第j个节点的最短路径上源于节点i的第一边。为压缩这一矩阵的存储空间,SRC(Single-Row Compression)算法对其每一行(对应每一个源节点)采用RLE(Run-Length Encoding)方法进行数据压缩,一般可得到300-400的压缩比(Strasser B,Harabor D,Botea A.Fast First-Move Queries through Run-LengthEncoding[C]//the Seventh Annual Symposium on Combinatorial Search.2014(SoCS):157–165.Strasser B,Botea A,Harabor D.Compressing Optimal Paths with RunLength Encoding[J].Journal of Artificial Intelligence Research,2015,54:593–629.)。在线进行路径规划时,SRC则在从起点开始的每一个当前节点向CPD中检索其到达给定目标点的最佳移动,从而迭代得到完整的最短路径。其中的每一次检索都需要在对应行压缩数据中进行二分查找。SRC因为完全不需要进行A*算法的在线搜索,因此成为GPPC-2014比赛最快的算法之一。Through the combination with Compressed Pattern Databases (CPD) technology, the performance of JPS has been further greatly improved. CPD technology is a path planning technology based on preprocessing that trades space for time. In the offline stage, it initiates a Dijkstra search with each accessible node as the source, and finds outgoing edges for the current node that can reach all other connected nodes in the shortest path ( outgoing edge). If the data obtained by this preprocessing is represented by a matrix M, then M[i,j] represents the first edge originating from node i on the shortest path from the i-th node to the j-th node. In order to compress the storage space of this matrix, the SRC (Single-Row Compression) algorithm uses the RLE (Run-Length Encoding) method for data compression on each row (corresponding to each source node). Generally, a compression ratio of 300-400 can be obtained. (Strasser B, Harabor D, Botea A. Fast First-Move Queries through Run-LengthEncoding[C]//the Seventh Annual Symposium on Combinatorial Search.2014(SoCS):157–165.Strasser B, Botea A, Harabor D. Compressing Optimal Paths with RunLength Encoding[J].Journal of Artificial Intelligence Research,2015,54:593–629.). When performing path planning online, SRC searches the CPD for each current node from the starting point to its optimal movement to a given target point, thereby iteratively obtaining the complete shortest path. Each of these searches requires a binary search in the corresponding row of compressed data. SRC has become one of the fastest algorithms in the GPPC-2014 competition because it does not require online search of the A* algorithm at all.

JPS与SRC结合产生了Topping(Two-Oracle Path PlannING)算法,原理是仅在关键节点上(如起点、跳点)上进行CPD的二分查找得到最优方向,而同时访问JPS的距离表得到对应方向可以重复执行的步数,从而免去了在中间节点上多余的二分查询(Salvetti M,Botea A,Gerevini A,et al.Two-Oracle Optimal Path Planning on Grid Maps[C]//International Conference on Automated Planning and Scheduling.2018(Sturtevant2012):227–231.)。因为对JPS距离表的访问是常数级的,Topping算法相较SRC提高了数倍的路径规划效率。需要注意地是,与SRC不同,预处理阶段的Dijkstra搜索采用了与JPS一致的diagonal-first偏序,保证两者结合的最大效益,即能将CPD查询的次数降到最低。这一基于离线预先计算的剪枝技术为JPS+和SRC算法分别提升了一个数量级左右和数倍的性能提升,使其能够在经典测试集下取得微秒级别的搜索速度。然而,这一显著进步的代价则是必须在预处理阶段投入大量的CPU时间和存储空间。The combination of JPS and SRC produces the Topping (Two-Oracle Path Planning) algorithm. The principle is to perform a binary search of CPD only on key nodes (such as starting points and jump points) to obtain the optimal direction, and at the same time access the distance table of JPS to obtain the corresponding The number of steps that can be repeated in the direction, thus eliminating redundant binary queries on intermediate nodes (Salvetti M, Botea A, Gerevini A, et al.Two-Oracle Optimal Path Planning on Grid Maps[C]//International Conference on Automated Planning and Scheduling. 2018(Sturtevant2012):227–231.). Because access to the JPS distance table is constant, the Topping algorithm improves path planning efficiency several times compared to SRC. It should be noted that, unlike SRC, the Dijkstra search in the preprocessing stage uses the diagonal-first partial order consistent with JPS to ensure the maximum benefit of the combination of the two, that is, to minimize the number of CPD queries. This pruning technology based on offline pre-computation improves the performance of the JPS+ and SRC algorithms by about an order of magnitude and several times respectively, enabling it to achieve microsecond-level search speeds under the classic test set. However, this significant improvement comes at the cost of investing a lot of CPU time and storage space in the pre-processing stage.

若要降低这一代价,则仅需对跳点位置进行预处理即可。这一处理将造成算法预处理信息一定程度上的丢失,主要在于若起点是普通节点而非跳点,则算法无法直接检索起点到终点最优路径上的第一步移动方向,因此无法采用迭代检索的方式。然而单纯地按照JPS模式的搜索将使Topping算法的搜索速度受到非常显著的影响。To reduce this cost, only the jump point locations need to be preprocessed. This processing will result in a certain degree of loss of algorithm preprocessing information. The main reason is that if the starting point is an ordinary node rather than a jump point, the algorithm cannot directly retrieve the first step moving direction on the optimal path from the starting point to the end point, so iteration cannot be used. Retrieval method. However, searching simply according to the JPS mode will significantly affect the search speed of the Topping algorithm.

发明内容Contents of the invention

本发明提供一种基于压缩模式数据库剪枝的路径提取方法及系统,用于克服现有技术在预处理过程中信息被压缩导致丢失的情况下搜索速度受限等缺陷,在对起点进行扩展并探索的过程中通过对相同路径进行融合与共享,实现局部探索,从而省去了对相同路径的重复探索和提取,进而实现了相对于现有技术实现搜索速度大幅提升。The present invention provides a path extraction method and system based on compressed mode database pruning, which is used to overcome the shortcomings of the existing technology such as limited search speed when information is lost due to compression during the preprocessing process, and expands the starting point and During the exploration process, local exploration is achieved by merging and sharing the same paths, thereby eliminating the need for repeated exploration and extraction of the same paths, thus achieving a significant increase in search speed compared to existing technologies.

为实现上述目的,本发明提供一种基于压缩模式数据库的路径提取方法,包括:In order to achieve the above objectives, the present invention provides a path extraction method based on a compressed mode database, including:

以均匀网格地图进中塌缩跳点的网格点所在位置进行预处理,生成压缩模式数据库;Preprocess the grid point locations of the collapse jump points in the uniform grid map to generate a compression pattern database;

获取起点和终点位置;Get the starting and ending positions;

在起点与终点之间需要寻找最优复合主序路径时,在连接过程中生成起始子节点;When it is necessary to find the optimal composite main sequence path between the starting point and the end point, the starting child node is generated during the connection process;

在路径提取过程中基于压缩模式数据库读取从每一起始子节点到达终点的最优方向及距离,并提取获得起点经每一起始子节点到达终点的唯一路径;During the path extraction process, the optimal direction and distance from each starting sub-node to the end point are read based on the compression mode database, and the unique path from the starting point to the end point via each starting sub-node is extracted;

对起点经所有起始子节点到达终点的路径中的重叠部分进行融合,避免重复提取,最终通过不同路径间的比较获得起点与终点之间的最优路径并存储。The overlapping parts of the paths from the starting point to the end point via all starting sub-nodes are fused to avoid repeated extraction. Finally, the optimal path between the starting point and the end point is obtained and stored through comparison between different paths.

为实现上述目的,本发明还提供一种基于压缩模式数据库的路径提取系统,包括存储器和处理器,所述存储器存储有基于模式数据库的路径提取程序,在所述处理器运行所述基于模式数据库的路径提取程序时执行所述基于模式数据库的路径提取方法的步骤。In order to achieve the above object, the present invention also provides a path extraction system based on a compressed pattern database, including a memory and a processor. The memory stores a path extraction program based on the pattern database, and the processor runs the path extraction program based on the pattern database. The path extraction program executes the steps of the path extraction method based on the pattern database.

本发明提供的基于压缩模式数据库的路径提取方法及系统,本发明Topping+PEx(Path Extraction)算法充分利用跳点位置上在预处理阶段存下的模式数据库,首先在连接过程中找到起点的子节点,为提高路径提取效率,也可以对起点的子节点(生成起始子节点时)进行剪枝,减小可待探索的节点数量。在此基础上,按照Topping的方式对起点的每一子节点进行路径提取,都可得到一条到达目标点的路径。在此过程中,对不同路径间的相同部分(又称子路subpath)进行融合,从而降低搜索代价,即可得到唯一的一条最短路径。最后通过对起点经不同起始子节点到达终点的路径长度进行比较,选择其中最短的一条即为最优路径。本发明将从充分利用稀疏的预处理数据的角度解决现有技术中搜索速度慢的问题,进行路径规划速度的提升。The present invention provides a path extraction method and system based on a compressed pattern database. The Topping+PEx (Path Extraction) algorithm of the present invention makes full use of the pattern database saved in the preprocessing stage at the jump point position. First, the starting point is found during the connection process. Node, in order to improve the efficiency of path extraction, the child nodes of the starting point (when generating the starting child node) can also be pruned to reduce the number of nodes that can be explored. On this basis, by extracting the path of each sub-node of the starting point according to the Topping method, a path to the target point can be obtained. In this process, the same parts (also called subpaths) between different paths are fused to reduce the search cost and obtain the only shortest path. Finally, by comparing the path lengths from the starting point to the end point via different starting sub-nodes, the shortest one is selected as the optimal path. The present invention will solve the problem of slow search speed in the prior art from the perspective of making full use of sparse preprocessed data and improve the path planning speed.

附图说明Description of the drawings

图1(a)为现有JPS技术中非跳点情景下对角移动时的剪枝示意图;Figure 1(a) is a schematic diagram of pruning during diagonal movement in the non-hop scenario in the existing JPS technology;

图1(b)为现有JPS技术中非跳点情景下轴向移动时的剪枝示意图;Figure 1(b) is a schematic diagram of pruning during axial movement in the non-jump scenario in the existing JPS technology;

图1(c)为现有JPS技术中在跳点位置处的剪枝示意图;Figure 1(c) is a schematic diagram of pruning at the jump point position in the existing JPS technology;

图2(a)为本发明实施例一提供的路径规划方法中轴向跳点的示意图;Figure 2(a) is a schematic diagram of axial jump points in the path planning method provided in Embodiment 1 of the present invention;

图2(b)为本发明实施例一提供的路径规划方法中对角跳点的示意图;Figure 2(b) is a schematic diagram of diagonal jump points in the path planning method provided in Embodiment 1 of the present invention;

图3为实施例一中主序路径分类示意图;Figure 3 is a schematic diagram of main sequence path classification in Embodiment 1;

图4为实施例一中CBD进行路径规划的主要算法流程图;Figure 4 is a flow chart of the main algorithm for CBD path planning in Embodiment 1;

图5为实施例一中Topping+PEx进行路径提取的主要流程;Figure 5 shows the main process of path extraction by Topping+PEx in Embodiment 1;

图6为实施例一中对相同路径进行检测的流程图;Figure 6 is a flow chart for detecting the same path in Embodiment 1;

图7为实施例一中连接过程生成起始子节点时的剪枝示例图;Figure 7 is an example diagram of pruning when the connection process generates a starting child node in Embodiment 1;

图8为实施例一中一种场景下路径提取过程的示例图;Figure 8 is an example diagram of the path extraction process in a scenario in Embodiment 1;

图9为实施例一中另一种场景下路径提取过程的示例图。Figure 9 is an example diagram of the path extraction process in another scenario in Embodiment 1.

具体实施方式Detailed ways

下面将结合本发明实施例,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts fall within the scope of protection of the present invention.

另外,本发明各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本发明要求的保护范围之内。In addition, the technical solutions between the various embodiments of the present invention can be combined with each other, but it must be based on what a person of ordinary skill in the art can implement. When the combination of technical solutions is contradictory or cannot be realized, it should be considered that such a combination of technical solutions is possible. It does not exist and is not within the protection scope required by the present invention.

实施例一Embodiment 1

如图1所示,本发明实施例提供一种基于压缩模式数据库的路径提取方法,包括:As shown in Figure 1, an embodiment of the present invention provides a path extraction method based on a compressed mode database, including:

S1以均匀网格地图进中塌缩跳点的网格点所在位置进行预处理,生成压缩模式数据库;S1 preprocesses the grid point locations of the collapse jump points in the uniform grid map to generate a compression mode database;

跳点包括轴向跳点和对角跳点,定义如下:Jump points include axial jump points and diagonal jump points, which are defined as follows:

轴向跳点为:均匀网格地图中障碍物对角方向的可通行点;至少能在水平方向和垂直方向上移动;一个轴向跳点(straight jump point)可视为一个三元组其中包含一个网格位置n和两个轴向的移动方向。它们满足:(1)/>和/>是两个可通行的移动;(2)/>(3)/>不可通行。The axial jump point is: a passable point in the diagonal direction of the obstacle in the uniform grid map; it can move at least in the horizontal and vertical directions; an axial jump point (straight jump point) can be regarded as a triplet It contains a grid position n and two axial movement directions. They satisfy: (1)/> and/> are two passable moves; (2)/> (3)/> Impassable.

直观来说,定义1中的网格位置n即为障碍物的拐角,而方向称为该跳点的父方向,为搜索的来向。以图2(a)为例,由实心圆和箭头分别表示位置和来向,图中标出了所有的轴向跳点和对应的父方向,可以看到符合条件的n一般附着有两个以上的轴向跳点。另外,将/>和/>称为该跳点的主序扩展方向。Intuitively, the grid position n in definition 1 is the corner of the obstacle, and the direction It is called the parent direction of the jump point and is the direction from which the search is coming. Take Figure 2(a) as an example. The solid circle and arrow represent the position and direction respectively. All axial jump points and corresponding parent directions are marked in the figure. It can be seen that n that meets the conditions generally has more than two attached axial jump point. Also, add/> and/> It is called the main sequence expansion direction of this jump point.

一个对角跳点(diagonal jump point)可表示为一个二元组其中包含一个网格位置n和一个对角方向/>位置n由来自/>方向的移动到达,并可经过/>或/>到达某一以/>或/>为父方向的轴向跳点,或到达目标点。A diagonal jump point can be represented as a tuple It contains a grid position n and a diagonal direction/> Position n is determined by from/> direction of movement to reach and pass/> or/> Arrive at a certain location/> or/> It is the axial jump point in the parent direction, or reaches the target point.

图2(b)展示了对角跳点与轴向跳点的位置关系。空心圆圈和灰色箭头分别表示位置和来向,需要注意,同一轴向跳点可同时被多个对角跳点到达,甚至同一位置可能同时使到达某一轴向跳点的不同对角跳点的位置,如(D1/D2/D3,SW/SE)。Figure 2(b) shows the positional relationship between the diagonal jump point and the axial jump point. The hollow circle and gray arrow represent the position and direction respectively. It should be noted that the same axial jump point can be reached by multiple diagonal jump points at the same time, and even the same position may be reached by different diagonal jump points reaching a certain axial jump point at the same time. position, such as (D1/D2/D3,SW/SE).

这里塌缩跳点的网格点的含义指的是:位于同一网格点位置至少具有来自于两个方向的父节点,该两个方向来自于:上、下、左、右、右上、右下、左上、左下中任意两个,这里的跳点可以是轴向跳点,也可以是对角跳点,也可以同时即是轴向跳点也是对角跳点;如果同一网格点塌缩多方向跳点,则仅就该位置搜索计算一次,不做重复计算;The meaning of the grid point of the collapsed jump point here refers to: the same grid point position has at least parent nodes from two directions, the two directions come from: up, down, left, right, right up, right Any two of the bottom, upper left, and lower left, the jump point here can be an axial jump point, a diagonal jump point, or both an axial jump point and a diagonal jump point at the same time; if the same grid point collapses If the multi-directional jump point is reduced, the position will only be searched and calculated once, without repeated calculations;

如上所述,轴向跳点的位置可简单地根据其与障碍物的相对位置关系通过对所有格点的一次扫描而全部快速识别。然而,我们并不需要将所有的对角跳点都识别出来并对其进行包围盒计算。这里,对两类对角跳点进行区分。As mentioned above, the position of the axial jump point can be quickly identified by scanning all grid points simply based on its relative position to the obstacle. However, we do not need to identify all diagonal jump points and perform bounding box calculations on them. Here, a distinction is made between two types of diagonal jump points.

一个有源对角跳点(active diagonal jump point)是具有一个轴向跳点作为其父节点,其中/>是该轴向跳点的对角主序扩展方向,n可以有s经过无障碍的/>移动到达。不满足该条件的其余位置为无源对角跳点。举例来说,图2(b)中的(F5,SE)因为有(D3,E,S)作为父节点,为一个有源对角跳点,可以通过向东运动到达另一轴向跳点(I5,E,N)。而(E5,SE)则为无源对角跳点。An active diagonal jump point (active diagonal jump point) has an axial jump point As its parent node, where/> is the diagonal main sequence expansion direction of the axial jump point, n can have s passing through the barrier-free /> Mobile arrived. The remaining locations that do not meet this condition are passive diagonal jump points. For example, (F5, SE) in Figure 2(b) has (D3, E, S) as a parent node and is an active diagonal jump point. It can reach another axial jump point by moving eastward. (I5,E,N). And (E5,SE) is the passive diagonal jump point.

所有符合diagonal-first规则的路径可以归为两类,如图3所示。第一类,我们称其为简单主序路径(Simple Canonical Paths),它们不涉及在跳点位置的搜索方向转换,这里的转换是某一轴向跳点处由其父方向转换到其中一个主序扩展方向,如图中<s1,t1>所示,寻路时可以通过一次深度优先搜索判断。第二类称为复合主序路径(CompoundCanonical Paths),可表示为<s,(ds),s1,(d1)x1,s2,(d2)x2,s3,…,sn,(dt),t>,如图中<s2,t2>所示。这类路径可划分为三个部分:(1)起始部分:从起点s到第一个轴向跳点s1,其中可能包含一个无源对角跳点ds;(2)中间部分:从第一个轴向跳点s1到最后一个轴向跳点sn,相邻两个之间有xi个有源对角跳点;(3)结尾部分:从sn到终点t,可能包含一个无源跳点。All paths that comply with the diagonal-first rule can be classified into two categories, as shown in Figure 3. The first category, which we call Simple Canonical Paths, does not involve search direction conversion at the jump point. The conversion here is from its parent direction to one of the canonical paths at an axial jump point. The sequence expansion direction, as shown in <s1,t1> in the figure, can be determined by a depth-first search during pathfinding. The second type is called Compound Canonical Paths, which can be expressed as <s,(d s ),s 1 ,(d 1 ) x1 ,s 2 ,(d 2 ) x2 ,s 3 ,…,s n ,(d t ),t>, as shown in the figure <s 2 ,t 2 >. This type of path can be divided into three parts: (1) The starting part: from the starting point s to the first axial jump point s 1 , which may include a passive diagonal jump point d s ; (2) The middle part: From the first axial jump point s 1 to the last axial jump point s n , there are x i active diagonal jump points between two adjacent ones; (3) Ending part: from s n to the end point t, May contain a passive hop.

需要说明的是,有些网格点既附着有轴向跳点,同时也有对角跳点;It should be noted that some grid points have both axial and diagonal jump points attached;

获取轴向跳点和对角跳点的方法可以根据上面的定义由程序来实现,具体方法不限。在本发明一实施例中,例如:通过识别障碍物的拐点来获取轴向跳点,即通过识别与障碍物的位置关系获得;对角跳点可通过识别与轴向跳点的位置关系获得;The method of obtaining the axial jump point and the diagonal jump point can be implemented by a program according to the above definition, and the specific method is not limited. In one embodiment of the present invention, for example, the axial jump point is obtained by identifying the inflection point of the obstacle, that is, by identifying the positional relationship with the obstacle; the diagonal jump point can be obtained by identifying the positional relationship with the axial jump point. ;

预处理搜索算法可以是压缩模式数据库搜索算法进行预处理;The preprocessing search algorithm can be a compressed mode database search algorithm for preprocessing;

S2获取起点和终点位置;S2 obtains the starting and ending positions;

在本发明一实施例中,智能机器人所在网格点位置或智能游戏中可移动对象所在网格点位置形成这里的起点,由操作者或玩家输入的指定网格点位置形成终点。In one embodiment of the present invention, the grid point position where the intelligent robot is located or the grid point position where the movable object in the smart game is located forms the starting point here, and the specified grid point position input by the operator or player forms the end point.

S3在起点与终点之间需要寻找最优复合主序路径时,在连接过程中生成起始子节点;这里的起始子节点的含义指的是从起点出发符合对角优先原则的轴向跳点;在生成起始子节点的过程中可能同时存在不止一个轴向上节点满足起始子节点要求,上述轴向子节点均可作为起始子节点;为了减少不必要的路径规划,提升路径规划速度,在生成起始子节点时进行了剪枝:When S3 needs to find the optimal composite main sequence path between the starting point and the end point, it generates a starting sub-node during the connection process; the meaning of the starting sub-node here refers to the axial jump from the starting point that complies with the diagonal priority principle. point; in the process of generating the starting sub-node, there may be more than one axial node that meets the starting sub-node requirements, and the above-mentioned axial sub-nodes can be used as the starting sub-node; in order to reduce unnecessary path planning, improve the path Planning speed, pruning is performed when generating the starting child node:

根据压缩模式数据库存储的数据与起始子节点的主序扩展方向进行匹配对起始子节点进行筛选,仅在有可能到达终点位置的局部路径上生成起始子节点;对于不可能到达终点位置的路径进行剪枝。The starting child nodes are filtered according to the main sequence expansion direction of the data stored in the compression mode database and the starting child node, and the starting child node is only generated on the local path that is likely to reach the end position; for the impossible to reach the end position The path is pruned.

S4在路径提取过程中基于压缩模式数据库读取从每一起始子节点到达终点的最优方向及距离,并对不同路径间的相同部分进行融合,获得起点经每一起始子节点到达终点的唯一路径;During the path extraction process, S4 reads the optimal direction and distance from each starting sub-node to the end point based on the compression mode database, and fuses the same parts between different paths to obtain the unique path from the starting point to the end point via each starting sub-node. path;

这里的不同路径指的是:从不同起始子节点到终点之间存在多条路径;例如从不同的起始子节点开始探索最优路径,假如在某一子节点相遇,则相遇的节点之后的路径(从相遇子节点到达终点的路径)相同,则仅在第一个探索到该相遇子节点的起始子节点的路径中记录,后面对于其他起始子节点在该相遇子节点到终点的路径不再重复探索;通过相同路径的融合与共享,减少探索空间和时间,提升路径规划速度。The different paths here refer to: there are multiple paths from different starting sub-nodes to the end point; for example, starting from different starting sub-nodes to explore the optimal path, if they meet at a certain sub-node, then the node after the meeting The path (the path from the encounter child node to the end point) is the same, then only the first path explored to the starting child node of the encounter child node is recorded, and later other starting child nodes are recorded from the encounter child node to the end point. Paths are no longer explored repeatedly; through the integration and sharing of the same paths, exploration space and time are reduced, and path planning speed is improved.

S5对起点经所有起始子节点到达终点的路径距离进行比较,获得起点与终点之间的最优路径并存储。S5 compares the path distance from the starting point to the end point via all starting sub-nodes, obtains and stores the optimal path between the starting point and the end point.

通过距离比较能够获得哪条路径为最优路径。计算距离的方式可采用坐标差或跳跃距离表等方式。Through distance comparison, we can determine which path is the optimal path. The distance can be calculated using methods such as coordinate difference or jump distance table.

优选地,所述S1以均匀网格地图中塌缩跳点的网格位置进行预处理的步骤包括:Preferably, the step of preprocessing S1 with the grid position of the collapse jump point in the uniform grid map includes:

S01,对均匀网格地图进行结构分析,根据可通行点与障碍点的位置关系识别出所有轴向跳点;为均匀网格地图上所有可通行节点的所有可通行方向计算跳跃距离表,并记载与该方向上下一跳点或与障碍物的距离;S01, perform structural analysis on the uniform grid map, identify all axial jump points based on the positional relationship between passable points and obstacle points; calculate jump distance tables for all passable directions of all passable nodes on the uniform grid map, and Record the distance to the next jump point or obstacle in that direction;

S02,根据所述轴向跳点在对角方向上的利用跳跃距离表识别出所有对角跳点;S02, identify all diagonal jump points according to the jump distance table of the axial jump point in the diagonal direction;

S03,以每个跳点塌缩位置为源节点进行面向全地图的Dijkstra搜索,获取其对于所有可达节点的最优起始边;将上述对所有可达节点的最优起始边存储生成压缩模式数据库。这里的最优起始边的含义为起点到达某一确定终点的最优方向,对于任意终点位置,最优方向可能是唯一,也可能存在两个或三个等价方向。S03, use the collapsed position of each hop as the source node to conduct a Dijkstra search for the entire map to obtain the optimal starting edge for all reachable nodes; store and generate the optimal starting edge for all reachable nodes. Compressed mode database. The meaning of the optimal starting edge here is the optimal direction from the starting point to a certain end point. For any end point position, the optimal direction may be unique, or there may be two or three equivalent directions.

塌缩位置指的是附着有至少两个方向轴向跳点和/或对角跳点的网格点。这里的起始边的意思指的是起始方向,八邻域网格中的八个方向作为起始方向的选择。A collapsed position is a grid point that has at least two axial jump points and/or diagonal jump points attached to it. The starting edge here refers to the starting direction, and the eight directions in the eight-neighbor grid are used as the starting direction selection.

优选地,所述S3在连接过程中生成起始子节点的步骤包括:Preferably, the step of S3 generating a starting child node during the connection process includes:

S30在连接过程中生成起始子节点时,通过读取压缩模式数据库对不可能达到终点的路径进行剪枝。When S30 generates the starting child node during the connection process, it prunes the path that is impossible to reach the end point by reading the compression mode database.

所述S30在连接过程中生成起始子节点时通过读取压缩模式数据库对不可能达到终点的路径进行剪枝的步骤包括:The step of S30 to prune the path that is impossible to reach the end point by reading the compression mode database when generating the starting child node during the connection process includes:

S301,根据跳跃距离表获得起点所有符合对角优先原则的轴向跳点子节点;S301: Obtain all axial jump point child nodes of the starting point that comply with the diagonal priority principle according to the jump distance table;

S302,在所述轴向跳点子节点的所有主序扩展方向与压缩模式数据库中存储的该节点的最优方向不存在交集时,删除该合法轴向跳点子节点;S302: When all main sequence expansion directions of the axial jump sub-node do not intersect with the optimal direction of the node stored in the compression mode database, delete the legal axial jump sub-node;

S303,遍历所有所述轴向跳点子节点,获得所有剪枝后的起始子节点。S303: Traverse all the axial jump sub-nodes and obtain all pruned starting sub-nodes.

虽然稀疏的预处理意味着很难从起点就开始利用压缩模式数据库进行剪枝,从而减少起点的子节点数量,但是当所有合法子节点找到之后,由于它们都是轴向跳点,可利用它们已有的模式数据库信息进行延后的剪枝。算法流程如图4的Algorithm 1所示。Although sparse preprocessing means that it is difficult to use the compressed mode database to prune from the starting point to reduce the number of child nodes at the starting point, once all legal child nodes are found, since they are all axial jump points, they can be used Existing schema database information undergoes deferred pruning. The algorithm flow is shown in Algorithm 1 in Figure 4.

算法输入为起点s、终点t和跳跃距离表T,符号表示节点n在方向/>上的距离值。算法遍历所有八个方向,通过距离值快速获得所有可能的子节点(第3、13行),其中对角方向需要一个迭代的过程(第9行)。对于这些没有通过起点的模式数据库进行剪枝的节点,可以一定程度通过自身的模式数据库和主序扩展方向进行剪枝(第4-6、14-16行)。若节点的所有主序方向的集合与CPD检索出的最优方向集合没有交集,则可安全地将其剔除搜素空间而不加入待探索列表中;反之,应考虑该节点。经过这一剪枝过程,能够留下的子节点一般只有1-2个,极大地减轻了搜索负担,从而与信息完备的Topping更为接近。The inputs to the algorithm are the starting point s, the end point t and the jump distance table T, with symbols Indicates that node n is in the direction /> distance value on. The algorithm traverses all eight directions and quickly obtains all possible child nodes through distance values (lines 3 and 13), of which the diagonal direction requires an iterative process (line 9). For these nodes that are not pruned through the schema database of the starting point, they can be pruned to a certain extent through their own schema database and main sequence expansion direction (lines 4-6, 14-16). If the set of all main order directions of a node does not intersect with the set of optimal directions retrieved by CPD, it can be safely removed from the search space and not added to the list to be explored; otherwise, the node should be considered. After this pruning process, only 1-2 child nodes can be left, which greatly reduces the search burden and is closer to Topping with complete information.

优选地,所述S4在搜索过程中基于压缩模式数据库读取从每一起始子节点到达终点的最优方向及距离,并对不同路径间的相同部分进行融合,获得起点经每一起始子节点到达终点的唯一路径的步骤中:Preferably, the S4 reads the optimal direction and distance from each starting sub-node to the end point based on the compression mode database during the search process, and fuses the same parts between different paths to obtain the starting point through each starting sub-node. Among the steps of the only path to the end:

S41在所述起始子节点的所有主序扩展方向与压缩模式数据库中存储的该节点的最优方向存在交集时;S41 When all main sequence expansion directions of the starting child node intersect with the optimal direction of the node stored in the compression mode database;

S42从所述节点的跳跃距离表中读取该最优方向上到达下一子节点移动的距离;S42 reads the distance moved in the optimal direction to the next child node from the jump distance table of the node;

S43在当前子节点未被探索过时;更新下一步节点并返回上一步骤S42,直到到达终点;S43: When the current child node has not been explored; update the next node and return to the previous step S42 until the end is reached;

S44提取获得起点经所述起始子节点到达终点的唯一路径;S44 extracts and obtains the unique path from the starting point to the end point via the starting sub-node;

S45重复所有起始子节点的路径探索,提取起点经每一起始子节点到达终点的唯一路径。S45 repeats the path exploration of all starting sub-nodes, and extracts the unique path from the starting point to the end point via each starting sub-node.

参见图5的Algorithm 2,给出了Topping+PEx进行路径提取的主要流程。它以算法1得到的起点的少数子节点集合和预处理得到的稀疏模式数据库为输入,首先对节点的数据结构进行初始化:包括设置所有节点的父节点和子节点为空,设置一个布尔型标志位表示该节点尚未被探索过(第1行)。然后设置一个全局布尔型标志位,标识是否有路径已经找到。算法遍历所有起点子节点,任一分支能够到达目标点,标志位pathFound都被置为真(第13-14行)。在每一个分支的提取中,当前节点到达目标的最优方向都被从CPD中检索得到(第6行),若不为空,则按照Topping的模式生成子节点(第7-9行)。为了防止相同的subpath被反复探索、浪费算法运行时间,需要对其进行检测(第10行)。Refer to Algorithm 2 in Figure 5, which shows the main process of path extraction using Topping+PEx. It takes the starting point set of a small number of child nodes obtained in Algorithm 1 and the sparse pattern database obtained by preprocessing as input. It first initializes the data structure of the node: including setting the parent node and child node of all nodes to empty, and setting a Boolean flag bit. Indicates that the node has not been explored yet (line 1). Then set a global Boolean flag to indicate whether a path has been found. The algorithm traverses all starting point sub-nodes. If any branch can reach the target point, the flag pathFound is set to true (lines 13-14). In the extraction of each branch, the optimal direction of the current node to reach the target is retrieved from the CPD (line 6). If it is not empty, child nodes are generated according to the Topping mode (lines 7-9). In order to prevent the same subpath from being repeatedly explored and wasting algorithm running time, it needs to be detected (line 10).

优选地,所述S42从所述跳跃距离表中读取该最优方向上到达下一子节点移动的距离的步骤之后还包括;Preferably, the step of S42 reading the distance to move to the next child node in the optimal direction from the jump distance table further includes;

S421在当前子节点被探索过时,比较当前到达当前子节点路径与已探索的路径;S421 When the current child node is explored, compare the current path to the current child node with the explored path;

S422a在已探索的路径优于当前到达当前子节点路径时,停止该分支方向探索;并记录起点到当前节点路径。S422a When the explored path is better than the current path to the current child node, stop exploring the branch direction; and record the path from the starting point to the current node.

优选地,所述S421在当前子节点被探索过时,比较当前到达当前节点路径与已探索的路径的步骤之后还包括:Preferably, when the current child node is explored, S421 further includes: after the step of comparing the current path to the current node with the explored path:

S422b在当前到达当前子节点优于已探索路径时,修改前驱关系并记录当前节点与起点距离;S422b When reaching the current child node is better than the explored path, modify the predecessor relationship and record the distance between the current node and the starting point;

这里的前驱关系指的是将已探索路径中到达当前子节点的父节点修改为当前到达当前子节点的父节点,或者说将当前探索路径中到达当前子节点的父节点付给已探索路径中到达当前子节点的父节点,即修改当前子节点的前驱关系;The predecessor relationship here refers to changing the parent node that reaches the current child node in the explored path to the parent node that currently reaches the current child node, or that the parent node that reaches the current child node in the current exploration path is paid to the parent node in the explored path. Reaching the parent node of the current child node, that is, modifying the predecessor relationship of the current child node;

S423并将上述信息向后续节点传播;S423 and propagate the above information to subsequent nodes;

S424a在后续节点往后的路径未被探索时,当前分支方向返回S42,并继续提取,直到达到终点。In S424a, when the subsequent path of the subsequent node has not been explored, the current branch direction returns to S42 and continues extraction until the end point is reached.

S424b在后续节点为终点或直接到达终点时,结束程序。S424b ends the program when the subsequent node is the end point or reaches the end point directly.

参见图6,该检测过程在Algorithm 3中给出,它用来判断当前分支的提取是否应当继续进行,以防后续路径已在其他分支中被探索过或将以更小的路径代价被探索。这一信息被记录在标识变量subpathMeet中。如果当前子节点c还未被其他分支探索过,算法将其更新为下一步的节点并返回(第1-5行)。反之,若当前到达该节点的路径不优于已探索到的路径,则当前分支可以停止(第7-10行)。如果当前路径更优,则需改写相关前驱关系和f-值(第12-13行,记录当前子节点到起点的距离)。算法还将把该信息向后续节点传播(第26-27行),直到出现以下三种情况:(1)从后续某一节点往后的路径尚未被探索,则需当前分支返回继续提取(第19-20行);(2)后续某一节点曾被另一分支以更小代价路径探索过,则应停止传播并停止当前分支的提取(第22-25行);(3)到达目标点(第28行)。总之,Algorithm3运行结束后若subpathMeet为真,Algorithm 2则应停止当前分支的路径提取;否则应当继续。Referring to Figure 6, this detection process is given in Algorithm 3, which is used to determine whether the extraction of the current branch should continue, in case the subsequent path has been explored in other branches or will be explored at a smaller path cost. This information is recorded in the identification variable subpathMeet. If the current child node c has not been explored by other branches, the algorithm updates it to the next node and returns (lines 1-5). On the contrary, if the current path to the node is not better than the path that has been explored, the current branch can be stopped (lines 7-10). If the current path is better, the relevant predecessor relationship and f-value need to be rewritten (lines 12-13, record the distance from the current child node to the starting point). The algorithm will also propagate this information to subsequent nodes (lines 26-27) until the following three situations occur: (1) The path from a subsequent node has not yet been explored, and the current branch needs to return to continue extraction (line 26-27). Lines 19-20); (2) If a subsequent node has been explored by another branch with a smaller cost path, the propagation should be stopped and the extraction of the current branch should be stopped (Lines 22-25); (3) The target point is reached (Line 28). In short, if subpathMeet is true after Algorithm3 runs, Algorithm 2 should stop path extraction of the current branch; otherwise, it should continue.

图7给出了一个本发明实施连接过程剪枝的示例。起点和终点分别为F2和J1。通过对有效距离值(加粗表示)的提取,快速找到了所有未经剪枝的子节点B0、F5和H5。图中将它们各自的主序扩展方向和CPD中存储的最优方向分别用灰色和黑色的短箭头标出。可以看到,仅H5向右边的主序扩展方向与最优方向重合,因此B0和F5都被剔除,仅向Open表中加入一个节点,即H5。Figure 7 shows an example of the present invention implementing connection process pruning. The starting point and end point are F2 and J1 respectively. By extracting the effective distance values (shown in bold), all unpruned child nodes B0, F5 and H5 are quickly found. In the figure, their respective main sequence expansion directions and the optimal directions stored in the CPD are marked with gray and black short arrows respectively. It can be seen that only the main sequence expansion direction of H5 to the right coincides with the optimal direction, so both B0 and F5 are eliminated, and only one node, H5, is added to the Open table.

图8给出了当前子节点均未被探索过(路径中不存在相同部分子路径)的场景下一个路径提取过程的示例,其中起点和终点分别为A0和A5。通过连接过程,生成了唯一的起点子节点B0。对该分支进行提取时,首先读取到从B0到达目标点的最佳方向是右下,再读取距离表可知该方向的运动可执行2步到达对角跳点D2。此时,读取从D2到达目标点的最优方向为向下,步数为3步。以此类推,则可提取出唯一一条路径。Figure 8 shows an example of the path extraction process in a scenario where none of the current child nodes have been explored (the same partial sub-path does not exist in the path), where the starting point and end point are A0 and A5 respectively. Through the connection process, the unique starting point child node B0 is generated. When extracting this branch, first read that the best direction to reach the target point from B0 is the lower right, and then read the distance table to know that the movement in this direction can take 2 steps to reach the diagonal jump point D2. At this time, the optimal direction to read from D2 to the target point is downward, and the number of steps is 3. By analogy, only one path can be extracted.

图9给出了出发于两个不同起始子节点的路径在某一子节点相遇(路径中存在相同部分即相遇子节点到终点之间的子路径)的场景下一个路径提取过程的示例,两条路径分别对应两个起始子节点s1和s1’。若先对s1’代表的分支进行提取时,探索s1分支时将在s2处发现该节点已被探索过。对比发现,s1分支到达s2的代价更小,因此将s2的父节点从s1’更新为s1,并将代价向后传播直到终点。中间没有再发现未经探索的节点。Figure 9 shows an example of the path extraction process in the scenario where paths starting from two different starting sub-nodes meet at a certain sub-node (the same part exists in the path, that is, the sub-path between the meeting sub-node and the end point). The two paths correspond to the two starting child nodes s 1 and s 1 ' respectively. If the branch represented by s 1 ' is extracted first, when exploring the branch s 1 , it will be found that the node has been explored at s 2 . The comparison shows that the cost of branch s 1 reaching s 2 is smaller, so the parent node of s 2 is updated from s 1 ' to s 1 , and the cost is propagated backward until the end point. No unexplored nodes are found in between.

如前所述,一般网格地图中两类跳点塌缩位置的数量远小于所有可通行节点的总量。因此本发明将大大地节省所需的预处理时间和空间。这里以取自https://movingai.com的通用测试集为地图,其基本信息如表1所示。其中既包含典型的游戏地图,也有人工合成的房间和迷宫。每张地图中还包含大量的路径规划测试问题。As mentioned before, the number of two types of jump point collapse locations in a general grid map is much smaller than the total number of all accessible nodes. Therefore, the present invention will greatly save the required preprocessing time and space. Here, the general test set taken from https://movingai.com is used as the map, and its basic information is shown in Table 1. It contains both typical game maps and synthetic rooms and mazes. There are also a number of path planning test questions included with each map.

实验结果如表2所示。其中,SRC和Topping为原算法,Topping+PEx为本发明。我们另外加入了Topping+WSSP和Topping+的变形,第一个没有采用起始子节点剪枝,且采用了A*搜索进行寻路而非路径提取;第二个采用了起始子节点剪枝但仍没有采用路径提取。展示该变形的实验结果可以清楚地看到本发明的两个技术分别对搜索速度起到的提升的作用。结果表明,在预处理信息相对稀疏的情况下,通过本发明提出的起点子节点剪枝和部分扩展技术,Topping+PEx算法的搜索速度相较SRC提升了数倍,与Topping已相当接近,基本在一个数量级上。同时,通过与Topping+WSSP和Topping+两个变形的比较,可以看出起始子节点剪枝和路径提取方式的采用对路径搜索效率的提高有明显的帮助。前者帮助减少待探索的分支数量,后者减少了对Open表的频繁重排序的操作。The experimental results are shown in Table 2. Among them, SRC and Topping are the original algorithms, and Topping+PEx is the present invention. We also added variations of Topping+WSSP and Topping+. The first one does not use starting child node pruning, and uses A* search for path finding instead of path extraction; the second one uses starting child node pruning but Still no path extraction is used. From the experimental results showing this deformation, it can be clearly seen that the two technologies of the present invention respectively improve the search speed. The results show that when the preprocessing information is relatively sparse, through the starting point sub-node pruning and partial expansion technology proposed by the present invention, the search speed of the Topping+PEx algorithm is improved several times compared with SRC, and is quite close to Topping. Basically On an order of magnitude. At the same time, through comparison with the two deformations of Topping+WSSP and Topping+, it can be seen that the adoption of starting sub-node pruning and path extraction methods significantly helps improve the path search efficiency. The former helps reduce the number of branches to be explored, and the latter reduces the frequent reordering of the Open table.

表1实验所用地图Table 1 Maps used in experiments

表2路径搜索结果对比。指标为平均搜索时间,单位为微秒。Table 2 Comparison of path search results. The metric is average search time in microseconds.

StarCraftStarCraft DAODAO BGBG WarcraftWarcraft RoomsRooms MazesMazes SRCSRC 42.042.0 16.516.5 15.815.8 22.422.4 37.337.3 52.152.1 ToppingTopping 16.216.2 5.85.8 5.05.0 6.06.0 15.515.5 44.944.9 Topping+WSSPTopping+WSSP 25.525.5 10.710.7 5.15.1 7.77.7 15.215.2 73.173.1 Topping+Topping+ 19.519.5 9.29.2 4.54.5 6.66.6 14.914.9 72.972.9 Topping+PExTopping+PEx 18.018.0 6.76.7 3.93.9 6.66.6 12.012.0 49.649.6

实施例二Embodiment 2

在实施例一的基础上,本发明实施例提供一种基于模式数据库的路径提取系统,包括存储器和处理器,所述存储器存储有基于模式数据库的路径提取程序,在所述处理器运行所述基于模式数据库的路径提取程序时执行上述任意实施例方法的步骤。On the basis of Embodiment 1, this embodiment of the present invention provides a path extraction system based on a pattern database, including a memory and a processor. The memory stores a path extraction program based on the pattern database. When the processor runs the The steps of the method in any of the above embodiments are executed when the path extraction program is based on the pattern database.

以上所述仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是在本发明的发明构思下,利用本发明说明书及附图内容所作的等效结构变换,或直接/间接运用在其他相关的技术领域均包括在本发明的专利保护范围内。The above are only preferred embodiments of the present invention, and do not limit the patent scope of the present invention. Under the inventive concept of the present invention, equivalent structural transformations can be made using the contents of the description and drawings of the present invention, or direct/indirect applications. Other related technical fields are included in the patent protection scope of the present invention.

Claims (7)

1. A path extraction method, comprising:
preprocessing the positions of grid points of collapsed jump points in the uniform grid map to generate a compressed mode database;
acquiring a starting point and an end point;
when an optimal composite main sequence path needs to be found between a starting point and a terminal point, generating a starting sub-node in the connecting process;
reading the optimal direction and distance from each starting sub-node to the end point based on a compressed mode database in the path extraction process, and fusing the same parts among different paths to obtain a unique path from the start point to the end point through each starting sub-node;
comparing the path distances from the starting point to the end point through all the starting sub-nodes, obtaining and storing the optimal path between the starting point and the end point;
the step of preprocessing the grid positions of the collapsed jump points in the uniform grid map comprises the following steps:
carrying out structural analysis on the uniform grid map, and identifying all axial jump points according to the position relation between the passable nodes and the barrier points;
calculating a jump distance table for all passable directions of all passable nodes on the uniform grid map, and recording the distance between the jump point and the next jump point or between the jump point and an obstacle in the direction;
identifying all diagonal jumping points by utilizing a jumping distance table in the diagonal direction according to the axial jumping points;
taking each jump point collapse position as a source node to perform Dijkstra search facing the full map, and acquiring the optimal initial edges, namely the optimal directions, of all reachable nodes; storing the optimal directions of all the reachable nodes to generate a compression mode database;
the step of reading the optimal direction and distance from each starting sub-node to the end point based on the compressed mode database in the path extraction process, and fusing the same parts among different paths to obtain a unique path from the starting point to the end point through each starting sub-node:
when the intersection exists between all main sequence expansion directions of the initial sub-node and the optimal direction of the node stored in the compressed mode database;
reading the distance of the next sub-node in the optimal direction from the jump distance table of the node;
when the current child node is not explored; updating the next node and returning to the previous step until reaching the end point;
extracting to obtain a unique path from the starting point to the end point through the starting sub-node;
and repeating the path exploration of all the initiator nodes, and extracting the unique path from the starting point to the end point through each initiator node.
2. The path extraction method of claim 1, wherein the step of generating the initiator node during the connection process comprises:
and when the initiator node is generated in the connection process, pruning paths which cannot reach the end point by reading the compressed mode database.
3. The path extraction method as claimed in claim 2, wherein the step of pruning paths unlikely to reach the end point by reading the compressed mode database when generating the initiator node in the connection process comprises:
obtaining all axial jump point child nodes of the starting point according with the diagonal priority principle according to the jump distance table;
deleting the axial jump point sub-node when the intersection does not exist between all main sequence expansion directions of the axial jump point sub-node and the optimal direction of the node stored in the compressed mode database;
and traversing all the axial jump point sub-nodes to obtain an initial sub-node.
4. The path extraction method as claimed in claim 1, further comprising, after the step of reading the distance moved in the optimal direction to reach the next child node from the jump distance table;
comparing the path reaching the current child node with the explored path when the current child node is explored;
stopping the optimal direction exploration when the explored path is better than the path reaching the current child node currently; and records the path from the start point to the current node.
5. The path extraction method of claim 4, wherein the step of comparing the current arrival current node path with the explored path when the current child node is explored further comprises:
when the current node reaches the child node and is better than the explored path, modifying the precursor relation and recording the distance between the current node and the starting point;
and the modified precursor relation and the distance between the current node and the starting point are transmitted to the subsequent nodes;
and when the subsequent path of the subsequent node is not explored, returning the current branch direction to the step of reading the moving distance reaching the next child node in the optimal direction from the jump distance table of the node, and continuing to extract until reaching the end point.
6. The path extraction method as claimed in claim 5, wherein said step of propagating said modified precursor relationship and a current node distance from a start point to a subsequent node further comprises:
and when the subsequent node is the end point, ending the extraction of the current branch.
7. A path extraction system comprising a memory and a processor, the memory storing a pattern database based path extraction program, the processor executing the steps of the method of any one of claims 1 to 6 when running the pattern database based path extraction program.
CN201911139052.6A 2019-11-20 2019-11-20 Path extraction method and system Active CN110975291B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911139052.6A CN110975291B (en) 2019-11-20 2019-11-20 Path extraction method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911139052.6A CN110975291B (en) 2019-11-20 2019-11-20 Path extraction method and system

Publications (2)

Publication Number Publication Date
CN110975291A CN110975291A (en) 2020-04-10
CN110975291B true CN110975291B (en) 2023-11-10

Family

ID=70085099

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911139052.6A Active CN110975291B (en) 2019-11-20 2019-11-20 Path extraction method and system

Country Status (1)

Country Link
CN (1) CN110975291B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112088349B (en) 2020-07-31 2024-10-29 深圳信息职业技术学院 Target tracking method, device, terminal equipment and storage medium
JP7036269B1 (en) * 2021-08-17 2022-03-15 三菱電機株式会社 Route creation device, route management system, route creation program and route creation method
CN113848897B (en) * 2021-09-17 2023-12-12 宁波大学 Method, system and related products for path planning for unmanned surface vessels
CN116429138A (en) * 2023-03-29 2023-07-14 重庆长安汽车股份有限公司 Path planning method, device, vehicle and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101493329A (en) * 2008-01-23 2009-07-29 华东师范大学 Multiple target point path planning method and device
CN105630984A (en) * 2015-12-25 2016-06-01 中国民航信息网络股份有限公司 Freight rate searching system
CN105955280A (en) * 2016-07-19 2016-09-21 Tcl集团股份有限公司 Mobile robot path planning and obstacle avoidance method and system
CN106651987A (en) * 2016-10-10 2017-05-10 腾讯科技(深圳)有限公司 Path planning method and device
CN109115226A (en) * 2018-09-01 2019-01-01 哈尔滨工程大学 The paths planning method of multirobot conflict avoidance based on jump point search
CN110006430A (en) * 2019-03-26 2019-07-12 智慧航海(青岛)科技有限公司 A kind of optimization method of Path Planning

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8155391B1 (en) * 2006-05-02 2012-04-10 Geoeye Solutions, Inc. Semi-automatic extraction of linear features from image data
CA2707246C (en) * 2009-07-07 2015-12-29 Certusview Technologies, Llc Automatic assessment of a productivity and/or a competence of a locate technician with respect to a locate and marking operation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101493329A (en) * 2008-01-23 2009-07-29 华东师范大学 Multiple target point path planning method and device
CN105630984A (en) * 2015-12-25 2016-06-01 中国民航信息网络股份有限公司 Freight rate searching system
CN105955280A (en) * 2016-07-19 2016-09-21 Tcl集团股份有限公司 Mobile robot path planning and obstacle avoidance method and system
CN106651987A (en) * 2016-10-10 2017-05-10 腾讯科技(深圳)有限公司 Path planning method and device
CN109115226A (en) * 2018-09-01 2019-01-01 哈尔滨工程大学 The paths planning method of multirobot conflict avoidance based on jump point search
CN110006430A (en) * 2019-03-26 2019-07-12 智慧航海(青岛)科技有限公司 A kind of optimization method of Path Planning

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Yue Hu 等."Improving the Combination of JPS and Geometric Containers".Proceedings of the International Conference on Automated Planning and Scheduling.2019,第29卷第209-213 页. *

Also Published As

Publication number Publication date
CN110975291A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
CN110975291B (en) Path extraction method and system
CN110975290B (en) Method and system for path planning based on pattern database
CN110967015B (en) Path planning method and system
CN113485369B (en) Improved A* algorithm for indoor mobile robot path planning and path optimization
US20170219353A1 (en) Method and system for determining a path of an object for moving from a starting state to an end state set avoiding one or more obstacles
CN110095122A (en) A kind of method for planning path for mobile robot based on improvement ant group algorithm
CN111104471B (en) Mode database information compression method and system based on jumping point path search
CN114721370B (en) A fast optimal path planning method for robots based on dual heuristic functions
US9910878B2 (en) Methods for processing within-distance queries
Armstrong et al. AM-RRT*: Informed sampling-based planning with assisting metric
US11461656B2 (en) Genetic programming for partial layers of a deep learning model
CN116203975A (en) Robot path planning method
CN117270534A (en) Multi-robot path planning method based on improved conflict search method
CN113188555A (en) Mobile robot path planning method
CN110975288B (en) Geometric container data compression method and system based on jump point path search
CN118999584B (en) Unmanned plane path planning method and device, computer equipment and storage medium
CN111829526B (en) Distance map reconstruction and jumping point path planning method based on anti-collision radius
CN112965500B (en) Path planning method and device with must-pass point set and additional hard constraints
CN118278670A (en) Multi-robot scheduling method and system based on incremental search
CN118544343A (en) A task planning method, device, medium and product for a multi-robot system
CN115016461B (en) Robot path planning method based on IA-Star algorithm of dynamic end point strategy
CN116449826A (en) Path planning method for mobile robot based on path smoothing and bidirectional jump point search
CN117091598A (en) Improved A-algorithm and device for mixed heuristic function
CN116560360A (en) Method and system for planning real-time dynamic path of medical care robot facing complex dynamic scene
CN116429114B (en) An improved path planning search algorithm based on grid map

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant