Wide-area space railway line GPU parallel intelligent search method, medium and equipment

By parallelizing grid scanning and updating distance maps on the GPU, the performance bottleneck problem of railway line search in wide-area space and fine grids in the prior art is solved, and efficient line path search and better solution discovery is achieved.

CN119671005AActive Publication Date: 2025-03-21CENT SOUTH UNIV +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510179442.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-19
Publication Date
2025-03-21
Estimated Expiration
2045-02-19

AI Technical Summary

Technical Problem

When existing railway line search algorithms conduct path searches in wide-area space and fine grids, they face performance bottlenecks, resulting in too long search time, and simplified grid processing methods may ignore better line solutions, especially in complex terrain areas.

Method used

The GPU parallel intelligent search method is adopted to establish a comprehensive geographic information model, divide the grid hierarchy, and scan it in parallel in the GPU to update the distance map and find feasible line paths. This method utilizes the parallel processing capabilities of the GPU and combines the collaborative computing architecture controlled by CPU to realize efficient application of distance transformation method.

Benefits of technology

It significantly improves the computing efficiency of railway line search, can process more refined geographic information model data, reduces search time, and increases the probability of discovering better line solutions, especially in complex terrain areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119671005A_ABST
    Figure CN119671005A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of railway line intelligent search, and discloses a wide-area space railway line GPU parallel intelligent search method which comprises the following steps: S1, establishing a comprehensive geographic information model and initializing data; s2, performing hierarchical division on the grids; s3, grid scanning is carried out in parallel in the GPU to update the distance map, and a feasible line path is searched; and S4, judging whether the distance value in the distance map is changed or not, if so, returning to S3, and otherwise, outputting final distance map data. According to the method, by means of hierarchical division of massive grids, execution of serial calculation in each thread block area and parallel calculation of all the thread blocks, the powerful parallel processing capacity of the GPU is utilized, and meanwhile, a cooperative calculation framework of GPU calculation and CPU control is adopted, so that efficient application of the distance transformation method in wide-area line selection space and fine grids is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of railway line intelligent search, and in particular to a wide-area spatial railway line GPU parallel intelligent search method, medium and device. Background Art

[0002] Railway lines play a vital role in railway construction. Route selection and design, as the leader and foundation of railway survey and design, is a core task in railway construction that involves a wide range of aspects and is highly systematic. It has a decisive impact on the difficulty of the project, the size of the project investment, and the safety of construction and operation. Traditional manual route selection is limited by time, energy, and equipment. Designers can only rely on experience to select a small number of options for detailed design, and it is difficult to ensure the optimal solution. Intelligent route search and optimization technology can use computers to automatically complete the three-dimensional railway route search and coordinated layout of structures, generating a route solution that meets various constraints and has the optimal objective function. It effectively solves the problems of limited solutions, long decision-making cycles, single evaluation indicators, and high labor intensity in existing manual route selection and design, and significantly improves design efficiency and quality.

[0003] Currently, an effective route search method is the generalized distance transform (GDT). Distance transform is a common transformation method in image science. It converts a bitmap into a distance map, which records the shortest distance from each pixel to the target pixel. Based on this distance map, the shortest path to the target point can be generated. By expanding the meaning of distance to include comprehensive engineering costs, including roads, bridges, and tunnels, the GDT method is developed. This method can automatically generate a large number of routes connecting the starting and ending points in complex mountainous environments. However, in practical applications, path searches often require a wide spatial area and a fine grid. In this case, existing algorithms face severe performance bottlenecks. Even with high-performance computing equipment, a single path search can still take too long. To shorten search time, existing algorithms often simplify the grid, performing an initial screening of the grid data to increase the grid size. While this improves computational efficiency to a certain extent, it also increases the probability of overlooking more optimal route solutions, especially in complex terrain such as mountainous areas.

[0004] Therefore, there is an urgent need to propose a railway line search method that has high computational efficiency and can process more sophisticated geographic information model data to solve the problems existing in the existing technology. Summary of the Invention

[0005] The purpose of the present invention is to provide a wide-area spatial railway line GPU parallel intelligent search method, and its specific technical solution is as follows: A wide-area spatial railway line GPU parallel intelligent search method includes the following steps: S1. Establish a comprehensive geographic information model and initialize data; S2, divide the grid into levels; S3, parallelize the grid scan in the GPU to update the distance map and find a feasible line path; S4. Determine whether the distance value in the distance map has changed. If so, return to S3; otherwise, output the final distance map data.

[0006] Preferably, the specific steps of S1 include: S1-1. Establishing a comprehensive geographic information model array of grid data, wherein the grid data includes elevation, grid type, fill and cut volume, bridge and tunnel, land acquisition unit price, and control factor information; S1-2, initialize the distance map array; S1-3, initialize the scan control array; S1-4, initialize the tag variable; The comprehensive geographic information model array is stored in the GPU global memory.

[0007] Preferably, the distance map data in the distance map array includes a generalized distance value and a relative row offset and a relative column offset of a next grid on the shortest path from the current grid to the target point.

[0008] Preferably, the grid level division of S2 includes the following steps: Divide the grid data in S1 into blocks; Each block is further divided into thread blocks; Each thread block is responsible for processing A piece of grid data of size; Based on the known grid data size, block size, and thread block size, the number of blocks contained in the grid data is calculated using the following formula: ; ; Where: Indicates the total number of rows of blocks into which the grid data is divided. Indicates the total number of columns of blocks into which the grid data is divided; is the total number of rows of grid data, is the total number of columns of grid data; is the total number of rows or columns of grid data contained in the thread block; The total number of rows or columns of thread blocks contained in the block.

[0009] Preferably, the step S3 specifically includes the following steps: S3-1, check whether the current block needs to update the distance map data according to the scan control array; S3-2. Copy the local grid data and local distance map data corresponding to each block from the global memory to the shared memory where the block is located, and convert the global index into a local index during the copy; S3-3. Create a Boolean variable in the shared memory to control the scan loop of S3-4; S3-4, all thread blocks continuously traverse and scan the grid within their range to find a feasible line path; S3-5. Detect whether the distance map data changes during the scanning process. If so, copy the local distance map data in the shared memory to the global memory.

[0010] Preferably, S3-1 specifically includes: Create a size The two-dimensional Boolean array is used as the scan control array and stored in the global memory of the GPU; The scan control array is used to indicate whether the current block needs to be grid scanned to reduce the generalized distance value. The expression is as follows: ; Where: Indicates the scan control array; The scan control array optimizes the calculation process by marking which blocks need further processing. When the distance map data in a block changes, the Ctrl value of the block and its adjacent blocks will be set to true, triggering the next round of grid scanning and updating the distance map.

[0011] Preferably, before the grid scan in S3-4 begins, a local Boolean variable that can only be accessed within the thread block is defined. If the thread block modifies the distance map data in the local shared memory during the scan, the variable is assigned a value of true, otherwise it defaults to false. The steps for detecting whether the distance map data has changed during the scan in S3-5 are as follows: after the scan is completed, if the local Boolean variable is true, the flag variable in the global memory is set to true using a CAS operation; if the flag variable is false, it means that all thread blocks in all blocks have not changed the distance map data.

[0012] Preferably, the S4 includes: S4-1, update the scan control array; After each round of S3, the scan control array of each thread block will be updated. If the distance map data of a block in the current search round is changed, the scan control array value at the same position is true. Then, in the next search round, the scan control array values ​​corresponding to the eight adjacent blocks around it will be set to true. S4-2, check whether the distance value of this round of scanning has been modified. If it has been modified, return to S3; if not, the algorithm ends; The distance map data used by each block in the grid scanning search path comes from the distance map data of the previous round of scanning. By executing two rounds of S3 steps, the shortest distance from the adjacent block to the target point is propagated to the current block; after a maximum of In step S3 of the round, the distance map data of each block is no longer changed. At this time, the distance map stores the shortest distance from all grid points to the target point.

[0013] The application of the technical solution of the present invention has the following beneficial effects: A GPU-based parallel intelligent search method for wide-area railway routes includes the following steps: S1: gridding the selected route area, establishing a comprehensive geographic information model based on the grids, and initializing data; S2: hierarchically dividing the grids; S3: parallelizing grid scanning on the GPU to update the distance map and find feasible route paths; S4: determining whether the distance values ​​in the distance map have changed; if so, returning to S3; otherwise, outputting the final distance map data. By hierarchically dividing massive grids, performing serial computations within each thread block area, and parallelizing computations across all thread blocks, the present invention leverages the powerful parallel processing capabilities of GPUs. Furthermore, by employing a collaborative computing architecture combining GPU computing with CPU control, the present invention achieves efficient application of distance transformation methods in wide-area route selection and fine grids.

[0014] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the aforementioned wide-area spatial railway line GPU parallel intelligent search method.

[0015] The present invention also provides an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the aforementioned wide-area spatial railway line GPU parallel intelligent search method by executing the executable instructions.

[0016] In addition to the above-described objects, features and advantages, the present invention has other objects, features and advantages. The present invention will be further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0018] Figure 1 is a flow chart of a wide-area spatial railway line GPU parallel intelligent search method according to an embodiment; Figure 2 Schematic diagram of grid level division; Figure 3 Flowchart for parallelized grid scanning; Figure 4 This is a schematic diagram of memory copy; Figure 5(a) is a schematic diagram of the first round of inter-block distance propagation, Figure 5(b) is a schematic diagram of the second round of inter-block distance propagation, and Figure 5(c) is a schematic diagram of the third round of inter-block distance propagation. DETAILED DESCRIPTION

[0019] The embodiments of the present invention are described in detail below with reference to the accompanying drawings. Example:

[0020] The embodiment of the present invention is to Perform fast line path search for the line selection area, such as Figure 1 As shown, a wide-area spatial railway line GPU parallel intelligent search method includes the following steps: S1. Establish a comprehensive geographic information model, which specifically includes the following steps: S1-1. Establishing a comprehensive geographic information model array for grid data , which includes but is not limited to the following grid data: grid elevation, grid type, fill and cut, bridge and tunnel, land acquisition unit price, control factor information, etc.

[0021] S1-2. Initialize the distance map array The distance graph data includes the generalized distance value DT and the relative row offset of the next connected grid in the shortest path from the current grid to the target point. and column offsets Before starting the calculation, all distance values ​​in the distance map must be set to a specific initial value. The expression is as follows: ; Where: Indicates the distance in the map The generalized distance value of the grid, where the target point refers to the starting point or end point of the line.

[0022] S1-3. Initialize the scan control array , the initial values ​​are all false.

[0023] S1-4. Initialize the flag variable flag, and the initial value is false.

[0024] Furthermore, before using the GPU for fast route search, given the relatively low data transfer rate between the CPU and GPU, it's necessary to completely copy the comprehensive geographic information model array and initialized distance map array prepared in step S1 to the GPU's global memory. Once the data is copied, all subsequent related computational tasks can be performed entirely autonomously by the GPU, eliminating the need for frequent data exchanges with the CPU. This measure improves the time efficiency of the entire processing workflow and reduces latency caused by data communication.

[0025] S2, divide the grid into levels, see Figure 2 , including the following steps: Divide the grid data mentioned in step S1 into A larger block (Block); Each larger block is further divided into A smaller thread block (Thread); Each thread block is responsible for processing A piece of grid data of size.

[0026] According to the above division levels, the grid data size is known, and the 8. If 32 is used, the block size of the grid data can be calculated using the following formula: ; ; Where: and Respectively represent the total number of rows and columns of the blocks into which the grid data read from step S1 is divided; and are the total number of rows and columns of the grid data read in step S1 respectively; The total number of rows (columns) of grid data contained in the thread block (Thread); The total number of rows (columns) of thread blocks (Thread) contained in each block (Block).

[0027] Through this step, the grid is decomposed into several small areas. In the same round of grid scanning, all thread blocks in each block share the same local grid data, and at the same time, each thread block performs calculation operations simultaneously.

[0028] S3, parallelize the grid scanning in the GPU to update the distance map and find a feasible line path, see Figure 3 , specifically: A step contains multiple sub-steps. In each block, all thread blocks execute all sub-steps in parallel. After each sub-step is completed, thread synchronization operations are performed to ensure that all thread blocks in the block have completed the current sub-step before entering the next sub-step.

[0029] S3-1, according to the scanning control array Check whether the distance map of the current block needs to be updated, specifically: Step S1-3 establishes the scan control array , the purpose of this array is to indicate whether the current block needs to be grid scanned to reduce the generalized distance value. Specifically, its value is defined as follows: ; This scan control array optimizes the computation by marking which blocks require further processing. When the distance value in a block changes, the Ctrl value for that block and its neighbors is set to true, triggering the next round of grid scanning and updating the distance map. This mechanism ensures that only blocks that could affect the final result are processed, avoiding unnecessary computation.

[0030] When S3 is executed for the first time, the Ctrl array only contains the block where the target point is located. The corresponding value is true, and the rest are false, so only The block will continue to execute the subsequent sub-steps. During the subsequent repeated execution of S3, only the block corresponding to the position where the Ctrl array value is true will execute the subsequent sub-steps of S3.

[0031] S3-2, the local grid data corresponding to each block is loaded from the global memory and local distance map data Copy to the high-speed shared memory where the block is located, see Figure 4 , specifically: If the position of the current thread block is , the current block position is , the size of the thread block is .

[0032] This conversion ensures that each thread block correctly retrieves the local data it is responsible for processing and stores it in the GPU's high-speed shared memory. This not only reduces the number of accesses to global memory but also improves data access efficiency, thereby accelerating the line search process.

[0033] S3-3. Create a Boolean variable in the shared memory to control the scan loop of S3-4; S3-4. All thread blocks continuously scan the grid area within their range and try to search for a connected line path, as follows: The grid scanning process consists of two phases: forward and reverse. Thread blocks in , in its corresponding A traversal search is performed within the range, first scanning forward (from left to right, from top to bottom), and then scanning backward (from right to left, from bottom to top). The scanning process is the same as the traditional generalized distance transform method.

[0034] It is worth noting that the scanning process is continuously executed in each thread block divided by S2 until the local Boolean variable shouldScan established in S3-3 is false, that is, the distance value in the same block no longer changes.

[0035] S3-5. Detect whether the distance map data has changed during the scanning process. If so, copy the local distance map data in the shared memory to the global memory. Specifically: Before the grid scan begins, a local Boolean variable, hasChange, is defined, accessible only within the thread block. If the thread block modifies the distance data in local shared memory during the scan, it is assigned a value of true; otherwise, it defaults to false. After the scan completes, if the hasChange variable is true, a CAS (CompareAndSwap) operation is used to set the global flag variable, flag, in memory to true. Since multiple thread blocks may perform this operation simultaneously, this C operation ensures that as long as the hasChange variable is true in at least one thread block, the global flag variable, flag, is true. After the scan completes, if flag is false, it indicates that no thread blocks in any block have modified the distance map data.

[0036] S4: Determine whether the distance value in the distance map has changed. If so, return to S3; otherwise, output the final distance map data. Specifically, it includes: In the When executing step S3 for the first time, each block will obtain the latest distance map data of its adjacent blocks after the last round of scanning. , and then update the distance value of this block accordingly. For each block, the distance data used in the grid scanning search path comes from , and by executing two rounds of S3, the shortest distance from the adjacent block to the target point can be propagated to the current block. In step S3 of the round, the generalized distance value of each block no longer changes. At this time, what is stored in the distance map is the shortest distance from all grid points to the target point (the starting point or the end point of the route).

[0037] S4-1. Update control array , Figure 5 (a) to Figure 5 (c) are schematic diagrams of inter-block distance propagation from the first round to the third round. After each round of S3, the control array Ctrl of each block will be updated. If the distance value of the block changes, the Ctrl value at the same position is true, then in the next round of search, the Ctrl values ​​corresponding to the eight adjacent blocks around it are set to true.

[0038] S4-2. If the global marking variable flag is true, continue to execute the steps described in S3. If flag is false, the algorithm ends.

[0039] This embodiment further discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the wide-area spatial railway line GPU parallel intelligent search method described above in this embodiment is implemented.

[0040] This embodiment also discloses an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the wide-area spatial railway line GPU parallel intelligent search method as described above in this embodiment by executing the executable instructions.

[0041] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A GPU parallel intelligent search method for wide-area spatial railway lines, characterized in that: The steps include: S1. Establish a comprehensive geographic information model and initialize data; S2, divide the grid into levels; S3, parallelize the grid scanning in the GPU to update the distance map and find a feasible line path; S4. Determine whether the distance value in the distance map has changed. If so, return to S3; otherwise, output the final distance map data.

2. The wide-area spatial railway line GPU parallel intelligent search method according to claim 1 is characterized in that: The specific steps of S1 include: S1-1, establishing a comprehensive geographic information model array of grid data, wherein the grid data includes elevation, grid type, fill and cut volume, bridge and tunnel, land acquisition unit price and control factor information; S1-2, initialize the distance map array; S1-3, initialize the scan control array; S1-4, initialize the tag variable; The comprehensive geographic information model array is stored in the GPU global memory.

3. The wide-area spatial railway line GPU parallel intelligent search method according to claim 2 is characterized in that: The distance map data in the distance map array includes a generalized distance value and a relative row offset and a relative column offset of the next grid on the shortest path from the current grid to the target point.

4. The wide-area spatial railway line GPU parallel intelligent search method according to claim 2 is characterized in that: The grid level division of S2 includes the following steps: Divide the grid data in S1 into blocks; Each block is further divided into thread blocks; Each thread block is responsible for processing A piece of grid data of size; Based on the known size of the grid data, the block size, and the thread block size, the number of blocks contained in the grid data is calculated using the following formula: ; ; Where: Indicates the total number of rows of blocks into which the grid data is divided. Indicates the total number of columns into which the grid data is divided; is the total number of rows of grid data, is the total number of columns of grid data; is the total number of rows or columns of grid data contained in the thread block; is the total number of rows or columns of thread blocks contained in the block.

5. The wide-area spatial railway line GPU parallel intelligent search method according to claim 4, characterized in that: The S3 specifically includes the following steps: S3-1, checking whether the current block needs to update the distance map data according to the scan control array; S3-2, copy the local grid data and local distance map data corresponding to each block from the global memory to the shared memory where the block is located, and convert the global index into a local index during the copying; S3-3, create a Boolean variable in the shared memory to control the scan loop of S3-4; S3-4, all thread blocks continuously traverse and scan the grid within their range to find feasible line paths; S3-5. Detect whether the distance map data changes during the scanning process. If changed, copy the local distance map data in the shared memory to the global memory.

6. The wide-area spatial railway line GPU parallel intelligent search method according to claim 5, characterized in that: S3-1 specifically: Create a size The two-dimensional Boolean array of is used as the scan control array and stored in the global memory of the GPU; The scan control array is used to indicate whether the current block needs to be grid scanned to reduce the generalized distance value. The expression is as follows: ; Where: Indicates the scan control array; The scan control array optimizes the calculation process by marking which blocks need further processing. When the distance map data in a block changes, the Ctrl value of the block and its adjacent blocks will be set to true, triggering the next round of grid scanning and updating the distance map.

7. The wide-area spatial railway line GPU parallel intelligent search method according to claim 6, characterized in that: Before the grid scan described in S3-4 starts, a local Boolean variable that can only be accessed within the thread block is defined. If the thread block modifies the distance map data in the local shared memory during the scan, the variable is assigned a value of true, otherwise it defaults to false. The steps for detecting whether the distance map data has changed during the scanning process in S3-5 are as follows: after the scanning is completed, if the local Boolean variable is true, the mark variable in the global memory is set to true using the CAS operation; if the mark variable is false, it means that all thread blocks in all blocks have not changed the distance map data.

8. The wide-area spatial railway line GPU parallel intelligent search method according to claim 7, characterized in that: The S4 includes: S4-1, update the scan control array; After each round of S3, the scan control array of each thread block will be updated; if the distance map data of the block in this round of search is changed, the scan control array value at the same position is true, then the scan control array values ​​corresponding to the eight adjacent blocks around it will be set to true in the next round of search; S4-2, check whether the distance value of this round of scanning has been modified. If it has been modified, return to S3; if it has not been modified, the algorithm ends; The distance map data used by each block when performing grid scanning to search for paths comes from the distance map data of the previous round of scanning. By executing two rounds of S3 steps, the shortest distance from the adjacent block to the target point is propagated to the current block; after a maximum of In step S3 of the round, the distance map data of each block is no longer changed. At this time, what is stored in the distance map is the shortest distance from all grid points to the target point.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the wide-area spatial railway line GPU parallel intelligent search method described in any one of claims 1 to 8 is implemented.

10. An electronic device, characterized in that: include: processor; and a memory for storing executable instructions for the processor; Wherein, the processor is configured to execute the wide-area spatial railway line GPU parallel intelligent search method as described in any one of claims 1-8 by executing the executable instructions.

Citation Information

Patent Citations

  • Grid-free Galerkin method structural topology optimization method based on GPU parallel acceleration

    CN103970960A

  • Railway line three-dimensional rapid modeling and dynamic updating method

    CN114549717A

  • Complex mountain railway line station cooperation scheme searching method, medium and equipment

    CN118469117A

  • Method For Partitioning A Search Direction When Using Least Squares Reverse Time Migration

    US20210239879A1