Coarse-grained and fine-grained three-dimensional architectural model organization method, device, electronic device and storage medium

By obtaining the optimal K value in the R-tree and combining it with the octree method, the three-dimensional building model is organized in a coarse-grained and fine-grained manner, which solves the limitations of the R-tree and octree in the organization of three-dimensional building model data and achieves more efficient data management and retrieval.

CN120125771BActive Publication Date: 2025-09-12GUANGXI ZHUANG AUTONOMOUS REGION NATURAL RESOURCES REMOTE SENSING INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510087143.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2025-09-12
Estimated Expiration
2045-01-20

AI Technical Summary

Technical Problem

The existing R-tree and octree have limitations in organizing 3D building model data, resulting in low data organization efficiency, especially low search efficiency when the data is unevenly distributed.

Method used

A coarse-grained and fine-grained method is adopted. The optimal K value is obtained under the legal value limit of the R-tree. The K-Means algorithm is used for unsupervised classification to ensure the legality of the R-tree nodes and perform tree balancing operations. The octree is combined with fine-grained organization of single buildings, and redundant nodes are deleted to finally form a data structure that integrates the R-tree and octree.

Benefits of technology

It improves the balance of data organization and retrieval speed, especially in small area retrieval, and meets the needs of efficient organization and management of 3D building models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120125771B_ABST
    Figure CN120125771B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, electronic device, and storage medium for organizing three-dimensional building models that combine coarse and fine granularity. The method utilizes an R-tree to organize data at a coarse granularity, and then utilizes an octree to organize data at a fine granularity. This reduces the tree depth and makes the overall structure more balanced, speeding up data organization and construction, providing support for the organization of three-dimensional data models. Experiments have shown that this method is superior to R-trees and octrees in terms of creation and insertion speed, and is also faster than octrees in terms of retrieval speed, particularly for retrieval of small areas. This method can meet the requirements for efficient organization and management of three-dimensional building models, particularly in applications that require frequent construction and insertion of three-dimensional building model data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of three-dimensional models, and in particular to a method, device, electronic device and storage medium for organizing three-dimensional architectural models combining coarse and fine granularity. Background Art

[0002] With the rapid development of technologies such as smart cities, digital twins, and the metaverse, 3D model data for indoor and outdoor, above and below ground is experiencing explosive growth. [1,2] In particular, 3D building model data, as a key element in the city, is becoming increasingly complex, which places higher demands on the organization and management of 3D building model data, especially the real-time and high efficiency in data insertion, movement and update. [3-5] Therefore, how to organize and manage building models efficiently and quickly has become a research topic that needs to be solved urgently.

[0003] Spatial indexing technology has become an important tool in the field of 3D data organization due to its efficient data organization capabilities. Spatial indexes can be divided into single structure and hybrid structure. In the organization of 3D model data, R-tree index, quadtree and octree index are several commonly used single index methods. [6-8] R-tree is popular for its efficient spatial query capability, dynamic data management, self-balancing characteristics, and good adaptability to uneven data. [9-13] However, during the construction of the R-tree, the minimum bounding rectangles between sibling nodes are prone to overlap, leading to multi-path query problems. [14,15] In order to reduce the overlap of regions, the optimized version of R-tree, R+ tree, came into being. Currently, R* tree is the best optimized version. However, as the depth of the tree increases and the number of nodes increases, the R* tree reduces overlap but increases the calculation process, and the convergence process becomes longer. [16,17] In order to meet the demand for fast data convergence, many researchers choose to use quadtree to organize urban 3D data. [18-22] Despite this, the quadtree has certain limitations in expressing fine data in three-dimensional space. To overcome this limitation, researchers have expanded the quadtree to three dimensions and developed octree indexes, including regular octrees and linear octrees. [23,24] Octree inherits the fast convergence characteristics of quadtree and converges faster than R-tree, which enables octree to effectively meet the needs of fast organization. Therefore, it is widely used in many fields such as real-time 3D scene construction and rendering, laser point cloud data management, geological model indexing, etc. [25-30]However, octree indexing also has obvious disadvantages. If the data in the space is unevenly distributed, the octree may become unbalanced, resulting in some branches being very deep and other branches being shallow. This imbalance may affect search efficiency. Given the limitations of a single index, many researchers have begun to explore ways to organize data more efficiently through hybrid indexing. For example, Zhang et al. used quadtrees and R-trees to organize three-dimensional electronic navigation chart data. [6] Liu et al. used 3D multi-level adaptive grids and R+ trees to manage and store three-dimensional spatial data.

[31] , Gong Jun et al. integrated octree and R-tree to manage point cloud data

[32] Wang Y et al. used octree and R* tree to manage geological tetrahedron model data [7] For example, Wang Yongzhi et al., Wang W et al., Yu Anbin et al. used octree and R* tree to manage point cloud data [8,33,34] . Hybrid indexing technology has been widely used in various data organizations, especially in point cloud data management. However, research on the organization of three-dimensional building model data is relatively insufficient. In addition, considering the huge amount of point data in point cloud data, it is reasonable to choose the fast-converging octree as the primary index, but this requires determining the minimum spatial division threshold of the octree, and considering that the uneven distribution of spatial area data may increase the depth of the tree, thereby increasing the retrieval cost. At the same time, when the R-tree and its improved version are used as secondary indexes, they mainly organize the fine-grained data at the end, which accounts for a large proportion of all the data, thereby increasing the time to build the hybrid index.

[0004] Here, taking a single building as the basic unit means the sum of all the monomer indivisible three-dimensional models belonging to the building that can be distinguished by the building logo; the monomer indivisible model and the monomer model have the same meaning, that is, the model is represented by a body unit without further splitting or decomposition, and the same meaning is expressed below.

[0005] Currently, no effective solutions have been proposed to address the above-mentioned requirements for efficient organization and management of 3D building model data and the limitations of R-trees, octrees, and their existing hybrid structures for data organization.

[0006] [1] Wu Zhiqiang, Wang Jian, Li Deren, et al. Academic discussion on “cold” thinking under the trend of smart city[J]. Journal of Urban Planning, 2022, (02): 1-11.

[0007] [2] Li Deren, Zhang Hongyun, Jin Wenjie. The mission of geospatial informatics in the new infrastructure era[J]. Journal of Wuhan University (Information Science Edition), 2022, 47(10): 1515-22.

[0008] [3]LIFELO Z,DING J,NING H,et al.Artificial Intelligence-EnabledMetaverse for Sustainable Smart Cities:Technologies,Applications,Challenges,and Future Directions[J].Electronics,2024,13(24):4874.

[0009] [4]LAM P-D,GU B-H,LAM H-K,et al.Digital Twin Smart City:IntegratingIFC and CityGML with Semantic Graph for Advanced 3D City Model Visualization[J].Sensors,2024,24(12):3761.

[0010] [5]XU H,OMITAOMU F,SABRI S,et al.Leveraging generative AI for urbandigital twins:a scoping review on the autonomous generation of urban data,scenarios,designs,and 3D city models for smart city advancement[J].UrbanInformatics,2024,3(1):29.

[0011] [6]ZHANG Y,ZHANG A,GAO M,et al.Research on Three-DimensionalElectronic Navigation Chart Hybrid Spatial Index Structure Based on Quadtreeand R-Tree[J].ISPRS International Journal of Geo-Information,2022,11(5):319.

[0012] [7]WANG Y,LV H,MA Y.Geological tetrahedral model-oriented hybridspatial indexing structure based on Octree and 3D R*-tree[J].Arabian Journalof Geosciences,2020,13(15):728.

[0013] [8]WANG W,ZHANG Y,GE G,et al.A Hybrid Spatial Indexing Structure ofMassive Point Cloud Based on Octree and 3D R*-Tree[J].Applied Sciences,2021,11(20):9581.

[0014] [9]GUTTMAN A.R-trees:a dynamic index structure for spatial searching[J].SIGMOD Rec,1984,14(2):47–57.

[0015]

[10] BRAKATSOULAS S,PFOSER D,THEODORIDIS Y.Revisiting R-TreeConstruction Principles[Z].Proceedings of the6th East European Conference onAdvances in Databases and Information Systems.Springer-Verlag.2002:149–62

[0016]

[11] ZHU Q,GONG J,ZHANG Y.An efficient 3D R-tree spatial index methodfor virtual geographic environments[J].ISPRS Journal of Photogrammetry andRemote Sensing,2007,62(3):217-24.

[0017]

[12] ZHENWEN H, GANG L, ZHENGPING W, et al. Three-dimensional spatial indexing method of complicated geological scene; proceedings of the 2009 17th International Conference on Geoinformatics, F 12-14Aug.2009, 2009[C].

[0018]

[13] LI C,KUAI

[0019]

[14] Gong Jun, Zhu Qing, Zhang Yeting, et al. Three-dimensional R-tree index extension method considering multiple levels of detail [J]. Acta Geodaetica et Cartographica Sinica, 2011, 40(02): 249-55.

[0020]

[15] SUHAIBAH A,UZNIR U,ANTON F,et al.3D nearest neighbor searching using a clustered hierarchical tree structure[J].Int Arch Photogramm RemoteSens Spatial Inf Sci,2016,XLI-B2:87-93.

[0021]

[16] SELLIS TK, ROUSSOPOULOS N, FALOUTSOS C. The R+-Tree: A Dynamic Index for Multi-Dimensional Objects; proceedings of the Very Large Data Bases Conference, F, 1987[C].

[0022]

[17] BECKMANN N,KRIEGEL HP,SCHNEIDER R,et al.The R*-tree:an efficient and robust access method for points and rectangles[Z].Proceedings of the1990ACM SIGMOD international conference on Management of data.Atlantic City,New Jersey,USA;Association for Computing Machinery.1990:322–31.10.1145 / 93597.98741

[0023]

[18] Zhu Qing, Chen Xingwang, Ding Yulin, et al. Visual perception driven 3D urban scene data organization and scheduling method [J]. Journal of Southwest Jiaotong University, 2017, 52(05): 869-76.

[0024]

[19] Chen Liangchao, Li Feng. Indoor and outdoor 3D model organization and scheduling method considering multi-source LOD[J]. Surveying and Mapping Science, 2019, 44(10): 152-7.

[0025]

[20] Chen Jing, Xu Jia, Li Mo, et al. Multi-scale data organization method of 3D model in network environment [J]. Surveying and Mapping Science, 2011, 36(06): 182-3+54.

[0026]

[21] Wang Feng, Pan Deji, Wang Jun. Dynamic organization and scheduling method for massive data of urban three-dimensional models[J]. Journal of University of Chinese Academy of Sciences, 2015, 32(03): 409-15.

[0027]

[22] Li Jian, Lei Sui, Tian Zhihui, et al. Research on grid indexing method of point cloud data based on decimal linear quadtree[J]. Science of Surveying and Mapping, 2015, 40(04): 115-20.

[0028]

[23] Zhang Yongyu, Ma Jinsong. Research on the establishment and query algorithm of linear octree spatial index in 3D GIS[J]. Computer Engineering and Science, 2009, 31(02): 61-3.

[0029]

[24] BI L, ZHAO H, JIA MT. Database-oriented storage based on LMDB and linear octree for massive block model [J]. Transactions of Nonferrous Metals Society of China, 2016, 26(9): 2462-8.

[0030]

[25] CHEN J,LIANG Y,XIE Z,et al.Automated Reconstruction of ExistingBuilding Interior Scene BIMs Using a Feature-Enhanced Point Transformer andan Octree[J].Applied Sciences,2023,13(24):13239.

[0031]

[26] Duanmu Xinghui. Research on construction and visualization of substation 3D simulation model based on Unity3D[D], 2023.

[0032]

[27] SU YT,BETHEL J,HU S.Octree-based segmentation for terrestrialLiDAR point cloud data in industrial applications[J].ISPRS Journal ofPhotogrammetry and Remote Sensing,2016,113:59-74.

[0033]

[28] Wang Jinxin, Zhao Guangcheng, Lu Fengnian, et al. Spherical geodesic octree grid method for constructing true three-dimensional geological model[J]. Journal of Geo-Information Science, 2019, 21(08): 1161-9.

[0034]

[29] HAN X,NI J,YIN C,et al.3D Airborne EM Forward Modeling Based onFinite-Element Method with Goal-Oriented Adaptive Octree Mesh[J].RemoteSensing,2023,15(11):2816.

[0035]

[30] Yao Wanqiang, Zheng Junliang, Chen Peng, et al. Octree indexed 3D point cloud data compression algorithm[J]. Surveying and Mapping Science, 2016, 41(07): 18-22.

[0036]

[31] LIU Y, HAO T, GONG X, et al. Research on Hybrid Index Based on 3DMulti-Level Adaptive Grid and R+Tree[J]. IEEE Access, 2021,9:146010-22.

[0037]

[32] Gong Jun, Ke Shengnan, Zhu Qing, et al. A laser point cloud data management method based on octree and 3D R-tree integration[J]. Acta Geodaetica et Cartographica Sinica, 2012, 41(04): 597-604.

[0038]

[33] Wang Yongzhi, Yang Lusheng, Liao Lixia, et al. Laser point cloud data storage structure integrated with octree and 3D R* tree[J]. Journal of Geo-information Science, 2017, 19(05): 587-94.

[0039]

[34] Yu Anbin, Mei Wensheng. A massive subway tunnel point cloud management method based on R-tree and grid[J]. Journal of Wuhan University (Information Science Edition), 2019, 44(10): 1553-9.

[0040]

[35] SEN W,CHEN L,SHUAIJIE X.Review on K-means Clustering Algorithm[J].Journal of East China Jiaotong University,2022,39(05):119-26.

[0041]

[36] CHO S, PARK S, CHA G, et al. Development ofImage Processing for CrackDetection on Concrete Structures through Terrestrial Laser ScanningAssociated with the Octree Structure[J].Applied Sciences,2018,8(12):2373.

[0042]

[37] JIANING M,JIN C,LU L J.Maximum-minimum distance clustering method for split-delivery vehicle-routing problem:Case studies and performance comparisons[J].Advances in Production Engineering And Management,2019,14:125-35. Summary of the Invention

[0043] The embodiments of the present invention provide a method, device, electronic device and storage medium for organizing three-dimensional building models with a combination of coarse and fine granularity, so as to at least solve the technical problem of the limitations of R-tree and octree in the related art in organizing three-dimensional building model data.

[0044] According to one aspect of an embodiment of the present invention, a method for organizing three-dimensional building models with a combination of coarse and fine granularity is provided, comprising: step S10, obtaining an optimal K value under the limitation of an R-tree legal value, using a K-Means algorithm based on the optimal K value to perform unsupervised classification on three-dimensional building model data with a single building as a basic unit to ensure the legality of the R-tree node, and then performing a tree balancing operation to ensure the balance of the R-tree, and obtaining an R-tree branch node containing data of multiple single buildings through multiple recursive iterations; step S20, using an octree to perform fine-grained organization of the single building, creating an octree root node for each building at the R-tree branch node; assigning the monomer model data to the octree node, and deleting redundant nodes, to finally obtain a three-dimensional building model data organization structure that integrates the R-tree and the octree.

[0045] Optionally, step S10 includes the following steps:

[0046] Step S101, initialize the R-tree, create a root node, and pass in a three-dimensional building model with a single building as the basic unit; Step S102, determine the number of buildings passed in. If it is greater than the maximum legal entry value M of the R-tree node, proceed to step S103; if it is less than or equal to M, proceed to step S107; Step S103, obtain the optimal K value K-Value under the legal value limit of the R-tree; Step S104, execute the K-means clustering algorithm when the K value is K-Value to obtain the cluster data array Clusters; Step S105, adjust the number of buildings in each cluster in the cluster data array Clusters to the average value to obtain the balanced number of clusters Group bClusters; Step S106, determine whether the balanced cluster array bClusters has completed the loop. If not, read the clusters in the array, create the child node childNode of the current node, and enter step S102. The data passed in is the three-dimensional building model data with a single building as the basic unit in the current cluster; If the loop is completed, enter step S108; Step S107, insert the single building data into the current node to complete the update of the bounding box of each node in the R-tree; Step S108, recursively complete the loop of all other balanced cluster arrays to obtain the R-tree structure with a single building as the basic unit.

[0047] Optionally, step S103 includes the following steps, where N is the total number of buildings in the current node, m is the minimum legal entry value of the R-tree node, and M is the minimum legal entry value of the R-tree node:

[0048] S1031, under the constraints of MaxK and maxDelta, find the best K value K1 by comparing the SSE value; 1032, if the K1 value is less than the minimum legal entry value m of the R-tree node, then take the most appropriate K value K-Value value m; if m≤K1≤M, then take the K-Value value K1; S1033, calculate the number of buildings N, that is, the total number of buildings in the current node, if Add 1 to the K-Value until Stop when , and get the best K value K-Value under the legal value limit of R tree.

[0049] Optionally, the K-Means algorithm uses a maximum-minimum distance method to select initial cluster centers.

[0050] Optionally, step S20 includes the following steps:

[0051] Step S201, obtain the R-tree structure with a single building as the basic unit, and determine whether the leaf nodes of the R-tree have been looped; when the loop is not completed, proceed to the next step; when the loop is completed, a three-dimensional building model data structure that integrates the R-tree and the octree is obtained; Step S202, create the root node of the octree according to the leaf nodes of the R-tree, and obtain the minimum cubic bounding box of the single building as the range of the octree root node; Step S203, determine whether the monomer model of the current building is inserted, and when the insertion is completed, proceed to step S207; when the insertion is not completed, proceed to step S204; Step S204, determine whether the expansion value of the current node is less than the minimum area threshold Minl of the octree division, and when the current node is less than Minl, stop judging, insert the current node, and then return to step S 203 is re-judged; otherwise, when the current node ≥ Minl, octree division is performed and the process goes to step S205; in step S205, when the single building model is surrounded by the current node area but not by any child node area of ​​the current node, the current node is inserted, and then the process returns to step S203 for re-judgment; otherwise, the process goes to the next step, i.e., step S206; in step S206, when the single building model is surrounded by the current node area and by any child node area of ​​the current node, the child node is set as the current node and the process goes to step S204; in step S207, non-essential nodes are deleted. Non-essential nodes are blank nodes. If a child node and its sibling nodes have neither child nodes nor data, all child nodes pointed to by the parent node in the child node are deleted.

[0052] Optionally, the three-dimensional building model data organization structure that integrates the R-tree and the octree includes: the root node, intermediate nodes and leaf nodes of the R-tree and the octree, wherein the root node and the intermediate nodes of the R-tree do not contain a pointer to the root node of the octree, and the pointer array OcPtrs pointing to the root node of the octree is empty; and the leaf node of the R-tree does not contain a pointer to other child nodes, and the Children is empty; the root node of the octree is located at the top layer, that is, it does not point to any parent node, and its Parent value is empty; when entering the root node, the building identification value BuildID is only recorded once, the intermediate nodes and leaf nodes do not store the BuildID value, the leaf node does not contain a pointer to a child node, and the Children is empty.

[0053] According to another aspect of an embodiment of the present invention, a coarse-grained and fine-grained three-dimensional building model organization device is also provided, including: obtaining an optimal K value under the limitation of the legal value of the R-tree, and then using the K-Means algorithm on the basis of the optimal K value to perform unsupervised classification on the three-dimensional building model data with a single building as the basic unit to ensure the legality of the R-tree node, and then performing a tree balancing operation to ensure the balance of the R-tree, and through multiple recursive iterations, obtaining an R-tree leaf node containing multiple single building data; an octree fine-grained organization module, for using an octree to perform fine-grained organization on a single building, and creating an octree root node for each building at the R-tree leaf node; assigning the monomer model data to the octree node, and deleting redundant nodes, and finally obtaining a data organization structure that integrates the R-tree and the octree.

[0054] According to another aspect of an embodiment of the present invention, an electronic device is provided, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods of various embodiments of the present invention when running.

[0055] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.

[0056] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0057] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0058] According to another aspect of an embodiment of the present invention, a computer program is provided. When the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0059] In an embodiment of the present invention, a method for organizing 3D building models that combines coarse and fine granularity is provided. This method obtains an optimal K value within the constraints of an R-tree's legal value. Based on this optimal K value, the K-Means algorithm is then used to perform unsupervised classification of 3D building model data based on individual buildings, ensuring the legality of the R-tree nodes. A tree balancing operation is then performed to ensure the balance of the R-tree. Through multiple recursive iterations, R-tree child nodes containing data for multiple individual buildings are obtained. An octree is used to organize the individual buildings in a fine-grained manner. An octree root node is created for each R-tree child node. Individual model data is assigned to octree nodes, and redundant nodes are deleted, ultimately resulting in a 3D building model data organization structure that integrates the R-tree and octree. This method uses an octree for fine-grained data organization, reducing the tree depth and making the overall structure more balanced. This method addresses the technical limitations of R-trees and octrees in data organization in related technologies, providing support for 3D building model data organization. Experiments have shown that this data structure method is superior to R-trees and octrees in terms of creation and insertion speed. It is also faster than octrees in retrieval speed, especially for retrieval of small areas. It can meet the requirements for efficient organization and management of 3D building models, especially in applications that require frequent construction and insertion of 3D building model data. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0061] Figure 1 is a flow chart of a method for organizing a three-dimensional building model combining coarse and fine granularity according to an embodiment of the present invention;

[0062] Figure 2 is a flow chart of a method for organizing a three-dimensional building model combining coarse and fine granularity according to an embodiment of the present invention;

[0063] Figure 3 Schematic diagrams of two situations presented by octree nodes after cyclic insertion of 3D model data of a single building through Algorithm 4 according to an embodiment of the present invention;

[0064] Figure 4 is a schematic diagram of a three-dimensional building model data structure integrating an R-tree and an octree according to an embodiment of the present invention;

[0065] Figure 5 is a schematic diagram of a bird's-eye view of the entire scene, extracted building data, and some local data details according to an embodiment of the present invention;

[0066] Figure 6 1 is a visualization diagram of the experimental results of the R-tree, octree and the method according to an embodiment of the present invention;

[0067] Figure 7 This is a visualization diagram of the local data partitioning effect of the method when using data 4 for the experiment according to an embodiment of the present invention - a schematic diagram of the overlapping areas between multiple octrees;

[0068] FIG8( a ) is a schematic diagram showing the local visualization effect of the method during the data 4 experiment according to an embodiment of the present invention, where a nearly square building is surrounded by an octree root node;

[0069] FIG8( b ) is a schematic diagram of a local visualization effect of the method during the data 4 experiment according to an embodiment of the present invention;

[0070] Figure 9 is a schematic diagram of a coarse-grained and fine-grained three-dimensional building model organization device according to an embodiment of the present application;

[0071] Figure 10a is a schematic diagram of a drag-and-drop function for a single building model according to an embodiment of the present invention;

[0072] Figure 10b is a schematic diagram of a function of generating a three-dimensional building model by regional parameterization according to an embodiment of the present invention;

[0073] Figure 10c is a schematic diagram of building model splitting and attribute query according to an embodiment of the present invention;

[0074] Figure 10d is a schematic diagram of building height restriction analysis according to an embodiment of the present invention;

[0075] Figure 10e is a schematic diagram of a building skyline analysis according to an embodiment of the present invention;

[0076] Figure 10f 2 is a schematic diagram of wind force analysis of a building according to an embodiment of the present invention. DETAILED DESCRIPTION

[0077] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0078] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0079] According to one aspect of an embodiment of the present invention, a method for organizing a three-dimensional building model with a combination of coarse and fine granularity is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0080] Figure 1 is a flow chart of a method for organizing a three-dimensional building model with a combination of coarse and fine granularity according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps:

[0081] Step S10: Obtain the optimal K value within the constraints of the legal value of the R-tree. Then, based on the optimal K value, use the K-Means algorithm to perform unsupervised classification on the 3D building model data with a single building as the basic unit to ensure the legality of the R-tree nodes. Then, perform a tree balancing operation to ensure the balance of the R-tree. Through multiple recursive iterations, obtain R-tree child nodes containing data of multiple single buildings; thus, achieving R-tree coarse-grained data organization for a single building.

[0082] In step S20, an octree is used to organize a single building in a fine-grained manner. An octree root node is created for each building at the R-tree leaf node. The monomer model data is assigned to the octree node and redundant nodes are deleted, ultimately obtaining a 3D building model data organization structure that integrates the R-tree and octree.

[0083] The above two steps can be divided into two levels. The specific flow chart is as follows: Figure 2 As shown, Figure 2 The flowchart of the method for organizing a 3D building model with a combination of coarse and fine granularity is shown. Figure 2Among the input parameters, M and m are the maximum and minimum legal entry values ​​of the R-tree, maxDelta is the threshold for K-value clustering to find the optimal K value (a smaller value means a better number of clusters K, but the amount of calculation will increase), maxK is the maximum limit value when K-value clustering to find the optimal K value, MinL is the minimum area threshold for octree division, and Data is a three-dimensional building model with a single building as the basic unit. In view of the uneven spatial distribution of building data, the present invention first constructs an R-tree with a single building as the basic unit to achieve coarse-grained data organization. The construction of the tree nodes in the above S10 will adopt a top-down, depth-first strategy, starting from the root node and gradually constructing child nodes downward until reaching the leaf nodes of the R-tree.

[0084] Continue to refer Figure 2 , step S10 specifically includes the following steps:

[0085] Step S101: Initialize the R-tree, create a root node, and input a 3D building model with a single building as the basic unit;

[0086] Step S102: Determine the number of buildings passed in. If it is greater than the maximum legal entry value M of the R-tree node, proceed to step S103; if it is less than or equal to M, proceed to step S107.

[0087] Step S103, obtaining the best K value K-Value (K-ValueForRtree) under the legal value limit of the R-tree;

[0088] Step S104, executing the K-means clustering algorithm when the K value is K-Value to obtain a cluster data array Clusters;

[0089] Step S105: perform a tree balancing operation to adjust the number of buildings in each cluster in the cluster data array Clusters to the average value, and obtain a balanced cluster array bClusters to ensure the balance of the R-tree and thus reduce the depth of the tree;

[0090] Step S106: Determine whether the balanced cluster array bClusters has completed the loop. If not, read the clusters in the array, create a child node childNode of the current node, and proceed to step S102. The data passed in is the 3D building model data of the current cluster with a single building as the basic unit. If the loop is complete, proceed to step S108.

[0091] Step S107, inserting the single building data into the current node, completing the update of the bounding box of each node in the R-tree;

[0092] Step S108 , recursively complete the loop of all other balanced clustering arrays to obtain an R-tree structure with a single building as the basic unit.

[0093] As an optional embodiment, the above step S10 can be expressed using Algorithm 1:

[0094]

[0095] The above step S103 specifically includes the following steps, where N is the total number of buildings in the current node, m is the minimum legal entry value of the R-tree node, and M is the minimum legal entry value of the R-tree node:

[0096] S1031, under the constraints of MaxK and maxDelta, find the optimal K value K1 by comparing the SSE values. ;

[0097] S1032, if the K1 value is less than the minimum legal entry value m of the R-tree node, then take the most appropriate K value K-Value value m; if m≤K1≤M, then take the K-Value value K1;

[0098] S1033, calculate the number of buildings N, if Add 1 to the K-Value until Stop when , and get the best K value K-Value under the legal value limit of R tree.

[0099] As an optional embodiment, the above step S103 can be expressed by Algorithm 2:

[0100]

[0101] Finding the optimal K value in the K-Means algorithm is crucial. This paper uses the sum of squared errors (SSE) as the selection condition for the K value, that is, comparing the difference in SSE values ​​between the K and K-1 clustering cases to see if it is less than a threshold. If the difference is less than the set threshold maxDelta, then it is considered that the current K value can better classify the data. The purpose of setting this threshold is to find the elbow point of the K value change curve, that is, after this point, the increase of the K value no longer significantly improves the clustering effect. [35,36] The SSE value is calculated as follows (1).

[0102]

[0103] Where: C j is the cluster center of base j, Pi is the data point dataset of base i, k is the number of clusters, and n is the number of datasets.

[0104] In addition to the selection of the K value, another key step in the K-Means algorithm is the determination of the initial cluster centers. To improve the efficiency and quality of clustering, this application uses the maximum-minimum distance method to select the initial cluster centers.

[37] This method selects the point farthest from the existing cluster centers as the new cluster center, thereby reducing the number of iterations in the clustering process and improving the stability of clustering.

[0105] Each node of the R tree has a limit on the minimum legal entry value m and the maximum legal entry value M of the R tree node. Therefore, for the optimal K value obtained by judging the SSE value difference, three situations of K < m, K > M, and m ≤ K ≤ M may occur. For this reason, when the maximum limit value of the number of clusters is restricted, MaxK = M. So the remaining two situations of K < m and m ≤ K ≤ M will occur. To conform to the legal value, when K < m, K will be directly set equal to the m value, and when m ≤ K ≤ M, no additional modification is required.

[0106] However, when clustering using the above K value, the number of entries in the leaf node may be less than m, resulting in an illegal leaf node. For this reason, this invention uses formula (2) for judgment. If it holds, it means that the child nodes created by this node and the nodes created by the child nodes will have entry values less than m. By using formula (3), the data entry S1 of the child node of the current node can be calculated. When the number of clusters is m, each cluster entry is the largest. Therefore, formula (4) can be used to calculate whether the entry value of the child node's child node of the current node is legal. The combined expression of formula (3) and formula (4) is formula (2). When using the K value to create an illegal leaf node, the optimization method adopted in this article is to increase the K value, make the entry value of each cluster smaller, so that the child nodes of this node conform to the legal value, that is, satisfy formula (5). Instead of having its child nodes create leaf nodes, let this node itself directly create leaf nodes.

[0107] When the above K value is M and still cannot satisfy formula (5), this K value is allowed to exceed the M value because choosing to adjust further to its parent node has a large algorithm cost and is complex. In addition, there is still a possibility of being illegal when recursively adjusting to the root node. And there is a certain compatibility between the values of m and M. The situation where increasing the K value still cannot satisfy formula (5) is less. Therefore, the method of allowing this K value to exceed the M value has the least cost.

[0108]

[0109] In the above formula: N is the total number of building blocks in the current node, K-Value represents the current K value used, S1 is the entry value of the child node of the current node, m is the minimum legal entry value of the R tree node, and M is the minimum legal entry value of the R tree node.

[0110] The above step S105 specifically includes the following steps:

[0111] S1051, dividing the clusters into above-average cluster sets and below-average cluster sets based on the average number of cluster buildings;

[0112] S1052, find the super-average cluster closest to the cluster below the average value from the super-average cluster set, and use the cluster center to determine the distance;

[0113] S1053: Find the target single building closest to the cluster center below the average value from the cluster above the average value, and use the minimum bounding box center of the single building and the cluster center for discrimination;

[0114] S1054: Migrate the target single building to the cluster below the average value, and execute until the number of buildings in each cluster reaches the average value.

[0115] Further references Figure 2 When the spatial division is further refined to a single building, octree will be used for fine-grained organization. Since the internal monomer or partial models of the building are widely distributed in space, covering multiple directions such as up, down, left, and right, it is more suitable to use octree for organization and division. In addition, for complex buildings, which are composed of multiple monomer models, it will be very time-consuming to continue to use R-tree for division. Using octree to organize and divide data can significantly improve computing efficiency. The purpose of this step is to find the most suitable octree node to organize the data. Step S20 specifically includes the following steps:

[0116] Step S201: Obtain an R-tree structure based on a single building as the basic unit and determine whether the leaf nodes of the R-tree have been looped through. If the loop is not complete, proceed to step S202. If the loop is complete, a 3D building model data structure that integrates the R-tree and the octree is obtained.

[0117] Step S202: Create an octree root node based on the leaf nodes of the R-tree, and obtain the minimum cubic bounding box of a single building as the range of the octree root node;

[0118] Step S203, determining whether the single model of the current building has been inserted. If the insertion is completed, proceed to step S207; if the insertion is not completed, proceed to step S204;

[0119] Step S204: determine whether the expansion value of the current node is less than the minimum area threshold Minl of the octree partition. If the current node is less than Minl, stop the determination, insert the current node, and then return to step S203 for re-determination. Otherwise, if the current node is greater than or equal to Minl, perform octree partitioning and proceed to step S205.

[0120] Step S205: If the single building model is surrounded by the current node area but not by any child node area of ​​the current node, the current node is inserted, and then the process returns to step S203 for re-judgment; otherwise, the process proceeds to the next step, i.e., step S206;

[0121] Step S206: When the single building model is surrounded by the current node area and the targetChild area of ​​any child node of the current node, the targetChild child node is set as the current node and the process goes to step S204.

[0122] Step S207: Delete unnecessary nodes. A non-essential node is a blank node. If a child node and its sibling nodes have neither child nodes nor data, delete all child nodes pointed to by the parent node of the child node.

[0123] As an optional embodiment, part of the process of step S20 may refer to Algorithm 3.

[0124]

[0125] Among them, Algorithm 4 is the recursive partitioning supplement of Algorithm 3. It is worth noting that after the octree root node Node calls OctreeInsertDatas (Algorithm 3), it is necessary to delete unnecessary nodes. This is because after organizing the data through Algorithm 5, the leaf nodes of the octree will present two situations: one is as follows: Figure 3 As shown in (a), the spatial division of the building's monomer model data does not reach the minimum division length, which may generate multiple blank child nodes; another example is Figure 3As shown in (b), the spatial partitioning of the building's individual model data has reached the minimum partitioning length. The first case is because when determining whether a building's individual model is within the range of an octree node, it is necessary to determine whether the model is surrounded by any child nodes to find the most suitable model octree node (i.e., the smallest enclosing area that cannot be included by any child node). Therefore, Algorithm 4 generates child nodes for this determination, which inevitably results in blank nodes. The second case is because the minimum threshold for octree spatial partitioning has been reached, and further partitioning is impossible. Therefore, the building's individual model is inserted into the leaf node of the octree. To improve query efficiency, blank nodes in the first case need to be deleted. In Algorithm 4, when a model is added to the appropriate octree node, the blank child node is not immediately deleted. This is because there is more than one individual model of the building to be inserted into the octree, and the child node may be used for insertion by other models. Therefore, it is more efficient to delete the child nodes after all individual models of the entire building are inserted (i.e., after Algorithm 4 is executed). Specifically, if a sibling node of a child node has neither child nodes nor data, then all child nodes pointed to by the parent node in the child node should be deleted.

[0126] Figure 4 A schematic diagram of a 3D building model data structure integrating an R-tree and an octree is shown, wherein Figure 4 As shown in (a), the R+ octree node data structure includes the root node, intermediate nodes, and leaf nodes of the R-tree and octree. An R-tree node consists of the following elements: node level (Level), minimum bounding box center (Center), extensions of the bounding box center in the X, Y, and Z directions (Extend), an array of pointers to child nodes (Children), and an array of pointers to the octree root node (OcPtrs). It is worth noting that the root and intermediate nodes of the R-tree do not contain pointers to the octree root node, so OcPtrs is empty. Meanwhile, leaf nodes of the R-tree do not contain pointers to other child nodes, so Children is empty. An octree node consists of the node level (Level), the center of the cube bounding box (Center), extensions of the bounding box center in the X, Y, and Z directions (Extend), a building identifier (BuildID), a pointer to the parent node (Parent), an array of pointers to child nodes (Children), and an array of pointers to the building model (Mesh). The root node of the octree is at the top level and therefore does not point to any parent node. Its Parent value is null. The building ID value, BuildID, is recorded only once when entering the root node. Intermediate nodes and leaf nodes do not store BuildID values. Leaf nodes do not contain pointers to child nodes, so Children is null.

[0127] like Figure 4 The main design idea of ​​the three-dimensional building model unit data structure shown in (b) is to be able to clearly express the model's geometric data, material data, topological data and attribute data. ① Geometric data, which is expressed in the data structure through the hierarchical association between multiple elements such as body, surface, line and point; ② Material data, which is associated with the material identifier (MaterialID) in the surface structure to the material structure, and is specifically described by the material detail structure (MaterialDetail) in the material structure, including color, texture, metallicity, roughness and other information (see Table 1 for details). ③ Topological data, which is expressed by the geometric relationship between body, surface, line and point in the data structure. ④ Attribute data, attribute fields (Attribute) are added to the body data structure, surface data structure, line data structure and element structure to express the attribute data of buildings and models, among which the element structure is associated by the BuildID in the octree to express the attribute information belonging to a single building. The representation of the building model in a three-dimensional scene is shown in the figure below. Figure 4 (e) 4(f), Figure 4 (e) represents the data contained in the root node of the R-tree, Figure 4 (d) indicates that the octree divides the space of the three-dimensional building model, and its monomer cannot be divided into three-dimensional building models (such as Figure 4 (e)) will be divided into Mesh pointer array, and the single indivisible 3D building model is Figure 4 (f) The geometry and material data are represented.

[0128] Table 1. Material data structure and its field explanation

[0129]

[0130] To evaluate the performance and effect of the present invention in processing building data of different scales and complexities, so that those skilled in the art can better understand the present invention:

[0131] The building data in the Metaverse platform was selected as the experimental object. Figure 5 (a) shows a bird's-eye view of the entire scene, Figure 5 (b) shows the extracted building data. Four experimental data were designed to simulate the response and efficiency under the condition of increasing data. Each experimental data involves Figure 5(b) The combination of different areas, Table 2 lists in detail the key indicators of each group of experiments, including the number of buildings, the number of single models, the number of scene vector points and the number of scene textures. The number of components refers to the smallest separable model in the scene. In terms of the hardware and software conditions of the experiment, this application selected Unreal Engine 5 (UE5) as the 3D rendering engine of the data, and the implementation of the algorithm adopted a combination of C++ language and UE blueprint language. The hardware equipment is CPU 12thGen Intel(R)Core(TM)i9-12900K, GPU NVIDIA GeForce RTX 3090Ti, Kingston memory bar 128GB.

[0132] Table 2 Experimental data information

[0133]

[0134] In order to maintain the comparability of various methods in the experiment, a unified parameter setting is adopted. For the R-tree, the maximum fan-out parameter M is set to 30, the minimum value m is set to 15, and the maxDelta value is 100cm. 2 , the maximum limit of the number of clusters MaxK is 15. The difference is that the R-tree index is directly divided into single model data, while the R-tree part in this method only performs coarse-grained division. Similarly, the parameter settings of the octree are consistent with the octree part in this method. The minimum division limit of the grid is 10cm. The difference is that the organization method of the octree is directly from the maximum range to the single model data, while the octree part in this application only performs fine-grained division. When comparing the retrieval speed of the method, this application uses a regional query method to query the architectural model data in the space. The minimum bounding box of each experimental data is used as the benchmark, and the length, width and height of the bounding box are divided into 10 equal parts. The data is then incrementally queried in the region. For example, the first query is 1 / 10 of the maximum bounding box, and the last query is 10 / 10 of the maximum bounding box. The differences in data retrieval at different scales are tested by different methods. Each retrieval is performed 10 times and the average is taken. The total time of 10 retrievals is recorded. The visual rendering results of the experimental results are as follows Figure 6As shown, Figures (a1), (b1), (c1), and (d1) respectively show the visualization effects of the R-tree under experimental data 1 to 4; Figures (a2), (b2), (c2), and (d2) show the visualization effects of the octree under experimental data 1 to 4; and Figures (a3), (b3), (c3), and (d3) show the visualization effects of the method of the present application under experimental data 1 to 4. Observation results show that in the visualization effect of the R-tree, the buildings are surrounded by layers of tight bounding boxes, showing a high spatial utilization rate; while the octree starts from a larger cubic bounding box and gradually subdivides it, eventually converging to the building area, and its spatial utilization rate is relatively low; the method used in the present application compresses the spatial division range to the building area, and then performs spatial division on a single building, achieving a more balanced spatial utilization rate. Figure 7 The local visualization results of the experiment using data 4 are convenient for observing the effects of each method on large amounts of data processing because its data volume is the largest in the experimental data group. By comparing the data of the two outdoor scenes represented by Figures (a1), (a2), (a3) ​​and Figures (b1), (b2), (b3), and the two indoor scenes represented by Figures (c1), (c2), (c3) and Figures (d1), (d2), (d3), we can draw a consistent conclusion: the R-tree has the highest space utilization rate, the octree has the lowest space utilization rate, and the method of this application achieves a balanced space utilization.

[0135] The construction time required for each method is shown in Table 3 below. The construction time for the R-tree, octree, and our method increases with the amount of experimental data. The R-tree construction time is significantly longer than the octree and our method, while the octree construction time is significantly longer than our method. Our method achieves a maximum improvement of 41.25% over the octree on Experimental Data 4 and at least 32.87% improvement on Experimental Data 1. The total number of nodes for each method is shown in Table 4 below. The number of nodes for the R-tree, octree, and our method increases with the amount of experimental data. The R-tree has significantly fewer nodes than the octree and our method. Our method has fewer nodes than the octree on Data 1-3, but more nodes than the octree on Data 4. The retrieval time required for each method is shown in Table 5 below. The retrieval time for the R-tree, octree, and our method increases with the amount of experimental data. The R-tree requires less time than the octree and our method, while the octree requires more time than our method.

[0136] Table 3 Build time (time / ms)

[0137]

[0138] Table 4 Number of nodes

[0139]

[0140] Table 5 Retrieval time (time / ms)

[0141]

[0142] Through the analysis of experimental data, we can get:

[0143] (1) In terms of construction speed:

[0144] The data organization and construction process involves inserting data into nodes, so construction speed can be considered a direct indicator of insertion speed. R-trees lag significantly behind our method and octrees in construction and insertion speed, primarily due to the extensive unsupervised classification computations required during data clustering. Furthermore, each time new data is inserted, the R-tree must update its clustering structure and rebalance the tree. After all data has been inserted, the bounding box information must be updated, starting with the leaf nodes and working upwards. Our method significantly improves construction and insertion speed compared to octrees. This is because it first constructs R-data for the 3D building model data, focusing spatial partitioning on data-dense areas and significantly reducing the tree depth. In contrast, octrees partition the entire scene from top to bottom, making smaller individual models appear insignificant relative to the octree's bounding box. In complex 3D building models, smaller individual models are numerous and are typically assigned to deeper octree nodes. Consequently, octrees require more time to construct and create, lagging behind our method. However, the insertion efficiency of the octree is still much more efficient than that of the R-tree, so its insertion speed is still faster than that of the R-tree.

[0145] (2) In terms of the number of nodes:

[0146] The R-tree has fewer nodes than the octree and our method because, through adaptive spatial partitioning and flexible node capacity, the R-tree can more efficiently organize spatial data and reduce the number of nodes. However, both the octree and our method use fixed, recursive partitioning rules, resulting in a large number of empty or inefficient nodes. Another manifestation is that, through the coarse-grained R-tree organization, our method has clustered the partitioned areas around buildings, yet the number of nodes is relatively close to that of the octree and our method. This is because the octree portion of our method requires the construction of a cubic bounding box for the building, and thus uses the maximum value of its length, width, and height as the partition length. This causes multiple octrees to overlap in space, resulting in a large number of nodes. Figure 8(a) shows a local visualization of the experiment using data 4. Rectangles 1-3-4-6 are the octree bounding box for building 1, and rectangles 7-8-9-10 are the octree bounding box for building 2. The resulting overlapping area is rectangles 2-3-4-5. When organizing the data in area A, it can only be assigned to the octree node of building 1. Although building 2 is also spatially partitioned into nodes, the algorithm performs octree partitioning on a building-by-building basis, so the data for building 1 cannot be inserted into the octree nodes of building 2. Ideally, as shown in Figure 8(b), the octree bounding box should exactly enclose the building, but the minimum bounding box of many buildings is not close to a square.

[0147] (3) In terms of retrieval speed:

[0148] The R-tree's faster search speed stems from the adaptive size and shape of the region stored in each node, allowing for more compact data storage. Furthermore, the R-tree, a balanced tree, boasts high tree depth and node utilization, reducing query time. Both the octree and this method result in a large number of inefficient nodes. However, this method's search speed is faster than the octree's because it uses the R-tree organization at a coarse granularity. Despite having similar node numbers, the tree depth of this method is much shallower than that of the octree, resulting in faster searches. As shown in Tables 6 to 9 below, in experiments with increasing search ranges for Data 1 to 4, observing the search times reveals that this method's advantage is more pronounced when the query range is smaller. This is because octree searches require searching downward from a larger spatial range, while the target region is relatively small, requiring more time to retrieve the target. In addition, when performing a global query (10 / 10 of the bounding box), the query time of the octree and this method will be proportional to the number of nodes, because both indexes need to traverse all nodes. In data 4, the number of nodes generated by this method is greater than that of the octree, and the time for performing a global query will also be longer than that of the octree.

[0149] Table 6. Retrieval time of bounding boxes from small to large when using data 1 experiment, time unit is ms

[0150]

[0151] Table 7. Retrieval time of bounding boxes from small to large when using data 2 experiment, time unit is ms

[0152]

[0153] Table 8. Retrieval time of bounding boxes from small to large when using data 3 experiment, time unit is ms

[0154]

[0155] Table 9. Retrieval time of bounding boxes from small to large when using data 4 experiment, time unit is ms

[0156]

[0157] (4) In terms of application scenarios:

[0158] In this experiment, different data organization methods demonstrated their respective advantages and characteristics. In the most complex scenario, when performing a full-domain (10 / 10 of the minimum bounding box) retrieval of experimental data 4, this method was only 31.28 milliseconds slower than the fastest R-tree, but the construction speed was nearly 357 times faster than the R-tree's 260.72 seconds, which is only 728.37 milliseconds. In addition, this method is superior to the octree in terms of construction and insertion speed as well as retrieval speed. Therefore, this method can provide an excellent experience for the organization and management of three-dimensional building models, especially in scenarios where three-dimensional building model data needs to be frequently constructed and inserted. The retrieval speed in the experiment was only 31.28 milliseconds slower, a gap that is almost imperceptible to the naked eye and consciousness. However, when the construction speed is only 260.72 seconds, the user experience will be significantly affected. For example Figure 10a 、 Figure 10b 、 Figure 10c 、 Figure 10d 、 Figure 10e as well as Figure 10f With the support of the method of this application, many applications based on the organizational structure of three-dimensional buildings have been developed in the Metaverse platform, and the experience and effects of these applications are good. Figure 10a Drag and drop functionality for a single building model, which in this application's data structure is for inserting data; Figure 10b The function of generating 3D building models by regional parameterization is to select the area where the model needs to be generated, and then add it to the generation list. By adjusting the weights and density of various model generation, the model can be generated in the area of ​​the scene. In the data structure of this application, a large amount of data is inserted; Figure 10c Building model splitting and attribute query, in the data structure, is to retrieve the attribute data of the building model; Figure 10d For building height limit analysis and Figure 10e For building skyline analysis and Figure 10f For building wind analysis, it is necessary to conduct a comprehensive query on the topological data, geometric data, and attribute data in the data structure of this application.

[0159] The present invention provides a method for organizing 3D building models at a combined coarse and fine granularity. This method uses an R-tree for coarse-grained data organization and an octree for fine-grained data organization. This reduces the tree depth, making the overall structure more similar to a balanced tree, providing support for organizing 3D data models. Experiments have shown that this method is superior to R-trees and octrees in terms of creation and insertion speed, and is also faster than octrees in retrieval speed, especially for retrieval of small regions. This method can meet the requirements for efficient organization and management of 3D building models, particularly in applications that require frequent construction and insertion of 3D building model data.

[0160] According to another aspect of an embodiment of the present invention, a device for organizing a three-dimensional building model with a combination of coarse and fine granularity is also provided. The system can execute the method for organizing a three-dimensional building model with a combination of coarse and fine granularity of the above embodiment. The specific implementation method and preferred application scenario are the same as those of the above embodiment and will not be repeated here.

[0161] Figure 9 Schematic diagram of a coarse-grained and fine-grained three-dimensional building model organization device according to an embodiment of the present application. Figure 9 As shown, the device includes the following:

[0162] The R-tree coarse-grained organization module 10 is used to obtain the optimal K value under the limitation of the R-tree legal value, and then use the K-Means algorithm based on the optimal K value to perform unsupervised classification on the three-dimensional building model data with a single building as the basic unit to ensure the legality of the R-tree node. Then, a tree balancing operation is performed to ensure the balance of the R-tree. Through multiple recursive iterations, R-tree child nodes containing multiple single-building data are obtained; that is, R-tree coarse-grained data organization of a single building is realized;

[0163] The octree fine-grained organization module 20 is used to use the octree to perform fine-grained organization on a single building. At the R-tree leaf node, an octree root node is created for each building. The monomer model data is assigned to the octree node and redundant nodes are deleted, ultimately obtaining a three-dimensional building model data organization structure that integrates the R-tree and the octree.

[0164] like Figure 2As shown, among the input parameters of the 3D building model organization device, M and m are the maximum and minimum legal entry values ​​of the R-tree, maxDelta is the threshold for K-value clustering to find the optimal K value (a smaller value means a better number of clusters K, but the computational complexity will increase), maxK is the maximum limit value when K-value clustering to find the optimal K value, MinL is the minimum area threshold of the octree division, and Data is the 3D building model data to be organized; the output parameter is the 3D building model data organization structure that integrates the R-tree and octree.

[0165] The embodiments of the present application also provide an electronic device, comprising: a memory storing an executable program; a processor for running the program, wherein the method of each embodiment of the present invention is executed when the program is running. The above-mentioned memory may refer to a device inside a computer for storing data and programs, and may include a memory, a hard disk, etc., wherein the memory may be used to temporarily store running programs and data, the hard disk may be used to store programs and data for a long time, and the memory may be used to enable the computer to read and write data, as well as execute programs; the above-mentioned processor may be responsible for executing instructions in the computer program and performing data processing, and may be responsible for controlling and executing various operations, including arithmetic operations, logical operations, data transmission, etc.

[0166] An embodiment of the present application further provides a computer-readable storage medium, which includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.

[0167] The above-mentioned computer storage medium may refer to a medium in a computer memory used to store certain discontinuous physical quantities. Computer storage media mainly include semiconductors, magnetic cores, magnetic drums, magnetic tapes, laser disks, etc. The stored program included in the computer-readable storage medium may be a set of instructions that can be recognized and executed by a computer, running on an electronic computer, and serving as an information tool to meet certain needs of people.

[0168] An embodiment of the present application further provides a computer program product, including a computer program, which implements the methods in various embodiments of the present invention when executed by a processor.

[0169] The above-mentioned computer program product may refer to a software program that has been written, tested and released, which can be run on a computer or other device. The computer program product may include an application, an operating system, tool software, etc., which is used to implement specific functions or solve specific problems.

[0170] An embodiment of the present application further provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0171] The above-mentioned non-volatile computer-readable storage medium may refer to a medium for storing data. The non-volatile computer-readable storage medium can keep the data from being lost when the power is off, and can be used to store long-term data, such as operating systems, applications and user files. The non-volatile storage medium may include hard disk drives, solid-state drives, optical disks and flash memory storage devices, etc.

[0172] The embodiments of the present application further provide a computer program, which implements the methods in the above-mentioned embodiments of the present invention when executed by a processor.

[0173] The above-mentioned computer program may refer to a collection of instructions used to tell a computer to perform a specific task or operation. A computer program may be written by a programmer using a specific programming language and may include algorithms, data structures, logic, and control flows. Computer programs may be used for a variety of purposes, including application software, operating systems, and the like.

[0174] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0175] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0176] The units described as separate components may or may not be physically separate, and 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 units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0177] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0178] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.

[0179] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A method for organizing a three-dimensional building model with a combination of coarse and fine granularity, characterized in that: include: Step S10: Obtaining an optimal K value within the constraints of the legal value of the R-tree. Based on the optimal K value, using the K-Means algorithm, unsupervised classification is performed on the three-dimensional building model data with a single building as the basic unit to ensure the legality of the R-tree nodes. A tree balancing operation is then performed to ensure the balance of the R-tree. Through multiple recursive iterations, R-tree tree child nodes containing multiple single-building data are obtained. Step S20, using an octree to organize individual buildings in a fine-grained manner, and creating an octree root node for each building at the R-tree leaf node; Assign the single model data to the octree nodes and delete the redundant nodes, finally obtaining the 3D building model data organization structure that integrates the R-tree and octree; The step S20 includes the following steps: Step S201: Obtain an R-tree structure based on a single building as the basic unit and determine whether the leaf nodes of the R-tree have been looped through. If the loop is not complete, proceed to step S202. If the loop is complete, a 3D building model data structure that integrates the R-tree and the octree is obtained. Step S202: Create an octree root node based on the leaf nodes of the R-tree, and obtain the minimum cubic bounding box of a single building as the range of the octree root node; Step S203, determining whether the single-body model of the current building has been inserted. If the insertion is completed, proceed to step S207; if the insertion is not completed, proceed to step S204; Step S204: determine whether the expansion value of the current node is less than the minimum area threshold Minl of the octree partition. If the current node is less than Minl, stop the determination, insert the current node, and then return to step S203 for re-determination. Otherwise, if the current node is greater than or equal to Minl, perform octree partitioning and proceed to step S205. Step S205: If the single building model is surrounded by the current node area but not by any child node area of ​​the current node, the current node is inserted, and then the process returns to step S203 for re-judgment; otherwise, the process proceeds to step S206; Step S206: When the single building model is surrounded by the current node area and any child node area of ​​the current node, the child node is set as the current node and the process goes to step S204; Step S207: Delete unnecessary nodes. A non-essential node is a blank node. If a child node and its sibling nodes have neither child nodes nor data, delete all child nodes pointed to by the parent node of the child node.

2. The method for organizing a three-dimensional building model combining coarse and fine granularity according to claim 1, characterized in that: The step S10 includes the following steps: Step S101: Initialize the R-tree, create a root node, and input a 3D building model with a single building as the basic unit; Step S102: Determine the number of buildings passed in. If it is greater than the maximum legal entry value M of the R-tree node, proceed to step S103; if it is less than or equal to M, proceed to step S107; Step S103, obtaining the best K value K-Value under the legal value limit of the R tree; Step S104, executing the K-means clustering algorithm when the K value is K-Value to obtain the cluster data array Clusters; Step S105: performing a tree balancing operation to adjust the number of buildings in each cluster in the cluster data array Clusters to an average value, thereby obtaining a balanced cluster array bClusters; Step S106: Determine whether the balanced cluster array bClusters has completed the loop. If not, read the clusters in the array, create a child node childNode of the current node, and proceed to step S102. The data passed in is the 3D building model data of the current cluster with a single building as the basic unit. If the loop is complete, proceed to step S108. Step S107, inserting the single building data into the current node, completing the update of the bounding box of each node in the R-tree; Step S108 , recursively complete the loop of all other balanced clustering arrays to obtain an R-tree structure with a single building as the basic unit.

3. The method for organizing a three-dimensional building model combining coarse and fine granularity according to claim 2, characterized in that: The step S103 includes the following steps: S1031, under the constraints of MaxK and maxDelta, find the optimal K value K1 by comparing the SSE values; S1032, if the K1 value is less than the minimum legal entry value m of the R-tree node, then take the K-Value value as m; if m≤K1≤M, then take the K-Value value as K1; S1033, calculate the number of buildings N, that is, the total number of buildings in the current node, such as Add 1 to the K-Value until Stop when , and get the best K value K-Value under the legal value limit of R tree.

4. The method for organizing a three-dimensional building model with a combination of coarse and fine granularity according to claim 1, characterized in that: The three-dimensional building model data organization structure that integrates the R-tree and the octree includes: the root node, intermediate nodes and leaf nodes of the R-tree and the octree, wherein the root node and the intermediate nodes of the R-tree do not contain a pointer to the root node of the octree, and the pointer array OcPtrs pointing to the root node of the octree is empty; and the leaf node of the R-tree does not contain a pointer to other child nodes, and the Children is empty; the root node of the octree is located at the top layer, that is, it does not point to any parent node, and its Parent value is empty; when entering the root node, the building identification value BuildID is only recorded once, the intermediate nodes and leaf nodes do not store the BuildID value, the leaf node does not contain a pointer to a child node, and the Children is empty.

5. A coarse-grained and fine-grained three-dimensional architectural model organization device, characterized in that: include: The R-tree coarse-grained organization module obtains the optimal K value within the constraints of the R-tree's legal values. Based on this optimal K value, the K-Means algorithm is used to perform unsupervised classification on the 3D building model data based on a single building, ensuring the legality of the R-tree nodes. A tree balancing operation is then performed to ensure the balance of the R-tree. Through multiple recursive iterations, R-tree tree child nodes containing data from multiple single buildings are obtained. The octree fine-grained organization module is used to organize a single building in a fine-grained manner using an octree. At the R-tree leaf node, an octree root node is created for each building. Assign the monomer model data to the octree nodes and delete the redundant nodes, finally obtaining the data organization structure that integrates the R-tree and octree; The octree fine-grained organization module is used to use the octree to perform fine-grained organization on a single building, and create an octree root node for each building at the R-tree leaf node; The data of the single model is assigned to the octree nodes, and the redundant nodes are deleted, and finally a data organization structure that integrates the R-tree and the octree is obtained, which includes the following steps: Step S201, obtaining the R-tree structure with a single building as the basic unit, and determining whether the leaf nodes of the R-tree are completely cycled; When the loop is not completed, go to step S202; when the loop is completed, the three-dimensional building model data structure that integrates the R-tree and the octree is obtained; in step S202, the root node of the octree is created according to the leaf node of the R-tree, and the minimum cubic bounding box of the single building is obtained as the range of the octree root node; in step S203, it is determined whether the single model of the current building is inserted. When the insertion is completed, it goes to step S207; when the insertion is not completed, it goes to step S204; in step S204, it is determined whether the expansion value of the current node is less than the minimum area threshold Minl of the octree division. When the current node is less than Minl, the judgment is stopped, the current node is inserted, and then the judgment is returned to step S203 for re-judgment; on the contrary, when the current node is less than Minl, the judgment is stopped, the current node is inserted, and then the judgment is returned to step S203 for re-judgment; on the contrary, when the current node is less than Minl, the judgment is stopped, the current node is inserted, and then the judgment is returned to step S203 for re-judgment. When the point ≥Minl, octree division is performed and the process goes to step S205; in step S205, when the single building model is surrounded by the current node area but not by any child node area of ​​the current node, the current node is inserted, and then the process returns to step S203 for re-judgment; otherwise, the process goes to step S206; in step S206, when the single building model is surrounded by the current node area and by any child node area of ​​the current node, the child node is set as the current node and the process goes to step S204; in step S207, non-essential nodes are deleted. Non-essential nodes are blank nodes. If a child node and its sibling nodes have neither child nodes nor data, all child nodes pointed to by the parent node in the child node are deleted.

6. An electronic device, characterized in that: include: a memory storing an executable program; A processor is used to run the program, wherein the program, when running, executes the coarse-grained and fine-grained combined three-dimensional building model organization method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored executable program, wherein when the program is run, the device where the computer-readable storage medium is located is controlled to execute the coarse-grained and fine-grained combined three-dimensional building model organization method according to any one of claims 1 to 4.

8. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the coarse-grained and fine-grained combined three-dimensional building model organization method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Granularity balance data organization method of complicated three-dimensional building model

    CN105957148A

  • Fractal dimension calculation method and device based on octree algorithm

    CN112991424A