Triangular patch data management method and device, and XR device
By performing spatial meshing and surface reconstruction on 3D landmarks and calculating the hash index of triangular facets, the problem of high complexity in triangular facet data management in existing technologies is solved, enabling fast and accurate triangular facet queries and meeting the response requirements of real-time applications.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies have high computational complexity when managing triangular patch data in 3D maps, making it difficult to meet the millisecond-level response requirements of real-time applications.
By dividing the initial 3D landmarks into a spatial grid, constructing a grid map, and reconstructing the surface to obtain triangular facet data, the vertex index and hash index of the triangular facets are calculated to achieve fast and accurate triangular facet query.
By transforming the global traversal operation into a hash-based direct location operation, fast and accurate lookup of triangular facet data is achieved, reducing computational complexity and improving response speed.
Smart Images

Figure CN120953544B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular to a triangular patch data management method, device and XR equipment. BACKGROUND
[0002] With the rapid development of automatic driving, robot navigation, extended reality (XR) and other technologies, there is a high demand for real-time perception, reconstruction and interaction capabilities of high-precision and large-scale three-dimensional scenes. The core relies on efficient management and fast query of massive three-dimensional map data.
[0003] However, existing solutions mostly use a global single data structure (such as octree) to manage all triangular patch data. When querying triangular patches, a large amount of irrelevant data needs to be traversed, and the computational complexity is high, which is difficult to meet the millisecond-level response requirements of real-time applications.
[0004] Therefore, there is an urgent need in the art for a new triangular patch data management method to overcome the limitations of the above-mentioned prior art and achieve fast and accurate query of triangular patch data in three-dimensional maps. SUMMARY
[0005] The present application provides a triangular patch data management method, device and XR equipment, which can solve the problem that the existing triangular patch data management method is difficult to achieve fast and accurate query of triangular patch data.
[0006] The present application provides a triangular patch data management method, comprising:
[0007] performing spatial grid division on the initial three-dimensional landmark points to construct a grid map;
[0008] performing surface reconstruction on the three-dimensional landmark points in the grid map to obtain triangular patch data of each grid;
[0009] obtaining vertex indexes of the triangular patches according to the triangular patch data;
[0010] calculating hash indexes of the triangular patches according to the vertex indexes of the triangular patches to map the triangular patches to a triangular patch index list of the corresponding grid.
[0011] The present application provides a triangular patch data management method, comprising:
[0012] in response to a grid map local update request, obtaining a target grid and a target three-dimensional landmark point;
[0013] determining triangular patches to be updated in the target grid according to the target three-dimensional landmark point;
[0014] updating the triangle index list according to the triangle to be updated.
[0015] According to the triangle to be updated, the triangle index list is updated.
[0016] According to the target three-dimensional landmark point, surface reconstruction is performed to obtain new triangle data of the target grid.
[0017] Obtain initial triangle data of the target grid.
[0018] According to the new triangle data and the initial triangle data, determine the triangle to be updated in the target grid.
[0019] According to the triangle to be updated, the triangle index list is updated.
[0020] In response to a global grid map update request, obtain a list of grids to be updated.
[0021] Lock the list of grids to be updated, and traverse each grid in the list of grids to be updated.
[0022] When the traversal is completed, release the lock of the list of grids to be updated.
[0023] According to the triangle to be updated, the triangle index list is updated.
[0024] When traversing, lock the current traversed grid and its corresponding neighborhood grid.
[0025] Perform cross-grid fusion calculation on the locked current traversed grid and its corresponding neighborhood grid to generate new grid data.
[0026] Update the triangle index list according to the new grid data.
[0027] Release the lock of the current traversed grid and its corresponding neighborhood grid.
[0028] According to the triangle to be updated, the triangle index list is updated.
[0029] According to the first vertex index of the triangle and the first preset prime number, calculate a first product value.
[0030] According to the second vertex index of the triangle and the second preset prime number, calculate a second product value.
[0031] calculating a third product value according to the third vertex index of the triangular patch and a third preset prime number;
[0032] performing an exclusive or operation on the first product value, the second product value and the third product value to obtain a hash index of the triangular patch.
[0033] According to the triangular patch data management method provided by the application, the initial three-dimensional landmark points are subjected to spatial grid division to construct a grid map, which comprises:
[0034] According to the preset minimum resolution, the initial three-dimensional landmark points are subjected to spatial grid division to construct a 0th-level grid map;
[0035] For each target level i from 1 to N, the resolution of the target level i is determined according to the target level i and the preset minimum resolution;
[0036] According to the resolution of the target level i, the grid data in the (i-1)th-level grid map is subjected to aggregation processing to construct an ith-level grid map;
[0037] Wherein, N is an integer greater than or equal to 1, and the resolution of the ith-level grid map is lower than the resolution of the (i-1)th-level grid map.
[0038] According to the triangular patch data management method provided by the application, after the initial three-dimensional landmark points are subjected to spatial grid division to construct a grid map, the method further comprises:
[0039] Obtaining the coordinates of the three-dimensional landmark points of each grid in the grid map;
[0040] Calculating the grid index of the three-dimensional landmark points of each grid in the grid map according to the coordinates, so as to map the initial three-dimensional landmark points to the three-dimensional landmark point index list of the corresponding grid.
[0041] The application further provides a triangular patch data management device, comprising:
[0042] A grid division module is configured to divide the initial three-dimensional landmark points into spatial grids to construct a grid map;
[0043] A surface reconstruction module is configured to reconstruct the three-dimensional landmark points in the grid map to obtain the triangular patch data of each grid;
[0044] A number acquisition module is configured to acquire the vertex index of the triangular patch according to the triangular patch data;
[0045] The hash index calculation module is used to calculate the hash index of the triangle based on the vertex index of the triangle, so as to map the triangle to the triangle index list of the corresponding mesh.
[0046] The present invention also provides an XR device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the triangular facet data management method as described above.
[0047] The triangular facet data management method, apparatus, and XR device provided by this invention construct a grid map by dividing initial 3D landmarks into a spatial grid. Then, surface reconstruction is performed on the 3D landmarks in the grid map to obtain triangular facet data for each grid, thereby acquiring the vertex indices of the triangular facets. Finally, based on the vertex indices of the triangular facets, a hash index is calculated to map the triangular facets to the corresponding grid's triangular facet index list. This invention manages triangular facets through the aforementioned grid spatial indexing mechanism, transforming global traversal operations into hash-based direct positioning operations. That is, during subsequent triangular facet retrieval, the target area can be quickly and accurately located using its hash index, thus enabling fast and accurate querying of triangular facet data. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0049] Figure 1 This is a system architecture diagram of the triangular facet data management system provided by the present invention;
[0050] Figure 2 This is one of the flowcharts illustrating the triangular facet data management method provided by the present invention;
[0051] Figure 3 This is the second flowchart illustrating the triangular facet data management method provided by the present invention;
[0052] Figure 4 This is the third flowchart illustrating the triangular facet data management method provided by the present invention;
[0053] Figure 5 This is a schematic diagram of the triangular facet data management device provided by the present invention;
[0054] Figure 6This is a schematic diagram of the structure of the XR device provided by the present invention. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0056] This invention proposes a method, apparatus, and XR equipment for managing triangular facet data. The following is a detailed description... Figures 1-6 Describe it.
[0057] Figure 1 This is a system architecture diagram of the triangular patch data management system provided by the present invention, as shown below. Figure 1 As shown, the triangular facet data management system may include terminal devices 101, 102, and 103 and server 104. Terminal devices 101, 102, and 103 and server 104 can be connected via a network, such as a wired or wireless communication link or fiber optic cable.
[0058] Users can interact with server 104 using terminal devices 101, 102, and 103 to receive or send messages, etc. Terminal devices 101, 102, and 103 can be hardware or software.
[0059] When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices, including but not limited to XR devices, smartphones, tablets, laptops, desktop computers, smart TVs, robots, etc. XR devices refer to wearable or portable devices that integrate virtual and real environments through hardware and software technologies to achieve human-computer interaction. These can include, but are not limited to, VR (Virtual Reality) devices, AR (Augmented Reality) devices, and MR (Mixed Reality) devices. VR devices use computer technology to simulate and generate a three-dimensional virtual space, allowing users to immerse themselves in and interact with it, gaining a truly immersive experience. AR devices use technology to merge virtual information with the real world, overlaying it onto real scenes in real time to enhance sensory experience. MR devices mix the real and virtual worlds to create a new visual environment that simultaneously contains physical entities and virtual information, allowing users to interact with these physical entities and virtual information in real time.
[0060] When terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. They can be implemented as multiple software programs or software modules (e.g., multiple software programs or software modules used to provide distributed services), or as a single software program or software module. No specific limitations are made here.
[0061] Server 104 can be a server that provides various services, such as a backend server that provides support for terminal devices 101, 102, and 103.
[0062] It should be noted that the triangular facet data management method provided in this application embodiment can be executed by server 104 or terminal devices 101, 102, 103. Correspondingly, the triangular facet data management device can be set in server 104 or terminal devices 101, 102, 103.
[0063] Figure 2 This is one of the flowcharts illustrating the triangular facet data management method provided by the present invention, such as... Figure 2 As shown, the triangular facet data management method includes steps S110, S120, S130 and S140.
[0064] Step S110: Divide the initial three-dimensional landmarks into a spatial grid to construct a grid map.
[0065] The initial 3D landmarks are the raw 3D data collected by sensors such as LiDAR, depth cameras, or multi-view cameras.
[0066] The initial 3D landmarks can be divided into spatial grids according to the preset resolution to construct a grid map.
[0067] Specifically, iterate through all the initial 3D landmarks and calculate the minimum and maximum values of these initial 3D landmarks on the X-axis, Y-axis and Z-axis in the global coordinate system, denoted as min_x, max_x, min_y, max_y, min_z and max_z, respectively.
[0068] Then, based on the minimum and maximum values on the X, Y, and Z axes, and the preset resolution, the number of grid cells in each dimension is calculated. Specifically, the number of grid cells in the X-axis dimension is calculated as num_x = ceil((max_x - min_x) / r), the number of grid cells in the Y-axis dimension is calculated as num_y = ceil((max_y - min_y) / r), and the number of grid cells in the Z-axis dimension is calculated as num_z = ceil((max_z - min_z) / r). Here, ceil stands for ceiling function, which rounds up, and r represents the preset resolution.
[0069] It should be understood that the grid map consists of multiple grids, each of which maintains multiple 3D landmarks, meaning that each grid corresponds to multiple 3D landmarks.
[0070] Furthermore, the initial 3D landmarks can be preprocessed, including but not limited to: denoising, filtering, downsampling, and registration. Registration refers to merging point clouds from multiple viewpoints into the same coordinate system. Through these methods, a clean, high-quality, unified coordinate system, and more easily processed 3D coordinate point dataset can be obtained.
[0071] Step S120: Perform surface reconstruction on the three-dimensional landmarks in the grid map to obtain triangular facet data for each grid.
[0072] The surface reconstruction algorithms used include, but are not limited to: Delaunay Triangulation, Poisson Surface Reconstruction, Marching Cubes, and BPA (Ball-Pivoting Algorithm).
[0073] By reconstructing the surfaces of 3D landmarks in a grid map, a triangular mesh can be constructed. A triangular mesh is a network structure composed of vertices, edges, and faces. Since the faces are triangular, it is called a triangular patch.
[0074] After surface reconstruction, triangular facet data for each mesh can be obtained. The triangular facet data includes a vertex array and an index array. The vertex array stores the actual attributes of each vertex of the triangular facet (such as coordinates, normals, color, etc.), while the index array stores the vertex numbers. These vertex numbers point to their positions in the vertex array, thus defining the connection relationship of the triangular facets.
[0075] Step S130: Obtain the vertex index of the triangle based on the triangle patch data.
[0076] Triangle facet data includes a vertex array and an index array.
[0077] In one embodiment, the vertex number of a triangle can be obtained directly from the index array of the triangle facet data, and the vertex number can be used as the vertex index.
[0078] In another embodiment, the vertex number of the triangle can be obtained from the index array of the triangle facet data, and then the corresponding vertex coordinates can be obtained from the vertex array according to the vertex number. The hash index corresponding to each vertex coordinate is calculated according to a preset hash function, and this hash index is used as the vertex index.
[0079] Step S140: Calculate the hash index of the triangle facet based on its vertex index, so as to map the triangle facet to the triangle facet index list of the corresponding mesh.
[0080] After obtaining the vertex indices of the triangle, the hash index of the triangle is calculated based on the vertex indices of the vertex-indexed triangle.
[0081] Since a triangular facet has three vertices, it has three corresponding vertex indices, denoted as the first vertex index, the second vertex index, and the third vertex index. A first product value is calculated based on the first vertex index and a first preset prime number. A second product value is calculated based on the second vertex index and the second preset prime number. Simultaneously, a third product value is calculated based on the third vertex index and the third preset prime number. Then, a bitwise XOR operation is performed on the first product value, the second product value, and the third product value to obtain the hash index of the triangular facet. The specific execution process can be found in the following embodiment, which will not be elaborated here.
[0082] Using the above method, vertex index triangles can be mapped to the corresponding mesh's triangle index list.
[0083] The triangular facet data management method provided in this invention involves dividing initial 3D landmarks into a spatial grid to construct a grid map. Then, surface reconstruction is performed on the 3D landmarks in the grid map to obtain triangular facet data for each grid, thereby acquiring the vertex indices of the triangular facets. Finally, based on the vertex indices, a hash index is calculated for each triangular facet to map it to the corresponding grid's triangular facet index list. This invention manages triangular facets through the aforementioned grid spatial indexing mechanism, transforming global traversal operations into hash-based direct location operations. That is, during subsequent triangular facet retrieval, the target area can be quickly and accurately located using its hash index, thus enabling fast and accurate querying of triangular facet data.
[0084] Based on any of the above embodiments Figure 3 This is the second flowchart illustrating the triangular facet data management method provided by the present invention, as shown below. Figure 3 As shown, the triangular facet data management method further includes steps S150, S160 and S170.
[0085] Step S150: In response to the grid map local update request, obtain the target grid and target 3D landmarks.
[0086] A grid map local update request is a request to update a local grid map, which can be triggered when changes in the 3D coordinates of some grid points are detected.
[0087] The target grid is the grid where the three-dimensional coordinate points change, and the target three-dimensional landmark is the current three-dimensional landmark in the target grid (i.e., the three-dimensional landmark after the change).
[0088] When a grid map local update request is received, the target grid is first obtained, and then the current 3D landmark point in the target grid is obtained and recorded as the target 3D landmark point.
[0089] Step S160: Determine the triangular facets to be updated in the target mesh based on the target 3D landmarks.
[0090] Triangle faces to be updated, including triangle faces to be deleted and newly added triangle faces.
[0091] The method for determining the triangular facets to be updated is as follows: Based on the target 3D landmarks, surface reconstruction is performed to obtain new triangular facet data for the target mesh; initial triangular facet data for the target mesh is obtained; then, based on the new triangular facet data and the initial triangular facet data, the triangular facets to be updated in the target mesh are determined. The specific execution process can be found in the following embodiment, and will not be elaborated here.
[0092] Step S170: Update the triangular facet index list according to the triangular facet to be updated.
[0093] Then, based on the triangle to be updated, its vertex coordinates and topological relationships are recalculated, and its vertex indices are updated. Based on the updated vertex indices, a new hash index is generated, denoted as the newly added hash index. At the same time, the hash index of the triangle to be deleted is obtained, denoted as the deleted hash index.
[0094] Then, based on the newly added hash index and the hash index to be deleted, the triangular facet index list is updated. Specifically, the hash index to be deleted mentioned above is deleted from the triangular facet index list, and the newly added hash index mentioned above is added to complete the update.
[0095] The triangular facet data management method provided in this invention accurately locates the changed meshes and their current 3D landmarks, and determines the triangular faces to be updated accordingly, thereby updating the triangular facet index list. Compared to the global mesh reconstruction in the prior art, this invention only performs localized targeted updates on the affected meshes, which can greatly reduce computational resource overhead and improve data processing efficiency and system real-time performance.
[0096] Based on any of the above embodiments, step S160 includes: step S161, step S162 and step S163.
[0097] Step S161: Based on the target three-dimensional landmarks, perform surface reconstruction to obtain new triangular facet data of the target mesh.
[0098] After obtaining the current 3D landmarks of the target mesh, i.e. the target 3D landmarks, the surface is reconstructed based on the target 3D landmarks to obtain the new triangular facet data of the target mesh.
[0099] The surface reconstruction algorithms used include, but are not limited to: Delaunay Triangulation algorithm, Poisson Surface Reconstruction algorithm, Marching Cubes algorithm, and BPA.
[0100] Step S162: Obtain the initial triangular facet data of the target mesh.
[0101] Next, the initial triangular facet data of the target mesh is obtained. The initial triangular facet data is obtained by reconstructing the surface based on the previous (i.e., before the change) 3D landmarks of the target mesh.
[0102] Step S163: Based on the new triangular facet data and the initial triangular facet data, determine the triangular facets to be updated in the target mesh.
[0103] The triangles to be updated in the target mesh, including newly added triangles and triangles to be deleted.
[0104] The new triangular face data is compared with the initial triangular face data to determine the newly added triangular faces and the triangular faces to be deleted.
[0105] Specifically, obtain the index array from the new triangular facet data, denoted as the new index array V. new At the same time, obtain the index array from the initial triangular facet data, denoted as the initial index array V.
[0106] By comparing the new index array V new Given the initial index array V, determine the newly added triangular facet, which is V. new The triangle corresponding to -V, the triangle to be deleted is VV. new The corresponding triangular facet, and V new The triangular facet corresponding to ∩V is denoted as the triangular facet to be retained.
[0107] Based on the newly added triangular facets, determine the triangular facets in the target mesh that need to be updated.
[0108] The triangular facet data management method provided in this invention can greatly reduce the amount of data that needs to be processed and avoid unnecessary repeated reconstruction by only reconstructing and comparing new triangular facet data for the target mesh that has changed, thereby achieving efficient incremental updates.
[0109] Based on any of the above embodiments Figure 4 This is the third flowchart of the triangular facet data management method provided by the present invention, as shown below. Figure 4 As shown, the triangular facet data management method further includes steps S180, S190 and S200.
[0110] Step S180: In response to the global update request for the grid map, obtain the list of grids to be updated.
[0111] A global grid map update request is a request to update the global grid map. It can be triggered automatically (e.g., timed) or externally (e.g., task-driven).
[0112] Upon receiving a global grid map update request, retrieve the list of grids to be updated. This list includes all grids that require updating.
[0113] Furthermore, each region of the grid map maintains a list of grids to be updated. Correspondingly, the list of grids to be updated can include multiple grids. During a global update, the grid lists of grids to be updated in each region can be processed in parallel to speed up the global update.
[0114] Step S190: Lock the list of grids to be updated and traverse each grid in the list of grids to be updated.
[0115] Once a global update is triggered, the list of grids to be updated is locked. At this time, other threads adding grids to the list will be blocked, thus ensuring that the content of the list of grids to be updated will not change during the traversal.
[0116] Then, the process iterates through each grid in the grid list to be updated. Specifically, during the iteration, the currently traversed grid and its corresponding neighboring grids are locked; then, cross-grid fusion calculations are performed on the locked currently traversed grid and its corresponding neighboring grids to generate new grid data, and the triangular facet index list is updated based on the new grid data; finally, the lock on the currently traversed grid and its corresponding neighboring grids is released. The specific execution process can be found in the following embodiment, and will not be elaborated upon here.
[0117] Step S200: Upon completion of the traversal, release the lock on the list of grids to be updated.
[0118] When all grids in the grid list to be updated have been traversed, the lock on the grid list to be updated is released so that other threads can add new grids to these grid lists.
[0119] The triangular patch data management method provided in this invention, when performing a global update of a grid map, limits the impact of the update operation to the smallest necessary spatial area by locking the list of grids to be updated, rather than locking the entire grid list, thereby improving the overall concurrency and response speed of the system. Furthermore, by locking the list of grids to be updated, it ensures that the grid data in the list is not concurrently modified during the update process, avoiding reading corrupted data or writing conflicts, and improving data security.
[0120] Based on any of the above embodiments, the step "traversing each grid in the grid list to be updated" includes:
[0121] Step S191: During traversal, lock the currently traversed grid and its corresponding neighboring grids.
[0122] When traversing the list of grids to be updated, each grid in the list is processed one by one. During processing, the currently traversed grid and its corresponding neighboring grids are locked, where the neighboring grids are the 6 grids adjacent to the current grid.
[0123] It should be noted that, when locking, the exclusive lock of the currently traversed grid and all six neighboring grids can be acquired in a preset fixed order (e.g., sorted by grid coordinates).
[0124] By locking the currently traversed mesh and its corresponding neighboring meshes, other threads are prevented from reading or modifying the data in these meshes, fundamentally avoiding problems such as memory access conflicts, model cracks, or topological disorder that may occur due to concurrent operations. Furthermore, by limiting the locking scope to the local meshes affected by the current traversal update operation (i.e., the currently traversed mesh and its neighboring meshes), rather than all meshes in the list of meshes to be updated, thread blocking time can be further reduced.
[0125] Step S192: Perform cross-mesh fusion calculation on the locked current traversed mesh and its corresponding neighboring mesh to generate new mesh data.
[0126] Retrieves the mesh data of the locked currently traversed mesh and its corresponding neighboring meshes, where the mesh data includes vertex data and triangle facet data.
[0127] The obtained grid data is fused across grids using a fusion algorithm to generate new grid data.
[0128] Among them, the fusion algorithms include, but are not limited to, Mesh stitching, vertex merging, and retriangulation algorithms. Through cross-mesh fusion processing, each mesh can be smoothly connected at the boundary, avoiding cracks or discontinuities at the mesh boundary and thus preventing damage to the integrity of the mesh map.
[0129] Step S193: Update the triangular patch index list according to the new mesh data.
[0130] The calculated new mesh data is written back to the corresponding mesh, including the currently traversed mesh and / or affected neighboring meshes, to update the corresponding triangular patch index list.
[0131] It should be understood that, in addition to updating the list of triangle patch indices, the vertex array and index array can also be updated.
[0132] Step S194: Release the lock on the currently traversed mesh and its corresponding neighboring meshes.
[0133] Release the lock on the current grid and its corresponding neighboring grids. After release, other threads can access these grids again.
[0134] It should be noted that the release order is the reverse of the acquisition order to reduce the risk of deadlock.
[0135] The triangular patch data management method provided in this embodiment of the invention first locks the current grid and its neighboring grids when traversing each grid in the grid list to be updated, and then performs cross-grid fusion calculation. By combining the above-mentioned local locking and cross-grid fusion calculation, the system blocking time can be further reduced and the efficiency of multi-threaded concurrent processing and resource utilization can be improved while ensuring the consistency of grid map data and the integrity of the model.
[0136] Based on any of the above embodiments, the step "calculate the hash index of the triangle based on the vertex index of the triangle" includes: steps S141, S142, S143 and S144.
[0137] Step S141: Calculate the first product value based on the first vertex index of the triangular facet and the first preset prime number;
[0138] Step S142: Calculate the second product value based on the second vertex index of the triangular facet and the second preset prime number;
[0139] Step S143: Calculate the third product value based on the third vertex index of the triangular facet and the third preset prime number.
[0140] For any triangular facet, it consists of three vertices, and the corresponding vertex indices include three values, denoted as the first vertex index a, the second vertex index b, and the third vertex index c. Here, a, b, and c are all positive integers.
[0141] It should be noted that the first, second, and third preset prime numbers are all large prime numbers to reduce hash collisions; specifically, prime numbers in the tens of millions can be selected. For example, the first preset prime number P1 is 73,856,093, the second preset prime number P2 is 19,349,663, and the third preset prime number P3 is 83,492,791.
[0142] Then, based on the preset prime numbers, calculate the product values respectively. Specifically, calculate the first product value Value1 = a. P1, calculate the second product value Value2 = b P2, calculate the third product value Value3 = c P3.
[0143] Step S144: Perform a bitwise XOR operation on the first product value, the second product value, and the third product value to obtain the hash index of the triangular facet.
[0144] Performing a bitwise XOR operation on the three product values yields the hash index of the triangle: triangle ID = Value1 ⊕ Value2 ⊕ Value3. Here, the symbol ⊕ represents the bitwise XOR operator.
[0145] The triangular facet data management method provided in this invention generates a unique hash index for triangular facets that is computationally efficient, has an extremely low collision probability, and is evenly distributed, through prime number multiplication and bitwise XOR operations. This index not only enables rapid mapping of triangular facets to spatial meshes, achieving millisecond-level retrieval, but also lays the foundation for efficiently obtaining their neighboring topological facets, thereby significantly improving the management and query efficiency of large-scale 3D mesh data.
[0146] Based on any of the above embodiments, step S110 includes: step S111, step S112 and step S113.
[0147] Step S111: Based on the preset minimum resolution, the initial three-dimensional landmark points are divided into spatial grids to construct a level 0 grid map.
[0148] As application scenarios continue to expand and deepen, single-resolution grid map representations are insufficient to meet diverse task requirements. Therefore, in this embodiment, by constructing a multi-scale layered grid map management structure with different levels, the diverse task requirements of different downstream applications can be met.
[0149] Specifically, based on the preset minimum resolution, the initial three-dimensional landmarks are divided into spatial grids. Each initial three-dimensional landmark is assigned to a corresponding spatial grid according to its coordinates to construct the most refined level 0 (denoted as L0) grid map.
[0150] Step S112: For each target level i from 1 to N, determine the resolution of target level i based on the target level i and the preset minimum resolution.
[0151] Step S113: Based on the resolution of the target level i, aggregate the grid data in the (i-1)th level grid map to construct the i-th level grid map.
[0152] Where N is an integer greater than or equal to 1, and the resolution of the i-th level grid map is lower than the resolution of the (i-1)-th level grid map.
[0153] Resolution r of target level i i =Preset minimum resolution r0×2 i-1 .
[0154] Aggregation processing methods include, but are not limited to: averaging, summing, taking the maximum or minimum value, etc.
[0155] It should be noted that r N < Grid map side length, to ensure that the highest level grid map (i.e., the Nth level grid map) can still be divided into at least a number of meaningful blocks.
[0156] For example, if the maximum level to be constructed is N=3 and the minimum resolution r0 is 0.05m, then for each target level i (i from 1 to 3), the resolution is calculated as follows:
[0157] When i=1, r1=0.05m×2 1 =0.10m;
[0158] When i=2, r2=0.05m×2 2 =0.20m;
[0159] When i=3, r3=0.05m×2 3 =0.40m.
[0160] Taking the construction of level 1 (i=1) as an example, based on the calculated target resolution r1=0.10m, the space is divided into 0.10m grids. Each level 1 grid corresponds precisely to 2x2=4 adjacent grids in its lower level (level 0) in physical space. The grid data of level 0 grids is aggregated; specifically, the average of the coordinates of the four grid center points is taken as the center point coordinates of the corresponding level 1 grid. Then, the aggregation result is stored as the data for the level 1 (L1 level) grid map.
[0161] Repeating the above process, the first-level map can be aggregated to generate the second-level (L2) map, and so on, until the final third (N)-level map is generated. Ultimately, the system maintains a grid map data structure in memory with four different resolution levels, ranging from fine (L0) to coarse (L3).
[0162] Among them, L0 level is the highest precision, with a data density of 100%, used for close-range high-precision interaction; L1 level has a data density of 40%, used for mid-range visualization; L2 level has a data density of 10%, used for long-range scene overview; and L3 level has a data density of 2%, used for global collision detection.
[0163] Furthermore, upon receiving a data acquisition request, the target-level grid map is obtained according to the data acquisition request, and the obtained target-level grid map is converted into the target format.
[0164] In one embodiment, the data acquisition request includes a target resolution, and a grid map of the target level can be acquired based on the target resolution. In another embodiment, the data acquisition request includes an application scenario, and a grid map of the target level can be determined based on the application scenario.
[0165] The target format can be the format requirement carried in the data acquisition request, or it can be determined according to the application scenario. For example, for the application scenario of 3D modeling, the corresponding target format is OBJ (Object, a file format).
[0166] The triangular patch data management method provided in this invention constructs a multi-scale grid map, including global, regional, block, and landmark levels, by starting from the finest level 0 grid map and aggregating upwards layer by layer. This ensures strict spatial alignment and data consistency across all map levels. Simultaneously, it significantly compresses the data volume while preserving the macroscopic structure and key features of the environment to the greatest extent possible. Furthermore, it enables the system to efficiently access map data of varying precision according to different task requirements, avoiding the enormous computational and storage overhead associated with processing a single high-precision map.
[0167] Based on any of the above embodiments, after step S110, the method further includes:
[0168] Step S210: Obtain the coordinates of the three-dimensional landmarks of each grid in the grid map.
[0169] Step S220: Calculate the grid index of the three-dimensional landmark point of each grid in the grid map according to the coordinates, so as to map the initial three-dimensional landmark point to the three-dimensional landmark point index list of the corresponding grid.
[0170] Obtain the coordinates of 3D landmarks in each grid of the grid map, including x-axis, y-axis, and z-axis coordinates.
[0171] Then, the grid index of the 3D landmark point in each grid of the grid map is calculated based on the coordinates. Specifically, the resolution of the grid map can be obtained. Based on the x-axis coordinate and the resolution of the grid map, the x-axis coordinate hash index is calculated. Based on the y-axis coordinate and the resolution of the grid map, the y-axis coordinate hash index is calculated. Based on the z-axis coordinate and the resolution of the grid map, the z-axis coordinate hash index is calculated. Based on the x-axis coordinate hash index, y-axis coordinate hash index, and z-axis coordinate hash index, the grid index of the 3D landmark point is obtained.
[0172] Assuming the coordinates of a 3D coordinate point P are (x, y, z) and the resolution of the grid map is e, the grid index of the 3D coordinate point P can be calculated using the following formula.
[0173] ;
[0174] in, Indicates grid index, This is the down-to-integer operator.
[0175] Furthermore, considering the limited number of landmarks that can be maintained in the 3D landmark index list, radius filtering and uniform downsampling can be applied to the 3D landmarks of each grid in the grid map to obtain processed 3D landmarks. The 3D landmark index list is then updated based on these processed landmarks. This method significantly improves the quality and representativeness of 3D landmark data while strictly limiting memory usage.
[0176] The triangular patch data management method provided in this invention calculates the corresponding grid index for each 3D landmark and maps it to the corresponding grid's 3D landmark index list. This transforms large-scale, unordered 3D landmarks into a structured and organized data format, allowing them to be categorized into different, discrete grid units. During subsequent queries and retrievals of 3D landmarks, the grid index can be used for rapid location, significantly improving query efficiency compared to global traversal searches.
[0177] The triangular facet data management device provided by the present invention is described below. The triangular facet data management device described below can be referred to in correspondence with the triangular facet data management method described above.
[0178] Figure 5 This is a schematic diagram of the triangular facet data management device provided by the present invention, as shown below. Figure 5 As shown, the device includes a mesh generation module 510, a surface reconstruction module 520, a number acquisition module 530, and a hash index calculation module 540; wherein:
[0179] The grid division module 510 is used to divide the initial three-dimensional landmark points into spatial grids to construct a grid map;
[0180] The surface reconstruction module 520 is used to perform surface reconstruction on the three-dimensional landmarks in the grid map to obtain triangular facet data of each grid.
[0181] The number acquisition module 530 is used to obtain the vertex index of the triangle facet based on the triangle facet data;
[0182] The hash index calculation module 540 is used to calculate the hash index of the triangle based on the vertex index of the triangle, so as to map the triangle to the triangle index list of the corresponding mesh.
[0183] The triangular facet data management device provided in this embodiment of the invention constructs a grid map by dividing initial 3D landmarks into spatial grids. Then, it reconstructs the surfaces of the 3D landmarks in the grid map to obtain triangular facet data for each grid, thereby acquiring the vertex indices of the triangular facets. Finally, it calculates the hash index of the triangular facets based on their vertex indices to map them to the corresponding grid's triangular facet index list. This embodiment of the invention manages triangular facets through the aforementioned grid spatial indexing mechanism, transforming global traversal operations into hash-based direct positioning operations. That is, during subsequent triangular facet retrieval, the target area can be quickly and accurately located using its hash index, thus enabling fast and accurate querying of triangular facet data.
[0184] It should be noted that the triangular facet data management device provided in this embodiment of the invention can implement all the method steps implemented in the above-mentioned triangular facet data management method embodiment, and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiment and the beneficial effects will not be described in detail.
[0185] Figure 6 An example is a schematic diagram of the physical structure of an XR device, such as... Figure 6As shown, the XR device may include a processor 610, a communications interface 620, a memory 630, and a communication bus 640. The processor 610, communications interface 620, and memory 630 communicate with each other via the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute a triangular facet data management method. This method includes: dividing initial 3D landmarks into a spatial grid to construct a grid map; reconstructing the surfaces of the 3D landmarks in the grid map to obtain triangular facet data for each grid; obtaining the vertex index of the triangular facet based on the triangular facet data; and calculating the hash index of the triangular facet based on the vertex index of the triangular facet to map the triangular facet to the triangular facet index list of the corresponding grid.
[0186] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0187] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the triangular facet data management method provided by the above methods. The method includes: dividing initial three-dimensional landmark points into spatial grids to construct a grid map; reconstructing the surfaces of the three-dimensional landmark points in the grid map to obtain triangular facet data for each grid; obtaining the vertex index of the triangular facet based on the triangular facet data; and calculating the hash index of the triangular facet based on the vertex index of the triangular facet to map the triangular facet to the triangular facet index list of the corresponding grid.
[0188] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the triangular facet data management method provided by the above methods. The method includes: dividing initial three-dimensional landmarks into spatial grids to construct a grid map; reconstructing the surfaces of the three-dimensional landmarks in the grid map to obtain triangular facet data for each grid; obtaining the vertex index of the triangular facet based on the triangular facet data; and calculating the hash index of the triangular facet based on the vertex index of the triangular facet to map the triangular facet to the triangular facet index list of the corresponding grid.
[0189] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0190] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0191] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for managing triangular facet data, characterized in that, include: The initial 3D landmarks are divided into spatial grids to construct a grid map; Surface reconstruction is performed on the three-dimensional landmarks in the grid map to obtain the triangular facet data of each grid. Based on the triangular facet data, obtain the vertex index of the triangular facet; Based on the vertex index of the triangle, calculate the hash index of the triangle to map the triangle to the triangle index list of the corresponding mesh. The triangular facet data management method further includes: In response to a global update request for the grid map, retrieve the list of grids to be updated; Lock the list of grids to be updated, and iterate through each grid in the list of grids to be updated; During traversal, lock the currently traversed grid and its corresponding neighboring grids; Perform cross-mesh fusion calculations on the locked currently traversed mesh and its corresponding neighboring meshes to generate new mesh data; Update the triangular facet index list based on the new grid data; Release the lock on the currently traversed mesh and its corresponding neighboring meshes; When the traversal is complete, release the lock on the list of grids to be updated.
2. The triangular patch data management method according to claim 1, characterized in that, The triangular facet data management method further includes: In response to a grid map local update request, obtain the target grid and target 3D landmarks; Based on the target 3D landmarks, determine the triangular facets to be updated in the target mesh; The triangular facet index list is updated based on the triangular facets to be updated.
3. The triangular patch data management method according to claim 2, characterized in that, The step of determining the triangular facets to be updated in the target mesh based on the target 3D landmarks includes: Based on the target 3D landmarks, surface reconstruction is performed to obtain new triangular facet data of the target mesh; Obtain the initial triangular facet data of the target mesh; Based on the new triangular facet data and the initial triangular facet data, determine the triangular facets to be updated in the target mesh.
4. The triangular patch data management method according to any one of claims 1 to 3, characterized in that, The step of calculating the hash index of the triangle based on its vertex index includes: Calculate the first product value based on the first vertex index of the triangular facet and the first preset prime number; Calculate the second product value based on the second vertex index and the second preset prime number of the triangular facet; Calculate the third product value based on the index of the third vertex of the triangular facet and the third preset prime number; Perform a bitwise XOR operation on the first product value, the second product value, and the third product value to obtain the hash index of the triangular facet.
5. The triangular patch data management method according to any one of claims 1 to 3, characterized in that, The process of dividing the initial 3D landmarks into a spatial grid to construct a grid map includes: Based on the preset minimum resolution, the initial three-dimensional landmarks are divided into spatial grids to construct a level 0 grid map; For each target level i from 1 to N, the resolution of target level i is determined based on the target level i and the preset minimum resolution; Based on the resolution of the target level i, the grid data in the (i-1)th level grid map is aggregated to construct the i-th level grid map; Where N is an integer greater than or equal to 1, and the resolution of the i-th level grid map is lower than the resolution of the (i-1)-th level grid map.
6. The triangular patch data management method according to any one of claims 1 to 3, characterized in that, After dividing the initial 3D landmarks into a spatial grid and constructing a grid map, the process further includes: Obtain the coordinates of the 3D landmarks of each grid in the grid map; The grid index of the 3D landmark point in the grid map is calculated based on the coordinates, so as to map the initial 3D landmark point to the 3D landmark point index list of the corresponding grid.
7. A triangular facet data management device, characterized in that, include: The grid generation module is used to divide the initial 3D landmarks into spatial grids to construct a grid map; The surface reconstruction module is used to reconstruct the surface of the three-dimensional landmarks in the grid map to obtain the triangular facet data of each grid. The number acquisition module is used to obtain the vertex index of the triangle based on the triangle data; The hash index calculation module is used to calculate the hash index of the triangle based on the vertex index of the triangle, so as to map the triangle to the triangle index list of the corresponding mesh. The triangular patch data management method further includes a module for responding to a global update request for the grid map, obtaining a list of grids to be updated; locking the list of grids to be updated, and traversing each grid in the list of grids to be updated; During traversal, lock the currently traversed grid and its corresponding neighboring grids; Perform cross-mesh fusion calculations on the locked currently traversed mesh and its corresponding neighboring meshes to generate new mesh data; The triangular facet index list is updated based on the new mesh data; upon completion of the traversal, the lock on the mesh list to be updated is released.
8. An XR device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the triangular facet data management method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Discrete grid patch geometric topological relation reconstruction method, device and equipment and storage medium
CN118013770A
Three-dimensional scene reconstruction method and apparatus, and XR device
CN120655841A