Tunnel inspection robot path cache eviction and topology incremental planning method and system
Patent Information
- Application Number
- CN202611433002.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-16
- Publication Date
- 2026-10-30
AI Technical Summary
现有方法未能充分利用这一结构化先验知识,而是在细化层直接执行“平层搜索”,无法从拓扑层面识别哪些隧道段已被缓存覆盖、哪些属于尚未探索区域,导致缓存复用率长期维持在较低水平,大量重复的路径搜索耗费了不必要的计算资源
(1)本发明通过提取隧道拓扑结构构建两级图,并结合曲率自适应步长扩展策略,在隧道直段采用大步长减少细化节点数量,在弯段采用小步长保证路径精度,在保证弯段路径精度的同时有效降低了直段的计算冗余和存储开销。
Smart Images

Figure CN123007785A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of tunnel construction automation and robot navigation technology, and in particular to a method and system for path caching and topology incremental planning of a tunnel inspection robot. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] Currently, with A Graph search methods, represented by algorithms, have been widely used in the field of mobile robot path planning. However, for scenarios involving continuous access to multiple targets in tunnels, existing methods still have the following technical shortcomings: First, while existing caching mechanisms introduce path cache pools to store path segments for reuse, these pools only follow a "store first, use later" cumulative storage principle without a corresponding eviction mechanism. As inspection tasks continue to execute, the cache pool expands rapidly, and retrieval time increases linearly. Meanwhile, a large number of low-value path segments occupy storage resources for extended periods but are rarely reused, creating a performance paradox of "the more cached, the slower the retrieval," which severely weakens the actual benefits of caching mechanisms in medium- to long-term tasks.
[0004] Furthermore, existing path reuse strategies typically require the path to be reused and the cached path to satisfy an exact match or prefix match in the node sequence of the refinement layer, meaning a strict head-to-tail containment relationship exists between the queried path and the cached path. However, tunnel networks themselves possess a naturally hierarchical topology composed of branch nodes and tunnel segments, a structure that is known a priori and stable over the long term. Existing methods fail to fully utilize this structured prior knowledge, instead performing a "flat-layer search" directly at the refinement layer. This fails to identify, at the topological level, which tunnel segments are already cached and which belong to unexplored areas, resulting in a persistently low cache reuse rate and a large amount of redundant path searches consuming unnecessary computational resources.
[0005] Meanwhile, different path segments vary significantly in length, planning computation cost, and future reuse potential. However, existing solutions treat all cached paths equally, failing to identify high-value paths for priority retention or to proactively eliminate low-value paths. This results in limited cache resources not being optimally allocated. Furthermore, the tunnel environment undergoes local changes due to construction progress and equipment relocation, rendering some historically planned paths invalid. These outdated paths cannot be automatically identified and eliminated, further reducing the utilization efficiency of the cache pool.
[0006] The common root cause of the above problems is that existing methods treat path caching as passive, cumulative storage, lacking a mechanism for proactively optimizing and managing cached content from a global benefit perspective. Summary of the Invention
[0007] To address the shortcomings of existing technologies, this invention provides a method and system for path cache eviction and topology incremental planning for tunnel inspection robots. It extracts the tunnel topology to generate a two-level graph structure containing a topology layer and a refinement layer, providing a structured foundation for path segmentation identification. By establishing a reuse value scoring model weighted by reuse frequency, length weight, and time-degradation factor, and eviction of low-value path segments when the cache pool exceeds its limits, dynamic optimization of cache resources is achieved. When inserting a new target point, it searches for combined paths in the topology layer based on the two-level graph structure, prioritizing the splicing of existing cache segments in the cache pool, performing path searches only on uncovered segments, and storing the newly generated path segments in the cache pool. This continuously improves the path planning response speed while controlling the cache size.
[0008] On the one hand, a method for path cache eviction and topology incremental planning for tunnel inspection robots is provided, including: Obtain a tunnel map, extract the tunnel topology, and generate a two-level graph structure with intersections as nodes and tunnel segments as edges; the two-level graph structure includes a topology layer and a refinement layer. A path cache pool is pre-built, which stores planned path segments in key-value pairs. The key is a pair of path start and end nodes, and the value is the sequence of path nodes from the start to the end. The reuse value score of each path segment in the path cache pool is calculated. The reuse value score is obtained by weighting the reuse frequency, length weight and time decay factor of the path segment. When the storage size of the path cache pool exceeds a preset threshold, the path segment with the lowest reuse value score is discarded. When a new target point is inserted, a combined path from the current position to the new target point is searched in the topology layer according to the two-level graph structure. The combined path is formed by splicing together the existing cached segments in the path cache pool. Path search is only performed on segments that are not covered by the cache, and the newly generated path segments are stored in the path cache pool. The robot moves according to the combined path.
[0009] Furthermore, the topology layer uses intersections as nodes and tunnel segments as edges, storing information on tunnel segment length, average curvature, and width. The refinement layer adaptively generates refinement nodes between the nodes of the topology layer based on the degree of tunnel curvature, resulting in a mesh graph for path search. The adaptive generation includes: determining the generation step size of the refinement nodes based on the curvature of the tunnel segment; using a large step size when the curvature is less than a first threshold, using a small step size when the curvature is greater than a second threshold, and using an intermediate step size when the curvature is between the first and second thresholds.
[0010] Furthermore, the formula for calculating the reuse value score is as follows: ; in, The reuse frequency of the path segment (u, v) is... The weight is the path segment length. This is the time-degradation factor.
[0011] Furthermore, the multiplexing frequency Record the number of times a path segment is successfully reused, and increment this value after each reuse. The length weight It is positively correlated with the path segment length, and the calculation formula is: ; in, Let (u, v) be the length of the path segment. β is the maximum length of all path segments in the cache pool, and β is the length weighting coefficient. The time-degradation factor The calculation formula is: ; in, The unused duration of path segment (u, v) since the current time. This is the attenuation rate coefficient.
[0012] Furthermore, when the storage size of the path cache pool exceeds a preset threshold, the path segment with the lowest score is eliminated based on the reuse value score of each path segment until the storage size of the path cache pool drops below the preset threshold.
[0013] Furthermore, the step of searching for a combined path from the current location to the new target point at the topology layer specifically includes: Determine the tunnel section where the current location is located and the corresponding current intersection; determine the tunnel section where the new target point is located and the corresponding target intersection. If the current location and the target point are located in the same tunnel segment, then the path search is performed directly in the refinement layer of that tunnel segment to generate a combined path from the current location to the target point; If the current location and the target point are located in different tunnel segments, then the shortest topological path from the current intersection to the target intersection is searched in the topology layer. The shortest topological path consists of several topological edges, which are tunnel segments between adjacent intersections. For each topological edge, query the path cache pool to see if there is a cached path segment that covers the topological edge; if there is, directly reuse the path node sequence of the cached path segment; if there is not, perform path search in the refinement layer corresponding to the topological edge and store the newly generated path segment in the path cache pool. Following the order of the topological edges in the shortest topological path, the path segments corresponding to each topological edge are sequentially concatenated; then, the path segments from the current position to the current intersection and from the target intersection to the target point are sequentially concatenated to obtain the complete combined path from the current position to the new target point.
[0014] Furthermore, the path search is A search.
[0015] On the other hand, a tunnel inspection robot path cache eviction and topology incremental planning system is also provided, including: The map processing module is configured to: acquire a tunnel map, extract the tunnel topology, and generate a two-level graph structure with intersections as nodes and tunnel segments as edges; the two-level graph structure includes a topology layer and a refinement layer. The cache management module is configured to: pre-build a path cache pool, which stores planned path segments in key-value pairs, where the key is a pair of path start and end nodes, and the value is a sequence of path nodes from the start to the end; calculate the reuse value score of each path segment in the path cache pool, which is obtained by weighting the reuse frequency, length weight, and time decay factor of the path segment; and discard the path segment with the lowest reuse value score when the storage size of the path cache pool exceeds a preset threshold. The incremental planning module is configured to: when a new target point is inserted, search for a combined path from the current position to the new target point in the topology layer according to the two-level graph structure. The combined path is formed by splicing together existing cached segments in the path cache pool. Path search is only performed on segments not covered by the cache, and the newly generated path segments are stored in the path cache pool. The motion control module is configured to control the robot's movement according to the combined path.
[0016] In another aspect, a computer device is also provided, including a computer-readable storage medium, a processor, and a computer program stored on the computer-readable storage medium and executable on the processor, wherein when the processor executes the program, it performs the method described in the first aspect.
[0017] In another aspect, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, performs the method described in the first aspect.
[0018] The above technical solution has the following advantages or beneficial effects: (1) This invention constructs a two-level graph by extracting the tunnel topology and combines it with a curvature adaptive step size expansion strategy. In the straight section of the tunnel, a large step size is used to reduce the number of refined nodes, and in the curved section, a small step size is used to ensure path accuracy. While ensuring the path accuracy of the curved section, the computational redundancy and storage overhead of the straight section are effectively reduced.
[0019] (2) This invention establishes a path reuse value scoring model weighted by three dimensions: reuse frequency, length weight, and time decay factor. This model realizes the quantitative representation and dynamic ranking of cache path value, upgrading cache management from "passive accumulation" to "active optimization". Based on this, a dynamic elimination strategy is introduced. When the cache pool exceeds its limit, low-value paths are automatically eliminated, while high-frequency backbone paths are retained. This ensures that the cache pool always stores the most valuable path information, effectively avoiding the problem of decreased retrieval efficiency caused by the continuous expansion of the cache size.
[0020] (3) This invention utilizes the two-level topology structure of tunnel junctions and tunnel sections to propose a topology-aware incremental planning method. It expands path reuse from the single mode of precise matching or prefix matching of refinement layer nodes in existing technologies to segmented splicing reuse at the topology layer. When inserting a new target point, the topology layer identifies cached path segments and path segments to be searched, prioritizing the splicing of existing cached segments in the cache pool. Path search is only performed on uncovered segments, significantly reducing the computational load of redundant planning and significantly improving the cache hit rate and utilization efficiency.
[0021] (4) This invention maximizes cache reuse benefits while controlling the size of the cache pool. Theoretical analysis shows that, compared with traditional non-eviction caching schemes, this invention can maintain a high cache hit rate and low retrieval overhead in multi-target continuous inspection scenarios, significantly reducing planning time. Moreover, the advantages become more obvious as the task scale increases, effectively improving the working efficiency and system scalability of tunnel inspection robots. Attached Figure Description
[0022] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0023] Figure 1 This is a flowchart illustrating the method described in Embodiment 1 of the present invention; Figure 2 It is the two-level graph structure described in Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the path caching reuse mechanism described in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of the computer device structure described in Embodiment 3 of the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings. Those skilled in the art should understand that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0025] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0026] Example 1 The tunnel's interior is long and narrow, featuring diverse terrain characteristics such as straight sections, curved sections, intersections, and slope changes, creating a unique environment with both static and dynamic obstacles. In a multi-target continuous inspection scenario, the robot must sequentially visit multiple target locations, including ventilation equipment monitoring points, gas concentration monitoring points, support structure inspection points, lighting equipment inspection points, and drainage facility inspection points, with significant overlap between adjacent path segments. In this scenario, the computational efficiency of path planning directly determines the completion time of the inspection task and the robot's energy consumption.
[0027] Currently, graph search-based A In multi-target continuous access, the algorithm plans and executes independently for each step, making it difficult to reuse planned path segments. When new tasks are dynamically inserted, a complete replanning is required, resulting in insufficient real-time response capabilities. Furthermore, existing methods lack a value assessment mechanism for cached paths, failing to effectively distinguish between high-value and low-value paths, leading to low cache resource utilization. Specifically, cache value assessment involves multiple interdependent dimensions such as path reuse frequency, path length, and environmental timeliness. Establishing a unified quantitative assessment model and implementing dynamic elimination accordingly, while simultaneously improving cache reuse rates without relying on exact matching, remains a long-standing but unresolved technical challenge in this field.
[0028] To address the aforementioned issues, this embodiment provides a method for path cache eviction and topology incremental planning for tunnel inspection robots. This method constructs a two-level graph model by extracting the tunnel topology, establishes a path cache pool based on this model, and introduces three core mechanisms: reuse value assessment, dynamic eviction, and topology incremental planning. This achieves controllable cache pool size, effective retention of high-value paths, and topology-guided path splicing, thereby solving the problems of decreased retrieval efficiency due to cache expansion and low reuse rate due to lack of topology guidance in existing technologies.
[0029] Figure 1 This is an overall flowchart of the method according to Embodiment 1 of the present invention. The method includes the following steps: S1: Obtain the tunnel map, extract the tunnel topology, and generate a two-level graph structure with intersections as nodes and tunnel segments as edges; the two-level graph structure includes a topology layer and a refinement layer.
[0030] S2: Pre-build a path cache pool. The path cache pool stores planned path segments in key-value pairs. The key is the path start and end node pair, and the value is the path node sequence from the start to the end.
[0031] S3: Calculate the reuse value score of each path segment in the path cache pool. The reuse value score is calculated by weighting the reuse frequency, length weight and time decay factor of the path segment.
[0032] S4: If the cache pool does not exceed the threshold, proceed directly to S5; if the storage size of the path cache pool exceeds the preset threshold, eliminate the path segment with the lowest reuse value score and return to step S3 to recalculate the score.
[0033] S5: Check if a new target point has been inserted. If no new target point has been inserted, continue to execute the current planned path and return to step S3. If a new target point has been inserted, search for a combined path from the current position to the new target point in the topology layer according to the two-level graph structure. The combined path is formed by splicing together the existing cached segments in the path cache pool. Only perform path search on segments not covered by the cache and store the newly generated path segments in the path cache pool. After the execution is completed, proceed to step S6.
[0034] S6: Control the robot's movement based on the combined path.
[0035] The following is a detailed explanation of each step.
[0036] In step S1, the tunnel map is obtained, the tunnel topology is extracted, and a two-level graph structure containing intersection nodes and tunnel segment nodes is generated.
[0037] S1.1, a 3D laser scanner mounted on the robot body is used to acquire point cloud data of the tunnel environment. This 3D laser scanner has a horizontal field of view of 360°, a vertical field of view of 30°, a scanning frequency of 10Hz, and acquires approximately 300,000 points of 3D coordinate data per frame. The laser scanner calculates the distance from the scanner to the surface of the object being measured by emitting a laser beam and measuring the reflection time. Let the laser emission time be... The time when the reflected signal is received is If the speed of light is c, then the distance d from the scanner to the measured point satisfies: ; By combining the horizontal rotation angle θ and vertical rotation angle φ recorded by the angle encoder inside the scanner, the three-dimensional coordinates of the measured point in the scanner's local coordinate system can be calculated. Specifically: ; ; ; The above calculations are performed on each measured point acquired by the scanner. The three-dimensional coordinate data of all measured points constitute a point cloud, which serves as the raw data input for subsequent map construction.
[0038] S1.2, after obtaining the point cloud data, it is projected onto a two-dimensional plane to generate a two-dimensional map of the tunnel. Since the construction robot moves on the tunnel floor, its mobility is mainly limited by the distribution of obstacles in the horizontal direction (x is the tunnel length direction, y is the tunnel width direction). Obstacles along the height direction (z-axis) can be projected and compressed based on whether they are within the robot's travel height range. Let the robot height be... In this embodiment, For any point (x, y, z) in the point cloud, its projected passability flag is defined as follows: If z [0, Then the projection of that point is the obstacle point, if z [0, If the value is 0, then that point is ignored.
[0039] Specifically, the tunnel is divided along the x and y directions according to resolution. Discretize, =0.1 meters. Assuming the tunnel length L = 500 meters and width W = 20 meters, the discretized mesh size is... , For each grid cell (i, j), i = 1, ..., N x j=1,...,N y Its corresponding actual location is =(i δ j δ The existence of all projection points within the grid cell is counted. If at least one projection point exists, F(i,j)=0 indicates an obstacle; otherwise, F(i,j)=1 indicates passage. All F(i,j) values are saved as grayscale images, where F=0 corresponds to black pixels and F=1 corresponds to white pixels, thus obtaining a two-dimensional grayscale map of the tunnel.
[0040] S1.3 After the two-dimensional map is generated, the two-dimensional grayscale map of the tunnel is binarized.
[0041] Let the pixel values of the grayscale image be I(x, y), ranging from 0 to 255. Set the grayscale threshold. In this embodiment, For any pixel (x, y), define a binarized passable flag. for: when hour, , indicating passage is permitted (white); when hour, , indicates an obstacle (black).
[0042] Binarization converts a grayscale image into a black-and-white binary image. In the binarized image, white areas represent areas accessible to the robot, while black areas represent areas occupied by tunnel walls or obstacles.
[0043] S1.4 After binarization, morphological closing operations are further performed on the binarized image to eliminate noise and holes.
[0044] Morphological closing is defined as dilation followed by erosion. The dilation operation slides a structuring element B across the image; if foreground pixels exist within the area covered by the structuring element, the corresponding position in the output image is considered foreground. The erosion operation slides the structuring element B across the image; only when all pixels within the area covered by the structuring element are foreground pixels is the corresponding position in the output image considered foreground. In this embodiment, the structuring element B is a 3×3 square kernel. The dilation operation fills in small holes in the foreground region, and the erosion operation removes isolated noise and restores areas over-dilated by the dilation operation. After the closing operation, a clean, binarized tunnel pass-through map is obtained.
[0045] S1.5 Extract the skeleton from the binarized access map.
[0046] After obtaining a clean, binarized tunnel passability map, the Zhang-Suen thinning algorithm is used to iteratively remove boundary pixels that meet specific conditions until a skeleton with a single pixel width is obtained. Each pixel in the binarized image is set to either 1 or 0. 1 represents the foreground, passable; 0 represents the background, an obstacle. Pixels are defined... 8 neighborhoods lie in Directly above, with For the center pixel, from Starting in a clockwise direction, the sequence is as follows: (superior), (Top right) (right), (bottom right) (Down), (bottom left) (Left), (Top left).
[0047] Define function A( )for to The sequence of pixel values changing from 0 to 1 the number of times. Define a function. for to The number of mid-foreground pixels, i.e. .
[0048] Each iteration consists of two sub-loops. In the first sub-loop, pixels that satisfy all of the following conditions are deleted. : (1) Between 2 and 6; (2) ; (3) ; (4) .
[0049] In the second sub-loop, delete pixels that satisfy all of the following conditions. : (1) B Between 2 and 6; (2) ; (3) ; (4) .
[0050] Repeat the two sub-loops above until no pixels can be deleted. This results in a tunnel centerline skeleton with a width of one pixel. Each pixel in this skeleton represents a point on the tunnel centerline.
[0051] S1.6 After obtaining the skeleton, identify the intersection nodes from the skeleton.
[0052] For any pixel p on the skeleton, define the number of skeleton pixels in its 8-neighborhood as N8(p). If N8(p) > 2, then pixel p is a branching node. Let all branching nodes be denoted as a set. The skeleton line segment between adjacent intersection nodes is defined as a tunnel segment. For any two adjacent intersection nodes... and The tunnel section between them is denoted as Record each tunnel segment. length Mean curvature and width .
[0053] length It is calculated by multiplying the number of skeleton pixels by the pixel resolution δ, that is: = count( )×δ; Among them, count( )for The number of pixels on the skeleton.
[0054] Mean curvature Calculations are performed by fitting the centerline curve of the tunnel section. Let the tunnel section... The sequence of centerline points is The least squares method was used to fit the quadratic curve. That is, minimizing the error function: ; After solving for the coefficients a, b, and c, the curvature for: ; Mean curvature for: ; width The average width of the cross-section perpendicular to the centerline within the tunnel section is obtained by measuring the cross-section width. For each point on the centerline... Calculate the normal direction of the centerline at that point, search for the nearest black pixels on the left and right sides in the binarized map along the normal direction, and record the sum of the distances on both sides as the tunnel width at that point. Then, average the widths of all centerline points to obtain the tunnel width. .
[0055] In this embodiment, three intersection nodes are extracted and labeled as follows: , , The four tunnel sections are marked as S1 (from the entrance to J1), S2 (…), and S3 (…). to S3 to S4 (To export). Calculated: Tunnel width All are between 3.5 meters and 4 meters.
[0056] S1.7 Construct a two-level graph structure, including a topology layer and a refinement layer. The topology layer uses intersection nodes as vertices and tunnel segments as edges to construct the graph structure. ,in, For the set of intersection nodes, It is a set of tunnel segment edges, where each edge stores the length, average curvature, and width information of the corresponding tunnel segment. Entrance, Exit , There is a tunnel section connection The length of each topological edge (u, v) is stored. Mean curvature ,width Information. In this embodiment, = {entry point, , , ,exit}, Includes edge (entry point, ) corresponds to S1, edge ( , ) corresponds to S2, edge ( , ) corresponds to S3, edge ( (Export) corresponds to S4.
[0057] The refinement layer adaptively generates refinement nodes between topology nodes based on the tunnel curvature. A first threshold for curvature is defined. = 0.05 and the second threshold = 0.10. For tunnel segment S, its average curvature is Refine the node generation step size for: when hour, = (Straight section, using a large step length of 2.0 meters); when hour, = (For gentle curves, use a 1.0 meter intermediate step). when hour, = (For curved sections, use small step lengths of 0.5 meters).
[0058] For tunnel segment S, its starting coordinates and endpoint coordinates Given that, along the centerline of the tunnel section with step length Sampling is performed to generate refined nodes. Each refined node n stores its global coordinates. and passable signs All refined nodes constitute the refined layer graph structure. The refined nodes are connected in the order of sampling, and the edge weight between adjacent refined nodes is the Euclidean distance between the two points.
[0059] In this embodiment, S1 is a straight segment. ,use With a large step size, the distribution of refined nodes is sparse, generating approximately 75 refined nodes; S2 is a curved segment. ,use With a small step size, the refined nodes are densely distributed, generating approximately 160 refined nodes; S3 is a straight segment. ,use With a large step size, the distribution of refined nodes is sparse, generating approximately 25 refined nodes; S4 is a straight segment. ,use With a large step size, the distribution of refined nodes is sparse, generating approximately 110 refined nodes. The total number of refined nodes is 370. Figure 2 This is a schematic diagram of the two-level graph structure proposed in this invention. The upper part of the diagram is the topology layer, and the lower part is the refinement layer (partial magnification of segment S2), showing the curved segment ( When 1=0.15) and a small step size Δs=0.5m is used, the node distribution is dense and the straight segment ( 1=0.02) The correspondence of sparse node distribution when using a large step size Δs=2.0m, and the lengths of each tunnel segment in the topology layer (S1=150m, S2=80m, S3=50m, S4=220m) and intersection nodes ( , , () mark.
[0060] Step S2: Pre-build and maintain a path cache pool to store planned path segments in key-value pairs.
[0061] The path cache pool stores planned path segments in key-value pairs, where the key is the path start and end node pair (u, v), where u is the path start and v is the path end. u and v can be refinement layer nodes or branching nodes; the value is the sequence of path nodes from u to v. ,in , .
[0062] The cache pool is initially empty and grows dynamically during the path planning process. When a new path from u to v is generated by path search, it is stored in the cache pool with (u, v) as the key and the path node sequence as the value. The length of this path segment is also recorded. Deposit time Number of times of reuse (Initially 0) and the most recent reuse time (Initial storage time). In this embodiment, path search uses A. Algorithm implementation.
[0063] The cache pool's storage structure is implemented using a hash table, indexed by keys, supporting precise lookups with O(1) time complexity. For prefix matching and subpath matching, the cache pool needs to be traversed to compare the inclusion relationships of the path node sequences. To improve the efficiency of prefix / subpath matching, an auxiliary index structure can be established, such as a secondary index using the start and end points of the path as keys.
[0064] Step S3: For each path segment in the path cache pool, calculate its reuse value score.
[0065] For each path segment (u, v) in the cache pool, its reuse value score R(u, v) is calculated from the following three dimensions: (1) Frequency of reuse Define the reuse frequency. This represents the cumulative number of times the path segment has been successfully reused. During each path planning iteration, if the path segment (u, v) is successfully retrieved and reused from the cache pool, then... Increment by 1. The higher the reuse frequency, the more frequently the path segment is used, and the greater its retention value. The introduction of reuse frequency allows frequently used backbone paths to be identified and retained long-term. In actual inspection tasks, the straight sections of the main tunnel are usually reused at high frequency, sometimes dozens or even hundreds of times.
[0066] (2) Length weight The longer the path segment, the greater the computational cost of replanning, and the higher its reuse value. In A... In the algorithm, the computational complexity of path search is positively correlated with the size of the search space. Searching long path segments typically requires expanding more nodes and consumes more computation time. Therefore, reusing long path segments can bring greater computational benefits. (Length weight) It is positively correlated with the path segment length, and the calculation formula is: ; in, Let (u, v) be the length of the path segment (u, v), which is the cumulative Euclidean distance of the path node sequence. This represents the maximum length of all path segments in the cache pool. For length weighting coefficients, this embodiment takes... =1.0. Length weight The range of values for is [1, 1+]. ],Right now When taking 1.0 Longer path segments receive higher value scores. The value can be adjusted according to the actual application scenario. The value range is [0.5, 2.0]. The upper limit is [1.5, 3.0]; if you want to prioritize keeping long paths, you can set β to a larger value; if you want to balance long and short paths, you can set β to a smaller value.
[0067] (3) Time decay factor The tunnel environment is not entirely static; factors such as construction progress, equipment movement, and temporary storage can all cause environmental changes. A route planned six months ago may no longer be feasible due to the addition of temporary facilities within the tunnel. Therefore, a time-degradation factor is introduced, causing the value of a cached route to decrease exponentially with increasing unused time, approaching zero. This ensures that outdated routes are naturally downgraded in the scoring and are prioritized for elimination when the cache pool exceeds its limit. Time-degradation factor The calculation formula is: ; in, Let be the unused duration of path segment (u, v) from the current time (i.e., the current time minus the most recent reuse time), and η be the attenuation rate coefficient, with a value range of [0.001, 0.1]. In this embodiment, we take η = 0.001. =0.01 (in minutes). When =0 =1, path value does not decay; as unused time increases... Exponential decay approaches zero. The value of η controls the decay rate; the larger η is, the faster the decay. For frequently changing environments, a larger η value can be used to make outdated paths fail quickly; for relatively stable environments, a smaller η value can be used.
[0068] Combining three dimensions, path segments Reuse value score The calculation formula is: ; A higher reuse value score indicates that the path segment is more worthy of retention; a lower score indicates that the path segment has less reuse value and should be prioritized for elimination. This scoring model has a clear physical meaning: the value of a path is positively correlated with its frequency of use, its length, and its timeliness.
[0069] In this embodiment, the scoring calculation process for three path segments is given as an example.
[0070] Assume there are three path segments in the cache pool, with the following parameters: Path segment A (straight section of the main tunnel, 150 meters long): reuse frequency f=10 times, most recent reuse time 1 minute ago, length weight. Time decay Value rating .
[0071] Path segment B (branch road segment, length 50 meters): reuse frequency f=2 times, most recent reuse time 30 minutes from now, length weight. Time decay Value rating .
[0072] Path segment C (curved section, length 80 meters): reuse frequency f=1 time, most recent reuse time 60 minutes from now, length weight. Time decay Value rating .
[0073] As can be seen from the above calculation results, path segment A received the highest value score due to its high reuse frequency, good timeliness, and long length; path segment C received the lowest value score due to its low reuse frequency and long period of non-use, and should be prioritized for elimination.
[0074] Step S4: When the storage size of the path cache pool exceeds the preset threshold, the path segment with the lowest reuse value score is eliminated.
[0075] After calculating the reuse value score for each path segment in step S3, this step dynamically cleans up the cache pool based on the score results to control the cache pool size from exceeding a preset upper limit. (Cache pool preset threshold) In this embodiment, 200 path segments are selected (the threshold value ranges from [50, 500]). Before the start of each planning cycle, the current number of path segments in the cache pool is checked. .like If no eviction process is performed, the current cache pool state is maintained, and the process proceeds directly to step S5; If so, a dynamic elimination strategy will be activated.
[0076] The specific process of the dynamic eviction strategy is as follows: Sort all path segments in the cache pool according to their reuse value score R(u, v) from low to high; remove the path segments with the lowest scores in turn and delete their key-value pairs from the cache pool; after each path segment is removed, re-examine... Has it dropped to The following steps involve repeating the removal and inspection process until... .
[0077] Through the dynamic eviction strategy described above, the cache pool always retains the caches with the highest reuse value. Low-frequency, outdated, and short path segments are automatically cleaned up to ensure the retrieval efficiency of the cache pool and the effective use of storage space.
[0078] Continuing with the example from step S3, assume the cache pool capacity is capped at 200 entries, but the current cache pool already contains 202 path segments. After sorting, path segment C (score 0.77) has the lowest score and is evicted first; path segment B (score 1.85) has the second lowest score and is also evicted; the cache pool is restored to 200 entries, and eviction stops. Path segment A (score 17.33) is retained due to its high value score.
[0079] In actual operation, the cache pool size usually reaches its limit within a short period of time, and is then maintained near the threshold through an eviction mechanism. This dynamic balance allows the cache pool to store the most valuable path information within a limited space.
[0080] In step S5, after the dynamic eviction of the cache pool is completed in step S4, it is checked whether a new target point has been inserted. If a new target point exists, the topology incremental planning process is executed; if not, the current planned path continues, and the process returns to step S3 to continuously maintain the cache pool. During the robot's inspection task, operators or the task management system may insert new target points at any time (such as adding new inspection tasks, changing inspection routes, etc.). The insertion event of a new target point is monitored in real time. If no new target point is inserted, the robot continues to move along the current planned path or remains in standby mode waiting for a new task. If a new target point is detected... If inserted, the subsequent topology incremental planning process will be executed.
[0081] Suppose a robot is performing a multi-target continuous inspection task, and has already visited some of the target points. Its current position is... The newly inserted target point is This step uses topology layer guidance to quickly assemble segmented paths; the specific process is as follows.
[0082] S5.1 Determine the topological affiliation of the current location and the new target point.
[0083] First, based on the current location The coordinates are used to find the nearest refined node in the refined layer and determine the tunnel segment to which that node belongs. This allows for the determination of the topological edges corresponding to the tunnel segment. and the nearest intersection node .
[0084] Similarly, determine the new target point. The tunnel section Topological edges and the nearest intersection node .
[0085] like and If the target point is located ahead of the current position along the centerline of the tunnel segment (i.e., the direction from the tunnel entrance to the exit is positive, and the target point's mileage coordinates are greater than the current position's mileage coordinates), then proceed directly to step S5.4 without performing topology layer stitching, and execute A in the refinement layer of that tunnel segment. Search for generated paths. If and If the locations are different, or if there is a fork in the road between the current location and the target point, then perform the topology layer splicing step S5.2.
[0086] S5.2 Search for the shortest topological path from the current intersection to the target intersection at the topology layer.
[0087] With topology layer As a graph structure, with Starting point Using the destination as the starting point, run Dijkstra's algorithm to search for the shortest topological path. Dijkstra's algorithm maintains a distance array dist, where dist[j] represents the distance from the starting point. The current shortest distance to node j; initially dist[ ]=0, other nodes dist=∞; each time, select the node u with the smallest dist from the unvisited nodes and expand it, and update the distance of its neighbor node v; repeat until all nodes are visited.
[0088] The topological path obtained by the search consists of several topological edges connected in sequence, denoted as . E1 connection At the next fork in the road, Connect to the previous intersection .
[0089] Each topological edge Corresponding to a tunnel segment The sequence of path nodes in its refined layer needs to be obtained or generated.
[0090] Dijkstra's algorithm has a very small search space at the topology level because the number of intersections in a tunnel network is usually small, generally between a few and a few dozen. Therefore, the computational cost of topology search is negligible. This is one of the keys to the fast response of this method.
[0091] S5.3 For each topological edge in the shortest topological path, query the cache pool and perform segmented reuse or search.
[0092] For topological edges = ( , ), and For two adjacent intersection nodes, queries are executed in the following priority order: First priority, direct matching: Check if the key () exists in the cache pool. , The path segment of C( ). If it exists, reuse C( ). , The complete path node sequence and reuse frequency Increment by 1. Direct matching is the ideal reuse scenario, offering the highest retrieval efficiency.
[0093] Second priority, prefix / subpath matching: If no direct match is found, iterate through the keys in the cache pool and check if there is a path that also passes through the same path. and ,and Appeared before. If it exists, the corresponding sub-path is intercepted as a reuse result. For example, if there exists in the cache pool from to , and the current requirement is to go from to , is located on the path from to , then the path prefix from to can be intercepted for reuse. Suppose a certain path in the cache pool has indices i<j such that and , then the sub-path is extracted as the reuse result.
[0094] Third priority, no match: If none of the above queries hit, the A algorithm is run in the refinement layer corresponding to the topological edge to generate the sequence of path nodes from to . The new path is stored in the cache pool with ( , ) as the key, the reuse frequency f is initialized to 1, and the path length and storage time are recorded.
[0095] The above steps are performed for each topological edge in the shortest topological path to obtain the sequence of refinement layer path nodes corresponding to each topological edge. Figure 3 is a schematic diagram of the path cache reuse mechanism proposed by the present invention, showing three reuse scenarios: direct matching reuse (direct hit when the path from A to B exists in the cache pool), sub-path matching reuse (intercepting the segment from C to B for reuse from the long path from A to C to B), and topological incremental splicing reuse (among the three topological edges , , , the cached segment is directly hit, and the uncached segment is spliced into a complete path after A search).
[0096] S5.4: Splice the segmented paths with the start and end paths to generate a combined path.
[0097] The combined path consists of three parts: (1) The path segment from the current position to the current fork : If is exactly located at the fork, this segment is empty; otherwise, it is generated by performing A search in the refinement layer of the tunnel segment to which belongs.
[0098] (2) The path segments corresponding to each topological edge in the topological path are spliced in sequence: the path node sequences obtained in step S5.3 are connected in sequence.
[0099] (3) From the target fork in the road To the new target point Path segment: If Located precisely at a fork in the road, this section is empty; otherwise, in Execute A in the refinement layer of the tunnel segment. Search results generated.
[0100] By concatenating the first and last parts of the above three path node sequences, a sequence starting from the current position is formed. To the new target point The full path.
[0101] In step S6, after generating the combined path in step S5, this step sends the path to the robot's motion control system, and the robot moves according to the path point sequence. Path point sequence ,in Starting point (current position), The target point is [location]. During movement, the robot continuously updates its current position coordinates using an onboard odometry system and an inertial measurement unit (IMU). The odometry calculates the distance traveled via a wheel encoder, while the IMU provides heading angle information; the fusion of these two components yields a more accurate pose estimate.
[0102] During the robot's movement and execution, the cache pool information is updated and maintained synchronously. After each path segment is reused, the reuse frequency of the corresponding path segment in the cache pool is updated. (Incrementing by 1) and most recent reuse time (Updated to the current time). For newly generated path segments, their path length, storage time, and reuse count are recorded when they are stored in the cache pool, with the initial reuse count being 1. This information update ensures that the value score of path segments in the cache pool dynamically reflects the latest status, providing an accurate basis for subsequent eviction decisions and reuse queries.
[0103] Once the robot reaches the current target point, it removes that target point from the list of points to be visited. If the list of points to be visited is not empty, it continues to plan the path to the next target point; if the list of points to be visited is empty, the task is completed, and the robot returns to the designated location.
[0104] To achieve continuous dynamic optimization of the cache pool, after completing robot movement control in step S6, the process returns to step S3, forming a continuous closed-loop maintenance mechanism. Throughout the robot's inspection task, the closed-loop process of "steps S3, S4, S5, S6, and S3" is continuously executed. Each time a path is reused or a new path is generated, the reuse frequency and most recent reuse time of the path segment in the cache pool are updated, and the value score changes accordingly. Each time a new path is stored in the cache pool, a cache pool size check is triggered, and eviction is performed when the storage size exceeds a preset threshold. Through this closed-loop mechanism of "reuse, update, check, and eviction," the cache pool is always dynamically maintained in an optimal state.
[0105] To verify the effectiveness of the method of this invention, this embodiment uses theoretical analysis to quantitatively evaluate the algorithm's performance. Let the optimal size of the cache pool be... (That is, the minimum size of the cache pool that can cover all path patterns), the peak hit rate is (That is, the highest cache hit rate achievable when the cache pool is in its optimal state). In a multi-target continuous inspection scenario, the total number of path planning requests is... Each request requires retrieving the following number of path segments. The total number of path segment requests is .
[0106] For traditional non-eviction caching schemes, the cache pool follows a "store first, use later" accumulation principle, and its size monotonically increases with task execution. As the cache pool size increases from... Growth to As a large number of redundant, outdated, and low-frequency path segments gradually accumulate in the cache pool, the cache hit rate drops from its peak. Down to The cache retrieval time complexity degrades from O(1) to O(L), and the retrieval overhead increases by 3 times. Let A The unit computational cost of the search is The unit computational cost of cache retrieval is The normalized single-programming time can be expressed as: ; Pick , The single planning time for a no-elimination scheme is The total planning time is .like ,but .
[0107] For the solution of this invention, a path caching value assessment model is used to comprehensively score the reuse frequency, length weight, and time-related decay factor from three dimensions, and a scale threshold is set. There are several path segments; when the cache pool size exceeds a threshold, the path segment with the lowest reuse value score is automatically discarded, ensuring the cache pool size remains stable. Nearby. Meanwhile, through an incremental planning strategy guided by the topology layer, A is only executed on topology edges not covered by the cache. Searching helps maintain a stable cache hit rate. The retrieval overhead remains at O(1) due to the constant size of the cache pool. The single planning time of the proposed solution is... The total planning time is .
[0108] Theoretical analysis shows that, compared to traditional non-eviction caching schemes, this invention increases the cache hit rate from approximately 55% to approximately 65%, a relative improvement of approximately 25% to 40%; the total planning time is reduced from 14.4 to 10.8, a relative reduction of approximately 25%. In scenarios with larger scales or higher search overhead, the advantages of the present invention are more significant, with an overall reduction in planning time of 30% to 50%.
[0109] As can be seen, this invention, through the synergistic effect of two core mechanisms—cache pool size control and topology-guided reuse—can maintain a high cache hit rate and low retrieval overhead in multi-target continuous inspection scenarios. Compared with traditional non-elimination caching schemes, it has significant and stable performance advantages, effectively improving the operational efficiency and system scalability of tunnel inspection robots.
[0110] Example 2 This embodiment provides a tunnel inspection robot path cache eviction and topology incremental planning system, including: The map processing module is configured to: acquire the tunnel map, extract the tunnel topology, and generate a two-level graph structure with intersections as nodes and tunnel segments as edges; the two-level graph structure includes a topology layer and a refinement layer. The cache management module is configured to: pre-build a path cache pool, which stores planned path segments in key-value pairs, where the key is the path start and end node pair and the value is the sequence of path nodes from the start to the end; calculate the reuse value score of each path segment in the path cache pool, which is calculated by weighting the reuse frequency, length weight, and time decay factor of the path segment; and discard the path segment with the lowest reuse value score when the storage size of the path cache pool exceeds a preset threshold. The incremental planning module is configured to: when a new target point is inserted, search for a combined path from the current position to the new target point in the topology layer according to the two-level graph structure. The combined path is formed by splicing together existing cached segments in the path cache pool. Path search is only performed on segments not covered by the cache, and the newly generated path segments are stored in the path cache pool. The motion control module is configured to control the robot's movement based on the combined path.
[0111] It should be noted that each module in this embodiment corresponds one-to-one with each step in Embodiment 1, and their specific implementation process is the same, so it will not be repeated here.
[0112] Example 3 This embodiment provides a computer device including a computer-readable storage medium 1003, a processor 1001, a communication interface 1002, and a computer program stored on the computer-readable storage medium 1003 and executable on the processor 1001. The processor 1001, communication interface 1002, and computer-readable storage medium 1003 can be connected via a bus or other means. The communication interface 1002 is used to receive and send data. When the processor 1001 executes the program, it implements the steps in the tunnel inspection robot path cache eviction and topology incremental planning method described in Embodiment 1 above.
[0113] The processor 1001 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, etc. A general-purpose processor can be a microprocessor or any conventional processor. The computer-readable storage medium 1003 stores a computer program executable by the processor 1001. The communication interface 1002 enables data exchange with external devices, including receiving sensor data and outputting control commands.
[0114] Memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of memory may also include non-volatile random access memory. For example, memory may also store information about the device type.
[0115] In the implementation process, each step of the above method can be completed by the integrated logic circuits in the processor hardware or by software instructions.
[0116] The method in Embodiment 1 can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules can reside in readily available storage media in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, a detailed description is not provided here.
[0117] Those skilled in the art will recognize that the units and algorithm steps described in connection with the various examples of this embodiment can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.
[0118] Example 4 This embodiment also provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, complete the method described in Embodiment 1.
[0119] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for path caching and incremental topology planning in tunnel inspection robots, characterized in that, include: Obtain the tunnel map, extract the tunnel topology, and generate a two-level graph structure with intersections as nodes and tunnel segments as edges; The two-level graph structure includes a topology layer and a refinement layer; A path cache pool is pre-built, which stores planned path segments in key-value pairs. The key is a pair of path start and end nodes, and the value is the sequence of path nodes from the start to the end. The reuse value score of each path segment in the path cache pool is calculated. The reuse value score is obtained by weighting the reuse frequency, length weight and time decay factor of the path segment. When the storage size of the path cache pool exceeds a preset threshold, the path segment with the lowest reuse value score is discarded. When a new target point is inserted, a combined path from the current position to the new target point is searched in the topology layer according to the two-level graph structure. The combined path is formed by splicing together the existing cached segments in the path cache pool. Path search is only performed on segments that are not covered by the cache, and the newly generated path segments are stored in the path cache pool. The robot moves according to the combined path.
2. The tunnel inspection robot path caching elimination and topology incremental planning method according to claim 1, characterized in that, The topology layer uses intersections as nodes and tunnel segments as edges, storing information on tunnel segment length, average curvature, and width. The refinement layer adaptively generates refinement nodes between nodes in the topology layer according to the curvature of the tunnel, resulting in a mesh map for path search. The adaptive generation includes: determining the generation step size of the refinement nodes according to the curvature of the tunnel segment; using a large step size when the curvature is less than a first threshold, using a small step size when the curvature is greater than a second threshold, and using an intermediate step size when the curvature is between the first and second thresholds.
3. The tunnel inspection robot path caching and incremental topology planning method according to claim 1, characterized in that, The formula for calculating the reuse value score is as follows: ; in, The reuse frequency of the path segment (u, v) is... The weight is the path segment length. This is the time-degradation factor.
4. The tunnel inspection robot path caching and incremental topology planning method according to claim 3, characterized in that, The reuse frequency Record the number of times a path segment is successfully reused, and increment this value after each reuse. The length weight It is positively correlated with the path segment length, and the calculation formula is: ; in, Let (u, v) be the length of the path segment. β is the maximum length of all path segments in the cache pool, and β is the length weighting coefficient. The time-degradation factor The calculation formula is: ; in, The unused duration of path segment (u, v) since the current time. This is the attenuation rate coefficient.
5. The tunnel inspection robot path cache eviction and topology incremental planning method according to claim 1, characterized in that, When the storage size of the path cache pool exceeds a preset threshold, the path segment with the lowest score is eliminated based on the reuse value score of each path segment until the storage size of the path cache pool drops below the preset threshold.
6. The tunnel inspection robot path cache eviction and topology incremental planning method according to claim 1, characterized in that, The search for a combined path from the current location to the new target point at the topological layer specifically includes: Determine the tunnel section where the current location is located and the corresponding current intersection; determine the tunnel section where the new target point is located and the corresponding target intersection. If the current location and the target point are located in the same tunnel segment, then the path search is performed directly in the refinement layer of that tunnel segment to generate a combined path from the current location to the target point; If the current location and the target point are located in different tunnel segments, then the shortest topological path from the current intersection to the target intersection is searched in the topology layer. The shortest topological path consists of several topological edges, which are tunnel segments between adjacent intersections. For each topological edge, query the path cache pool to see if there is a cached path segment that covers the topological edge; if there is, directly reuse the path node sequence of the cached path segment; if there is not, perform path search in the refinement layer corresponding to the topological edge and store the newly generated path segment in the path cache pool. Following the order of the topological edges in the shortest topological path, the path segments corresponding to each topological edge are sequentially concatenated; then, the path segments from the current position to the current intersection and from the target intersection to the target point are sequentially concatenated to obtain the complete combined path from the current position to the new target point.
7. The tunnel inspection robot path cache eviction and topology incremental planning method according to claim 1, characterized in that, The path search is A search.
8. A tunnel inspection robot path caching and eviction and topology incremental planning system, characterized in that, include: The map processing module is configured to: acquire a tunnel map, extract the tunnel topology, and generate a two-level graph structure with intersections as nodes and tunnel segments as edges; the two-level graph structure includes a topology layer and a refinement layer. The cache management module is configured to: pre-build a path cache pool, which stores planned path segments in key-value pairs, where the key is a pair of path start and end nodes, and the value is a sequence of path nodes from the start to the end; calculate the reuse value score of each path segment in the path cache pool, which is obtained by weighting the reuse frequency, length weight, and time decay factor of the path segment; and discard the path segment with the lowest reuse value score when the storage size of the path cache pool exceeds a preset threshold. The incremental planning module is configured to: when a new target point is inserted, search for a combined path from the current position to the new target point in the topology layer according to the two-level graph structure. The combined path is formed by splicing together existing cached segments in the path cache pool. Path search is only performed on segments not covered by the cache, and the newly generated path segments are stored in the path cache pool. The motion control module is configured to control the robot's movement according to the combined path.
9. A computer device comprising a computer-readable storage medium, a processor, and a computer program stored on the computer-readable storage medium and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the tunnel inspection robot path cache elimination and topology incremental planning method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the tunnel inspection robot path cache elimination and topology incremental planning method as described in any one of claims 1-7.
