Adaptive grid coding method, device and system for beidou grid code
By using an adaptive grid coding method and leveraging multi-threaded parallel tree traversal and the separating axis theorem, the contradiction between coding integrity and computational efficiency in large-scale oblique photogrammetry 3D model coding is resolved, achieving efficient and accurate BeiDou grid code generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-27
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies struggle to balance encoding integrity and computational efficiency when processing large-scale oblique photogrammetric 3D models. Traditional methods are prone to data omission or high computational complexity in high-precision mesh encoding scenarios, failing to meet real-time processing requirements.
An adaptive grid coding method is adopted, which performs top-down hierarchical tree traversal coding on triangular facet data through multi-threaded parallel processing. The data is then coarsely screened and precisely detected by combining axis-aligned bounding boxes and the separating axis theorem. Finally, duplicates are removed and merged to obtain the BeiDou grid code set.
It achieves efficient computation while ensuring code integrity, improves coding speed and accuracy, reduces computational complexity, and is suitable for real-time processing of large-scale 3D models.
Smart Images

Figure CN121585176B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of BeiDou grid code technology, and in particular to an adaptive grid coding method, apparatus and system for BeiDou grid codes. Background Technology
[0002] The application of BeiDou grid codes is becoming increasingly widespread in the low-altitude field, especially in scenarios such as UAV aerial surveying, low-altitude economic supervision, and urban airspace management. Accurate grid coding of large-scale oblique photogrammetric 3D models is required to achieve unified identification and efficient retrieval of spatial locations.
[0003] Oblique photogrammetry can capture the true 3D structure of ground features. The generated models in formats such as OSGB and 3DTiles contain a massive number of triangular meshes, with a single city-level scene often containing millions or even hundreds of millions of triangular meshes. How to quickly and accurately assign BeiDou mesh codes to these complex 3D entities is a pressing technical challenge that needs to be solved.
[0004] However, existing technologies still have significant limitations when processing large-scale oblique photogrammetric 3D models. On the one hand, traditional point-sampling-based encoding methods (such as vertex sampling and centroid sampling) struggle to accurately cover large areas of triangular mesh faces, easily leading to omissions in high-precision mesh encoding scenarios and resulting in incomplete spatial representation of the data. On the other hand, while bounding box-based dense sampling methods alleviate the omission problem to some extent, their computational complexity is extremely high, consuming enormous resources and failing to meet the real-time processing needs of massive amounts of data. Furthermore, existing technologies generally lack in-depth utilization of the hierarchical structure of BeiDou mesh codes and are deficient in accurately detecting the intersection of 3D entities and mesh cells, making it difficult to achieve a balance between accuracy and efficiency in the algorithms.
[0005] Therefore, how to provide a grid coding method that balances coding integrity and computational efficiency has become a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] This invention provides an adaptive grid coding method, apparatus, and system for BeiDou grid codes, solving the problem in related technologies that cannot balance coding integrity and computational efficiency.
[0007] As a first aspect of the present invention, an adaptive grid coding method for BeiDou grid codes is provided, comprising:
[0008] Oblique photogrammetry 3D model data is acquired, and the data format of the oblique photogrammetry 3D model data includes at least OSGB, OBJ and 3dTiles;
[0009] The oblique photogrammetry 3D model data is parsed to obtain all the triangular facet data that constitute the oblique photogrammetry 3D model.
[0010] All triangular facet data are encoded in parallel tree traversal using a multi-threaded parallel approach. Each thread independently encodes its own triangular facet data in a hierarchical tree traversal from top to bottom until a preset target level is reached. The top-down order is determined according to the hierarchical standard of the BeiDou grid code.
[0011] The preset target level grid codes obtained after each worker thread traverses are merged and deduplicated to obtain a set of Beidou grid codes.
[0012] Output the set of BeiDou grid codes.
[0013] Furthermore, the oblique photogrammetry 3D model data is parsed to obtain all the triangular mesh data constituting the oblique photogrammetry 3D model, including:
[0014] Extract all triangular patch data from the oblique photogrammetry 3D model data. The triangular patch data includes at least the coordinates of the three vertices of the triangular patch and the index information of the topological relationship of the triangular patch.
[0015] Calculate the axis-aligned bounding box of each triangular facet in the triangular facet data to obtain the minimum cube range that encloses each triangular facet.
[0016] Furthermore, all triangular patch data are encoded using a parallel tree traversal method based on multi-threaded parallelism, including:
[0017] Each triangle in the triangular mesh data is stored as an independent computation task in the task pool;
[0018] Worker threads are dynamically created based on the current number of CPU cores. Each worker thread can obtain a triangular facet from the task pool and encode the triangular facet in a hierarchical tree traversal order according to the BeiDou grid code from top to bottom until the preset target level is reached.
[0019] Furthermore, each worker thread can obtain a triangular facet from the task pool, and encode the triangular facet using a hierarchical tree traversal according to the BeiDou grid code in a top-down order until a preset target level is reached, including:
[0020] Construct traversal paths for the triangle facets using a breadth-first search strategy;
[0021] Starting from the first level of the BeiDou grid code, each level of grid nodes is coarsely traversed to determine whether the triangular facets intersect with the grid nodes in space. The BeiDou grid code includes multiple hierarchical structures set from top to bottom, and each grid code in the hierarchical structure is defined as a grid node.
[0022] When it is determined that the triangle facet intersects with the grid node in space, the subordinate grid nodes of the grid node are subjected to coarse screening and / or precise detection traversal until the current traversal level is determined to be the target preset level, and the target preset level grid code corresponding to the current triangle facet is obtained.
[0023] Collect the target preset level grid code for each worker thread.
[0024] Furthermore, starting from the first level of the BeiDou grid code, a coarse traversal is performed on the grid nodes of each level to determine whether the triangular facets intersect with the grid nodes in space, including:
[0025] Calculate the axis-aligned bounding box of the current mesh node;
[0026] Determine whether the axis-aligned bounding box of the current mesh node overlaps with the axis-aligned bounding box of the triangle facet;
[0027] If the axis-aligned bounding box of the current mesh node overlaps with the axis-aligned bounding box of the triangle facet, then the current mesh node and the triangle facet are determined to intersect in space.
[0028] If the axis-aligned bounding box of the current mesh node does not overlap with the axis-aligned bounding box of the triangle facet, then it is determined that the current mesh node and the triangle facet do not intersect in space, and processing of the current mesh node and its subordinate mesh nodes is abandoned.
[0029] Furthermore, when it is determined that the triangular facet intersects with a mesh node in space, a coarse screening traversal and / or a precise detection traversal are performed on the subordinate mesh nodes of that mesh node until the current traversal level is determined to be the target preset level, thereby obtaining the target preset level mesh code corresponding to the current triangular facet, including:
[0030] When it is determined that a triangular facet intersects with a grid node in space, it is determined whether the level of the subordinate grid nodes of that grid node is the target preset level.
[0031] If the level of the subordinate grid nodes of the grid node is not the target preset level, then a coarse traversal is performed on the level of the subordinate grid nodes of the grid node until the traversed level is determined to be the target preset level.
[0032] If the subordinate grid nodes of the current grid node are at the target preset level, then the subordinate grid nodes of the current grid node are precisely detected and traversed to obtain the target preset level grid code corresponding to the current triangle facet.
[0033] Furthermore, a precise traversal of the subordinate grid nodes of this grid node is performed, including:
[0034] A set of potential separating axes is constructed based on the subordinate mesh nodes of the mesh node and the triangular facets. The set of potential separating axes includes at least the face normals and edge normals of the subordinate mesh nodes of the mesh node and the face normals and edge normals of the triangular facets.
[0035] Calculate the projection of the triangular facet and each subordinate mesh node of the mesh node onto each axis in the set of potential separating axes;
[0036] Determine whether the projection of the triangular facet on each axis overlaps with the projection of each subordinate mesh node on each axis;
[0037] Subordinate mesh nodes whose projections overlap on each axis are identified as intersecting with triangular patches, and the mesh faces of these intersecting subordinate mesh nodes are identified as the target preset level mesh codes.
[0038] Furthermore, the preset target level grid codes obtained after each worker thread traverses are merged and deduplicated to obtain a BeiDou grid code set, including:
[0039] The preset target level grid codes obtained after traversing all threads are aggregated into a global deduplication container to remove duplicate preset target level grid codes;
[0040] The remaining target preset level grid codes after removing duplicate target preset level grid codes are merged to obtain the Beidou grid code set.
[0041] As another aspect of the present invention, an adaptive grid coding device for BeiDou grid codes is provided, for implementing the adaptive grid coding method for BeiDou grid codes described above, wherein the device includes:
[0042] The acquisition module is used to acquire oblique photogrammetry 3D model data, wherein the data format of the oblique photogrammetry 3D model data includes at least OSGB, OBJ and 3dTiles;
[0043] The parsing and processing module is used to parse and process the oblique photogrammetry 3D model data to obtain all the triangle patch data that constitute the oblique photogrammetry 3D model.
[0044] The traversal encoding module is used to perform parallel tree traversal encoding on all triangular facet data in a multi-threaded parallel manner. Each thread independently performs hierarchical tree traversal encoding on its own triangular facet data in a top-down order until a preset target level is reached. The top-down order is determined according to the hierarchical standard of Beidou grid code.
[0045] The deduplication and merging module is used to merge and deduplicate the grid codes of the preset target level obtained after each worker thread traverses the grid code to obtain a set of Beidou grid codes.
[0046] The output module is used to output the BeiDou grid code set.
[0047] As another aspect of the present invention, an adaptive grid coding system for BeiDou grid codes is provided, comprising: an oblique photogrammetry 3D model data acquisition device and the aforementioned adaptive grid coding device for BeiDou grid codes, wherein the oblique photogrammetry 3D model data acquisition device is communicatively connected to the adaptive grid coding device for BeiDou grid codes.
[0048] The oblique photogrammetry 3D model data acquisition device is used to acquire oblique photogrammetry 3D model data;
[0049] The adaptive grid coding device for BeiDou grid codes is used to analyze and process oblique photogrammetry 3D model data, and to obtain a set of BeiDou grid codes by performing parallel tree traversal coding on the analyzed triangular patch data based on multiple working threads.
[0050] The adaptive grid coding method for BeiDou grid codes provided by this invention parses the acquired oblique photogrammetry 3D model data to obtain triangular facet data, and then encodes the triangular facet data using a multi-threaded parallel tree traversal encoding method. Finally, it deduplicates and merges the grid codes of a preset target level obtained from the multi-threaded method to obtain a set of BeiDou grid codes for the oblique photogrammetry 3D model data. This adaptive grid coding method for BeiDou grid codes effectively improves computational efficiency through parallel threads, and the parallel tree traversal encoding method also ensures coding integrity. Therefore, this adaptive grid coding method for BeiDou grid codes can balance coding integrity and computational efficiency. Attached Figure Description
[0051] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the following detailed description to explain the invention, but do not constitute a limitation thereof.
[0052] Figure 1 The flowchart shows the adaptive grid coding method for BeiDou grid codes provided by this invention.
[0053] Figure 2 A schematic diagram of the oblique photogrammetry three-dimensional model data provided by the present invention.
[0054] Figure 3 This is a flowchart for parsing and processing oblique photogrammetric 3D model data provided by the present invention.
[0055] Figure 4 This is a flowchart for performing parallel tree traversal encoding on all triangular facet data provided by the present invention.
[0056] Figure 5 This is a flowchart illustrating the independent traversal encoding for each worker thread provided by the present invention.
[0057] Figure 6 This is a schematic diagram of hierarchical tree traversal and pruning provided by the present invention.
[0058] Figure 7 The flowchart illustrates the geometric intersection detection process of the separation axis theorem provided by this invention.
[0059] Figure 8 This invention provides a flowchart for merging and deduplicating grid codes at a preset target level.
[0060] Figure 9a This invention provides a set of BeiDou grid codes for the final encoding of oblique photogrammetry 3D model data.
[0061] Figure 9b This is another level of BeiDou grid code set for the final encoding of the oblique photogrammetry 3D model data provided by this invention.
[0062] Figure 9c This is another level of BeiDou grid code set for the final encoding of the oblique photogrammetry 3D model data provided by this invention.
[0063] Figure 10 This is a structural block diagram of the adaptive grid coding device for BeiDou grid codes provided by the present invention.
[0064] Figure 11 The diagram shows the structure of the adaptive grid coding system for BeiDou grid codes provided by this invention.
[0065] Figure 12 This is a schematic diagram of the configurable optimization strategies and action points integrated into the system's underlying layer, as provided by the present invention. Detailed Implementation
[0066] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0067] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0068] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of the invention described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0069] This embodiment provides an adaptive grid coding method for BeiDou grid codes. Figure 1 This is a flowchart of an adaptive grid coding method for BeiDou grid codes provided according to an embodiment of the present invention, such as... Figure 1 As shown, it includes:
[0070] S100. Obtain oblique photogrammetry 3D model data, wherein the data format of the oblique photogrammetry 3D model data includes at least OSGB, OBJ and 3dTiles;
[0071] In this embodiment of the invention, the acquired oblique photogrammetry 3D model data can be specifically as follows: Figure 2 As shown, the data format of this oblique photogrammetry 3D model data can include a variety of mainstream formats, including OSGB, OBJ, and 3dTiles.
[0072] S200. The oblique photogrammetry 3D model data is parsed to obtain all the triangle facet data constituting the oblique photogrammetry 3D model.
[0073] Specifically, the acquired oblique photogrammetry 3D model data can be converted into a standard format that can be processed later. Specifically, the oblique photogrammetry 3D model data can be read by a parser and parsed. The parsing process delves into the internal structure of the model and extracts all the triangular facet data that make up the 3D entity.
[0074] S300. Perform parallel tree traversal encoding on all triangular facet data in a multi-threaded parallel manner. Each thread independently performs hierarchical tree traversal encoding on its own triangular facet data in a top-down order until a preset target level is reached. The top-down order is determined according to the hierarchical standard of Beidou grid code.
[0075] In this embodiment of the invention, in order to reduce the computational pressure of massive data, a fine-grained multi-threaded parallel approach is used to perform parallel tree traversal encoding on all triangular facet data. This approach reduces the computational pressure of massive data through parallel threads, and also effectively removes irrelevant BeiDou grid codes by having each working thread perform hierarchical tree traversal encoding in a top-down order, thereby reducing computational complexity and improving computational efficiency.
[0076] It should be understood that the hierarchical standard of the BeiDou grid code in the embodiments of the present invention can specifically be GB / T39409-2020 BeiDou grid location code.
[0077] S400: Merge and deduplicate the preset target level grid codes obtained after each working thread traverses to obtain a set of Beidou grid codes;
[0078] In this embodiment of the invention, in order to avoid duplicate grid codes in multi-threaded processes, the grid codes of the preset target level after all threads are finally aggregated are deduplicated and then merged to obtain a set of Beidou grid codes.
[0079] S500, output the BeiDou grid code set.
[0080] In summary, the adaptive grid coding method for BeiDou grid codes provided by this invention obtains triangular facet data by parsing the acquired oblique photogrammetry 3D model data. Then, it encodes the triangular facet data using a multi-threaded parallel tree traversal encoding method. Finally, it deduplicates and merges the grid codes obtained from the multi-threaded methods at a preset target level to obtain a set of BeiDou grid codes for the oblique photogrammetry 3D model data. This adaptive grid coding method for BeiDou grid codes effectively improves computational efficiency through parallel threads, and the parallel tree traversal encoding method ensures coding integrity. Therefore, this adaptive grid coding method for BeiDou grid codes can balance coding integrity and computational efficiency.
[0081] In this embodiment of the invention, the oblique photogrammetry 3D model data is parsed to obtain all the triangular mesh data constituting the oblique photogrammetry 3D model, such as... Figure 3 As shown, it includes:
[0082] S210. Extract all triangular patch data from the oblique photogrammetry 3D model data. The triangular patch data includes at least the coordinates of the three vertices of the triangular patch and the index information of the topological relationship of the triangular patch.
[0083] In this embodiment of the invention, the extracted triangular patch data specifically includes the coordinates (x, y, z) of the three vertices of the triangle and index information defining the topological relationship of the triangular patch.
[0084] S220. Calculate the axis-aligned bounding box of each triangular facet in the triangular facet data to obtain the minimum cube range that encloses each triangular facet.
[0085] It should be understood that, while extracting geometric data, the axis-aligned bounding box (AABB) of each triangular facet is calculated immediately, that is, the minimum cubic range that encloses the triangular facet is determined by comparing the extreme values of the coordinates of the three vertices.
[0086] Considering that the original model typically uses a local Cartesian coordinate system or a projected coordinate system, while the BeiDou grid code is based on the Earth's spherical subdivision, the oblique photogrammetry 3D model data is parsed to obtain all the triangular patch data constituting the oblique photogrammetry 3D model, and also includes:
[0087] Based on the projection matrix, the coordinates of all vertices in the triangular patch data are transformed to obtain latitude, longitude, and elevation data in the WGS84 coordinate system.
[0088] It should be understood that by using the projection matrix to uniformly convert all vertex coordinates into latitude, longitude, and elevation data in the WGS84 coordinate system, a unified mathematical foundation is laid for subsequent spatial calculations.
[0089] In this embodiment of the invention, all triangle facet data are encoded using a parallel tree traversal in a multi-threaded parallel manner, such as... Figure 4 As shown, it includes:
[0090] S310a. Store each triangle facet in all triangle mesh facet data as an independent computation task in the task pool;
[0091] Specifically, at the task scheduling level, the system treats millions of triangle facet data as independent computational tasks and places them into a task pool.
[0092] S320a. Dynamically create worker threads based on the current number of CPU cores. Each worker thread can obtain a triangular facet from the task pool and encode the triangular facet in a hierarchical tree traversal order according to the BeiDou grid code from top to bottom until the preset target level is reached.
[0093] It should be understood that worker threads are dynamically created based on the number of CPU cores. Each worker thread obtains a triangle from the task pool and independently executes a top-down hierarchical tree traversal algorithm.
[0094] This hierarchical tree traversal algorithm utilizes the spatial partitioning characteristics of the BeiDou grid code, starting from Level 1 (specifically based on the hierarchical standard of the BeiDou grid code mentioned earlier; in this standard, Level 1 is a large-scale grid, and as the level increases, the grid scale becomes smaller, i.e., the accuracy becomes higher), and searches downwards layer by layer. At each level, the algorithm intelligently judges based on spatial geometric relationships: if the current grid node is spatially separated from the triangle, the node and all its descendant child nodes are directly pruned; if they intersect, the algorithm further subdivides to the next level until the user-specified target subdivision level (such as Level 7 or Level 10) is reached. This "on-demand traversal" strategy avoids ineffective searches of irrelevant regions.
[0095] Specifically, each worker thread can obtain a triangular facet from the task pool, and encode the triangular facet using a hierarchical tree traversal according to the BeiDou grid code in top-down order until a preset target level is reached, such as... Figure 5 As shown, it includes:
[0096] S310b, Construct the traversal path of the triangle facets according to the breadth-first search strategy;
[0097] It should be understood that the embodiments of the present invention abandon the traditional brute-force sampling method and make full use of the natural multi-branch tree structure characteristics of the BeiDou grid code. The spatial partitioning of the BeiDou grid code is essentially a recursive quadtree (2D) or octree (3D) structure. The embodiments of the present invention regard each grid code as a node in the tree and use the breadth-first search (BFS) strategy to construct the traversal path.
[0098] S320b: Starting from the first level of the Beidou grid code, a coarse traversal is performed on the grid nodes of each level to determine whether the triangular facets and the grid nodes intersect in space. The Beidou grid code includes multiple hierarchical structures set from top to bottom, and each grid code in the hierarchical structure is defined as a grid node.
[0099] In this embodiment of the invention, it should be understood that the coarse screening process is a very low-cost and rapid filtering process. Specifically, starting from the first level of the BeiDou grid code, a coarse screening process is performed on the grid nodes of each level to determine whether the triangular facets intersect with the grid nodes in space, including:
[0100] 1) Calculate the axis-aligned bounding box of the current mesh node;
[0101] 2) Determine whether the axis-aligned bounding box of the current mesh node overlaps with the axis-aligned bounding box of the triangle facet;
[0102] 3) If the axis-aligned bounding box of the current mesh node overlaps with the axis-aligned bounding box of the triangle facet, then the current mesh node and the triangle facet are determined to intersect in space.
[0103] 4) If the axis-aligned bounding box of the current mesh node does not overlap with the axis-aligned bounding box of the triangle facet, then it is determined that the current mesh node and the triangle facet do not intersect in space, and the processing of the current mesh node and its subordinate mesh nodes is abandoned.
[0104] In this embodiment of the invention, the coarse screening process involves calculating the axis-aligned bounding box of the current mesh node and detecting whether it overlaps with the triangular facet AABB. This comparison method involves only 6 floating-point comparison operations (comparison of the minimum and maximum values of the X, Y, and Z axes), with a complexity of O(1). Once it is determined that there is no overlap, a "pruning" operation can be performed immediately, abandoning further processing of that mesh node and all its subordinate sub-mesh nodes. This coarse screening method of the present invention can filter out more than 80% of irrelevant meshes, greatly reducing the number of subsequent complex calculations.
[0105] S330b When it is determined that the triangular facet intersects with the grid node in space, the subordinate grid nodes of the grid node are subjected to coarse screening and / or precise detection traversal until the current traversal level is determined to be the target preset level, and the target preset level grid code corresponding to the current triangular facet is obtained.
[0106] In this embodiment of the invention, for leaf nodes that have passed the coarse screening and reached the target subdivision level, in order to further improve accuracy and ensure the geometric integrity of the encoding results, a rigorous geometric intersection test can be performed using the Separating Axis Theorem (SAT). It should be noted that the SAT theorem states that if two convex polyhedra do not intersect, then there must exist a separating axis such that the projection intervals of the two objects on this axis do not overlap. Therefore, a geometric intersection test is performed based on this principle.
[0107] Specifically, when it is determined that a triangular facet intersects with a mesh node in space, a coarse screening traversal and / or a precise detection traversal are performed on the subordinate mesh nodes of that mesh node until the current traversal level is determined to be the target preset level, thereby obtaining the target preset level mesh code corresponding to the current triangular facet, including:
[0108] 1) When it is determined that a triangular facet intersects with a grid node in space, determine whether the level of the subordinate grid nodes of that grid node is the target preset level;
[0109] It should be understood that when determining that a triangular facet intersects with a grid node in space, it is necessary to further determine that the level of the subordinate grid nodes of the grid node is the target preset level. Then, a geometric intersection test can be performed based on the separating axis theorem. If the level of the subordinate grid nodes of the grid node is not the target preset level, then the coarse screening traversal continues.
[0110] 2) If the level of the subordinate grid nodes of the grid node is not the target preset level, then perform a coarse traversal of the level of the subordinate grid nodes of the grid node until the traversed level is determined to be the target preset level.
[0111] In embodiments of the present invention, for example, in combination with Figure 6 As shown, the target preset level is Level 7, while the subordinate grid nodes of the current grid node are at Level 6. Therefore, it is necessary to perform a coarse traversal of the grid nodes at Level 6 until Level 7 is reached. For the grid node at Level 6, its subordinate grid nodes are at Level 7. Therefore, a geometric intersection test based on the separating axis theorem is performed on the subordinate grid nodes at Level 7.
[0112] 3) If the level of the subordinate grid nodes of the grid node is the target preset level, then perform precise detection and traversal of the subordinate grid nodes of the grid node to obtain the target preset level grid code corresponding to the current triangle facet.
[0113] In this embodiment of the invention, the precise detection and traversal of the subordinate grid nodes of the grid node includes:
[0114] 31) Construct a set of potential separation axes based on the subordinate mesh nodes and triangular facets of the mesh node. The set of potential separation axes includes at least the face normals and edge normals of the subordinate mesh nodes of the mesh node and the face normals and edge normals of the triangular facets.
[0115] 32) Calculate the projection of the triangular facet and each subordinate mesh node of the mesh node onto each axis in the potential separation axis set;
[0116] It should be understood that, based on the geometric features of the triangular facets and the cube mesh nodes, the embodiments of the present invention construct a complete set of 13 potential separation axes: including the three face normal vector axes of the cube, the one face normal vector axis of the triangle, and the nine axes generated by the cross products of the three sides of the cube and the three sides of the triangle.
[0117] 33) Determine whether the projection of the triangular facet on each axis overlaps with the projection of each subordinate mesh node on each axis;
[0118] 34) Determine the subordinate mesh nodes whose projections overlap on each axis as intersecting with the triangular facets, and determine the mesh face of the intersecting subordinate mesh nodes as the target preset level mesh code.
[0119] It should be understood that, for each axis in the set of separation axes constructed above, the projection of the triangular facet and the projection of its subordinate mesh nodes are calculated sequentially on these axes. If projection separation is found on any axis, it can be determined that they are not intersecting; only when the projections on all axes overlap are they finally determined to be intersecting and the mesh code is recorded. This mechanism ensures that the geometric integrity of the encoding result is close to 100%.
[0120] It should be noted that the specific process of this geometric intersection detection based on the separating axis theorem can be described as follows: Figure 7 As shown, first move the vertices of the triangular facet to the coordinate system of the center of the mesh node (in the attached...). Figure 7 The grid nodes are represented by boxes, which makes it easier to understand that each grid can be likened to a box. Then, based on the coarse screening, the target grid nodes can be determined. Then, the separation axis theorem is used to detect the subordinate grid nodes of the target grid nodes, that is, to calculate the projection of the triangular facet and each subordinate grid node on each axis and determine whether they are separated. If they are not separated on all axes, they are determined to be intersecting, and the grid code of the corresponding subordinate grid node is determined to be the target preset level grid code.
[0121] S340b: Collects target preset level grid codes for each worker thread.
[0122] In this embodiment of the invention, after all parallel threads have completed their respective tasks, the system enters the data aggregation stage. Since different triangles (especially adjacent triangles) are highly likely to cover the same grid cell, the local results generated by each thread will inevitably contain a large number of duplicate grid codes. In this embodiment of the invention, to eliminate duplicate grid codes, specifically, the grid codes at a preset target level obtained after each working thread's traversal are merged and deduplicated to obtain a BeiDou grid code set, such as... Figure 8 As shown, it includes:
[0123] S410. Gather the preset target level grid codes obtained after traversing all threads into a global deduplication container to remove duplicate preset target level grid codes.
[0124] S420. Merge the remaining target preset level grid codes after removing duplicate target preset level grid codes to obtain the Beidou grid code set.
[0125] In this embodiment of the invention, a highly efficient set merging algorithm can be employed to aggregate the local results of all threads into a global deduplication container (such as std::set or hash table). This container utilizes its internal data structure characteristics to automatically identify and remove duplicate grid code strings during the insertion process, ensuring the uniqueness of the final result. Furthermore, this embodiment of the invention also supports formatted output of the results, which can generate a standard string list file or be serialized into a binary stream for subsequent storage, transmission, or database operations.
[0126] like Figures 9a to 9c As shown, this is the corresponding Figure 2 The oblique photogrammetry 3D model data shown represents the final BeiDou grid code set obtained from the data. Figures 9a to 9c These represent sets of BeiDou grid codes at different target levels, namely Figures 9a to 9c The target level of BeiDou grid codes is constantly increasing, for example, Figure 9a It can represent Level 5. Figure 9b It can represent Level 6. Figure 9c It can represent Level 7. Different levels result in different encoding precision. Obviously, the higher the level, the higher the encoding precision. The specific target level is set according to the user's needs.
[0127] The effectiveness of the adaptive grid coding method for BeiDou grid codes of the present invention will be described below with reference to specific embodiments.
[0128] As a specific implementation of city-level oblique photogrammetry model encoding, a city's UAV low-altitude flight path planning project requires Level 7 (approximately 50-meter accuracy) BeiDou grid code encoding of an oblique photogrammetry model covering approximately 100 square kilometers. Data preparation: The input data is an oblique photogrammetry model in OSGB format, with a model size of approximately 100,000 triangle faces, target level: Level 7. The OSGB model is parsed, vertex coordinates and triangle indices are extracted, and the AABB bounding box of each triangle is calculated. The local coordinates of the model are converted to WGS84 latitude, longitude, and elevation coordinates. Parallel tree traversal is performed, specifically using OpenMP with 8 threads for parallel processing. Each triangle face undergoes independent tree traversal, starting with BFS traversal from Level 1, dynamically pruning non-intersecting branches, and performing SAT (Satisfactory Aspect-Adjustable Threshold) detection at Level 7 leaf nodes. Results from each thread are merged and automatically deduplicated.
[0129] The final performance results are as follows: total encoding time: 1.8 seconds (8 cores in parallel); peak memory usage: approximately 500MB; number of generated grid codes: approximately 1.2 million; encoding integrity: 100% sampling verification coverage.
[0130] Table 1 Performance Comparison Data (Compared with Traditional Methods)
[0131]
[0132] Additionally, it should be noted that traditional vertex sampling methods only sample 10 points for large triangles (side length 100m), potentially missing more than 40 grid points. This invention addresses the processing of large triangles by automatically expanding the tree traversal to all intersecting Level 7 grids, and using SAT detection to ensure that every intersecting grid is recorded, providing complete coverage regardless of triangle size.
[0133] The final verification results are as follows: for the large triangle (side length 100m): the coverage rate of the traditional method is 62%, while the coverage rate of the present invention is 100%; for the small triangle (side length 10m): the coverage rates of the two methods are comparable, but the present invention is faster.
[0134] In summary, the adaptive grid coding method for BeiDou grid codes provided by this invention has the following advantages:
[0135] (1) Although traditional vertex sampling has low complexity, it is insufficient for large triangles and has a high omission rate; bounding box dense sampling increases cubically with sampling density, and in city-level and high-level grids, it is easy to have hundreds of millions of sampling points, which is extremely slow and has high memory pressure. In contrast, this invention adopts a combination of "hierarchical tree traversal and SAT", with a complexity of O(N×B×L), where N represents the number of triangles, B represents the average number of branches retained at each level (about 2~4), and L represents the target level. In the typical scenario of "100,000 triangles + Level 7", the amount of computation is about 60 million times, with a single core < 1 second; 8 cores in parallel can reach 0.2 seconds. This complexity comes from the synergy of layer-by-layer pruning and leaf layer fine inspection: the upper layer quickly removes most non-intersecting nodes, and only goes deeper to a finer level when necessary, thereby avoiding exponential expansion of invalid calculations.
[0136] (2) High efficiency: The combination of hierarchical traversal and pruning is 50 to 100 times faster than traditional methods; it maintains stable throughput even in complex scenarios; Accuracy: Leaf layer SAT fine inspection, coding integrity is about 99.97%, significantly reducing the risk of missing coding; Parallel friendly: Independent tasks + dynamic scheduling, 8 cores accelerate by about 7 times, and the load balance is good; Memory friendly: Streaming and lazy strategies, low peak value, avoid overflow, suitable for large-scale batch processing.
[0137] (3) Compared with traditional vertex sampling and bounding box sampling, the present invention is significantly superior to existing solutions in terms of integrity, speed, memory, large triangle processing and parallelism; at the same time, it also has advantages in terms of engineering feasibility and easy integration into existing production pipelines.
[0138] As another embodiment of the present invention, an adaptive grid coding device 100 for BeiDou grid codes is provided, which is used to implement the adaptive grid coding method for BeiDou grid codes described above, wherein, as Figure 10 As shown, it includes:
[0139] The acquisition module 110 is used to acquire oblique photogrammetry 3D model data, wherein the data format of the oblique photogrammetry 3D model data includes at least OSGB, OBJ and 3dTiles;
[0140] The parsing and processing module 120 is used to parse and process the oblique photogrammetry 3D model data to obtain all the triangle facet data constituting the oblique photogrammetry 3D model.
[0141] The traversal encoding module 130 is used to perform parallel tree traversal encoding on all triangular facet data in a multi-threaded parallel manner. Each thread independently performs hierarchical tree traversal encoding on its own triangular facet data in a top-down order until a preset target level is reached. The top-down order is determined according to the hierarchical standard of the Beidou grid code.
[0142] The deduplication and merging module 140 is used to merge and deduplicate the preset target level grid codes obtained after each working thread traverses, and obtain a set of Beidou grid codes.
[0143] Output module 150 is used to output the BeiDou grid code set.
[0144] The adaptive grid encoding device for BeiDou grid codes provided by this invention parses the acquired oblique photogrammetry 3D model data to obtain triangular facet data, and then encodes the triangular facet data using a multi-threaded parallel tree traversal encoding method. It then deduplicates and merges the grid codes of a preset target level obtained from the multi-threaded method to obtain a set of BeiDou grid codes for the oblique photogrammetry 3D model data. This adaptive grid encoding device for BeiDou grid codes effectively improves computational efficiency through parallel threads, and the parallel tree traversal encoding method also ensures encoding integrity. Therefore, this adaptive grid encoding device for BeiDou grid codes can balance encoding integrity and computational efficiency.
[0145] The specific working principle of the adaptive grid coding device for BeiDou grid codes of the present invention can be referred to the description of the adaptive grid coding method for BeiDou grid codes above, and will not be repeated here.
[0146] As another embodiment of the present invention, an adaptive grid coding system 10 for BeiDou grid codes is provided, wherein, as Figure 11 As shown, it includes: an oblique photogrammetry 3D model data acquisition device 200 and the aforementioned adaptive grid coding device 100 for BeiDou grid codes. The oblique photogrammetry 3D model data acquisition device 200 is communicatively connected to the adaptive grid coding device 100 for BeiDou grid codes.
[0147] The oblique photogrammetry 3D model data acquisition device 200 is used to acquire oblique photogrammetry 3D model data;
[0148] The adaptive grid coding device 100 for BeiDou grid codes is used to analyze and process oblique photogrammetry 3D model data, and to obtain a set of BeiDou grid codes by performing parallel tree traversal coding on the analyzed triangular patch data based on multiple working threads.
[0149] The adaptive grid coding system for BeiDou grid codes provided by this invention, sampling the aforementioned adaptive grid coding device for BeiDou grid codes, obtains triangular facet data by parsing the acquired oblique photogrammetric 3D model data. Then, it encodes the triangular facet data using a multi-threaded parallel tree traversal encoding method. Finally, it deduplicates and merges the grid codes of a preset target level obtained from the multi-threaded method to obtain a set of BeiDou grid codes for the oblique photogrammetric 3D model data. This adaptive grid coding system for BeiDou grid codes effectively improves computational efficiency through parallel threads, and the parallel tree traversal encoding method ensures coding integrity. Therefore, this adaptive grid coding system for BeiDou grid codes can balance coding integrity and computational efficiency.
[0150] In this embodiment of the invention, the oblique photogrammetry 3D model data acquisition device 200 can specifically be an unmanned aerial vehicle platform or an oblique photogrammetry camera, etc.
[0151] In terms of architecture optimization design, in order to further explore hardware performance, combined with Figure 12 As shown, the adaptive grid coding system for BeiDou grid codes of the present invention integrates the following configurable optimization strategies at the system bottom layer:
[0152] (1) Pre-calculated lookup table (LUT): Considering that the size of each level of the grid code is fixed, the system pre-calculates and stores the latitude and longitude span and metric size of each level of grid. In the massive intersection detection calculation, the parameters are obtained directly by looking up the table, avoiding the overhead of hundreds of millions of repeated trigonometric function operations and coordinate transformations.
[0153] (2) Delayed child node generation: During tree traversal, the system abandons the practice of pre-generating all child grid nodes and instead adopts a "lazy evaluation" strategy. Child node objects are dynamically calculated and generated only when the parent node is determined to be intersecting. This strategy significantly reduces the number of temporary objects created, reducing memory allocation fragmentation and garbage collection pressure.
[0154] (3) Direct bounding box calculation: Traditional methods usually require decoding the grid code string into latitude and longitude before calculating the bounding box. This invention optimizes this path by using the bounding box coordinates of the parent node to directly derive the bounding box range of the child node through simple numerical addition and subtraction operations, completely bypassing the expensive string parsing and decoding operations.
[0155] (4) Thread Local Storage (TLS): To avoid frequent memory allocation lock contention in a multi-threaded environment, the system allocates an independent memory pool and temporary container (Thread Local Storage) for each thread. Threads reuse these local resources during computation and only access global memory during the final merging, which significantly improves parallel efficiency.
[0156] (5) SIMD Vectorization Acceleration: To address the numerous vector dot product and cross product operations in SAT detection, the system utilizes the CPU's SSE / AVX instruction set to achieve Single Instruction Multiple Data (SIMD) parallel processing. A single instruction can simultaneously perform operations on the X, Y, and Z components, thereby increasing the core calculation speed of geometric detection by 2 to 4 times.
[0157] The specific working principle of the adaptive grid coding system for BeiDou grid codes of the present invention can be referred to the description of the adaptive grid coding method for BeiDou grid codes above, and will not be repeated here.
[0158] It is understood that the above embodiments are merely exemplary implementations used to illustrate the principles of the present invention, and the present invention is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.
Claims
1. An adaptive grid coding method for BeiDou grid codes, characterized in that, include: Oblique photogrammetry 3D model data is acquired, and the data format of the oblique photogrammetry 3D model data includes at least OSGB, OBJ and 3dTiles; The oblique photogrammetry 3D model data is parsed to obtain all the triangular facet data that constitute the oblique photogrammetry 3D model. All triangular facet data are encoded in parallel tree traversal using a multi-threaded parallel approach. Each thread independently encodes its own triangular facet data in a hierarchical tree traversal from top to bottom until a preset target level is reached. The top-down order is determined according to the hierarchical standard of the BeiDou grid code. The preset target level grid codes obtained after each worker thread traverses are merged and deduplicated to obtain a set of Beidou grid codes. Output the set of BeiDou grid codes; All triangle patch data are encoded using a parallel tree traversal approach based on multi-threading, including: Each triangle in the triangular mesh data is stored as an independent computation task in the task pool; Worker threads are dynamically created based on the current number of CPU cores. Each worker thread can obtain a triangular facet from the task pool and encode the triangular facet in a hierarchical tree traversal order according to the Beidou grid code from top to bottom until the preset target level is reached. Each worker thread can obtain a triangular facet from the task pool, and encode the triangular facet using a hierarchical tree traversal according to the BeiDou grid code in top-down order until a preset target level is reached, including: Construct traversal paths for the triangle facets using a breadth-first search strategy; Starting from the first level of the BeiDou grid code, each level of grid nodes is coarsely traversed to determine whether the triangular facets intersect with the grid nodes in space. The BeiDou grid code includes multiple hierarchical structures set from top to bottom, and each grid code in the hierarchical structure is defined as a grid node. When it is determined that the triangle facet intersects with the grid node in space, the subordinate grid nodes of the grid node are subjected to coarse screening and / or precise detection traversal until the current traversal level is determined to be the target preset level, and the target preset level grid code corresponding to the current triangle facet is obtained. Collect the target preset level grid code for each worker thread.
2. The adaptive grid coding method for BeiDou grid codes according to claim 1, characterized in that, The oblique photogrammetry 3D model data is parsed to obtain all the triangular mesh data constituting the oblique photogrammetry 3D model, including: Extract all triangular patch data from the oblique photogrammetry 3D model data. The triangular patch data includes at least the coordinates of the three vertices of the triangular patch and the index information of the topological relationship of the triangular patch. Calculate the axis-aligned bounding box of each triangular facet in the triangular facet data to obtain the minimum cube range that encloses each triangular facet.
3. The adaptive grid coding method for BeiDou grid codes according to claim 1, characterized in that, Starting from the first level of the BeiDou grid code, a coarse traversal is performed on the grid nodes of each level to determine whether triangular facets intersect with grid nodes in space, including: Calculate the axis-aligned bounding box of the current mesh node; Determine whether the axis-aligned bounding box of the current mesh node overlaps with the axis-aligned bounding box of the triangle facet; If the axis-aligned bounding box of the current mesh node overlaps with the axis-aligned bounding box of the triangle facet, then the current mesh node and the triangle facet are determined to intersect in space. If the axis-aligned bounding box of the current mesh node does not overlap with the axis-aligned bounding box of the triangle facet, then it is determined that the current mesh node and the triangle facet do not intersect in space, and processing of the current mesh node and its subordinate mesh nodes is abandoned.
4. The adaptive grid coding method for BeiDou grid codes according to claim 1, characterized in that, When it is determined that a triangular facet intersects with a mesh node in space, a coarse traversal and / or a precise detection traversal are performed on the subordinate mesh nodes of that mesh node until the current traversal level is determined to be the target preset level. This yields the target preset level mesh code corresponding to the current triangular facet, including: When it is determined that a triangular facet intersects with a grid node in space, it is determined whether the level of the subordinate grid nodes of that grid node is the target preset level. If the level of the subordinate grid nodes of the grid node is not the target preset level, then a coarse traversal is performed on the level of the subordinate grid nodes of the grid node until the traversed level is determined to be the target preset level. If the subordinate grid nodes of the current grid node are at the target preset level, then the subordinate grid nodes of the current grid node are precisely detected and traversed to obtain the target preset level grid code corresponding to the current triangle facet.
5. The adaptive grid coding method for BeiDou grid codes according to claim 4, characterized in that, Perform precise detection and traversal of the subordinate grid nodes of this grid node, including: A set of potential separating axes is constructed based on the subordinate mesh nodes of the mesh node and the triangular facets. The set of potential separating axes includes at least the face normals and edge normals of the subordinate mesh nodes of the mesh node and the face normals and edge normals of the triangular facets. Calculate the projection of the triangular facet and each subordinate mesh node of the mesh node onto each axis in the set of potential separating axes; Determine whether the projection of the triangular facet on each axis overlaps with the projection of each subordinate mesh node on each axis; Subordinate mesh nodes whose projections overlap on each axis are identified as intersecting with triangular patches, and the mesh faces of these intersecting subordinate mesh nodes are identified as the target preset level mesh codes.
6. The adaptive grid coding method for BeiDou grid codes according to claim 1, characterized in that, The grid codes obtained after traversing each worker thread are merged and deduplicated to obtain a set of BeiDou grid codes, including: The preset target level grid codes obtained after traversing all threads are aggregated into a global deduplication container to remove duplicate preset target level grid codes; The remaining target preset level grid codes after removing duplicate target preset level grid codes are merged to obtain the Beidou grid code set.
7. An adaptive grid coding device for BeiDou grid codes, used to implement the adaptive grid coding method for BeiDou grid codes according to any one of claims 1 to 6, characterized in that, include: The acquisition module is used to acquire oblique photogrammetry 3D model data, wherein the data format of the oblique photogrammetry 3D model data includes at least OSGB, OBJ and 3dTiles; The parsing and processing module is used to parse and process the oblique photogrammetry 3D model data to obtain all the triangle patch data that constitute the oblique photogrammetry 3D model. The traversal encoding module is used to perform parallel tree traversal encoding on all triangular facet data in a multi-threaded parallel manner. Each thread independently performs hierarchical tree traversal encoding on its own triangular facet data in a top-down order until a preset target level is reached. The top-down order is determined according to the hierarchical standard of Beidou grid code. The deduplication and merging module is used to merge and deduplicate the grid codes of the preset target level obtained after each worker thread traverses the grid code to obtain a set of Beidou grid codes. The output module is used to output the BeiDou grid code set.
8. An adaptive grid coding system for BeiDou grid codes, characterized in that, include: The oblique photogrammetry 3D model data acquisition device and the adaptive grid encoding device for BeiDou grid codes as described in claim 7 are provided, wherein the oblique photogrammetry 3D model data acquisition device is communicatively connected to the adaptive grid encoding device for BeiDou grid codes. The oblique photogrammetry 3D model data acquisition device is used to acquire oblique photogrammetry 3D model data; The adaptive grid coding device for BeiDou grid codes is used to analyze and process oblique photogrammetry 3D model data, and to obtain a set of BeiDou grid codes by performing parallel tree traversal coding on the analyzed triangular patch data based on multiple working threads.
Citation Information
Patent Citations
Digital earth three-dimensional space scene management method compatible with Beidou grid
CN114092654A
Spatial data retrieval method and device
CN117688045A