A GPU-based parallel fast KNN method and system for retrieving channel point cloud data using octrees

By constructing a parallel fast KNN method for channel octrees, the problems of thread divergence and memory access in channel point cloud data processing of existing GPU algorithms are solved, and more efficient channel 3D model construction and point cloud data processing are achieved.

CN118427399BActive Publication Date: 2026-11-10WUZHOU UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410174136.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2023-02-14
Filing Date
2024-02-07
Publication Date
2026-11-10
Estimated Expiration
2044-02-07

AI Technical Summary

Technical Problem

Existing GPU-based KNN algorithms suffer from issues such as thread divergence and insufficient performance in continuous memory access when processing channel point cloud data, resulting in low speed and low precision in building 3D channel models.

Method used

We employ a GPU-based octree parallel fast KNN method. By constructing a channel octree and utilizing a channel node neighbor table and multi-threaded parallel computation, we optimize the spatial partitioning and neighbor search of point cloud data, thereby improving the computational efficiency of the GPU.

Benefits of technology

It improves the speed and detail of 3D channel model construction, enhances the global effect, and improves the speed and quality of point cloud data processing through the neighbor search method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118427399B_ABST
    Figure CN118427399B_ABST
Patent Text Reader

Abstract

This invention discloses a GPU-based parallel fast KNN method and system for retrieving channel point cloud data using an octree, comprising: constructing a channel octree based on the channel point cloud data; storing the channel node information of each layer of the octree independently in array form, with each corresponding to a thread; obtaining the channel child node neighbor table information and establishing the channel node neighbor table; obtaining the channel layer data structure information and the storage space required for the channel octree, and sequentially copying the channel layer data structure information into the channel octree; performing iterative search in the channel octree to find the channel node where the channel standard point is located, obtaining the channel search radius, and generating a channel node search list; merging the points contained in each channel node in the channel node search list under different channel search directions into a new channel search list to generate a channel point search list, thereby finding the K points closest to the channel target point in the channel point search list.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of ship autopilot technology, specifically to a GPU-based octree parallel fast KNN method and system for retrieving channel point cloud data. Background Technology

[0002] With the rise of artificial intelligence, advancements in sensor technology, and increased computer speeds, research in fields such as intelligent shipping and autonomous driving has further progressed. Scene perception technology, as an important branch of this development, combines sensor technology to collect and analyze data from the surrounding environment to obtain perception results. This meets the needs of research into autonomous ship operation, providing a guarantee for achieving ship automation and intelligence, and reducing the probability of ship collisions caused by human factors.

[0003] my country is a major shipping nation with 180,000 kilometers of coastline from south to north and 120,000 kilometers of inland waterways, including the Yangtze and Yellow Rivers. Its inland waterway resources are abundant, with numerous tributaries and major rivers interspersed throughout. However, inland waterway shipping technology is generally lagging behind. The large number of inland vessels, with small vessels crowding major waterways, coupled with inconsistent hardware configurations and software operation levels, easily leads to traffic accidents. Achieving scene perception and autonomous vessel operation on inland waterways presents a significant challenge.

[0004] In traditional autonomous driving research, scene perception primarily relies on conventional visual sensors such as cameras. Cameras, due to their rich sensory input, project real-world three-dimensional information into two-dimensional space, enabling computer processing to acquire, understand, and recognize information about external objects. While cameras can acquire perceptual information more directly, as passive sensors, they depend on existing information within the scene to perceive the environment, making them poorly adaptable to complex environments. Therefore, computer vision research is not limited to traditional visual sensors; spatially coherent data generated by other sensors can also be used for computer vision analysis to acquire perceptual information.

[0005] In the 1990s, lidar was widely used as a commercial tool for geolocation and ranging to acquire 3D spatial information. The development of lidar has provided a novel technological solution for 3D urban modeling, geological and road exploration and detection, and autonomous driving. Simultaneously, lidar ranging technology has provided a new means of information acquisition for obtaining 3D geospatial locations. Unlike traditional photogrammetry methods, lidar ranging is an active sensor that can directly acquire large-scale, high-precision 3D data of target areas. With its advantages of high detection accuracy, high detection frequency, and strong anti-interference capabilities, lidar has provided powerful hardware support for surveying and modeling, autonomous driving, and other fields, becoming a research hotspot. The data acquired by lidar consists of many single points, called point clouds. By clustering and analyzing these point clouds, further discrimination can be made against regions of interest and targets, achieving situational awareness of the scene. Currently, lidar captures point cloud data at frame rate to obtain dynamic 3D scenes.

[0006] One crucial step in constructing a 3D dynamic scene of a waterway using point clouds is accurately classifying the target point clouds. In recent years, data classification technology has been widely applied to various problems, and the KNN algorithm, as one of the most important classification algorithms, is also widely used. KNN, or Nearest Neighbor, is a relatively good classification algorithm proposed by Cover and Hartzai in 1968. The idea behind this method is very simple and intuitive: in a large sample library, if certain features of a sample match and belong to the majority of samples, then that sample belongs to that sample library; in other words, it's about grouping similar things together. This algorithm relies only on its one or more nearest samples during the classification process. KNN is a supervised learning algorithm, mainly used for classifying unknown objects. Its discriminative idea is: a sample belongs to the class with the closest neighbors and possesses the features of that class. KNN is an instance-based classification method; that is, given an unknown sample, it finds the K nearest neighbors and determines the class to which the unknown sample belongs. KNN classification is actually a relatively lazy algorithm. In practice, most KNN calculations are performed using GPUs.

[0007] The channel point cloud data collected by LiDAR is a series of discrete and unordered 3D point cloud data. When performing spatial partitioning and neighbor search on the channel point cloud data, the existing GPU-based KNN algorithm is insufficient in terms of thread divergence and continuous memory access, and cannot give full play to the advantages of GPU multi-threaded parallel computing. This results in low speed and quality of spatial partitioning and neighbor search, which restricts the speed of channel 3D model construction and affects the fineness and global effect of the final channel 3D model. Summary of the Invention

[0008] To overcome the shortcomings of existing technologies, this invention provides a GPU-based octree parallel fast KNN method and system for retrieving channel point cloud data. This method addresses the technical problems of insufficient performance of existing GPU-based KNN algorithms in terms of thread divergence and continuous memory access when classifying target point clouds from channel point cloud data. This aims to improve the speed, accuracy, and overall effect of channel 3D model construction.

[0009] This addresses technical issues related to insufficient performance in areas such as thread divergence and continuous memory access, thereby achieving the goal of fully utilizing the GPU for multi-threaded parallel computation during KNN retrieval.

[0010] To solve the above problems, the technical solution adopted by the present invention is as follows: A GPU-based parallel fast KNN method for retrieving channel point cloud data using octrees includes the following steps: Channel point cloud data is acquired by lidar, and a channel octree is constructed layer by layer from top to bottom based on the channel point cloud data. After determining the channel nodes contained in each layer of the channel octree, the channel node information of each layer is stored independently in the form of an array, and each array and each node corresponds to a thread. Obtain the neighbor table information of the child nodes of the channel by using the neighbor tables of the sibling nodes and the parent node of the channel, and establish the neighbor table of the channel node. Useful information of the channel layer data structure used in constructing the channel octree is extracted and merged to obtain channel layer data structure information. The storage space required for the channel octree is obtained according to the channel layer offset array in the channel node neighbor table. The channel layer data structure information is then copied into the channel octree in sequence. A channel benchmark point is provided, and the channel node where the channel benchmark point is located is found by iterative search in the channel octree using the coordinate information of the channel benchmark point. The channel search radius is obtained based on the information of the channel node. Search all channel nodes in all channel search directions within the channel search radius, and generate a channel node search list for different channel search directions; The points contained in each channel node in the channel node search list under the different channel search directions are merged into a new channel search list. Based on the information of the points contained in the channel nodes in the new channel search list, a channel point search list is generated, and the top K points closest to the channel target point are found in the channel point search list. The information of the channel node includes: channel node number and channel node coordinates. There are no duplicate channel nodes in the channel node search list under different search directions. The channel point cloud data is a series of discrete and unordered three-dimensional channel point cloud data.

[0011] In a preferred embodiment of the present invention, the process of establishing the channel node neighbor table includes: Obtain the offsets of the upper, middle and lower layers of the channel parent node's neighbor table. Use a for loop to iterate n1 times. In each iteration, obtain the directional neighbors of the upper, middle and lower layers of the channel parent node's neighbor table projected onto the z-axis. The missing positions of the channel sibling nodes in different layers are determined by obtaining the starting direction of the missing neighbors and the positions of the channel child nodes in the upper and lower layers. A for loop is then performed. In the n2 iterations, the neighbors in the middle, upper and lower layers are filled in counterclockwise. The direction of the channel sibling node neighbors in the positive z-axis direction of the channel child node is obtained, and all channel sibling nodes are found. The location of the missing neighbor in the z-axis direction of the channel child node is determined by analyzing which layer of the upper and lower layers the channel child node is on. After obtaining the z-axis neighbor position of the channel parent node to be visited and the starting position of the missing neighbor of the channel child node, the missing neighbor information is obtained sequentially in the counterclockwise direction starting from the starting direction by using a for loop n3 times. Based on the missing neighbor information, the neighbor information of the channel child node in the positive z-axis direction is obtained.

[0012] In a preferred embodiment of the present invention, generating a search list of channel nodes under different channel search directions includes: A breadth-first search algorithm is adopted, and each channel orientation is assigned to a different channel search direction and range. By extending all channel search directions, all channel nodes within the entire channel search radius are found, and the searched channel nodes are added to the channel search list of the corresponding channel search direction, thus generating the channel node search list under the different channel search directions.

[0013] In a preferred embodiment of the present invention, when adding the searched channel nodes to the channel search list, the following is included: Atomic operation functions are used as communication tools between threads. These atomic operation functions are used to determine whether a searched channel node has already been included in the channel search list. If so, it is not included in the searched channel node.

[0014] As a preferred embodiment of the present invention, when each waterway bearing is designated to be responsible for different waterway search directions and ranges, the following is included: Based on the characteristics of the channel search direction, all channel search directions are divided into channel oblique angle search directions and channel straight search directions; Based on the characteristics of the three-layer structure of the channel node neighbor table, the channel oblique search direction and the channel forward search direction are further divided into the channel middle layer oblique search direction, the channel upper layer oblique search direction, the channel lower layer oblique search direction, the channel middle layer forward search direction, the channel upper layer forward search direction, and the channel lower layer forward search direction. A channel z-axis search direction is further divided between the upper channel positive search direction and the lower channel positive search direction.

[0015] In a preferred embodiment of the present invention, when each waterway bearing is designated to be responsible for different waterway search directions and ranges, the method further includes: The channel mid-level oblique angle search direction takes the mid-level oblique angle direction as the main search route, searches for channel nodes extending from the current channel node in the mid-level oblique angle direction, until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius. Using the positive directions of the preceding and following middle layers corresponding to the oblique direction of the middle layer as auxiliary search directions, search for channel nodes extending from the current channel node in the auxiliary search directions until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited.

[0016] In a preferred embodiment of the present invention, when each waterway bearing is designated to be responsible for different waterway search directions and ranges, the method further includes: The upper and lower channel oblique angle search directions are the main search routes, which are the upper and lower oblique angle directions respectively. The search continues until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius. The middle layer oblique angle direction is used as one auxiliary search direction, and the corresponding positive z-axis direction is used as another auxiliary search direction; Search for the channel node where the current channel node extends in the auxiliary search direction until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius. Search for channel nodes that extend from the current channel node in the other auxiliary search direction until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited. The positive search direction in the middle layer of the channel uses the positive middle layer direction as the main search route, and searches for channel nodes extending in the positive middle layer direction of the current channel node until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited.

[0017] In a preferred embodiment of the present invention, when each waterway bearing is designated to be responsible for different waterway search directions and ranges, the method further includes: The upper and lower positive search directions of the waterway are the main search routes, which are the upper and lower positive directions. The search continues to search for waterway nodes extending in the upper and lower positive directions of the current waterway node until the shortest distance between the visited waterway node and the waterway standard point is not less than the waterway search radius. The positive direction of the middle layer is used as one auxiliary search direction, and the corresponding positive z-axis direction is used as the other auxiliary search direction; Search for the channel nodes that extend from the current channel node in the auxiliary search direction until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited. Search for channel nodes that extend from the current channel node in the other auxiliary search direction until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited. The channel z-axis search direction is based on the positive z-axis direction as the main search route. The search continues for channel nodes extending along the positive z-axis direction of the current channel node until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited.

[0018] In a preferred embodiment of the present invention, generating a channel point search list based on the information of the points contained in the channel nodes of the new channel search list includes: Obtain the prefix sum of the lengths of the channel node search lists under different channel search directions, allocate appropriate space for the new channel search list based on the prefix sum of the lengths, and merge the channel node search lists under different channel search directions to obtain the new channel search list. Obtain the range and starting position of the points contained in the channel nodes in the new channel search list; Obtain the prefix sum of the range of points contained in the new channel search list, allocate appropriate space to the channel search point list based on the prefix sum of the range, and copy the points within the range of the node to the channel search point list.

[0019] A GPU-based parallel fast KNN octree retrieval system for channel point cloud data includes: Channel Octree Construction Unit: Used to construct a channel octree layer by layer from top to bottom based on channel point cloud data. After determining the channel nodes contained in each layer of the channel octree, the channel node information of each layer is stored independently in the form of an array, and each array and each node corresponds to a thread. Channel node neighbor table establishment unit: used to obtain channel child node neighbor table information through the channel sibling node and channel parent node neighbor tables, and establish the channel node neighbor table; Channel octree generation unit: used to extract and merge useful information of the channel layer data structure used in constructing the channel octree, obtain channel layer data structure information, obtain the storage space required for the channel octree according to the channel layer offset array in the channel node neighbor table, and copy the channel layer data structure information into the channel octree in sequence; Channel search unit: It is used to provide a channel benchmark point, and through the coordinate information of the channel benchmark point, iteratively search in the channel octree to find the channel node where the channel benchmark point is located, and obtain the channel search radius based on the information of the channel node; it searches all channel nodes in all channel search directions within the channel search radius, and generates a channel node search list under different channel search directions; Channel search point list generation unit: used to merge the points contained in each channel node in the channel node search list under different channel search directions into a new channel search list, and generate a channel point search list based on the information of the points contained in the channel nodes in the new channel search list; Channel search unit: used to find the top K points closest to the channel target point in the channel point search list; The channel point cloud data is acquired by lidar; the channel node information includes: channel node number and channel node coordinates; there are no duplicate channel nodes in the channel node search list under different search directions; and the channel point cloud data is a series of discrete, unordered three-dimensional channel point cloud data.

[0020] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) This invention constructs a channel octree and utilizes the principle that when the eight channel nodes in the channel octree are projected onto the z-axis, the neighbor positions of the upper, middle and lower layers of the neighbor table are the same except for the missing direction of the z-axis. By obtaining the layer offset, the positioning of neighbors at different layers is achieved. Compared with the existing GPU-based KNN algorithm, the computational efficiency is higher, thereby improving the speed, refinement and global effect of the channel 3D model construction. (2) This invention fully leverages the advantages of GPU multi-threaded parallel computing by assigning each channel node and each array containing node information to a thread, thereby effectively solving the performance problems of the existing GPU-based KNN algorithm in terms of thread divergence and continuous memory access. (3) Since the channel point cloud data is large and disordered, this invention constructs a channel octree to recursively divide the three-dimensional space of the channel and organizes the channel point cloud data into a tree structure, so that the required channel target point cloud data can be quickly queried through the spatial index; in addition, the point cloud data management based on the channel octree can greatly improve the processing efficiency of channel point cloud data, especially when performing large-scale channel point cloud data processing, its advantages are more obvious. (4) The present invention also provides a neighbor search method for processing local relationships in channel point cloud data. In channel point cloud data processing, it is necessary to consider the relationships between points, between points and surfaces, and between surfaces. These relationships can be quickly obtained through the neighbor search method provided by the present invention. For example, when performing point cloud registration and stitching, it is necessary to find the neighbor points between corresponding points to determine their positional relationships. When performing detailed processing of the model, it is necessary to find the neighbor surfaces between surfaces to achieve a smooth transition. The neighbor search method provided by the present invention improves the speed and quality of channel point cloud data processing.

[0021] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. Attached Figure Description

[0022] Figure 1 - This is a step diagram of the method for retrieving channel point cloud data based on GPU-based octree parallel fast KNN in an embodiment of the present invention; Figure 2 - This is a schematic diagram of the initialization process for constructing the channel octree according to an embodiment of the present invention; Figure 3 - This is a schematic diagram of the splitting process for constructing the channel octree according to an embodiment of the present invention; Figure 4 - This is a schematic diagram of the parallel splitting process of each child node in the CPU for constructing the channel octree in an embodiment of the present invention; Figure 5 - This is a schematic diagram showing the data after the channel octree is constructed according to an embodiment of the present invention; Figure 6 - This is a schematic diagram illustrating the completion of neighbor information in 26 directions according to an embodiment of the present invention; Figure 7 - This is a schematic diagram of five types of search directions in an embodiment of the present invention. Detailed Implementation

[0023] The present invention provides a GPU-based parallel fast KNN method for retrieving channel point cloud data using octrees, such as... Figure 1 As shown, it includes the following steps: Step S1: Obtain channel point cloud data through lidar, and construct a channel octree layer by layer from top to bottom based on the channel point cloud data. After determining the channel nodes contained in each layer of the channel octree, store the channel node information of each layer independently in the form of an array, and assign each array and each node to a thread. Step S2: Obtain the neighbor table information of the child nodes of the channel through the neighbor tables of the sibling nodes and the parent nodes of the channel, and establish the neighbor table of the channel nodes; Step S3: Extract and merge the useful information of the channel layer data structure used in the construction of the channel octree to obtain the channel layer data structure information. Obtain the storage space required for the channel octree according to the channel layer offset array in the channel node neighbor table, and copy the channel layer data structure information into the channel octree in sequence. Step S4: Provide a channel benchmark point, and use the coordinate information of the channel benchmark point to perform an iterative search in the channel octree to find the channel node where the channel benchmark point is located, and obtain the channel search radius based on the information of the channel node; Step S5: Search all channel nodes in all channel search directions within the channel search radius, and generate a channel node search list for different channel search directions; Step S6: Merge the points contained in each channel node in the channel node search list under different channel search directions into a new channel search list; Step S7: Generate a channel point search list based on the information of the points contained in the channel nodes in the new channel search list, and find the top K points closest to the channel target point in the channel point search list; The information of the channel nodes includes: channel node number and channel node coordinates. There are no duplicate channel nodes in the search list under different search directions. The channel point cloud data is a series of discrete and unordered three-dimensional channel point cloud data.

[0024] The following explains the node thresholds of the octree in this invention: The channel octree node threshold is a crucial parameter in the channel octree data structure. It represents the maximum number of 3D channel data points that a leaf node in a channel octree can store. In traditional channel octree construction, when a new channel data point is inserted into a leaf node whose contained data points reach the channel octree node threshold, that leaf node is split, creating eight channel child leaf nodes. The data points it originally contained are then stored in these child leaf nodes. In other words, for any non-leaf node in a channel octree, the total number of channel data points contained in its descendant leaf nodes must exceed the channel octree node threshold. When the parallel fast KNN octree for channel points cloud data constructed in this invention is used to retrieve channel point cloud data, the threshold value of the channel octree node is required to be greater than K. It is recommended to set the threshold value to be greater than 8 times the value of K. This can ensure that when the channel search range is determined according to the channel search radius, the channel search range contains at least one channel non-leaf node, thereby ensuring that the channel search range contains more than K channel data points, from which the K nearest neighbor channel data points can be selected.

[0025] In step S1 above, the basic idea of ​​constructing the channel octree is as follows: build the tree layer by layer from top to bottom. Each layer stores the channel node index and coordinates, and other related information, independently in an array to facilitate subsequent parallel operations. Furthermore, each spatial point and each array corresponds to a separate thread for fast sorting and processing. After the channel nodes at each layer are determined, a threshold judgment is performed to obtain the number of channel nodes that will be generated by the split at the next layer and the storage space of each array. After the tree is built, similar information is copied together. The specific construction process is as follows: Figures 2 to 5 As shown.

[0026] In step S2 above, the process of establishing the channel node neighbor table includes: Get the offsets of the upper, middle and lower layers of the channel parent node's neighbor table. Use a for loop to iterate n1 times. In each iteration, get the directional neighbors of the upper, middle and lower layers of the channel parent node's neighbor table projected on the z-axis. The missing positions of the channel sibling nodes in different layers are determined by obtaining the starting direction of the missing neighbors and the positions of the channel child nodes in the upper and lower layers. A for loop is then performed. In the n2 iterations, the neighbors in the middle, upper and lower layers are filled in counterclockwise. The direction of the channel sibling node neighbors in the positive z-axis direction of the channel child node is obtained, and all channel sibling nodes are found. The location of the missing neighbor in the z-axis direction of the channel child node is determined by analyzing which layer of the upper and lower layers the channel child node is in. After obtaining the z-axis neighbor position of the channel parent node to be visited and the starting position of the missing neighbor of the channel child node, the missing neighbor information is obtained sequentially in the counterclockwise direction starting from the starting direction through a for loop n3 times. Based on the missing neighbor information, the neighbor information of the channel child node in the positive z-axis direction is obtained.

[0027] Specifically, establishing the channel node neighbor table consists of two parts: one part involves solving the channel child node neighbor table information using the channel sibling nodes, and the other part involves solving the channel child node neighbor table information using the channel parent node neighbor table. The core of the channel node neighbor table algorithm lies in obtaining the layer offset. Because when the eight channel nodes in the channel octree are projected onto the z-axis, the neighbor positions in the upper, middle, and lower layers of the neighbor table are identical except for the missing direction along the z-axis. Therefore, when obtaining neighbors with the same missing direction, the layer offset allows for the location of neighbors at different layers. The implementation of the channel node neighbor table algorithm involves three steps: Step 1: Obtain the neighbors (excluding those along the z-axis) that require information from the channel's parent node neighbor table to solve for the channel's child node neighbor table. This is done by obtaining the offsets of the upper, middle, and lower layers of the neighbor table, using a for loop to iterate 5 times. Each iteration simultaneously retrieves the neighbors in the z-axis projection direction of the upper, middle, and lower layers. Since accessing the changes in the orientation of the channel's parent node neighbors and the missing orientation changes of the channel's child node neighbors within the for loop is inconvenient for mathematical calculations, this invention uses a feature change recording method, storing the values ​​of each change in a corresponding one-dimensional array for easier calculation. The number of neighbor nodes to be obtained is 5 × 3 = 15.

[0028] Step 2: Obtain the neighbors needed to solve the channel child node neighbor table information through channel sibling nodes. Determine the missing positions of channel sibling node neighbors at different levels by obtaining the starting direction of the missing neighbors and the upper and lower layers where the channel child node is located, and then perform a for loop. In the three iterations, complete the middle layer, upper layer, and lower layer in a counter-clockwise direction. Finally, obtain the direction of channel sibling node neighbors along the positive z-axis of the channel child node, finding all channel sibling nodes to complete the channel child node neighbor table. The number of neighbor nodes to be obtained is: 3 × 2 + 1 = 7.

[0029] Step 3: Obtain the neighbors whose neighbor table information for the channel child node needs to be solved by the z-axis neighbors of the channel parent node. The location of the missing neighbors in the z-axis direction of the channel child node is determined by analyzing which layer (upper or lower) the channel child node is on. Since the missing direction of the neighbor in this direction is consistent with the missing direction of the neighbor whose neighbor table information is completed by the channel sibling node under the z-axis projection, we can also use the method from Step 2. After obtaining the z-axis neighbor position of the channel parent node to be visited and the starting position of the missing neighbors of the channel child node, we use a for loop 3 times to obtain the information of the missing neighbors sequentially in a counter-clockwise direction, starting from the starting direction, and finally obtain the neighbor information of the channel child node in the positive z-axis direction. The number of neighbor nodes to be obtained is: 3 × 1 + 1 = 4.

[0030] After the above three steps, the neighbor information for all 26 directions has been completed, such as... Figure 6 As shown.

[0031] In step S3 above, useful information from the channel layer data structure used in the tree construction is extracted and merged to facilitate subsequent KNN lookup.

[0032] In step S5 above, when generating the search list of channel nodes under different channel search directions, the following is included: A breadth-first search algorithm is adopted, and each channel orientation is assigned to a different channel search direction and range. By extending all channel search directions, all channel nodes within the entire channel search radius are found, and the searched channel nodes are added to the channel search list of the corresponding channel search direction, thus generating a channel node search list under different channel search directions.

[0033] Specifically, step S5 uses the breadth-first search (BFS) algorithm and specifies that each channel orientation is responsible for different channel search directions and ranges, and finds nodes within the entire channel search radius by extending in 26 directions.

[0034] Furthermore, when adding the searched channel nodes to the channel search list, this includes: Atomic operation functions are used as communication tools between threads. These functions are used to determine whether a searched channel node has already been included in the channel search list. If so, it is not included in the searched channel node.

[0035] Specifically, to address the issue of duplicate inclusion of search channel nodes in the channel search list during the search process, the atomic operation atomicExch() function is used as a communication tool between threads to resolve the duplicate inclusion problem.

[0036] Furthermore, when specifying that each navigational bearing is responsible for different navigational search directions and ranges, this includes: Based on the characteristics of the channel search direction, all channel search directions are divided into channel oblique angle search directions and channel straight search directions; Based on the characteristics of the three-layer structure of the channel node neighbor table, the channel oblique search direction and the channel forward search direction are further divided into the channel middle layer oblique search direction, the channel upper layer oblique search direction, the channel lower layer oblique search direction, the channel middle layer forward search direction, the channel upper layer forward search direction, and the channel lower layer forward search direction. A channel z-axis search direction is further divided between the upper channel positive search direction and the lower channel positive search direction.

[0037] Specifically, since each channel bearing is responsible for different channel search directions and ranges, all channel search directions are divided into channel oblique search directions and channel forward search directions based on their characteristics. Based on the characteristics of the three-layer neighbor table structure, channel oblique search directions and channel forward search directions are further divided into channel middle-layer oblique search directions, channel upper-layer oblique search directions, channel lower-layer oblique search directions, channel middle-layer forward search directions, channel upper-layer forward search directions, and channel lower-layer forward search directions. Since the channel upper-layer and lower-layer forward search directions include a special positive z-axis search direction, a channel z-axis search direction can be further defined. Through the above division, five types of channel search directions are obtained: channel middle-layer oblique search direction, channel upper and lower-layer oblique search direction, channel middle-layer forward search direction, channel upper and lower-layer forward search direction, and channel z-axis search direction, as detailed below. Figure 7 As shown. Each thread searches in its own main search direction according to its thread number until all channel nodes within the channel search radius have been found and there are no duplicate channel nodes in the channel search list.

[0038] Furthermore, when specifying that each waterway bearing is responsible for different waterway search directions and ranges, it also includes: The search direction of the middle layer of the channel is mainly the middle layer angle direction. The search extends to channel nodes in the middle layer angle direction of the channel node where it is located, until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius. Using the positive directions of the preceding and following middle layers corresponding to the oblique direction of the middle layer as auxiliary search directions, search for channel nodes extending from the current channel node in the auxiliary search directions until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited.

[0039] Furthermore, when specifying that each waterway bearing is responsible for different waterway search directions and ranges, it also includes: The upper and lower channel angled search directions are the main search routes, which are the upper and lower channel angled directions. The search continues to the channel nodes extending from the upper and lower channel angled directions of the current channel node until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius. The middle layer oblique angle direction is used as one auxiliary search direction, and the corresponding positive z-axis direction is used as another auxiliary search direction; The search continues until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius. Search for channel nodes that extend in another auxiliary search direction from the current channel node, until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited. The positive search direction in the middle layer of the channel is the main search route. The search continues for channel nodes extending in the positive middle layer direction from the current channel node until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited.

[0040] Furthermore, when specifying that each waterway bearing is responsible for different waterway search directions and ranges, it also includes: The upper and lower positive search directions of the channel are the main search routes, which are the upper and lower positive directions. The search continues to the channel nodes that extend in the upper and lower positive directions of the channel node until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius. The positive direction of the middle layer is used as one auxiliary search direction, and the corresponding positive z-axis direction is used as the other auxiliary search direction; The search continues until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited. Search for channel nodes that extend in another auxiliary search direction from the current channel node, until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited. The channel z-axis search direction is based on the positive z-axis direction as the main search route. The search continues for channel nodes extending along the positive z-axis direction of the current channel node until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited.

[0041] In step S7 above, when generating the channel point search list based on the information of the points contained in the channel nodes in the new channel search list, the following steps are included: Obtain the prefix sum of the lengths of the channel node search lists under different channel search directions, allocate appropriate space for the new channel search list based on the prefix sum of the lengths, and merge the channel node search lists under different channel search directions to obtain the new channel search list. Get the range and starting position of the points contained in the channel nodes in the new channel search list; Obtain the prefix sum of the range of points contained in the new channel search list, allocate appropriate space for the channel search point list based on the prefix sum of the range, and copy the points within the range of the node to the channel search point list.

[0042] In step S7 above, finding the K nearest points to the target point in the point search list includes: A method combining binary search and fast selection is used to find the top K points closest to the target point in the channel point search list.

[0043] The present invention provides a GPU-based parallel fast KNN system for retrieving channel point cloud data using an octree, comprising a channel octree construction unit, a channel node neighbor table establishment unit, a channel octree generation unit, a channel search unit, a channel search point list generation unit, and a channel lookup unit. The channel octree construction unit constructs a channel octree layer by layer from top to bottom based on the channel point cloud data. After determining the channel nodes included in each layer of the channel octree, it stores the channel node information of each layer independently in array form, and assigns each array and each node to a separate thread. The channel node neighbor table establishment unit obtains the channel child node neighbor table information through the channel sibling node and channel parent node neighbor tables, and establishes the channel node neighbor table. The channel octree generation unit extracts and merges useful information from the channel layer data structure used in constructing the channel octree, obtains the channel layer data structure information, calculates the storage space required for the channel octree based on the channel layer offset array in the channel node neighbor table, and copies the channel layer data structure information sequentially into the channel octree. The search unit provides a channel reference point and iteratively searches the channel octree using its coordinates to find the channel node containing the reference point. It then obtains the channel search radius based on the channel node information, searches all channel nodes within the channel search radius in all channel search directions, and generates channel node search lists for different channel search directions. The channel search point list generation unit merges the points contained in each channel node in the channel node search lists for different channel search directions into a new channel search list, and generates a channel point search list based on the information of the points contained in the new channel search list. The channel search unit finds the K closest points to the channel target point in the channel point search list. The channel point cloud data is obtained through lidar; the channel node information includes: channel node number and channel node coordinates. There are no duplicate channel nodes in the channel node search list under different search directions. The channel point cloud data is a series of discrete and unordered three-dimensional channel point cloud data.

[0044] The above embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Any non-substantial changes and substitutions made by those skilled in the art based on the present invention shall fall within the scope of protection claimed by the present invention.

Claims

1. A GPU-based octree parallel fast KNN method for retrieving channel point cloud data, characterized in that, Includes the following steps: Channel point cloud data is acquired by lidar, and a channel octree is constructed layer by layer from top to bottom based on the channel point cloud data. After determining the channel nodes contained in each layer of the channel octree, the channel node information of each layer is stored independently in the form of an array, and each array and each node corresponds to a thread. Obtain the neighbor table information of the child nodes of the channel by using the neighbor tables of the sibling nodes and the parent node of the channel, and establish the neighbor table of the channel node. Useful information of the channel layer data structure used in constructing the channel octree is extracted and merged to obtain channel layer data structure information. The storage space required for the channel octree is obtained according to the channel layer offset array in the channel node neighbor table. The channel layer data structure information is then copied into the channel octree in sequence. A channel benchmark point is provided, and the channel node where the channel benchmark point is located is found by iterative search in the channel octree using the coordinate information of the channel benchmark point. The channel search radius is obtained based on the information of the channel node. Search all channel nodes in all channel search directions within the channel search radius, and generate a channel node search list for different channel search directions; The points contained in each channel node in the channel node search list under the different channel search directions are merged into a new channel search list. Based on the information of the points contained in the channel nodes in the new channel search list, a channel point search list is generated, and the top K points closest to the channel target point are found in the channel point search list. The information of the channel node includes: channel node number and channel node coordinates. There are no duplicate channel nodes in the channel node search list under different search directions. The channel point cloud data is a series of discrete and unordered three-dimensional channel point cloud data. When establishing the channel node neighbor table, the following is included: Obtain the offsets of the upper, middle and lower layers of the channel parent node's neighbor table. Use a for loop to iterate n1 times. In each iteration, obtain the directional neighbors of the upper, middle and lower layers of the channel parent node's neighbor table projected onto the z-axis. The missing positions of the channel sibling nodes in different layers are determined by obtaining the starting direction of the missing neighbors and the positions of the channel child nodes in the upper and lower layers. A for loop is then performed. In the n2 iterations, the neighbors in the middle, upper and lower layers are filled in counterclockwise. The direction of the channel sibling node neighbors in the positive z-axis direction of the channel child node is obtained, and all channel sibling nodes are found. The location of the missing neighbor in the z-axis direction of the channel child node is determined by analyzing which layer of the upper and lower layers the channel child node is on. After obtaining the z-axis neighbor position of the channel parent node to be visited and the starting position of the missing neighbor of the channel child node, the missing neighbor information is obtained sequentially in the counterclockwise direction starting from the starting direction by using a for loop n3 times. Based on the missing neighbor information, the neighbor information of the channel child node in the positive z-axis direction is obtained.

2. The method for retrieving channel point cloud data using GPU-based octree parallel fast KNN according to claim 1, characterized in that, When generating the search list of channel nodes under different channel search directions, the following are included: A breadth-first search algorithm is adopted, and each channel orientation is assigned to a different channel search direction and range. By extending all channel search directions, all channel nodes within the entire channel search radius are found, and the searched channel nodes are added to the channel search list of the corresponding channel search direction, thus generating the channel node search list under the different channel search directions.

3. The method for retrieving channel point cloud data using GPU-based octree parallel fast KNN according to claim 2, characterized in that, When adding the searched channel nodes to the channel search list, the following is included: Atomic operation functions are used as communication tools between threads. These atomic operation functions are used to determine whether a searched channel node has already been included in the channel search list. If so, it is not included in the searched channel node.

4. The method for retrieving channel point cloud data using GPU-based octree parallel fast KNN according to claim 2, characterized in that, When assigning different search directions and ranges to each waterway bearing, this includes: Based on the characteristics of the channel search direction, all channel search directions are divided into channel oblique angle search directions and channel straight search directions; Based on the characteristics of the three-layer structure of the channel node neighbor table, the channel oblique search direction and the channel forward search direction are further divided into the channel middle layer oblique search direction, the channel upper layer oblique search direction, the channel lower layer oblique search direction, the channel middle layer forward search direction, the channel upper layer forward search direction, and the channel lower layer forward search direction. A channel z-axis search direction is further divided between the upper channel positive search direction and the lower channel positive search direction.

5. The method for retrieving channel point cloud data using GPU-based octree parallel fast KNN according to claim 4, characterized in that, When assigning different search directions and ranges to each waterway bearing, it also includes: The channel mid-level oblique angle search direction takes the mid-level oblique angle direction as the main search route, searches for channel nodes extending from the current channel node in the mid-level oblique angle direction, until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius. Using the positive directions of the preceding and following middle layers corresponding to the oblique direction of the middle layer as auxiliary search directions, search for channel nodes extending from the current channel node in the auxiliary search directions until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited.

6. The method for retrieving channel point cloud data using GPU-based octree parallel fast KNN according to claim 4, characterized in that, When assigning different search directions and ranges to each waterway bearing, it also includes: The upper and lower channel oblique angle search directions are the main search routes, which are the upper and lower oblique angle directions respectively. The search continues until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius. The middle layer oblique angle direction is used as one auxiliary search direction, and the corresponding positive z-axis direction is used as another auxiliary search direction; Search for the channel node where the current channel node extends in the auxiliary search direction until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius. Search for channel nodes that extend from the current channel node in the other auxiliary search direction until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited. The positive search direction in the middle layer of the channel uses the positive middle layer direction as the main search route, and searches for channel nodes extending in the positive middle layer direction of the current channel node until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited.

7. The method for retrieving channel point cloud data using GPU-based octree parallel fast KNN according to claim 4, characterized in that, When assigning different search directions and ranges to each waterway bearing, it also includes: The upper and lower positive search directions of the waterway are the main search routes, which are the upper and lower positive directions. The search continues to search for waterway nodes extending in the upper and lower positive directions of the current waterway node until the shortest distance between the visited waterway node and the waterway standard point is not less than the waterway search radius. The positive direction of the middle layer is used as one auxiliary search direction, and the corresponding positive z-axis direction is used as the other auxiliary search direction; Search for the channel nodes that extend from the current channel node in the auxiliary search direction until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited. Search for channel nodes that extend from the current channel node in the other auxiliary search direction until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited. The channel z-axis search direction is based on the positive z-axis direction as the main search route. The search continues for channel nodes extending along the positive z-axis direction of the current channel node until the shortest distance between the visited channel node and the channel standard point is not less than the channel search radius and the visited channel node is not marked as visited.

8. The method for retrieving channel point cloud data using GPU-based octree parallel fast KNN according to claim 1, characterized in that, When generating the channel point search list based on the information of the points contained in the channel nodes in the new channel search list, the following is included: Obtain the prefix sum of the lengths of the channel node search lists under different channel search directions, allocate appropriate space for the new channel search list based on the prefix sum of the lengths, and merge the channel node search lists under different channel search directions to obtain the new channel search list. Obtain the range and starting position of the points contained in the channel nodes in the new channel search list; Obtain the prefix sum of the range of points contained in the new channel search list, allocate appropriate space to the channel search point list based on the prefix sum of the range, and copy the points within the range of the node to the channel search point list.

9. A GPU-based octree parallel fast KNN system for retrieving channel point cloud data, characterized in that, include: Channel Octree Construction Unit: Used to construct a channel octree layer by layer from top to bottom based on channel point cloud data. After determining the channel nodes contained in each layer of the channel octree, the channel node information of each layer is stored independently in the form of an array, and each array and each node corresponds to a thread. Channel node neighbor table establishment unit: used to obtain channel child node neighbor table information through the channel sibling node and channel parent node neighbor tables, and establish the channel node neighbor table; Channel octree generation unit: used to extract and merge useful information of the channel layer data structure used in constructing the channel octree, obtain channel layer data structure information, obtain the storage space required for the channel octree according to the channel layer offset array in the channel node neighbor table, and copy the channel layer data structure information into the channel octree in sequence; Channel search unit: It is used to provide a channel benchmark point, and through the coordinate information of the channel benchmark point, iteratively search in the channel octree to find the channel node where the channel benchmark point is located, and obtain the channel search radius based on the information of the channel node; it searches all channel nodes in all channel search directions within the channel search radius, and generates a channel node search list under different channel search directions; Channel search point list generation unit: used to merge the points contained in each channel node in the channel node search list under different channel search directions into a new channel search list, and generate a channel point search list based on the information of the points contained in the channel nodes in the new channel search list; Channel search unit: used to find the top K points closest to the channel target point in the channel point search list; The channel point cloud data is acquired using lidar; the channel node information includes: The channel node number and coordinates, the channel node search list under different search directions has no duplicate channel nodes, and the channel point cloud data is a series of discrete, unordered three-dimensional channel point cloud data. When establishing the channel node neighbor table, the following is included: Obtain the offsets of the upper, middle and lower layers of the channel parent node's neighbor table. Use a for loop to iterate n1 times. In each iteration, obtain the directional neighbors of the upper, middle and lower layers of the channel parent node's neighbor table projected onto the z-axis. The missing positions of the channel sibling nodes in different layers are determined by obtaining the starting direction of the missing neighbors and the positions of the channel child nodes in the upper and lower layers. A for loop is then performed. In the n2 iterations, the neighbors in the middle, upper and lower layers are filled in counterclockwise. The direction of the channel sibling node neighbors in the positive z-axis direction of the channel child node is obtained, and all channel sibling nodes are found. The location of the missing neighbor in the z-axis direction of the channel child node is determined by analyzing which layer of the upper and lower layers the channel child node is on. After obtaining the z-axis neighbor position of the channel parent node to be visited and the starting position of the missing neighbor of the channel child node, the missing neighbor information is obtained sequentially in the counterclockwise direction starting from the starting direction by using a for loop n3 times. Based on the missing neighbor information, the neighbor information of the channel child node in the positive z-axis direction is obtained.

Citation Information

Patent Citations

  • Topological data analysis of data from a fact table and related dimension tables

    US20180025035A1

  • Map creation and localization for autonomous driving applications

    US20210063200A1