Map voxel searching method and device, computer device and storage medium

CN115393382BActive Publication Date: 2026-08-07GUANGZHOU XIAOMA ZHIXING TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU XIAOMA ZHIXING TECH CO LTD
Filing Date
2022-07-28
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

在已构建的地图中,经常需要查找某个点附近的临近点或者临近区域,由于海量的点云数据不均匀且稀疏地分布在广阔的空间中,这使得查找某个点附近的临近点有点困难

Benefits of technology

[0059]上述地图中体素查找方法、装置、计算机设备和存储介质,通过接收终端发送的当前地图中待查询点的近邻体素的查询请求,当前地图包括多个体素;对各高度块中的体素根据最近邻查找算法进行查找,得到待查询点对应的一个或多个近邻体素的指向信息,各高度块为预先对当前地图中的各体素进行划分得到;将指向信息发送至终端。本申请可以预先对当前地图中的各体素进行划分成多个高度块,基于各高度块进行查找近邻体素,解决了传统技术中对整个点云地图进行搜索所带来的查找效率低下的问题,提高了查找效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115393382B_ABST
    Figure CN115393382B_ABST
Patent Text Reader

Abstract

The application relates to a voxel searching method and device in a map, computer equipment and a storage medium. The method comprises the following steps: receiving a searching request of a near-neighbor voxel of a to-be-searched point in a current map sent by a terminal, wherein the current map comprises a plurality of voxels; searching the voxels in each height block according to a nearest neighbor searching algorithm to obtain pointing information of one or more near-neighbor voxels corresponding to the to-be-searched point, wherein each height block is obtained by pre-dividing each voxel in the current map; and sending the pointing information to the terminal. The application can pre-divide each voxel in the current map into a plurality of height blocks, and search the near-neighbor voxels based on each height block, thereby solving the problem of low searching efficiency caused by searching the entire point cloud map in the prior art, and improving the searching efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, computer device, and storage medium for finding voxels in a map. Background Technology

[0002] LiDAR point cloud maps play a crucial role in the perception and motion planning of autonomous robots (including but not limited to: self-driving vehicles, robots, unmanned aerial vehicles, etc.). Several methods for generating LiDAR point cloud maps are currently available. Within the constructed map, it is often necessary to find neighboring points or nearby regions of a given point. However, due to the massive, uneven, and sparse distribution of point cloud data across a vast space, finding neighboring points of a given point is challenging.

[0003] In traditional technical solutions, when searching for nearby points, the entire point cloud map is often searched, resulting in low search efficiency. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer device, and storage medium for finding voxels in a map to address the aforementioned technical problems.

[0005] A method for finding voxels in a map, the method includes:

[0006] The receiving terminal sends a query request for the nearest voxels of the point to be queried in the current map;

[0007] Based on the location information of the point to be queried in the query request and the map data corresponding to the current map, determine the information of the target height block corresponding to the point to be queried. The map data includes the information of the current voxel to which each point belongs in the current map and the information of the height block to which each current voxel belongs.

[0008] Based on the information of the target height block, the nearest neighbor search algorithm is used to determine the pointing information of the nearest voxels corresponding to the query point;

[0009] Send the information to the terminal.

[0010] In one embodiment, the map data further includes voxel parameters for each current voxel, wherein each voxel parameter includes a key value determined based on point cloud data of each point in the current voxel, and the voxel lookup method in the map further includes:

[0011] Acquire the point cloud data of the current frame, and divide the corresponding point cloud into multiple new voxels based on the point cloud data;

[0012] The voxel parameters of each newly added voxel are determined based on the point cloud data of each point in each newly added voxel. The voxel parameters of each newly added voxel include the key value of each newly added voxel.

[0013] The newly added voxels are sorted according to a preset rule based on their key values ​​to obtain the first voxel sequence.

[0014] Obtain the second voxel sequence composed of each current voxel in the current map. The second voxel sequence is a sequence generated by sorting each current voxel according to a preset rule based on its voxel parameters.

[0015] Iterate through the sequence from the beginning and compare the key values ​​of each newly added voxel in the first voxel sequence with the key values ​​of each current voxel in the second voxel sequence.

[0016] The voxel parameters of the voxels with smaller key values ​​in each comparison result are obtained sequentially and stored in the preset target memory.

[0017] A new map is obtained based on the parameters of each voxel in the target memory.

[0018] In one embodiment, the above-described voxel lookup method in a map further includes:

[0019] Divide the three-dimensional coordinate space of each point on the current map to obtain each current voxel;

[0020] Divide each current voxel into height blocks;

[0021] The above-mentioned determination of the target height block information corresponding to the query point based on the location information of the query point in the query request and the map data corresponding to the current map includes:

[0022] Based on the location information of the point to be queried and the information of the current voxel to which each point belongs in the map data, determine the information of the current voxel to which the point to be queried belongs;

[0023] Based on the information of the current voxel to which the point to be queried belongs and the information of the height blocks to which each voxel belongs in the map data, determine the information of the height block to which the point to be queried belongs.

[0024] Based on the information of the height block to which the point to be queried belongs and the information of the adjacent height blocks, determine the information of the target height block.

[0025] In one embodiment, the above-described voxel lookup method in a map further includes:

[0026] Obtain the sub-voxel sequences corresponding to each height block from the first voxel sequence;

[0027] Based on the coordinate values ​​of each point in the current voxel corresponding to each height block, create a corresponding kdtree for the sub-voxel sequence corresponding to each height block;

[0028] The above-mentioned process of determining the pointing information of the nearest neighbor voxels corresponding to the query point using the nearest neighbor search algorithm based on the target height block information includes:

[0029] The nearest neighbor search algorithm is used to perform a K-neighbor search on the kdtree corresponding to the target height block to obtain the pointing information of the nearest voxels corresponding to the query point.

[0030] In one embodiment, the voxel parameters of each current voxel further include the number of points, centroid, and covariance of each voxel; the voxel parameters of each newly added voxel further include the number of points, centroid, and covariance of each newly added voxel; and the voxel lookup method in the map further includes:

[0031] If the comparison result is that the new voxel has the same key value as the current voxel, then the points of the current voxel and the new voxel with the same key value are merged to obtain the points of the merged voxel.

[0032] The current voxels with the same key value and the newly added voxels are merged based on their number of points and centroids to obtain the centroids of the merged voxels.

[0033] The covariance of the merged voxels is obtained by merging the current voxels and newly added voxels with the same key value based on their number of points and covariance.

[0034] Store the number of points, centroids, and covariance of the merged voxels into the target memory.

[0035] In one embodiment, the above-described voxel lookup method in a map further includes:

[0036] If the key value of the merged voxel is the same as the key value of an existing voxel in the target memory, then the voxel parameters of the merged voxel are merged with the voxel parameters of the voxel with the same key value in the target memory and stored in the target memory.

[0037] In one embodiment, the above-described voxel lookup method in a map further includes:

[0038] When the size of the new map exceeds a preset threshold, obtain the voxels to be deleted from the new map;

[0039] Start traversing from the first voxel in the new map using the preset first and second pointers;

[0040] If the voxel pointed to by the first pointer is the voxel to be deleted, then the second pointer remains stationary and the first pointer traverses backward.

[0041] If the voxel pointed to by the first pointer is the voxel to be retained, then the voxel pointed to by the first pointer is moved to the position pointed to by the second pointer to replace the voxel originally pointed to by the second pointer, and the first pointer traverses backward.

[0042] The loop executes the following steps: if the voxel pointed to by the first pointer is the voxel to be deleted, then the second pointer remains stationary and the first pointer traverses backward; and if the voxel pointed to by the first pointer is the voxel to be retained, then the voxel pointed to by the first pointer is moved to the position pointed to by the second pointer to replace the voxel originally pointed to by the second pointer, and the first pointer traverses backward.

[0043] When the first pointer reaches the last voxel in the current map, delete all voxels after the voxel pointed to by the second pointer.

[0044] A device for finding voxels in a map, comprising:

[0045] The receiving module is used to receive query requests from the terminal for the nearest voxels of the point to be queried in the current map;

[0046] The determination module is used to determine the target height block information corresponding to the query point based on the location information of the query point in the query request and the map data corresponding to the current map. The map data includes the information of the current voxel to which each point belongs and the information of the height block to which each current voxel belongs.

[0047] The lookup module is used to determine the pointing information of the nearest neighbor voxels corresponding to the point to be queried based on the information of the target height block using the nearest neighbor search algorithm;

[0048] The sending module is used to send the target information to the terminal.

[0049] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:

[0050] The receiving terminal sends a query request for the nearest voxels of the point to be queried in the current map;

[0051] Based on the location information of the point to be queried in the query request and the map data corresponding to the current map, determine the information of the target height block corresponding to the point to be queried. The map data includes the information of the current voxel to which each point belongs in the current map and the information of the height block to which each current voxel belongs.

[0052] Based on the information of the target height block, the nearest neighbor search algorithm is used to determine the pointing information of the nearest voxels corresponding to the query point;

[0053] Send the information to the terminal.

[0054] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, performs the following steps:

[0055] The receiving terminal sends a query request for the nearest voxels of the point to be queried in the current map;

[0056] Based on the location information of the point to be queried in the query request and the map data corresponding to the current map, determine the information of the target height block corresponding to the point to be queried. The map data includes the information of the current voxel to which each point belongs in the current map and the information of the height block to which each current voxel belongs.

[0057] Based on the information of the target height block, the nearest neighbor search algorithm is used to determine the pointing information of the nearest voxels corresponding to the query point;

[0058] Send the information to the terminal.

[0059] The aforementioned voxel lookup method, apparatus, computer equipment, and storage medium in the map receive a query request from a terminal for nearest neighbor voxels of a point to be queried in the current map, which includes multiple voxels. The voxels in each height block are searched using a nearest neighbor search algorithm to obtain pointing information for one or more nearest neighbor voxels corresponding to the point to be queried. Each height block is pre-divided from the voxels in the current map. The pointing information is then sent to the terminal. This application pre-divides the voxels in the current map into multiple height blocks and searches for nearest neighbor voxels based on each height block, solving the problem of low search efficiency caused by searching the entire point cloud map in traditional technologies and improving search efficiency. Attached Figure Description

[0060] Figure 1 This is an application environment diagram of a method for finding voxels in a map in one embodiment;

[0061] Figure 2 This is a flowchart illustrating a method for finding voxels in a map in one embodiment;

[0062] Figure 3 This is a schematic diagram illustrating the process of updating the current map in one embodiment;

[0063] Figure 4 This is a detailed flowchart illustrating the steps involved in determining the target height block information corresponding to the query point based on the location information of the query point in the query request and the map data corresponding to the current map in one embodiment.

[0064] Figure 5 This is a schematic diagram illustrating the process of creating a kdtree for each height block in one embodiment;

[0065] Figure 6 This is a schematic diagram of the process of merging a new voxel with the current voxel in one embodiment;

[0066] Figure 7 This is a schematic diagram illustrating the addition of a new voxel to the current map in one embodiment;

[0067] Figure 8 This is a schematic diagram of the voxel deletion process in one embodiment;

[0068] Figure 9 This is a structural block diagram of a voxel lookup device in a map in one embodiment;

[0069] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0070] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0071] Please refer to Figure 1 , Figure 1 This is a schematic diagram illustrating the application environment of a voxel lookup method in a map, provided as an exemplary embodiment of this application. For example... Figure 1 As shown, the application environment includes a server 100 and a terminal 101. The server 100 and the terminal 101 can communicate with each other through a network 102 to implement the voxel lookup method in the map of this application.

[0072] Server 100 receives a query request from terminal 101 for the nearest voxels of a point to be queried in the current map; based on the location information of the point to be queried in the query request and the map data corresponding to the current map, it determines the information of the target height block corresponding to the point to be queried. The map data includes the information of the current voxel to which each point belongs and the information of the height block to which each current voxel belongs; based on the information of the target height block, it uses a nearest neighbor search algorithm to determine the pointing information of the nearest voxels corresponding to the point to be queried; and sends the pointing information to terminal 101. Server 100 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0073] Terminal 101 is used to send a query request for the nearest voxels of the point to be queried in the current map to server 100, and to receive the pointing information of the nearest voxels corresponding to the point to be queried. Terminal 101 may be, but is not limited to, various personal computers, laptops, smartphones, tablets and portable wearable devices.

[0074] Network 102 is used to realize the network connection between terminal 101 and server 100. Specifically, network 102 may include various types of wired or wireless networks.

[0075] In one embodiment, such as Figure 2 As shown, a method for finding voxels in a map is provided, which can be applied to... Figure 1Taking the server in the example, the following steps are included:

[0076] S11. Receive a query request from the terminal for the nearest voxels of the point to be queried in the current map. In this application, the current map can be a point cloud map. The point to be queried can be a point in the current map sent by the terminal. The nearest voxels can be voxels within a preset range near the point to be queried. In this application, the voxels can be cubic or cuboid units obtained by dividing the three-dimensional coordinate system space of each point in the current map. Furthermore, the query request in this application can carry information about the point to be queried.

[0077] S12. Based on the location information of the point to be queried in the query request and the map data corresponding to the current map, determine the information of the target height block corresponding to the point to be queried. The map data includes the information of the current voxel to which each point belongs in the current map and the information of the height block to which each current voxel belongs.

[0078] In this application, the location information of the point to be queried can be the coordinate value information of the point to be queried. The map data can be the data related to each point included in the current map. Specifically, the map data can include the coordinate values ​​of each point in the current map, the information of the current voxel to which each point belongs, and the information of the height block to which each current voxel belongs. Here, the current voxel is the voxel included in the current map. In this application, the three-dimensional coordinate system space where each point in the map is located is divided to obtain multiple current voxels, and each current voxel can be a small cube or cuboid with length × width × height. Each current voxel can include multiple points. In this application, the length, width, and height of each current voxel can be set by the user. In order to accelerate on a computer, the length, width, and height of each current voxel can use dimensions with a base of 2, such as 0.125m, 0.25m, and 0.5m. The information of the current voxel can include the coordinate value information of the current voxel and the number of points it contains.

[0079] Furthermore, this application further subdivides the already defined current voxels into height blocks. Each height block may include multiple voxels. For example, when subdividing the current voxels, the three-dimensional coordinate system where the voxels are located can be cut at preset distances along the Z-axis. The information of the aforementioned height blocks may include the position information of the height blocks, the identification information of the height blocks, and the information of each current voxel included in each height block, etc.

[0080] In this application, the location information of the point to be queried can be matched with map data. Based on the relationship between each point and each current voxel in the map data and the relationship between each current voxel and each height block, the information of the target height block that matches the location information of the point to be queried can be obtained.

[0081] S13. Based on the information of the target height block, the nearest neighbor search algorithm is used to determine the pointing information of the nearest voxels corresponding to the point to be queried.

[0082] In this application, the information of the target height block can include the information of each current voxel included in the target height block. The information of each current voxel can include the coordinate values ​​and distribution information of each point included in each current voxel. The distribution information can be the covariance of each point included in each current voxel. The nearest neighbor search algorithm can be to pre-build a kd-tree for the target height block and find the nearest neighbor voxels corresponding to the query point through the kd-tree of the target height block. Here, kd-tree (short for k-dimensional tree) is a data structure for partitioning k-dimensional data space. It is mainly used for searching key data in multi-dimensional space (such as range search and nearest neighbor search). The tree stores some K-dimensional data. Constructing a kd-tree on a K-dimensional data set represents a partition of the K-dimensional space formed by the K-dimensional data set, that is, each node in the tree corresponds to a K-dimensional hyperrectangular region.

[0083] The aforementioned pointing information can be information pointing to the storage location of the nearest voxel corresponding to the query point in the corresponding memory. That is, through this pointing information, the data of the nearest voxel corresponding to the query point stored in the corresponding memory can be obtained.

[0084] S14. Send the pointing information to the terminal.

[0085] In one possible application scenario of obtaining pointing information in this application, the voxel to which the query point belongs and its neighboring voxels can be determined based on the information of the neighboring voxels of the query point, and the location of the query point on the map can be further determined.

[0086] In another possible application scenario, after determining the voxel to which the query point belongs and its neighboring voxels, the surrounding environment information of the map where the query point is located can be determined. For example, when determining the edge line of object A, the edge line information of object A can be determined by sequentially finding its neighboring points based on the points on the edge.

[0087] Please refer to Figure 3 In one embodiment, the map data may further include voxel parameters of each current voxel, wherein the voxel parameters of each current voxel include key values ​​determined based on the point cloud data of each point in each current voxel, and the voxel lookup method in the map may further include:

[0088] S31. Obtain the point cloud data of the current frame, and divide the corresponding point cloud into multiple new voxels based on the point cloud data;

[0089] S32. Determine the voxel parameters of each newly added voxel based on the point cloud data of each point in each newly added voxel. The voxel parameters of each newly added voxel include the key value of each newly added voxel.

[0090] S33. Sort each newly added voxel according to the key value of each voxel according to a preset rule to obtain the first voxel sequence.

[0091] S34. Obtain the second voxel sequence composed of each current voxel in the current map. The second voxel sequence is a sequence generated by sorting each current voxel according to a preset rule based on the voxel parameters of each voxel.

[0092] S35. Traverse from the beginning and compare the key values ​​of each newly added voxel in the first voxel sequence with the key values ​​of each current voxel in the second voxel sequence.

[0093] S36. Sequentially obtain the voxel parameters of the voxels with smaller key values ​​in each comparison result and store them in the preset target memory.

[0094] S37. Obtain a new map based on the voxel parameters in the target memory.

[0095] In this application, the voxel parameters mentioned above are data used to describe the attributes of each current voxel. The key value of each current voxel can be a unique identifier for that voxel, calculated based on its spatial location. Since the number of voxels in the local map space is enormous, but the number of voxels with data (useful) in actual applications is relatively small and sparsely distributed in space, only the necessary voxels are stored. Therefore, a key is needed to index each current voxel. Similarly, the key value of each newly added voxel is a unique identifier for that voxel, calculated based on its spatial location. In addition to the voxel's key value, the voxel parameters can also include other voxel parameters, such as the location of the voxel's centroid and the number of points included in the voxel.

[0096] The aforementioned current frame is either a newly scanned frame of point cloud data, or a frame of point cloud data to be added to the current map.

[0097] When calculating the key value of each newly added voxel, the X, Y, and Z coordinates of each voxel can be shifted and stored as a 64-bit integer, supporting a range of 4194*4194*16km^3. The specific calculation formula is as follows:

[0098] index = x index |y index <<bit x |z index <<(bits) y +bits x )

[0099] in,

[0100] index_offset=[1<<(bits_x-1), 1<<(bits_y-1), 1<<(bits_z-1)]

[0101] The index is the key (key value) of the voxel, which is the unique identifier of the voxel and is a 64-bit unsigned integer.

[0102] x index y index and z index The coordinates of a voxel on the three coordinate axes (the Nth voxel in a certain direction).

[0103] bit x ,bit y and bit z This represents the number of bits occupied by the voxel's three-axis coordinates in the key value.

[0104] index_offset is the key corresponding to the origin point on the map, and it is the "middle" key.

[0105] The above-mentioned sorting of each newly added voxel according to the key value of each newly added voxel according to a preset rule to obtain the first voxel sequence can be: sorting each newly added voxel in ascending order of key value to obtain the first voxel sequence.

[0106] The second voxel sequence mentioned above is a sequence generated by sorting the voxel parameters of each current voxel in ascending order of key values.

[0107] The above-mentioned process of traversing and comparing the key values ​​of each newly added voxel in the first voxel sequence with the key values ​​of each current voxel in the second voxel sequence from the beginning; and sequentially obtaining the voxel parameters of the voxels with smaller key values ​​in each comparison result and storing them in a preset target memory, may include:

[0108] Compare the current voxel in the first voxel sequence with the current voxel in the second voxel sequence, and obtain the voxel parameter of the target voxel with the smaller key value in the current round and store it in the target memory;

[0109] Obtain the next voxel in the voxel sequence containing the target voxel, and use it as the current voxel in that sequence;

[0110] The current voxel of this sequence is compared with the current voxel of another sequence, and the target voxel with the smaller key value in the current round is obtained and stored in the target memory;

[0111] Get the next voxel in the voxel sequence containing the target voxel with the smaller key value in the current round, and use it as the current voxel in that sequence. Return to the steps above of comparing the current voxel of that sequence with the current voxel of another sequence and storing the target voxel with the smaller key value in the current round into the target memory, until the next voxel in the voxel sequence containing the target voxel is obtained, which is the last voxel in that voxel sequence.

[0112] In this application, the map data corresponding to the current map can be stored in a preset current memory. The target memory can be a twin memory space of the same size as the current memory, used for map updates and maintenance. That is, each time a new scan frame (i.e., a new voxel) needs to be added to the current map, the voxel sequences need to be merged through the target memory, combining two sequences into one and storing it in the target memory. Based on the target memory, a new map is generated accordingly. This application can achieve map updates and maintenance through this implementation method. Simultaneously, since voxels are arranged in an ordered manner in the memory space, this improves the efficiency of voxel addition during map updates, thereby enhancing the efficiency of map updates and maintenance.

[0113] In one embodiment, the above-described voxel lookup method in a map may further include:

[0114] Divide the three-dimensional coordinate space of each point on the current map to obtain each current voxel;

[0115] Divide each current voxel into height blocks;

[0116] Please refer to Figure 4 The aforementioned determination of the target height block information corresponding to the query point based on the location information of the query point in the query request and the map data corresponding to the current map may include:

[0117] S41. Based on the location information of the point to be queried and the information of the current voxel to which each point belongs in the map data, determine the information of the current voxel to which the point to be queried belongs.

[0118] S42. Based on the information of the current voxel to which the point to be queried belongs and the information of the height block to which each voxel belongs in the map data, determine the information of the height block to which the point to be queried belongs.

[0119] S43. Determine the information of the target height block based on the information of the height block to which the point to be queried belongs and the information of the adjacent height blocks.

[0120] In this application, the aforementioned map data includes information on each height block, information on each current voxel included in each height block, and information on each point included in each current voxel. The information on each height block may include its identifier and location information. The information on each current voxel may include its voxel parameters, such as its key value, the distribution information of points within the current voxel, and its location information. The information on each point may include its location information. This application can determine the information of the current voxel to which the queried point belongs by matching the location information of the point to be queried with the distribution information and location information of points within each current voxel.

[0121] Furthermore, the information of the voxel to which the queried point belongs is matched with the information of each current voxel included in each height block in the map data to determine the information of the height block to which the queried point belongs. The target height block can be the height block to which the queried point belongs and / or the height blocks adjacent to the height block to which the queried point belongs. The information of the target height block can include its identifier and location information, etc.

[0122] This application, through its implementation method, can divide each current voxel in the current map into height blocks, determine the target height block from each height block, and search for voxels from the target height block, thus avoiding searching for neighboring voxels of the queried point from the entire point cloud map and improving search efficiency.

[0123] Please refer to Figure 5 In one embodiment, the above-described voxel lookup method in a map may further include:

[0124] S51. Obtain the sub-voxel sequences corresponding to each height block from the first voxel sequence;

[0125] S52. Based on the coordinate values ​​of each point in the current voxel corresponding to each height block, create a corresponding kdtree for the sub-voxel sequence corresponding to each height block;

[0126] The above-mentioned process of determining the pointing information of the nearest neighbor voxels corresponding to the query point using the nearest neighbor search algorithm based on the target height block information includes:

[0127] The nearest neighbor search algorithm is used to perform a K-neighbor search on the kdtree corresponding to the target height block to obtain the pointing information of the nearest voxels corresponding to the query point.

[0128] In this application, since each current voxel in the current map is a sequence ordered by key value in memory, and each height block is divided according to the position information of each current voxel, each current voxel in each height block is also ordered.

[0129] After dividing the current map into multiple height blocks in this application, a corresponding KD-tree is created for each height block. In the above step of performing a K-neighborhood search on the KD-tree corresponding to the target height block according to the nearest neighbor search algorithm to obtain the pointing information of the neighboring voxels corresponding to the query point, the specific K-neighborhood search may include:

[0130] (1) Starting from the root node, access the KD-Tree downward according to the comparison results between the query data Q and each node until reaching the leaf node.

[0131] The comparison between Q and a node refers to comparing the value of Q corresponding to the k dimension in the node with m. If Q(k) < m, access the left subtree; otherwise, access the right subtree. When reaching the leaf node, calculate the distance between Q and the data stored on the leaf node, record the data point corresponding to the minimum distance, denoted as the current "nearest neighbor point" Pcur and the minimum distance Dcur.

[0132] (2) Perform a backtracking operation, which is to find a "nearest neighbor point" closer to Q. That is, judge whether there are points closer to Q in the unvisited branches, and the distance between them is less than Dcur.

[0133] If the distance between Q and the unvisited branch under its parent node is less than Dcur, it is considered that there is data closer to P in this branch. Enter this node and perform the same search process as in step (1). If a closer data point is found, update it as the current "nearest neighbor point" Pcur and update Dcur.

[0134] If the distance between Q and the unvisited branch under its parent node is greater than Dcur, it means that there is no point closer to Q in this branch.

[0135] The backtracking judgment process is performed from bottom to top until there is no branch closer to P when backtracking to the root node.

[0136] Through this implementation method, this application can divide the entire current map into multiple height blocks, create a corresponding KD-tree for each height block. After determining the target height block corresponding to the query point, only need to perform a K-neighborhood search in the target height block using its KD-tree, which solves the problem of low search efficiency caused by constructing a KD-tree for the entire point cloud map in the traditional technology and improves the search speed.

[0137] Please refer to Figure 6 , in one of the embodiments, the voxel parameters of each of the above current voxels may further include the number of points, centroid, and covariance of each voxel. The voxel parameters of each of the above newly added voxels further include the number of points, centroid, and covariance of each newly added voxel. The above method for finding voxels in the map may further include:

[0138] S61. If the comparison result is that the new voxel has the same key value as the current voxel, then the points of the current voxel and the new voxel with the same key value are merged to obtain the points of the merged voxel.

[0139] S62. Merge the current voxels and newly added voxels with the same key value according to their number of points and centroids to obtain the centroids of the merged voxels.

[0140] S63. Merge the current voxels and newly added voxels with the same key value based on their number of points and covariance to obtain the covariance of the merged voxels.

[0141] S64. Store the number of points, centroids, and covariance of the merged voxels into the target memory.

[0142] In this application, the aforementioned voxel parameters can be user-defined. Specifically, users can pre-set the data included in the descriptive parameters of each current voxel. In this application, the pre-set voxel parameters for each current voxel may include key values, number of points, centroid location information, and covariance. The covariance is a matrix used to describe the distribution of points in each current voxel.

[0143] Similarly, the voxel parameters of the newly added voxels mentioned above also include key values, number of points, centroid location information, and covariance. In this application, voxel parameters can be set according to actual needs; for example, they can be set to include commonly used geometric features (such as points, lines, and surfaces) and semantic features (such as vegetation, drivable areas, and buildings). The voxel parameters of this application are stored in a pre-defined memory space, such as the aforementioned target memory and the aforementioned current memory. The current memory is used to store the voxel parameters corresponding to each current voxel in the current map. The target memory is used to store the voxel parameters of each voxel in the merged sequence of the first voxel sequence and the second voxel sequence when the current map is updated.

[0144] Specifically, assuming the current voxel and the newly added voxel with the same key value are voxel A and voxel B respectively, the resulting merged voxel is voxel C, and voxel A has m points, voxel B has n points, and voxel C has q points, then if the comparison result shows that the newly added voxel and the current voxel have the same key value, then the points of the current voxel and the newly added voxel with the same key value are merged to obtain the points of the merged voxel. The specific merging formula is as follows:

[0145] q = m + n

[0146] The above method merges current voxels and newly added voxels with the same key value based on their point count and centroid, resulting in the centroid of the merged voxels. The specific merging formula is as follows:

[0147]

[0148] Where, p new To merge the centroid position information of voxel C. n and m are the number of points in voxel A and voxel B, respectively, p old p is the center of mass of old voxels A and B. feature The centroid of the merged voxel C.

[0149] The above method merges current voxels with the same key value and newly added voxels based on their number of points and covariance, yielding the covariance of the merged voxels. The specific merging formula is as follows:

[0150]

[0151] Among them, Cov new To combine the covariance of voxel C. n and m are the number of voxels A and B, respectively, p old p is the center of mass of old voxels A and B. feature The center of mass for the combined voxel C. old Cov represents the covariance of old voxels A and B. feature The covariance of the combined voxel C.

[0152] Please refer to Figure 7 , Figure 7 This is a schematic diagram of adding a new voxel to the current map in one embodiment. Figure 7 The sequence includes a second voxel sequence 71, current voxels 711 in the second voxel sequence, key values ​​712 for each current voxel, a first voxel sequence 72, and a voxel sequence 73 obtained by adding the first voxel sequence to the second voxel sequence. The first voxel sequence 72 includes newly added voxels with key values ​​of 1, 2, 6, 7, 11, 11, and 12. The second voxel sequence 71 includes current voxels with key values ​​of 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10. Comparing each newly added voxel in the first voxel sequence with each current voxel in the second voxel sequence can include the following steps:

[0153] Get the key value 1 of the first voxel in the second voxel sequence 71 and the key value 1 of the first voxel in the first voxel sequence 72, compare them, and if the key values ​​are the same, merge the voxel parameters of the two voxels and store the merged voxel parameters into the target memory.

[0154] Get the key value 2 of the second voxel in the second voxel sequence 71 and the key value 2 of the second voxel in the first voxel sequence 72, compare them, and if the key values ​​are the same, merge the voxel parameters of the two voxels and store the merged voxel parameters into the target memory.

[0155] Obtain the key value 3 of the third voxel in the second voxel sequence 71 and the key value 6 of the third voxel in the first voxel sequence 72, compare them, obtain the voxel corresponding to the smaller key value 3, and store it in the target memory;

[0156] The key value 4 of the fourth voxel in the second voxel sequence 71 is compared with the key value 6 of the third voxel in the first voxel sequence 72. The voxel corresponding to the smaller key value 4 is obtained and stored in the target memory.

[0157] The key value 5 of the fifth voxel in the second voxel sequence 71 is compared with the key value 6 of the third voxel in the first voxel sequence 72. The voxel corresponding to the smaller key value 5 is obtained and stored in the target memory.

[0158] This process continues, with each iteration involving obtaining the key value of the next voxel from the voxel sequence with the smaller key value and comparing it with the current voxel from another voxel sequence, until the last voxel is matched, at which point the process terminates.

[0159] Finally, the newly added voxel sequence 73 was obtained, with the specific key value sequence being 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 12.

[0160] The voxel parameters in this application support user customization. These user-defined voxel parameters include the number of points, centroid location information, and covariance. By setting the voxel parameters as covariance, this application stores the voxel covariance in the corresponding memory space, eliminating the need to store the coordinate values ​​of each point within the voxel, thus saving memory storage space. Furthermore, this application provides various voxel parameter merging schemes, enabling the merging of voxel parameters and the addition of voxels to the current map, achieving real-time map updates.

[0161] In one embodiment, the above-described voxel lookup method in a map may further include:

[0162] When it is necessary to change the map coordinate system, the map coordinate system, centroid, and covariance must be updated simultaneously.

[0163] Specifically, when the origin of the coordinate system changes, it is necessary to keep the local map coordinate origin as close to 0 as possible. This requires changing the coordinate system. The specific formula for changing the coordinate system is as follows:

[0164]

[0165] This refers to the transformation from old coordinates to new coordinates on a map. For the transformation of the new map to the world coordinate system, This is a transformation from the old map to the world coordinate system.

[0166] When the coordinate system is changed, the specific formula for merging the centroids of the corresponding voxels can be as follows:

[0167]

[0168] in, For the transformation of the map from old coordinates to new coordinates, p new For the location information of the centroid of the merged voxels, p old This provides the location information of the centroid of the old voxels before merging.

[0169] When the coordinate system is changed, the specific formula for combining the covariances of the corresponding voxels can be as follows:

[0170]

[0171] in, and Cov is a 3x3 rotation matrix. new Cov is the covariance of the combined voxels. old This represents the covariance of the old voxels before the merger.

[0172] This application also provides a scheme for merging the centroid and covariance when the coordinate system needs to be changed, making the scheme more widely applicable and more flexible.

[0173] In one embodiment, the above-described voxel lookup method in a map may further include:

[0174] If the key value of the merged voxel is the same as the key value of an existing voxel in the target memory, then the voxel parameters of the merged voxel are merged with the voxel parameters of the voxel with the same key value in the target memory and stored in the target memory.

[0175] In this application, when aligning the first voxel sequence with the second voxel sequence, the alignment results are sequentially acquired and stored in the target memory. Each alignment result represents the voxel parameter of the voxel with the smaller key value. Therefore, if the current alignment result needs to be stored in the target memory, it also needs to be compared with the voxels already in the target memory. If the key values ​​are found to be the same, they need to be merged before storage. The specific merging logic is the same as the merging logic for centroid, point count, and covariance mentioned above.

[0176] In one embodiment, the above-described voxel lookup method in a map may further include:

[0177] When the size of the new map exceeds a preset threshold, obtain the voxels to be deleted from the new map;

[0178] Start traversing from the first voxel in the new map using the preset first and second pointers;

[0179] If the voxel pointed to by the first pointer is the voxel to be deleted, then the second pointer remains stationary and the first pointer traverses backward.

[0180] If the voxel pointed to by the first pointer is the voxel to be retained, then the voxel pointed to by the first pointer is moved to the position pointed to by the second pointer to replace the voxel originally pointed to by the second pointer, and the first pointer traverses backward.

[0181] The loop executes the following steps: if the voxel pointed to by the first pointer is the voxel to be deleted, then the second pointer remains stationary and the first pointer traverses backward; and if the voxel pointed to by the first pointer is the voxel to be retained, then the voxel pointed to by the first pointer is moved to the position pointed to by the second pointer to replace the voxel originally pointed to by the second pointer, and the first pointer traverses backward.

[0182] When the first pointer reaches the last voxel in the current map, delete all voxels after the voxel pointed to by the second pointer.

[0183] Please refer to Figure 8 , Figure 8 This is a schematic diagram of the voxel deletion process in one embodiment. Figure 8 In addition, the above-mentioned method for finding voxels in a map can also include:

[0184] S81. When the size of the new map exceeds a preset threshold, obtain the voxels to be deleted in the new map;

[0185] S82. Start traversing from the first voxel in the new map using the preset first and second pointers;

[0186] S83. Determine whether the voxel pointed to by the first pointer is the voxel to be deleted;

[0187] S84. If so, then the second pointer remains stationary, and the first pointer traverses backward.

[0188] S85. Otherwise, move the voxel pointed to by the first pointer to the position pointed to by the second pointer to replace the voxel originally pointed to by the second pointer, and traverse the first pointer backward.

[0189] S86. Determine whether the voxel pointed to by the first pointer is the last voxel;

[0190] S87. If yes, the process terminates; otherwise, return to the step above that determines whether the voxel pointed to by the first pointer is the voxel to be deleted.

[0191] In practical applications, it is necessary to maintain the size of the local map in real time. Therefore, map data outside a certain range will be continuously deleted based on changes in vehicle positions, which involves the deletion of voxels.

[0192] When deleting voxels, you can use two pointers, A and B, to traverse the voxel sequence corresponding to the new map, starting from the original position, based on the given voxel to be deleted (or a given method to determine whether a voxel needs to be deleted). Specifically, pointers A and B initially both point to the first voxel in the voxel sequence corresponding to the new map. The specific method is as follows:

[0193] Step 1: If the voxel pointed to by B is the voxel to be deleted, then A remains unchanged and B++.

[0194] Step 2: If the voxel pointed to by B is the voxel to be retained, then move the voxel pointed to by B to the position pointed to by A to replace the voxel of A (if A == B, then no relocation is needed), A++, B++;

[0195] Step 3: Repeat steps 1 and 2 above until B traverses to the last voxel of the voxel sequence corresponding to the new map.

[0196] Step 4: Delete all voxels after A.

[0197] In this application, a multi-layered framework can be used. Specifically, it provides a low-level accelerated merging logic support (framework layer) twin memory, a middle-level user-defined layer, and an upper-level map management layer for finding neighboring voxels.

[0198] The framework layer provides support for the aforementioned storage structure, and the underlying voxel merging logic definition will call user-defined behaviors.

[0199] The middle layer defines the specific data included in the voxel parameters, such as feature point voxels with covariance. It also provides custom merging methods, namely the merging schemes for the number of points, centroids, and covariance mentioned above.

[0200] The upper layer provides external interfaces, such as nearest neighbor lookup and map transformation (changing coordinate system).

[0201] In one embodiment, such as Figure 9 As shown, a voxel-finding device in a map is provided, comprising: a receiving module 11, a determining module 12, a searching module 13, and a sending module 14, wherein:

[0202] The receiving module 11 is used to receive the query request of the nearest voxels of the point to be queried in the current map sent by the terminal;

[0203] The determination module 12 is used to determine the target height block information corresponding to the query point based on the location information of the query point in the query request and the map data corresponding to the current map. The map data includes the information of the current voxel to which each point belongs and the information of the height block to which each current voxel belongs.

[0204] The lookup module 13 is used to determine the pointing information of the nearest neighbor voxels corresponding to the point to be queried by using the nearest neighbor search algorithm based on the information of the target height block.

[0205] The sending module 14 is used to send the pointing information to the terminal.

[0206] In one embodiment, the map data further includes voxel parameters for each current voxel. Each voxel parameter includes a key value determined based on the point cloud data of each point in the current voxel. The voxel lookup device in the map may further include a new module (not shown). This new module can acquire the point cloud data of the current frame, divide the corresponding point cloud into multiple new voxels based on the point cloud data, and determine the voxel parameters for each new voxel based on the point cloud data of each point in each new voxel. The voxel parameters for each new voxel include the key value of each new voxel. The newly added voxels are sorted according to a preset rule based on their key values ​​to obtain the first voxel sequence. The second voxel sequence, which is generated by sorting the voxel parameters of each current voxel according to a preset rule, is then obtained by iterating through and comparing the key values ​​of each newly added voxel in the first voxel sequence with those of each current voxel in the second voxel sequence. The voxel parameters of the voxels with smaller key values ​​in each comparison result are then obtained and stored in a preset target memory. A new map is obtained based on the voxel parameters in the target memory.

[0207] In one embodiment, the above-mentioned voxel lookup device in the map may further include a partitioning module (not shown). The partitioning module can partition the three-dimensional coordinate space of each point in the current map to obtain each current voxel, and partition each current voxel to obtain each height block. The determination module 12 can determine the information of the current voxel to which the query point belongs based on the location information of the query point and the information of the current voxel to which each point belongs in the map data. Based on the information of the current voxel to which the query point belongs and the information of the height block to which each voxel belongs in the map data, the determination module 12 can determine the information of the height block to which the query point belongs based on the information of the current voxel to which the query point belongs and the information of the height block to which each voxel belongs in the map data. Based on the information of the height block to which the query point belongs and the information of the adjacent height blocks, the determination module 12 can determine the information of the target height block.

[0208] In one embodiment, the above-mentioned voxel lookup device in the map may further include a creation module (not shown). The creation module can obtain the sub-voxel sequence corresponding to each height block from the first voxel sequence, and create a corresponding kdtree for the sub-voxel sequence corresponding to each height block according to the coordinate values ​​of each point in the current voxel corresponding to each height block. The lookup module can perform a K-neighbor search on the kdtree corresponding to the target height block according to the nearest neighbor search algorithm to obtain the pointing information of the nearest neighbor voxels corresponding to the point to be queried.

[0209] In one embodiment, the voxel parameters of each current voxel also include the number of points, centroid, and covariance of each voxel, and the voxel parameters of each newly added voxel also include the number of points, centroid, and covariance of each newly added voxel. The voxel lookup device in the map may further include a first merging module (not shown). If the comparison result is that the key value of the newly added voxel is the same as that of the current voxel, the first merging module merges the number of points of the current voxel and the newly added voxel with the same key value to obtain the number of points of the merged voxel. It merges the number of points and centroid of the current voxel and the newly added voxel with the same key value to obtain the centroid of the merged voxel. It merges the number of points and covariance of the current voxel and the newly added voxel with the same key value to obtain the covariance of the merged voxel. The number of points, centroid, and covariance of the merged voxel are then stored in the target memory.

[0210] In one embodiment, the above-mentioned voxel lookup device in the map may further include a second merging module (not shown). If the key value of the merged voxel is the same as the key value of an existing voxel in the target memory, the second merging module merges the voxel parameters of the merged voxel with the voxel parameters of the voxel with the same key value in the target memory and stores them in the target memory.

[0211] In one embodiment, the aforementioned voxel lookup device in the map may further include a deletion module (not shown). This deletion module can, when the size of the new map exceeds a preset threshold, obtain the voxels to be deleted in the new map, and start traversing from the first voxel in the new map using preset first and second pointers. If the voxel pointed to by the first pointer is the voxel to be deleted, the second pointer remains stationary, and the first pointer traverses backward. If the voxel pointed to by the first pointer is the voxel to be retained, the voxel pointed to by the first pointer is moved to the position pointed to by the second pointer to replace the voxel originally pointed to by the second pointer, and the first pointer traverses backward. This process is repeated cyclically, executing the steps of "if the voxel pointed to by the first pointer is the voxel to be deleted, the second pointer remains stationary, and the first pointer traverses backward," and "if the voxel pointed to by the first pointer is the voxel to be retained, the voxel pointed to by the first pointer is moved to the position pointed to by the second pointer to replace the voxel originally pointed to by the second pointer, and the first pointer traverses backward." When the first pointer traverses to the last voxel in the current map, all voxels after the voxel pointed to by the second pointer are deleted.

[0212] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data such as the operating data of smart home devices. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a resource allocation method for compiling a virtual machine.

[0213] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps: receiving a query request from a terminal for the nearest voxels of a point to be queried in the current map; determining the information of a target height block corresponding to the point to be queried based on the location information of the point to be queried in the query request and the map data corresponding to the current map, wherein the map data includes information of the current voxels to which each point belongs and information of the height blocks to which each current voxel belongs; determining the pointing information of the nearest neighbor voxels corresponding to the point to be queried based on the information of the target height blocks using a nearest neighbor search algorithm; and sending the pointing information to the terminal.

[0214] In one embodiment, the map data described above further includes voxel parameters for each current voxel, wherein the voxel parameters for each current voxel include key values ​​determined based on the point cloud data of each point in each current voxel, and the processor further implements the following steps when executing the computer program:

[0215] Acquire the point cloud data of the current frame, and divide the corresponding point cloud into multiple new voxels based on the point cloud data;

[0216] The voxel parameters of each newly added voxel are determined based on the point cloud data of each point in each newly added voxel. The voxel parameters of each newly added voxel include the key value of each newly added voxel.

[0217] The newly added voxels are sorted according to a preset rule based on their key values ​​to obtain the first voxel sequence.

[0218] Obtain the second voxel sequence composed of each current voxel in the current map. The second voxel sequence is a sequence generated by sorting each current voxel according to a preset rule based on its voxel parameters.

[0219] Iterate through the sequence from the beginning and compare the key values ​​of each newly added voxel in the first voxel sequence with the key values ​​of each current voxel in the second voxel sequence.

[0220] The voxel parameters of the voxels with smaller key values ​​in each comparison result are obtained sequentially and stored in the preset target memory.

[0221] A new map is obtained based on the parameters of each voxel in the target memory.

[0222] In one embodiment, when the processor executes a computer program, it further performs the following steps:

[0223] Divide the three-dimensional coordinate space of each point on the current map to obtain each current voxel;

[0224] Divide each current voxel into height blocks;

[0225] When the processor executes the computer program to implement the above-mentioned step of determining the target height block information corresponding to the query point based on the location information of the query point in the query request and the map data corresponding to the current map, the specific steps are as follows:

[0226] Based on the location information of the point to be queried and the information of the current voxel to which each point belongs in the map data, determine the information of the current voxel to which the point to be queried belongs;

[0227] Based on the information of the current voxel to which the point to be queried belongs and the information of the height blocks to which each voxel belongs in the map data, determine the information of the height block to which the point to be queried belongs.

[0228] Based on the information of the height block to which the point to be queried belongs and the information of the adjacent height blocks, determine the information of the target height block.

[0229] In one embodiment, when the processor executes a computer program, it further performs the following steps:

[0230] Obtain the sub-voxel sequences corresponding to each height block from the first voxel sequence;

[0231] Based on the coordinate values ​​of each point in the current voxel corresponding to each height block, create a corresponding kdtree for the sub-voxel sequence corresponding to each height block;

[0232] When the processor executes the computer program to implement the above-mentioned step of determining the pointing information of the nearest neighbor voxels corresponding to the query point based on the information of the target height block using the nearest neighbor search algorithm, the specific steps are as follows:

[0233] The nearest neighbor search algorithm is used to perform a K-neighbor search on the kdtree corresponding to the target height block to obtain the pointing information of the nearest voxels corresponding to the query point.

[0234] In one embodiment, the voxel parameters of each current voxel further include the number of points, centroid, and covariance of each voxel, and the voxel parameters of each newly added voxel further include the number of points, centroid, and covariance of each newly added voxel. When the processor executes the computer program, it further implements the following steps:

[0235] If the comparison result is that the new voxel has the same key value as the current voxel, then the points of the current voxel and the new voxel with the same key value are merged to obtain the points of the merged voxel.

[0236] The current voxels with the same key value and the newly added voxels are merged based on their number of points and centroids to obtain the centroids of the merged voxels.

[0237] The covariance of the merged voxels is obtained by merging the current voxels and newly added voxels with the same key value based on their number of points and covariance.

[0238] Store the number of points, centroids, and covariance of the merged voxels into the target memory.

[0239] In one embodiment, when the processor executes a computer program, it further performs the following steps:

[0240] If the key value of the merged voxel is the same as the key value of an existing voxel in the target memory, then the voxel parameters of the merged voxel are merged with the voxel parameters of the voxel with the same key value in the target memory and stored in the target memory.

[0241] In one embodiment, when the processor executes a computer program, it further performs the following steps:

[0242] When the size of the new map exceeds a preset threshold, obtain the voxels to be deleted from the new map;

[0243] Start traversing from the first voxel in the new map using the preset first and second pointers;

[0244] If the voxel pointed to by the first pointer is the voxel to be deleted, then the second pointer remains stationary and the first pointer traverses backward.

[0245] If the voxel pointed to by the first pointer is the voxel to be retained, then the voxel pointed to by the first pointer is moved to the position pointed to by the second pointer to replace the voxel originally pointed to by the second pointer, and the first pointer traverses backward.

[0246] The loop executes the following steps: if the voxel pointed to by the first pointer is the voxel to be deleted, then the second pointer remains stationary and the first pointer traverses backward; and if the voxel pointed to by the first pointer is the voxel to be retained, then the voxel pointed to by the first pointer is moved to the position pointed to by the second pointer to replace the voxel originally pointed to by the second pointer, and the first pointer traverses backward.

[0247] When the first pointer reaches the last voxel in the current map, delete all voxels after the voxel pointed to by the second pointer.

[0248] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When executed by a processor, the computer program performs the following steps: receiving a query request from a terminal for the nearest voxels of a point to be queried in the current map; determining the information of a target height block corresponding to the point to be queried based on the location information of the point to be queried in the query request and the map data corresponding to the current map, wherein the map data includes information of the current voxels to which each point belongs and information of the height blocks to which each current voxel belongs; determining the pointing information of the nearest neighbor voxels corresponding to the point to be queried based on the information of the target height blocks using a nearest neighbor search algorithm; and sending the pointing information to the terminal.

[0249] In one embodiment, the map data described above further includes voxel parameters for each current voxel, wherein the voxel parameters for each current voxel include key values ​​determined based on the point cloud data of each point in each current voxel, and the computer program, when executed by the processor, further implements the following steps:

[0250] Acquire the point cloud data of the current frame, and divide the corresponding point cloud into multiple new voxels based on the point cloud data;

[0251] The voxel parameters of each newly added voxel are determined based on the point cloud data of each point in each newly added voxel. The voxel parameters of each newly added voxel include the key value of each newly added voxel.

[0252] The newly added voxels are sorted according to a preset rule based on their key values ​​to obtain the first voxel sequence.

[0253] Obtain the second voxel sequence composed of each current voxel in the current map. The second voxel sequence is a sequence generated by sorting each current voxel according to a preset rule based on its voxel parameters.

[0254] Iterate through the sequence from the beginning and compare the key values ​​of each newly added voxel in the first voxel sequence with the key values ​​of each current voxel in the second voxel sequence.

[0255] The voxel parameters of the voxels with smaller key values ​​in each comparison result are obtained sequentially and stored in the preset target memory.

[0256] A new map is obtained based on the parameters of each voxel in the target memory.

[0257] In one embodiment, when a computer program is executed by a processor, it further performs the following steps:

[0258] Divide the three-dimensional coordinate space of each point on the current map to obtain each current voxel;

[0259] Divide each current voxel into height blocks;

[0260] When a computer program is executed by a processor to implement the above-mentioned step of determining the target height block information corresponding to the query point based on the location information of the query point in the query request and the map data corresponding to the current map, the following steps are specifically implemented:

[0261] Based on the location information of the point to be queried and the information of the current voxel to which each point belongs in the map data, determine the information of the current voxel to which the point to be queried belongs;

[0262] Based on the information of the current voxel to which the point to be queried belongs and the information of the height blocks to which each voxel belongs in the map data, determine the information of the height block to which the point to be queried belongs.

[0263] Based on the information of the height block to which the point to be queried belongs and the information of the adjacent height blocks, determine the information of the target height block.

[0264] In one embodiment, when a computer program is executed by a processor, it further performs the following steps:

[0265] Obtain the sub-voxel sequences corresponding to each height block from the first voxel sequence;

[0266] Based on the coordinate values ​​of each point in the current voxel corresponding to each height block, create a corresponding kdtree for the sub-voxel sequence corresponding to each height block;

[0267] When a computer program is executed by a processor to implement the above-mentioned step of determining the pointing information of the nearest neighbor voxels corresponding to the query point based on the information of the target height block using a nearest neighbor search algorithm, the specific steps are as follows:

[0268] The nearest neighbor search algorithm is used to perform a K-neighbor search on the kdtree corresponding to the target height block to obtain the pointing information of the nearest voxels corresponding to the query point.

[0269] In one embodiment, the voxel parameters of each current voxel further include the number of points, centroid, and covariance of each voxel, and the voxel parameters of each newly added voxel further include the number of points, centroid, and covariance of each newly added voxel. When the computer program is executed by the processor, it further implements the following steps:

[0270] If the comparison result is that the new voxel has the same key value as the current voxel, then the points of the current voxel and the new voxel with the same key value are merged to obtain the points of the merged voxel.

[0271] The current voxels with the same key value and the newly added voxels are merged based on their number of points and centroids to obtain the centroids of the merged voxels.

[0272] The covariance of the merged voxels is obtained by merging the current voxels and newly added voxels with the same key value based on their number of points and covariance.

[0273] Store the number of points, centroids, and covariance of the merged voxels into the target memory.

[0274] In one embodiment, when a computer program is executed by a processor, it further performs the following steps:

[0275] If the key value of the merged voxel is the same as the key value of an existing voxel in the target memory, then the voxel parameters of the merged voxel are merged with the voxel parameters of the voxel with the same key value in the target memory and stored in the target memory.

[0276] In one embodiment, when a computer program is executed by a processor, it further performs the following steps:

[0277] When the size of the new map exceeds a preset threshold, obtain the voxels to be deleted from the new map;

[0278] Start traversing from the first voxel in the new map using the preset first and second pointers;

[0279] If the voxel pointed to by the first pointer is the voxel to be deleted, then the second pointer remains stationary and the first pointer traverses backward.

[0280] If the voxel pointed to by the first pointer is the voxel to be retained, then the voxel pointed to by the first pointer is moved to the position pointed to by the second pointer to replace the voxel originally pointed to by the second pointer, and the first pointer traverses backward.

[0281] The loop executes the following steps: if the voxel pointed to by the first pointer is the voxel to be deleted, then the second pointer remains stationary and the first pointer traverses backward; and if the voxel pointed to by the first pointer is the voxel to be retained, then the voxel pointed to by the first pointer is moved to the position pointed to by the second pointer to replace the voxel originally pointed to by the second pointer, and the first pointer traverses backward.

[0282] When the first pointer reaches the last voxel in the current map, delete all voxels after the voxel pointed to by the second pointer.

[0283] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0284] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0285] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for finding voxels in a map, characterized in that, The method includes: The receiving terminal sends a query request for the nearest voxels of the point to be queried in the current map; Based on the location information of the point to be queried in the query request and the map data corresponding to the current map, the information of the target height block corresponding to the point to be queried is determined. The map data includes the information of the current voxel to which each point belongs in the current map, the information of the height block to which each current voxel belongs, and the voxel parameters of each current voxel. The voxel parameters of each current voxel include key values ​​determined based on the point cloud data of each point in each current voxel. Obtain the point cloud data of the current frame, and divide the corresponding point cloud into multiple new voxels based on the point cloud data; The voxel parameters of each newly added voxel are determined based on the point cloud data of each point in each newly added voxel, and the voxel parameters of each newly added voxel include the key value of each newly added voxel. The newly added voxels are sorted according to a preset rule based on their key values ​​to obtain a first voxel sequence. Obtain the sub-voxel sequences corresponding to each height block from the first voxel sequence; Based on the coordinate values ​​of each point in the current voxel corresponding to each height block, create a corresponding kdtree for the sub-voxel sequence corresponding to each height block; The nearest neighbor search algorithm is used to perform a K-neighbor search on the kdtree corresponding to the target height block to obtain the pointing information of the nearest neighbor voxels corresponding to the point to be queried. The pointing information is sent to the terminal.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the second voxel sequence composed of each current voxel in the current map. The second voxel sequence is a sequence generated by sorting according to the voxel parameters of each current voxel according to the preset rules. The key values ​​of each newly added voxel in the first voxel sequence and each current voxel in the second voxel sequence are traversed from the beginning and compared. The voxel parameters of the voxels with smaller key values ​​in each comparison result are obtained sequentially and stored in the preset target memory. A new map is obtained based on the voxel parameters in the target memory.

3. The method according to claim 1, characterized in that, The method further includes: The three-dimensional coordinate space of each point in the current map is divided to obtain each current voxel; Each current voxel is divided to obtain each height block; The step of determining the target height block information corresponding to the query point based on the location information of the query point in the query request and the map data corresponding to the current map includes: Based on the location information of the point to be queried and the information of the current voxel to which each point belongs in the map data, the information of the current voxel to which the point to be queried belongs is determined. Based on the information of the current voxel to which the point to be queried belongs and the information of the height block to which each voxel belongs in the map data, the information of the height block to which the point to be queried belongs is determined. The information of the target height block is determined based on the information of the height block to which the point to be queried belongs and the information of the adjacent height blocks.

4. The method according to claim 2, characterized in that, The voxel parameters of each current voxel also include the number of points, centroid, and covariance of each voxel; the voxel parameters of each newly added voxel also include the number of points, centroid, and covariance of each newly added voxel; the method further includes: If the comparison result is that the newly added voxel has the same key value as the current voxel, then the points of the current voxel and the newly added voxel with the same key value are merged to obtain the points of the merged voxel. The current voxel and the newly added voxel with the same key value are merged according to their point count and centroid to obtain the centroid of the merged voxel; The current voxels and the newly added voxels with the same key value are merged based on their point count and covariance to obtain the covariance of the merged voxels. The number of points, centroids, and covariance of the merged voxels are stored in the target memory.

5. The method according to claim 4, characterized in that, The method further includes: If the key value of the merged voxel is the same as the key value of an existing voxel in the target memory, then the voxel parameters of the merged voxel are merged with the voxel parameters of the voxel with the same key value in the target memory and stored in the target memory.

6. The method according to claim 2, characterized in that, The method further includes: When the size of the new map exceeds a preset threshold, obtain the voxels to be deleted from the new map; The traversal begins from the first voxel in the new map using a preset first and second pointer; If the voxel pointed to by the first pointer is the voxel to be deleted, then the second pointer remains stationary and the first pointer traverses backward. If the voxel pointed to by the first pointer is the voxel to be retained, then the voxel pointed to by the first pointer is moved to the position pointed to by the second pointer to replace the voxel originally pointed to by the second pointer, and the first pointer traverses backward. The process involves repeatedly executing the steps of: if the voxel pointed to by the first pointer is the voxel to be deleted, then the second pointer remains stationary and the first pointer traverses backward; and if the voxel pointed to by the first pointer is the voxel to be retained, then the voxel pointed to by the first pointer is moved to the position pointed to by the second pointer to replace the voxel originally pointed to by the second pointer, and the first pointer traverses backward. When the first pointer reaches the last voxel in the current map, all voxels after the voxel pointed to by the second pointer are deleted.

7. A device for finding voxels in a map, characterized in that, The device includes: The receiving module is used to receive query requests from the terminal for the nearest voxels of the point to be queried in the current map; The determination module is used to determine the target height block information corresponding to the query point based on the location information of the query point in the query request and the map data corresponding to the current map. The map data includes the information of the current voxel to which each point belongs in the current map, the information of the height block to which each current voxel belongs, and the voxel parameters of each current voxel. The voxel parameters of each current voxel include key values ​​determined based on the point cloud data of each point in each current voxel. The lookup module is used to acquire point cloud data of the current frame, divide the corresponding point cloud into multiple new voxels based on the point cloud data, determine the voxel parameters of each new voxel based on the point cloud data of each point in each new voxel, the voxel parameters of each new voxel include the key value of each new voxel, sort each new voxel according to the key value of each new voxel according to a preset rule to obtain a first voxel sequence, acquire the sub-voxel sequence corresponding to each height block from the first voxel sequence, create a corresponding kdtree for the sub-voxel sequence corresponding to each height block based on the coordinate values ​​of each point in the current voxel corresponding to each height block, and perform a K-neighbor search on the kdtree corresponding to the target height block according to the nearest neighbor search algorithm to obtain the pointing information of the nearest neighbor voxels corresponding to the query point; The sending module is used to send the pointing information to the terminal.

8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Three-dimensional laser radar point cloud efficient K-nearest neighbor search algorithm for unmanned driving

    CN111860340A