Method and equipment for realizing lightweight storage of model, program product and medium
Through component streamlining and separate storage of data tables, the problem of huge storage volume of geometric models is solved, lightweight storage is achieved, and storage efficiency and model parsing speed are improved.
Patent Information
- Application Number
- CN202411988256.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The large storage volume of geometric models leads to data redundancy and low storage efficiency.
Through component simplification, separate storage of entity tables and type tables, and structured description of file headers, a lightweight geometric model is generated, which significantly reduces the storage volume of the model.
It realizes lightweight storage of geometric models, reduces storage volume, and ensures the integrity of information and the rationality of storage structure, meeting the needs of efficient storage, fast parsing and flexible transmission.
Smart Images

Figure CN119782271A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of geometric modeling, and in particular to a method for implementing lightweight storage of models, a computer device and a computer program product, and a computer-readable storage medium. Background Art
[0002] Geometric modeling technology has been widely used in architectural design, industrial manufacturing and other fields. Geometric models will meet the needs of actual scenarios by describing the geometric shape, component properties and spatial position of objects. However, the complexity and data volume of geometric models increase exponentially with the increase in project scale, and the huge data volume poses a severe challenge to the required model storage.
[0003] In the existing geometric model storage, all components are usually recorded directly into an integral file. This storage structure leads to data redundancy and repeated storage of data, which in turn leads to the problem of huge storage volume of geometric models. Summary of the invention
[0004] One purpose of the present application is to solve the technical problem of large storage volume of geometric models, and to provide a method, computer device and computer program product, and computer-readable storage medium for realizing lightweight storage of models, thereby significantly reducing the storage volume of the models.
[0005] According to one aspect of an embodiment of the present application, a method for implementing lightweight storage of a model is disclosed, the method comprising:
[0006] Simplifying components of the geometric model to obtain a lightweight geometric model, wherein the lightweight geometric model is a small volume model of the geometric model;
[0007] By extracting component entities and component type data from the lightweight geometric model, an entity table and a type table corresponding to each component entity type are generated, wherein the entity table is used to record the geometric data of each component entity under the entity type, and the type table is used to record each component type under the instance type;
[0008] A file header is constructed with the component entity types distributed in the lightweight geometric model and the component types under the component entity types, and the geometric model storage file is obtained by merging and storing the entity table and the type table through the file header.
[0009] According to one aspect of an embodiment of the present application, the step of simplifying components of a geometric model to obtain a lightweight geometric model includes:
[0010] Classifying the component entities in the geometric model to determine the component entities belonging to linear components and the component entities belonging to point components in the geometric model;
[0011] Component simplification is performed on component entities belonging to linear components and point components respectively.
[0012] According to one aspect of an embodiment of the present application, the classifying of component entities in the geometric model to determine component entities belonging to linear components and component entities belonging to point components in the geometric model includes:
[0013] Extracting geometric features from the component entity in the geometric model, wherein the geometric features are used to describe the geometric elements contained in the component entity;
[0014] Acquiring corresponding geometric dimensions for the geometric features of the component entity;
[0015] The component entities belonging to the linear components and the component entities belonging to the point components in the geometric model are determined by matching the dimensions of the geometric bodies.
[0016] According to one aspect of an embodiment of the present application, the component entities belonging to linear components and point components are simplified respectively, including:
[0017] Taking outer boxes of component entities belonging to linear components in the geometric model to construct a quadtree;
[0018] By checking the neighboring collinearity between the linear components on the quadtree, the linear components that are collinear and whose spacing is less than the specified precision are merged.
[0019] According to one aspect of an embodiment of the present application, the component entities belonging to linear components and point components are simplified respectively, including:
[0020] Constructing a KD tree for component entities belonging to point components in the geometric model;
[0021] The KD tree is used to perform overlapping detection of point components, and point components detected to be adjacent to each other and with a spacing less than a specified precision are uniquely eliminated.
[0022] According to one aspect of an embodiment of the present application, the component entity and component type data extraction performed through the lightweight geometric model generates an entity table and a type table corresponding to each component entity type, including:
[0023] For each component entity belonging to the same component entity type on the geometric model, the component identification, the type identification and the geometric data of the component entity are extracted to generate an entity table.
[0024] According to one aspect of an embodiment of the present application, the component entity and component type data extraction performed through the lightweight geometric model generates an entity table and a type table corresponding to each component entity type, including:
[0025] For the type distribution of each component entity under each component entity type on the geometric model, extract the type identification and type description data corresponding to the distributed type;
[0026] A type table corresponding to the component entity type is generated based on the type identification and type description data.
[0027] According to one aspect of an embodiment of the present application, a computer device is disclosed, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of any of the methods described above.
[0028] According to one aspect of an embodiment of the present application, a computer program product is disclosed, including a computer program, wherein when the computer program is executed by a processor, the steps of any of the methods described above are implemented.
[0029] According to one aspect of an embodiment of the present application, a computer-readable storage medium is disclosed, on which a computer program is stored, and when the program is executed by a processor, the steps of any of the methods described above are implemented.
[0030] The embodiment of the present application generates a small and lightweight model by streamlining components, separate storage of entity tables and type tables, and implementation of structured description of file headers. This will significantly reduce the storage volume of the model and ensure the integrity of all relevant information in the model and the rationality of the storage structure, thereby greatly meeting the needs of efficient storage, fast parsing, and flexible transmission.
[0031] Specifically, the embodiments of the present application first simplify the components of a given geometric model that needs to be stored to obtain a small volume model of the geometric model. On this basis, the component entities and component type data in the lightweight geometric model are separated to generate entity tables and type tables respectively, thereby realizing modular management and storage of data, thereby effectively achieving data redundancy. Finally, the file header is structuredly described through the component entity types and component types of the lightweight geometric model to obtain a file header, thereby merging the entity table and the type table for storage, obtaining a geometric model storage file with a significantly reduced volume, thereby significantly reducing the storage volume of the model.
[0032] Furthermore, the simplification of geometric model components will ensure that the lightweight geometric model retains the necessary geometric features while minimizing the redundancy of details. Compared with the existing implementation, it can reduce the storage volume while avoiding the loss of critical information.
[0033] The separation of component entities and component type data in lightweight geometric models, that is, the separate generation of entity tables and type tables, will effectively eliminate data redundancy while also improving storage efficiency and model parsing speed.
[0034] The file header is constructed based on the component entity types distributed on the lightweight geometric model and the component types under the component entity types. In other words, the component entity types of the lightweight geometric model and the structural tilt information under the component entity types are added to the file header, so that the subsequent file parsing and model restoration can quickly locate the components of the model and extract relevant information without traversing the entire file, thereby significantly improving the efficiency of model loading and parsing.
[0035] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0036] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The above and other objects, features and advantages of the present application will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
[0038] Figure 1 A flow chart of a method for implementing lightweight storage of models according to an embodiment of the present application is shown.
[0039] Figure 2 is based on Figure 1 A method flow chart describing the steps of simplifying the components of a geometric model to obtain a lightweight geometric model is shown in the corresponding embodiment.
[0040] Figure 3 is based on Figure 2 A method flow chart describing the steps of classifying component entities in a geometric model and determining component entities belonging to linear components and component entities belonging to point components in the geometric model is shown in the corresponding embodiment.
[0041] Figure 4 is based on Figure 2 A method flow chart describing the steps of component simplification for component entities belonging to linear components and point components respectively shown in the corresponding embodiment.
[0042] Figure 5 is based on Figure 2 A method flow chart describing the steps of component simplification for component entities belonging to linear components and point components respectively shown in the corresponding embodiment.
[0043] Figure 6 is based on Figure 1A flowchart of a method for describing the steps of extracting component entities and component type data through a lightweight geometric model and generating entity tables and type tables corresponding to each component entity type is shown in the corresponding embodiment.
[0044] Figure 7 It is a schematic diagram of the execution process of a simplified model and a storage model rescued according to an application example.
[0045] Figure 8 is based on Figure 7 A schematic diagram of the execution process of removing overlapping components and merging adjacent collinear components shown in the corresponding embodiment.
[0046] Fig. 9 is based on Figure 8 A schematic diagram of an overlapping point component shown in the corresponding embodiment.
[0047] Fig.10 is based on Figure 7 A schematic diagram of the execution process of debris culling on a geometric model shown in the corresponding embodiment.
[0048] Fig.11 The diagram is a schematic diagram showing a file header structure and mapping of a file header to an entity table and a type table according to an exemplary embodiment.
[0049] Fig.12 It is a schematic diagram of an entity table corresponding to a wall entity according to an exemplary embodiment.
[0050] Fig.13 It is a schematic diagram of an entity table corresponding to a door entity according to an exemplary embodiment.
[0051] Fig.14 The diagram is a schematic diagram of a BIM model that needs to be stored according to an exemplary embodiment.
[0052] Fig.15 The figure is a schematic diagram of geometric model storage file attributes according to an exemplary embodiment. DETAILED DESCRIPTION
[0053] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present application will be more comprehensive and complete and the concepts of the example embodiments will be fully conveyed to those skilled in the art. The accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0054] In addition, the described features, structures or characteristics may be combined in one or more example embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the example embodiments of the present application. However, those skilled in the art will appreciate that the technical solution of the present application may be practiced while omitting one or more of the specific details, or other methods, components, steps, etc. may be adopted. In other cases, known structures, methods, implementations or operations are not shown or described in detail to avoid obscuring the present application and making the various aspects of the present application obscure.
[0055] Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0056] The embodiment of the present application is used to obtain a geometric model storage file for the constructed geometric model, so as to facilitate persistent storage on the disk, and then facilitate parsing and restoration based on the persistently stored geometric model storage file. Therefore, the data volume, that is, the size of the storage volume determines the storage efficiency and the storage space occupied, and also determines the efficiency of calling the geometric model again. Therefore, significantly reducing the storage volume of the model is the basis of storage and reuse.
[0057] See also Figure 1 , Figure 1 A flow chart of a method for implementing lightweight storage of models according to an embodiment of the present application is shown. The present application embodiment provides a method for implementing lightweight storage of models, the method comprising:
[0058] Step S110, simplifying the components of the geometric model to obtain a lightweight geometric model, where the lightweight geometric model is a small volume model of the geometric model;
[0059] Step S120, extracting component entities and component type data from the lightweight geometric model to generate an entity table and a type table corresponding to each component entity type, wherein the entity table is used to record the geometric data of each component entity under the entity type, and the type table is used to record each component type under the instance type;
[0060] Step S130: construct a file header with the component entity types and component types under the component entity types distributed in the lightweight geometric model, and obtain a geometric model storage file by merging the storage entity table and the type table through the file header.
[0061] This step is described in detail below.
[0062] First of all, it should be noted that for the geometric models that need to be stored, the geometric model storage file will be obtained through the implementation of model lightweight storage. In other words, the lightweight geometric model is written to the disk through the geometric model storage file for easy reuse.
[0063] In step S110, the constructed geometric model or the imported geometric model, if storage is required, will be subjected to component simplification. Component simplification is the execution process of lightweight processing of geometric models. In the lightweight processing, the complexity, file size and / or data volume of the model are reduced to make it easier to load, browse, share and process on different devices or platforms. In particular, for BIM models (Building Information Modeling), the execution of step S110 will effectively improve the performance of the model, especially for the processing of large-scale models, and can effectively improve the usability and operability of the model.
[0064] The component simplification operation is performed on all component entities on the geometric model. Specifically, the component simplification operation will be applicable to linear components and point components to implement component simplification respectively. The component simplification operation includes the merging of component entities and the removal of component entities. In addition, it will also eliminate edge fragment models for all component entities distributed in the geometric model. In this way, it will be possible to effectively merge a large number of small component entities that are partially similar and merge them into a larger single object, reducing the complexity of processing. Some unimportant or unnecessary component entities will also be removed from the model to avoid them occupying computing and storage resources.
[0065] Exemplarily, component simplification includes classifying component entities in the geometric model, and performing component simplification operations on component entities belonging to each classification based on the classification. The component simplification operations include merging and eliminating operations of component entities, and there are classifications of linear components and point components on the geometric model.
[0066] In summary, component simplification can be performed by classification, including the classification of component entities and the execution of merging or eliminating operations based on the classification.
[0067] Furthermore, for the component entity classification, the geometric dimensions of each component entity are obtained by extracting geometric features, and then the category to which the component entity belongs is determined by matching the geometric dimensions of the component entity, clarifying whether the component entity belongs to a linear component or a point component.
[0068] By identifying the category to which the component entity belongs, the storage of the geometric model can be better adapted to different types of component entities, so as to effectively simplify the geometric model with high reliability.
[0069] The process of identifying component entities and classifying them as linear components or point components involves analyzing and extracting the geometric shapes of component entities and classifying them according to geometric features. This process involves extracting geometric features, calculating the corresponding geometric dimensions based on the geometric features, and finally classifying the component entities as linear components or point components by matching the geometric dimensions.
[0070] For details, please refer to Figure 2 , Figure 2 is based on Figure 1 A method flow chart describing the steps of simplifying the components of a geometric model to obtain a lightweight geometric model is shown in the corresponding embodiment.
[0071] The step S110 of simplifying the components of the geometric model to obtain a lightweight geometric model provided in the embodiment of the present application includes:
[0072] Step S111, classifying component entities in the geometric model, and determining component entities belonging to linear components and component entities belonging to point components in the geometric model;
[0073] Step S112, simplifying the component entities belonging to the linear components and the point components respectively.
[0074] The following describes these two steps in detail.
[0075] In step S111, each component entity on the geometric model is classified to determine the category to which the component entity belongs. A linear component refers to a component entity with a certain length, direction, and geometric extension. For example, beams, pipes, cables, rails, etc. in a building are all linear components. Point components are component entities without obvious extensions, such as lamps, equipment connection points, support points, etc. in a building, and their component entities are all point components.
[0076] See also Figure 3 of, Figure 3 is based on Figure 2 A method flow chart describing the steps of classifying component entities in a geometric model and determining component entities belonging to linear components and component entities belonging to point components in the geometric model is shown in the corresponding embodiment.
[0077] The step S111 of classifying component entities in a geometric model and determining component entities belonging to linear components and component entities belonging to point components in the geometric model provided in the embodiment of the present application includes:
[0078] Step S1111, extracting geometric features from the component entity in the geometric model, where the geometric features are used to describe the geometric elements contained in the component entity;
[0079] Step S1112, obtaining corresponding geometric dimensions for the geometric features of several component entities;
[0080] Step S1113, determining the component entities belonging to the linear components and the component entities belonging to the point components in the geometric model by matching the geometric body dimensions.
[0081] These steps are described in detail below.
[0082] First of all, it should be noted that geometric features are used to describe geometric elements on a component entity, including but not limited to basic units such as points, lines, and surfaces. Geometric features are key features for calculating component entities, such as the bounding box, center point, start point, and end point of a component entity, which are not limited here.
[0083] The extracted geometric features are adapted to the classification of linear components and point components to be performed, and the corresponding geometric dimensions are obtained for the geometric features. Exemplarily, the geometric dimensions include at least one of size, position, shape, direction, length and area. The obtained geometric dimensions can clearly match whether the component entity belongs to a linear component or a point component.
[0084] For example, the obtained geometric dimension has a clear starting point and end point, and a length. Therefore, it can be matched that the geometric dimension describes a linear component, and the corresponding component entity should be attributed to the linear component.
[0085] If the obtained geometric dimension has only one position, then the point component will be matched to the description of the geometric dimension, and the corresponding component entity should be attributed to the point component.
[0086] In order to facilitate the rapid matching of geometric dimensions, thresholds can be set for each geometric dimension. The set thresholds include the minimum length threshold corresponding to the length in the geometric dimension and the position accuracy corresponding to the position. Thus, component entities below the minimum length threshold can be classified as point components, and whether the component entity is a point or a small range can be judged based on the position accuracy to ensure the rapid and accurate classification of component entities.
[0087] After the component entities are classified, they can be adapted to perform component reduction according to the classification, as shown in step S112. The component reduction execution process for the component entities belonging to linear components and point components includes a merging operation and a eliminating operation, as described above.
[0088] See also Figure 4 , Figure 4 is based on Figure 2A method flow chart describing the steps of component simplification for component entities belonging to linear components and point components respectively shown in the corresponding embodiment.
[0089] The step S112 of simplifying the component entities belonging to the linear component and the point component respectively provided in the embodiment of the present application includes:
[0090] Step S1121a, taking outer boxes of component entities belonging to linear components in the geometric model to construct a quadtree;
[0091] Step S1122a: By checking the adjacent collinearity between the linear components on the quadtree, the linear components whose collinear adjacent spacing is less than the specified precision are merged.
[0092] The following describes these two steps in detail.
[0093] Based on the quadtree, all linear components in the geometric model, such as walls and beams, are checked for adjacent collinearity. If continuous collinear adjacent component entities with a spacing less than the specified accuracy are detected, they are merged.
[0094] The outer box is the smallest cuboid that covers the spatial range of the linear component. For example, the outer box completely encloses all vertices of the linear component. The quadtree is used to store the outer boxes corresponding to the linear components in a tree-like manner in three-dimensional space.
[0095] Through the construction of the quadtree, all linear components of the geometric model exist in the quadtree in the form of outer boxes, and then the proximity collinearity check between the linear components can be performed on the quadtree.
[0096] The execution process of constructing a quadtree based on outer boxes for linear components includes: initializing the quadtree based on all linear components, and allocating outer boxes to each linear component of the initialized quadtree.
[0097] It should be understood that when creating a root node for the linear component of the geometric model, the region of the created root node will include the spatial region occupied by the outer boxes of all the linear components on the geometric model. For example, the spatial region can be a sufficiently large cuboid. After the quadtree is initialized to adapt to the geometric model, the outer box of each linear component on the geometric model is assigned nodes on the quadtree to obtain a quadtree that separates the outer boxes of all the linear components.
[0098] At this point, the neighboring collinearity check between linear components on the geometric model is performed under the action of the quadtree. On the one hand, it will ensure the comprehensiveness of the neighboring collinearity check, that is, it will efficiently and reliably cover all linear components on the geometric model. On the other hand, it also ensures the efficiency of the neighboring collinearity check.
[0099] The so-called adjacent collinearity check refers to whether the linear components in the geometric model are collinear in space and the spacing between them is less than the specified precision. If the linear components are collinear in space and the spacing between them is less than the specified precision, they are regarded as adjacent collinear and a merge operation will be initiated.
[0100] Similarly, adjacent collinearity checks can be performed on all linear components, and collinear and adjacent linear components can be merged.
[0101] For the component entities belonging to point components, overlap detection will be performed to determine whether there are overlapping point components, and then the overlapping point components will be uniquely eliminated.
[0102] See also Figure 5 , Figure 5 is based on Figure 2 A method flow chart describing the steps of component simplification for component entities belonging to linear components and point components respectively shown in the corresponding embodiment.
[0103] The step S112 of simplifying the component entities belonging to the linear component and the point component respectively provided in the embodiment of the present application includes:
[0104] Step S1121b, constructing a KD tree for the component entities belonging to the point components in the geometric model;
[0105] Step S1122b, performing overlapping detection of point components through the KD tree, and uniquely eliminating point components detected to be adjacent to each other and with a spacing less than a specified precision.
[0106] These two steps are described in detail below.
[0107] First of all, it should be explained that the KD (k-dimensional tree) tree is used to store and organize point data in multidimensional space, that is, the geometric data corresponding to the point components, so that the overlap detection performed on the point components on the geometric model can achieve efficient query and search.
[0108] For the component entities belonging to the point components in the geometric model, the KD tree is constructed to realize the overlap detection of the point components. The overlap can also be understood as repeated point components. The repeated point components will be removed and only one point component will be retained, thereby eliminating the redundant data on the geometric model. While ensuring data integrity, accuracy and efficiency, redundancy and duplication are avoided.
[0109] In another exemplary embodiment, in addition to simplifying the components of the geometric model based on the category to which the component entities belong, i.e., based on linear components and point components, edge fragment models distributed on the geometric model will also be identified and then eliminated.
[0110] Specifically, the execution process of step S110 also includes: obtaining the corresponding three-dimensional cube outer box for each component entity of the geometric model, and forming a point set of the component entity from the three-dimensional cube outer box; performing density clustering of the component entity according to the point set, and locating the component entity outside the cluster as an edge fragment model; and eliminating the edge fragment model distributed on the geometric model.
[0111] Edge fragment models refer to certain parts of the geometric model, mostly external edges or boundary parts, which are irregular, fragmented and inaccurately represented. These parts often affect the accuracy and usability of the geometric model. Therefore, identifying and eliminating edge fragment models can effectively reduce the data volume while improving the quality of the geometric model.
[0112] Specifically, all component entities in the geometric model are traversed to calculate the three-dimensional cube outer box of each component entity. Exemplarily, the three-dimensional cube outer box calculated for the component entity is defined by the maximum and minimum values of the point coordinates, which constitute the point set of the component entity.
[0113] For each component entity point set, a density clustering algorithm is used to cluster the points to obtain the clustering result. For example, the clustering structure assigns a cluster label to each component entity, and the component entities with the same cluster label belong to the same cluster. The component entities that are not in any cluster are edge fragment models and need to be eliminated.
[0114] In this way, the rapid positioning of edge fragment models on the geometric model is achieved, which can be applied to batch processing of fragmented components in large-scale geometric models without manual intervention, while retaining the main component entities, improving the data integrity of the geometric model and avoiding excessive elimination.
[0115] For example, remove fragment components that do not affect the core functions of the model, such as isolated edge walls, pipeline remnants, etc.
[0116] After removing the edge fragment model, the overall storage capacity of the model is significantly reduced, which is particularly suitable for lightweight storage needs and reduces the number of irrelevant components. The computational complexity of the optimized model is reduced, and the rendering speed and simulation calculation efficiency are improved.
[0117] As the component simplification on the geometric model is completed, an entity table and a type table will be generated for the simplified lightweight geometric model through step S120 to achieve separate storage of the geometric data of each component entity and each component type, which will effectively eliminate data redundancy and improve storage efficiency and model parsing speed.
[0118] In step 120, on the one hand, an entity table is generated for the component entities distributed on the lightweight geometric model, and on the other hand, all component types are counted to generate a type table.
[0119] It can be understood that the geometric data of the component entity under the component entity type existing in the lightweight geometric model is extracted to generate the entity table. For the component types existing under each type of component entity, the type description data is extracted to generate the type table.
[0120] Each component entity type has its own entity table, and the entity table records the geometric data of each component entity under the component entity type, that is, each data entry corresponds to the component entity under the component entity type, that is, the component identifier, type identifier and geometric data of the component entity constitute a data entry, and so on, all data entries under the component entity type form the entity table.
[0121] The entity surface is directed to all component entities under a component entity type, recording the geometric data of each component entity and the component type to which the component entity belongs under this component entity type. There is no need to store type description data of the component type, thereby avoiding repeated storage of type description data and the redundancy caused thereby.
[0122] A component type also corresponds to a component entity type, that is, there is at least one component type for a component entity type. Therefore, a type table will be generated for each component entity type to record the component types contained in the component entity type and the type description data of each component type.
[0123] By constructing entity tables and type tables separately, different data are stored in order. For a component entity type, the entity table specifically stores the geometric data related to the component entity, and the type table specifically stores the type data of each component. Therefore, the geometric data of a specific entity and the type description data of a specific type can be quickly located during operation, thereby improving processing efficiency.
[0124] And as pointed out above, separating the geometric data related to the component entity from the type description data and storing the two separately can avoid repeatedly storing the type description data in the data entry of the entity table for each component entity. By centrally managing the component types through the type table, it is only necessary to store the type identifier in the entity table to map it to the corresponding type description data in the type table. There is no need to repeatedly describe the component type for each component entity, which helps to reduce storage space and redundant data.
[0125] On the other hand, with the lightweight and reuse of geometric models, changes in component types are often involved. Therefore, expansion and adjustment can be easily and quickly carried out by maintaining the type table separately, and new component types can be added without modifying the data of each component entity.
[0126] Based on this, in an exemplary embodiment, the execution process of step S120 includes: for each component entity belonging to the same component entity type on the geometric model, extracting the component identification, the type identification and the geometric data of the component entity to generate an entity table.
[0127] Furthermore, firstly, an index is constructed for the distribution of each component entity of the corresponding component entity type, and the component identification, type identification and geometric data of the corresponding component entity are linearly stored with the index of each component entity to obtain the data entry of each component entity. The data entries of all component entities of the same component entity type form an entity table.
[0128] A component entity type, each component entity corresponds to a set of stored data, and the stored data are various parameters in the geometric data. For example, for a wall entity table, each wall entity stores various parameters in the geometric data, such as the start and end point coordinates, wall width, and wall type identification; for a door entity table, each door entity also stores various parameters in the geometric data, such as the midpoint coordinates, door width and height, and door type identification.
[0129] In another exemplary embodiment, see also Figure 6 , Figure 6 is based on Figure 1 A flowchart of a method for describing the steps of extracting component entities and component type data through a lightweight geometric model and generating entity tables and type tables corresponding to each component entity type is shown in the corresponding embodiment.
[0130] The step S120 of extracting component entities and component type data through a lightweight geometric model and generating entity tables and type tables corresponding to each component entity type provided in the embodiment of the present application includes:
[0131] Step S121, extracting type identifiers and type description data corresponding to the distributed types for the type distribution of each component entity under each component entity type on the geometric model;
[0132] Step S122: Generate a type table corresponding to the component entity type based on the type identifier and the type description data.
[0133] These two steps are described in detail below.
[0134] In step S121, as mentioned above, each component entity type has at least one component type, each component type is uniquely identified by a type identifier, and the component type is defined by the corresponding type description data. Exemplarily, the type description data may be the attributes of the component type, such as for a wall entity, its type description data includes attributes in several dimensions such as fire rating, material, and purpose.
[0135] In step S122, each component type of a component entity type constitutes a data entry of the component type through a corresponding type identifier and type description data, and so on, the data entries of all component types of the component entity type can form a type table corresponding to the component entity type.
[0136] In summary, the execution process of step S122 includes: constructing an index for each component type based on the type distribution of the component entity type; using the index of each component type, linearly storing the corresponding type identification and type description data to obtain the data entry of each component type, and the data entries of all component types of the same component entity type form a type table.
[0137] As step S120 is performed, an entity table and a type table are generated for the lightweight geometric model, and then a file header can be constructed by executing step S130. The entity table and the type table are merged and stored by mapping the file header to the entity table and the type table to obtain a geometric model storage file.
[0138] In step S130, the file header marks the lightweight geometric model through a structured table segment. Specifically, the entity table fields and type table fields corresponding to the component entity types on the lightweight geometric model are marked respectively, and then the entity table fields are mapped to the entity table, and the type table fields are mapped to the type table. Finally, the entity table and the type table are merged and stored.
[0139] The entity table fields constitute the field table segment of the file header, and the type table fields constitute the type table segment of the file header, thereby obtaining the structure of the file header.
[0140] In an exemplary embodiment, the execution process of step S130 includes: configuring type table segments and entity table segments according to the distribution of component entity types on the lightweight model; using the type table segments and entity table segments as file headers, mapping the type table segments to the type table, mapping the entity table segments to the entity table, and merging and storing the entity table and the type table to obtain a geometric model storage file.
[0141] In the file header, the type table segment includes type table fields corresponding to several component entity types, and the entity table segment includes entity table fields corresponding to several component entity types. Each type table field points to the corresponding type table, and each entity table field points to the corresponding entity table, so that the type table and entity table are merged and stored under this architecture.
[0142] The distribution of component entity types on the lightweight geometric model is adopted, the type table segment and the entity table segment are configured, and the type table segment is mapped to the type table and the entity table segment is mapped to the entity table through the file header, so that the entity table and the type table are merged and stored to obtain the geometric model storage file, which greatly reduces the storage of duplicate data, avoids the redundant information caused by decentralized storage, and saves storage space.
[0143] The mapping of the file header table segment provides a clear index structure, which enables the target data in the type table and entity table to be quickly located during file parsing, thus reducing traversal and search time and speeding up model loading and operation.
[0144] The configuration table segments and merged storage methods are highly consistent with the goal of lightweight storage. They not only reduce the size of storage files, but also retain the integrity and hierarchical structure of model data, realize lightweight storage of geometric models, and provide support for low-performance devices (such as mobile terminals).
[0145] Furthermore, the execution process of configuring the type table segment and the entity table segment according to the distribution of the component entity types on the lightweight model includes:
[0146] Generate entity table fields of each component entity type and type table fields under each component entity type according to the distribution of component entity types on the lightweight model;
[0147] All entity table fields form an entity table segment in the file header, and type table fields form a type table segment in the file header.
[0148] Through the separate storage of entity table fields and type table fields, the model data is clearly divided into component entities and component types, forming a structured data storage method. The entity table fields only store the geometric data of the component entities, while the type table fields store shared attributes and extract duplicate attribute information into the type table to avoid redundant storage.
[0149] For model loading and parsing, the entity table segment and type table segment in the file header provide clear indexes, so that the target data can be quickly located during model parsing. It also speeds up the model loading and parsing process through structured storage.
[0150] In another exemplary embodiment, along with obtaining the geometric model storage file, the aforementioned method further includes:
[0151] The geometry model storage file is compressed and persistently saved on the disk. The geometry model storage file persistently saved on the disk is used for restoring the geometry model.
[0152] At this point, the storage of the geometric model is completed, that is, it is stored on the disk in the form of a compressed geometric model storage file. If the model needs to be restored, the geometric model storage file that has been persistently saved on the disk is decompressed to obtain parsable data content;
[0153] The geometric data of each component entity under each component entity type and the type description data of the corresponding component type are obtained according to the byte order of the parsed data content;
[0154] The corresponding component model is reconstructed according to the geometric data and the type description data, and the reconstructed component model forms the geometric model.
[0155] In summary, by parsing and resolving, the model can be quickly restored, and parsing and reconstruction are performed only when used, which reduces the long-term occupation of disk space. In cross-platform or remote collaborative work, the transmission of lightweight files is faster, and the model can be restored directly on the target device after decompression.
[0156] Decompression and parsing are performed in byte order, which can gradually load the required data, avoid parsing and loading of the entire data, and improve efficiency; the geometric data and type description data in the storage file are stored separately and read according to the byte order, the data structure is clear, and the risk of data confusion during the reconstruction process is reduced; the association between geometric data and type description data can be used to accurately locate the type of physical component and its attributes, ensuring the accuracy of the reconstructed model.
[0157] The above method is described below with reference to a specific example.
[0158] Taking the BIM model as an example, it has the characteristics of large volume, large number of components, and large number of triangular faces. Therefore, the file size of a BIM model can reach hundreds or thousands of megabytes, which will incur large economic and time costs for storage and transmission. It is necessary to achieve lightweight BIM model storage through the method of this application, which can greatly reduce the file size while retaining all model information and details.
[0159] See also Figure 7 , Figure 7 It is a schematic diagram of the execution process of the simplified model and the storage model according to an application example.
[0160] During this execution process, in order to streamline the model, the topological information and triangular surface data of the geometric model will not be retained, and the project data and geometric data will be fundamentally separated to significantly reduce storage content.
[0161] exist Figure 7 In the execution process shown, several processes such as automatic elimination of redundant components, component grouping, table storage merging and compression are sequentially executed. In the resulting entity table, the complex topological structure and rich geometric details of the three-dimensional geometric topological data are not saved, and only the geometric data, that is, the coordinates of the geometric points, are retained.
[0162] exist Figure 7 The component collection is an execution process of collecting component entities contained in the geometric model in the scene, so as to obtain the component entities existing in the geometric model and the component entity categories and component types to which they belong.
[0163] Based on this, overlapping components are removed, adjacent collinear components are merged, and redundant fragment components are removed to obtain a lightweight geometric model.
[0164] The execution process of removing overlapping components and merging adjacent collinear components is as follows: Figure 8 As shown, Figure 8 is based on Figure 7 A schematic diagram of the execution process of removing overlapping components and merging adjacent collinear components shown in the corresponding embodiment.
[0165] It should be understood that overlapping components can be eliminated by constructing a KD tree for point components to perform duplicate checks, such as performing overlap checks on all point components such as doors and windows. If it is detected that they are adjacent to each other and the distance between them is less than the specified accuracy, they are uniquely eliminated, such as Fig. 9 shown.
[0166] In addition, the overlapping check is not limited to point components, and linear components can also be checked. For example, all walls will be scanned, and overlapping walls will be judged, and invalid walls will be eliminated.
[0167] For the adjacent collinearity check of linear components, a quadtree is used to quickly check the adjacent collinearity of all linear components in the geometric model, such as all walls, beams and other linear components. If continuous collinearity is detected and the spacing is less than the specified accuracy, it will be merged.
[0168] In addition to the removal of overlapping components and the merging of adjacent collinear components, debris removal will also be performed on the geometric model. Fig.10 is based on Figure 7 A schematic diagram of the execution process of debris culling on a geometric model shown in the corresponding embodiment.
[0169] In this process, first, for all components, their three-dimensional cube outer boxes on the geometric model are obtained, and then the eight vertices of all the three-dimensional cube outer boxes are taken to form a three-dimensional point set. The DBSCAN clustering algorithm is used to density cluster the point set to form N clusters. The components outside the cluster are regarded as edge fragment models and need to be eliminated.
[0170] In this way, a lightweight geometric model is obtained, and component types under all entity component types are collected for the lightweight geometric model to generate a type table and an entity table.
[0171] The component file header consists of a type table segment and an entity table segment, such as Fig.11 As shown, the type table segment is between the type table start tag and the type table end tag, and the entity table segment is between the entity table start tag and the entity table end tag. The entity table segment is mapped to each entity table, such as the wall entity table, and the type table segment is mapped to each type table, such as the wall type table.
[0172] On the one hand, the file header stores basic information of the model, such as model version and time, and on the other hand, it realizes mapping through the pointing of entity table fields and type table fields.
[0173] The mapped entity table is used to implement the storage of the corresponding component entity, such as Fig.12 The wall entity shown in the figure will only retain geometric data, namely the start and end point coordinates, width, and wall type identification (ID), and will be mapped to the corresponding wall type through the wall type identification.
[0174] like Fig.12 The storage content is "0, 0, 0, 0, 1000, 0, 200, 1001", and the space occupied is only 23 bytes.
[0175] like Fig.13 The storage of the door entity shown also only stores the midpoint coordinates, door width and height, and door type ID.
[0176] Based on this, the geometric model storage files obtained by merging and storing are Fig.14 The constructed BIM model is stored, and the resulting file size is as follows Fig.15 As shown, it is only 938,528 bytes, a significant 30% reduction compared to existing implementations.
[0177] In an exemplary embodiment, the present application further provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described above.
[0178] In an exemplary embodiment, the present application further provides a computer program product, including a computer program, wherein the computer program implements the steps of the above-mentioned method when executed by a processor.
[0179] In an exemplary embodiment, the present application further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the method described above are implemented.
[0180] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0181] In an exemplary embodiment of the present application, a computer program medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer is enabled to execute the method described in the above method embodiment.
[0182] According to one embodiment of the present application, a program product for implementing the method in the above method embodiment is also provided, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0183] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0184] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0185] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0186] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0187] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0188] In addition, although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0189] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0190] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the appended claims.
Claims
1. A method for realizing lightweight storage of a model, characterized in that: The method comprises: Simplifying components of the geometric model to obtain a lightweight geometric model, wherein the lightweight geometric model is a small volume model of the geometric model; By extracting component entities and component type data from the lightweight geometric model, an entity table and a type table corresponding to each component entity type are generated, wherein the entity table is used to record the geometric data of each component entity under the entity type, and the type table is used to record each component type under the instance type; A file header is constructed with the component entity types distributed in the lightweight geometric model and the component types under the component entity types, and the geometric model storage file is obtained by merging and storing the entity table and the type table through the file header.
2. The method according to claim 1, characterized in that: The step of simplifying the components of the geometric model to obtain a lightweight geometric model includes: Classifying the component entities in the geometric model to determine the component entities belonging to linear components and the component entities belonging to point components in the geometric model; Component simplification is performed on component entities belonging to linear components and point components respectively.
3. The method according to claim 2, characterized in that The classifying of the component entities in the geometric model to determine the component entities belonging to linear components and the component entities belonging to point components in the geometric model includes: Extracting geometric features from the component entity in the geometric model, wherein the geometric features are used to describe the geometric elements contained in the component entity; Acquiring corresponding geometric dimensions for the geometric features of the component entity; The component entities belonging to the linear components and the component entities belonging to the point components in the geometric model are determined by matching the dimensions of the geometric bodies.
4. The method according to claim 2, characterized in that: The component entities belonging to linear components and point components are simplified respectively, including: Taking outer boxes of component entities belonging to linear components in the geometric model to construct a quadtree; By checking the neighboring collinearity between the linear components on the quadtree, the linear components that are collinear and whose spacing is less than the specified precision are merged.
5. The method according to claim 2, characterized in that: The component entities belonging to linear components and point components are simplified respectively, including: Constructing a KD tree for component entities belonging to point components in the geometric model; The KD tree is used to perform overlapping detection of point components, and point components detected to be adjacent to each other and with a spacing less than a specified precision are uniquely eliminated.
6. The method according to claim 1, characterized in that The component entity and component type data extraction performed through the lightweight geometric model generates entity tables and type tables corresponding to each component entity type, including: For each component entity belonging to the same component entity type on the geometric model, the component identification, the type identification and the geometric data of the component entity are extracted to generate an entity table.
7. The method according to claim 1, characterized in that The component entity and component type data extraction performed through the lightweight geometric model generates entity tables and type tables corresponding to each component entity type, including: For the type distribution of each component entity under each component entity type on the geometric model, extract the type identification and type description data corresponding to the distributed type; A type table corresponding to the component entity type is generated based on the type identification and type description data.
8. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
IFC-based BIM model lightweight method
CN114372308A
Urban information model multi-source data storage method and system and medium
CN115422193A
Building information model lightweight processing method, system and equipment and storage medium
CN115601523A
BIM model lightweight method based on digital-analog separation and compression optimization
CN116258804A
Large-volume model loading method, device, equipment and medium
CN117851704A