Lightweight processing method and system for substation GIM model
Through semantic similarity analysis, geometric feature matching and Boolean operation optimization, the problem of model distortion and misdeletion of attributes in GIM model in high-precision processing is solved, efficient and reliable lightweight processing is achieved, the geometric accuracy and attribute consistency of the model are improved, and real-time visualization and collaborative work are supported.
Patent Information
- Application Number
- CN202510198798.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-02-24
AI Technical Summary
The existing GIM model lightweight technology is difficult to retain key geometric features when processing high-precision models, resulting in model distortion, and it is difficult to accurately identify semantic similarity and invalid operations during attribute optimization and Boolean operation optimization, affecting the integrity and efficiency of the model.
Semantic similarity analysis and attribute value validity detection are used to optimize attribute files, combine geometric feature matching and semantic consistency analysis to optimize geometric model, edge folding algorithm and vertex clustering algorithm are used to simplify the triangle face of the non-parametric model, and invisible primitives in the parameterized model are optimized through OBB envelope box detection and spatial inclusion relationship analysis, and invalid Boolean operations are deleted.
It realizes lightweight processing with higher reliability, better accuracy and higher efficiency of the substation GIM model, reduces storage costs and transmission time, improves model loading speed and interactive performance, ensures geometric accuracy and attribute consistency, and supports real-time visualization and collaborative work.
Smart Images

Figure CN119962056B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of electrical automation, and in particular relates to a lightweight processing method and system for a GIM model of a substation. Background Art
[0002] With the development of economy and technology and the improvement of people's living standards, electricity has become an indispensable secondary energy source in people's production and life, bringing endless convenience to people's production and life. Therefore, ensuring a stable and reliable supply of electricity has become one of the most important tasks of the power system.
[0003] In the power industry, the Grid Information Model (GIM), an extension of BIM (Building Information Model), is widely used in the 3D design and digital handover of power grid projects such as substations. Substation project 3D design model files (GIM models) are in the *.gim format and employ a hierarchical management structure, encompassing geometric models (*.mod, *.stl), geometric model groups (*.phm), physical models (*.dev), assembly models (*.cbm), and attribute information (*.fam). Geometric models are divided into parametric *.mod files and non-parametric *.stl files. *.mod files are stored parametrically, while *.stl files use triangular facets to represent geometric shapes. A geometric model group (*.phm) describes a model by referencing one or more *.mod or *.stl files. It supports peer-level references but not self-references. Physical models are stored in the *.dev file format. *.dev files describe the model by referencing geometric model groups (*.phm) and attribute files (*.fam). They support peer-level references but not self-references. The attribute file (*.fam) consists of attribute names and attribute values, and supports the expansion of attributes according to actual needs.
[0004] The assembly model (*.cbm) is described by referencing the attribute file (*.fam) at the current level of the physical model. It supports peer references but does not allow self-references. The project root file is in the project.cbm format. Substation projects include geographic coordinates, elevation coordinates, and references to the full-station assembly model (*.cbm) file, while line projects include references to the full-line assembly model (*.cbm) file. All model files should be stored according to the specified directory structure. Logical models should use fixed file names as unique identifiers, while other model files should use GUIDs as unique identifiers. Standard UTF-8 (excluding BOM) encoding should be used uniformly.
[0005] As power grid projects become increasingly complex, the amount of data generated by GIM models is growing exponentially, posing significant challenges to their storage, transmission, and real-time visualization. Therefore, lightweight processing solutions for substation GIM models are crucial.
[0006] Existing GIM model lightweighting technologies primarily focus on geometric simplification, attribute optimization, and Boolean operation optimization. For example, existing 3D GIM modeling tools for substation primary equipment, developed on the Autodesk Revit platform, and 3D GIM design software for transmission lines, all employ geometric simplification techniques such as triangular facet simplification and parametric model replacement. However, these approaches still have several limitations. First, when dealing with high-precision models, existing methods often struggle to reduce the number of triangular facets while retaining key geometric features, resulting in geometric distortion after simplification and hindering subsequent engineering applications. Second, when dealing with attribute optimization, existing methods struggle to accurately identify semantic similarities when processing complex attribute files, potentially leading to the accidental deletion or omission of attributes, compromising the semantic integrity of the model. Finally, when dealing with Boolean operation optimization, existing methods struggle to fully detect invalid operations when handling complex Boolean operations, potentially leading to incomplete model structures and inefficient data processing. Summary of the Invention
[0007] One of the objectives of the present invention is to provide a lightweight processing method for a substation GIM model with high reliability, good accuracy and high efficiency.
[0008] A second object of the present invention is to provide a system for implementing the lightweight processing method of the substation GIM model.
[0009] The lightweight processing method of the substation GIM model provided by the present invention includes the following steps:
[0010] S1. Obtain the target substation GIM model file;
[0011] S2. Optimize the attribute file based on semantic similarity analysis and attribute value validity detection for the file obtained in step S1;
[0012] S3. According to the file obtained in step S2, the geometric model is optimized based on geometric feature matching and semantic consistency analysis;
[0013] S4. Optimize the triangular face of the non-parametric model based on the edge collapse algorithm and vertex clustering algorithm according to the file obtained in step S3;
[0014] S5. According to the file obtained in step S4, optimization of invisible primitives in the parametric model is performed based on OBB envelope box detection and spatial inclusion relationship analysis;
[0015] S6. Optimize invalid Boolean operations in the parameterized model based on geometric analysis and logical judgment according to the file obtained in step S5;
[0016] S7. Complete lightweight processing of the target substation GIM model.
[0017] Step S2 optimizes the attribute file of the file obtained in step S1 based on semantic similarity analysis and attribute value validity detection, which specifically includes the following steps:
[0018] Parse and preprocess .fam files: Parse the .fam files referenced by the .cbm and .dev files line by line, extract English and Chinese attribute names and values, and present the extracted data in a structured manner. Use a hash table to quickly index attribute names, and employ a natural language processing solution to segment and parse Chinese attribute names. Clean the extracted attribute values to ensure data integrity.
[0019] Identification of semantic similarity: For English attribute names, string matching and edit distance are used to identify English attribute names that are identical or have a similarity higher than a set value. For Chinese attribute names, a word vector model is used to calculate semantic similarity, and Chinese attribute names that are identical or have a similarity higher than a set value are identified based on a set semantic similarity threshold. For English attribute names and Chinese attribute names that are identical or have a similarity higher than a set value, the attribute lines referenced by the .cbm file are retained, and the attribute lines referenced by the .dev file are deleted.
[0020] Optimize the .fam file: directly mark rows with empty or unfilled attribute values as invalid rows; use regular expressions or data type detection to identify rows with attribute value formats that do not meet the set requirements; directly delete the identified attribute rows and attribute rows marked as invalid rows from the .fam file.
[0021] Step S3, based on the file obtained in step S2, optimizes the geometric model based on geometric feature matching and semantic consistency analysis, specifically including the following steps:
[0022] Extraction of model file data: For .stl models, parse the triangular patch data and calculate the corresponding vertex coordinates, normal vectors, and geometric features; for .mod models, parse the primitive structure, transformation matrix, and Boolean operation relationships to generate the corresponding geometric representation; use the spatial index structure to partition the model to accelerate the matching process of geometric features;
[0023] Geometric feature matching and similarity assessment: In the first matching stage, the global geometric features of the .stl model and the .mod model are calculated, and possible matching model pairs are screened according to the set threshold. In the second matching stage, the geometric surfaces of the .stl model and the .mod model are aligned based on the ICP local registration method, and the average distance error between vertices is calculated. The curvature consistency detection method is used to evaluate the matching degree of the .stl model and the .mod model on the set key geometric features. If the average distance error and matching degree both meet the set requirements, the .stl model and the .mod model are considered to be consistent; otherwise, the .stl model and the .mod model are considered to be inconsistent.
[0024] Semantic consistency analysis: parse the primitive structure of the .mod model and the corresponding XML file, extract the semantic information of each, and compare it with the metadata of the .stl model; if the similarity between the semantic inheritance and the metadata is higher than the set value, the semantics are determined to be consistent, otherwise the semantics are determined to be inconsistent;
[0025] Verification of model substitutability: For .stl models and .mod models that are consistent in model and semantics, mark the .stl model as a redundant model, deprecate the redundant model in the model library, and update the corresponding reference relationship.
[0026] Step S4, based on the file obtained in step S3, optimizes the triangular face of the non-parametric model based on the edge collapse algorithm and the vertex clustering algorithm, specifically including the following steps:
[0027] Parsing the .stl file: extracting triangular facet data from the .stl file; the triangular facet data includes vertex coordinates, normal vectors, and triangular facet connectivity; spatially partitioning the triangular facets using a spatial index structure; and identifying high-curvature and low-curvature areas on the model surface using a curvature distribution analysis method; the high-curvature area is an area with a curvature higher than a set value, and the low-curvature area is an area with a curvature lower than a set value.
[0028] Simplify low-curvature areas: traverse all edges of the model and calculate the folding cost of each edge based on the geometric error metric function; select the edge with the smallest folding cost for folding: merge the two vertices of the edge into a new vertex, the position of the new vertex is determined by the geometric error metric function; update the connection relationship of the affected triangles; repeat this step until the geometric error of the model is within the set threshold range and the number of simplified triangles reaches the predetermined target or simplification is no longer possible; complete the simplification of low-curvature areas;
[0029] Simplify high curvature areas: Use a clustering algorithm to divide the model space into several cubic cells, where the size of each cell is determined by the cluster radius; merge the vertices in each cell into a representative vertex, and the position of the representative vertex is determined by the average value of all vertices in the cell, or by a geometric error metric function; after merging, regenerate the triangular facets and ensure the continuity and completeness of the model surface; repeat this step until the key geometric features of the set model are retained and the number of simplified triangular facets reaches the predetermined target or no further simplification is possible; complete the simplification of high curvature areas.
[0030] After each edge collapse or vertex clustering operation, the normal vector change value of the affected triangle facets is detected: if the normal vector change value exceeds the set threshold, the position of the new vertex or representative vertex is adjusted, or the corresponding simplification operation is canceled to ensure the smoothness and visual quality of the model surface.
[0031] Step S5, based on the file obtained in step S4, optimizes the invisible primitives in the parametric model based on OBB envelope detection and spatial inclusion relationship analysis, specifically including the following steps:
[0032] Primitive parsing and data extraction: Parse all primitives in the .mod file and extract the corresponding geometric data and transformation matrix; based on the transformation matrix, transform the primitive from the local coordinate system to the global coordinate system; based on the primitive vertex data, use the principal component analysis method to determine the direction axis of the OBB envelope and calculate the OBB envelope; use the spatial index structure to divide the primitive space;
[0033] Identification of invisible primitives: For each pair of primitives, check whether the corresponding OBB envelope boxes intersect: If they do, use ray intersection test and vertex inclusion test method to determine the inclusion relationship of the primitives; If they do not intersect, detect the spatial distance between the primitives: If the spatial distance is greater than the set threshold, it is determined that there is no spatial inclusion relationship between the two primitives, and the invisible primitives are not marked; If the spatial distance is less than or equal to the set threshold, continue with the remaining steps; The primitives that are determined to be completely contained in other primitives are marked as invisible primitives, marked as objects to be deleted, and the corresponding Entity identifiers of the invisible primitives in the .mod file are recorded;
[0034] Delete the invisible entities and update the Entity part in the .mod file. Parse the tree structure of the XML file, locate and delete the Entity nodes corresponding to the deleted invisible entities, and adjust the reference relationship between the parent node and sibling nodes of the deleted invisible entities to ensure the grammatical and semantic integrity of the XML file.
[0035] Step S6, based on the file obtained in step S5, optimizes invalid Boolean operations in the parameterized model based on geometric analysis and logical judgment, specifically including the following steps:
[0036] Identification of invalid Boolean operations: For Boolean intersection operations, a spatial index structure is used to detect whether the bounding boxes between primitives intersect, and the actual intersection area is calculated through geometric detection methods: if the intersection area is empty, the Boolean intersection operation is invalid; for Boolean cut operations, a geometric containment test is used to determine whether all cut primitives are located outside the target primitive: if all cut primitives are located outside the target primitive, the Boolean cut operation is invalid; for Boolean union operations, a geometric containment test is used to determine whether all union primitives are contained within the target primitive: if all union primitives are contained within the target primitive, the Boolean union operation is invalid;
[0037] The calculation of the actual intersection area by the geometric detection method specifically includes the following steps:
[0038] Divide the geometric space of the two primitives involved in the Boolean intersection operation into uniform grid cells;
[0039] Check whether each grid cell is occupied by two primitives at the same time: for grid cells occupied by two primitives at the same time, calculate the intersection of the grid cell and the two primitives, and merge all the intersections to obtain the final actual intersection area;
[0040] The geometric inclusion test is used to determine whether all the union primitives are contained within the target primitive, specifically including the following steps:
[0041] For Boolean shear and Boolean union operations, select a reference point and project several rays from the reference point in different directions to detect the intersections between the rays and the primitives. For Boolean shear, if the intersections of all projected rays and the shear primitives are outside the target primitive, then the shear primitives are considered to be outside the target primitive. For Boolean union, if the intersections of all projected rays and the union primitives are inside the target primitive, then the union primitives are considered to be completely contained within the target primitive.
[0042] For invalid Boolean operations, parse the XML structure of the .mod file, determine the Entity nodes related to the invalid Boolean operations and delete them, and adjust the reference relationship between the corresponding parent nodes and sibling nodes to ensure the grammatical and semantic integrity of the XML file; for invalid Boolean intersection operations, determine that the entities involved in the invalid Boolean intersection operation are not referenced by other Boolean operations, and delete the entities involved in the operation; for invalid Boolean cut operations, determine that the cut entities are not referenced by other Boolean operations, delete the cut entities, and retain the target entities; for invalid Boolean union operations, determine that the union entities are not referenced by other Boolean operations, delete the union entities, and retain the target entities.
[0043] The present invention also provides a system for implementing the lightweight processing method of the substation GIM model, comprising a model acquisition module, a file optimization module, a model optimization module, a triangle surface optimization module, a graphic element optimization module, an operation optimization module and a lightweight processing module; the model acquisition module, the file optimization module, the model optimization module, the triangle surface optimization module, the graphic element optimization module, the operation optimization module and the lightweight processing module are connected in series in sequence; the model acquisition module is used to acquire the file of the target substation GIM model and upload the data information to the file optimization module; the file optimization module is used to optimize the attribute file of the acquired file based on semantic similarity analysis and attribute value validity detection according to the received data information, and upload the data information to the model optimization module; the model optimization module is used to optimize the attribute file based on the received data information and the obtained file based on geometric feature matching and semantic consistency analysis The geometric model is optimized based on the received data information and the obtained files, and the data information is uploaded to the triangular surface optimization module; the triangular surface optimization module is used to optimize the triangular surfaces of the non-parametric model based on the edge collapse algorithm and the vertex clustering algorithm according to the received data information and the obtained files, and upload the data information to the primitive optimization module; the primitive optimization module is used to optimize the invisible primitives in the parametric model based on the received data information and the obtained files, based on the OBB envelope box detection and spatial inclusion relationship analysis, and upload the data information to the operation optimization module; the operation optimization module is used to optimize the invalid Boolean operations in the parametric model based on the received data information and the obtained files, based on geometric analysis and logical judgment, and upload the data information to the lightweight processing module; the lightweight processing module is used to complete the lightweight processing of the target substation GIM model based on the received data information.
[0044] The lightweight processing method and system for the substation GIM model provided by the present invention not only achieves lightweight processing of the substation GIM model but also has higher reliability, better accuracy and higher efficiency by optimizing attribute files, geometric models, non-parametric model triangular faces, invisible primitives in parametric models and invalid Boolean operations. Description of the Drawings
[0045] Figure 1 This is a schematic diagram of the method flow of the method of the present invention.
[0046] Figure 2 This is a schematic diagram of the functional modules of the system of the present invention. Detailed Embodiments
[0047] As Figure 1 shown, this is a schematic diagram of the method flow of the method of the present invention: The method for lightweight processing of the substation GIM model disclosed in the present invention includes the following steps:
[0048] S1. Obtain the file of the target substation GIM model;
[0049] S2. Optimize the attribute file for the file obtained in step S1 based on semantic similarity analysis and attribute value validity detection; specifically, it includes the following steps:
[0050] Parse and preprocess the.fam file: The attribute format of the.fam file is "English attribute name = Chinese attribute name = attribute value". Therefore, parse the.fam file referenced by the.cbm file and the.dev file line by line, extract the English attribute name, Chinese attribute name, and attribute value, and represent the extracted data information in a structured manner; use a hash table for fast indexing of the attribute name, and at the same time use a natural language processing scheme to perform word segmentation and semantic parsing on the Chinese attribute name; perform data cleaning on the extracted attribute value (including handling null values, duplicate values, and format exception values, etc.) to ensure the completeness of the data;
[0051] Recognition of semantic similarity: For English attribute names, use string matching and edit distance to identify English attribute names that are the same or have a similarity higher than the set value; for Chinese attribute names, use a word vector model (such as Word2Vec or BERT) to calculate semantic similarity, and identify Chinese attribute names that are the same or have a similarity higher than the set value according to the set semantic similarity threshold; for example, "Voltage = Voltage = 220V" and "VoltageLevel = Voltage level = 220V" may be determined as semantically similar attributes; for the identified English attribute names and Chinese attribute names that are the same or have a similarity higher than the set value, retain the attribute lines referenced by the.cbm file and delete the attribute lines referenced by the.dev file;
[0052] Optimize the .fam file: Mark rows with empty or unfilled attribute values as invalid. Use regular expressions or data type detection to identify rows with attribute values that do not meet set requirements (such as non-numeric attribute values containing letters or special characters). Delete identified attribute rows and those marked as invalid from the .fam file.
[0053] S3. According to the file obtained in step S2, the geometric model is optimized based on geometric feature matching and semantic consistency analysis; specifically comprising the following steps:
[0054] The geometric model should be in .mod or .stl file type. .mod is a model file constructed by parameters or multiple basic primitives and stored in a parametric manner; .stl is a model file constructed in a non-parametric manner.
[0055] .stl models use triangle meshes to represent geometric shapes, and describe the model surface through a large number of vertices and facet data. This non-parametric representation method cannot utilize the parametric features of geometric objects (such as symmetry, regularity, etc.), resulting in data redundancy. For example, a simple cylinder may only need to store a small number of parameters such as radius and height in a .mod model, but in a .stl model, it needs to store thousands or even tens of thousands of triangle facet data, which significantly increases the file size. Since the .stl model is based on triangle faces, its file size is proportional to the geometric complexity of the model. For high-precision models, the number of triangle faces may reach millions or even hundreds of millions, resulting in a huge .stl file size. For example, a complex design The size of the prepared .stl file may reach hundreds of MB or even GB, far exceeding the size of the parametric model (.mod file). The large file size not only increases storage costs but also significantly reduces the efficiency of data transmission and loading. The loading process of the .stl file involves reading and parsing a large amount of data. Since .stl files are usually stored in ASCII or binary format, reading requires parsing vertex coordinates and patch information line by line or block by block, which is a time-consuming process. In addition, the .stl file lacks a hierarchical structure and spatial index. After loading, additional computing resources are required to build spatial data structures (such as BVH or octree) to support subsequent rendering and interactive operations, further reducing loading efficiency.
[0056] Therefore, when building geometric models, *.mod files should be used whenever possible;
[0057] Extracting model file data: For .stl models, parse the triangular patch data and calculate the corresponding vertex coordinates, normal vectors, and geometric features (such as curvature distribution, edge features, etc.); for .mod models, parse the primitive structure, transformation matrix, and Boolean operation relationships to generate the corresponding geometric representation; use spatial index structures (such as octrees or BVH hierarchical bounding box trees) to spatially partition the model to accelerate the matching process of geometric features;
[0058] Geometric feature matching and similarity assessment: In the first matching stage, the global geometric features of the .stl model and the .mod model (such as bounding box size, volume, surface area, etc.) are calculated, and possible matching model pairs are screened according to the set threshold. In the second matching stage, the geometric surfaces of the .stl model and the .mod model are aligned based on the ICP local registration method, and the average distance error between vertices is calculated. The curvature consistency detection method is used to evaluate the matching degree of the .stl model and the .mod model on the set key geometric features. If the average distance error and matching degree both meet the set requirements, the .stl model and the .mod model are considered to be consistent; otherwise, the .stl model and the .mod model are considered to be inconsistent.
[0059] Semantic consistency analysis: parse the primitive structure of the .mod model and the corresponding XML file, extract the semantic information (such as object type, functional attributes, etc.), and compare it with the metadata of the .stl model; if the similarity between the semantic inheritance and the metadata is higher than the set value, the semantics are determined to be consistent, otherwise the semantics are determined to be inconsistent;
[0060] Verification of model substitutability: For .stl models and .mod models that are consistent in both model and semantics, mark the .stl model as redundant, deprecate the redundant model in the model library, and update the corresponding reference relationship;
[0061] S4. Based on the file obtained in step S3, the non-parametric model triangle surface is optimized based on the edge collapse algorithm and the vertex clustering algorithm; specifically, the steps include:
[0062] Parsing the .stl file: extracting triangular facet data from the .stl file; the triangular facet data includes vertex coordinates, normal vectors, and triangular facet connectivity; spatially partitioning the triangular facets using a spatial index structure (such as an octree or a BVH hierarchical bounding box tree); using a curvature distribution analysis method to identify high-curvature areas (such as edges, corners, etc.) and low-curvature areas (such as planes, smooth surfaces, etc.) on the model surface; the high-curvature areas are areas where the curvature is higher than a set value, and the low-curvature areas are areas where the curvature is lower than a set value;
[0063] Simplify low-curvature areas (reducing the number of facets by merging adjacent vertices): traverse all edges of the model and calculate the folding cost of each edge based on a geometric error metric function (such as a quadratic error metric, which quantifies the impact of edge folding on the model's geometry). Select the edge with the smallest folding cost for folding: Merge the two vertices of the edge into a new vertex, whose position is determined by the geometric error metric function to minimize the geometric deviation between the simplified model and the original model; Update the connectivity of the affected triangles; Repeat this step until the geometric error of the model is within a set threshold range and the number of simplified triangles reaches a predetermined target, or simplification is no longer possible. Simplification of low-curvature areas is completed. The "set threshold range" refers to the maximum allowable range of model geometric error predetermined based on actual needs, ensuring that the simplified model maintains consistency with the original model in terms of visual and geometric accuracy. The "predetermined target" can be the model complexity requirement based on the application scenario, such as reducing the number of triangles to a certain proportion of the original number. "No further simplification" means that under the current simplification strategy and parameter settings, further simplification will cause significant geometric distortion or fail to meet other constraints.
[0064] Simplify high curvature areas (by merging vertices with similar spatial positions into a representative vertex, thereby reducing the number of facets and retaining key geometric features): Use a clustering algorithm to divide the model space into several cubic cells, where the size of each cell is determined by the cluster radius; merge the vertices in each cell into a representative vertex, and the position of the representative vertex is determined by the average value of all vertices in the cell or by a geometric error metric function; after merging, regenerate the triangular facets and ensure the continuity and completeness of the model surface; repeat this step until the key geometric features of the model are retained and the number of simplified triangular facets reaches the predetermined target or simplification is no longer possible; the simplification of high curvature areas is completed; where "key geometric features" refers to geometric parts of the model that are important for subsequent applications (such as engineering analysis, visualization, etc.), such as edges and corners; "predetermined target" can be the model complexity requirements based on the application scenario, such as reducing the number of triangular facets to a certain proportion of the original number; "no further simplification" means that under the current simplification strategy and parameter settings, further simplification will cause the model to have obvious geometric distortion or fail to meet other constraints;
[0065] At the same time, to improve reliability, normal vector consistency detection is introduced to avoid sudden changes in model surface normal vectors caused by simplification operations: after each edge collapse or vertex clustering operation, the normal vector change value of the affected triangle facets is detected. If the normal vector change value exceeds the set threshold, the position of the new vertex or representative vertex is adjusted, or the corresponding simplification operation is canceled to ensure the smoothness and visual quality of the model surface.
[0066] S5. Based on the file obtained in step S4, optimization of invisible primitives in the parametric model is performed based on OBB envelope box detection and spatial inclusion relationship analysis; specifically, the steps include:
[0067] Primitive parsing and data extraction: Parse all primitives in the .mod file and extract the corresponding geometric data and transformation matrix. Based on the transformation matrix, transform the primitive from the local coordinate system to the global coordinate system. Based on the vertex data of the primitive, use principal component analysis to determine the direction axis of the OBB envelope (to more accurately describe the spatial distribution of the primitive) and calculate the OBB envelope. Use a spatial index structure (such as the BVH hierarchical bounding box tree) to partition the primitive space.
[0068] Identification of invisible primitives: For each pair of primitives, check whether the corresponding OBB envelope boxes intersect: If they do intersect, use ray intersection test and vertex inclusion test method to determine the inclusion relationship of the primitives; If they do not intersect, check the spatial distance between the primitives: If the spatial distance is greater than the set threshold, it is determined that there is no spatial inclusion relationship between the two primitives, and the invisible primitives are not marked; If the spatial distance is less than or equal to the set threshold, continue with the remaining steps; (The "set threshold" here is predetermined based on factors such as the size of the primitives and the application scenario, and is used to determine whether there is a potential spatial interaction relationship between the primitives; for example, in some complex substation models, even if the OBB envelope boxes of two primitives do not intersect, if they are very close in space, the mutual influence between them may still need to be considered, such as electromagnetic interference.) The primitives that are determined to be completely contained in other primitives are marked as invisible primitives, marked as objects to be deleted, and the corresponding Entity identifiers of the invisible primitives in the .mod file are recorded;
[0069] Delete the invisible elements and update the Entity part in the .mod file. Parse the tree structure of the XML file, locate and delete the Entity nodes corresponding to the deleted invisible elements, and adjust the reference relationship between the parent node and sibling nodes of the deleted invisible elements to ensure the syntactic and semantic integrity of the XML file.
[0070] S6. Based on the file obtained in step S5, optimize the invalid Boolean operations in the parameterized model based on geometric analysis and logical judgment; specifically, the steps include:
[0071] Invalid Boolean operations mainly include cases where Boolean intersection is empty, Boolean cut has no effect, and Boolean union has no added geometry. These operations not only increase the complexity of the model but may also cause performance issues during data processing and rendering. Therefore, removing invalid Boolean operations is an effective way to lightweight the model.
[0072] Identification of invalid Boolean operations: For Boolean intersection operations, a spatial index structure (such as an AABB hierarchical bounding box tree) is used to detect whether the bounding boxes between primitives intersect, and the actual intersection area is calculated through a geometric detection method: if the intersection area is empty, the Boolean intersection operation is invalid; for Boolean clipping operations, a geometric containment test is used to determine whether all clipping primitives are outside the target primitive: if all clipping primitives are outside the target primitive, the Boolean clipping operation is invalid; for Boolean union operations, a geometric containment test is used to determine whether all union primitives are contained within the target primitive: if all union primitives are contained within the target primitive, the Boolean union operation is invalid;
[0073] The calculation of the actual intersection area by the geometric detection method specifically includes the following steps:
[0074] Divide the geometric space of the two primitives involved in the Boolean intersection operation into uniform grid cells;
[0075] Check whether each grid cell is occupied by two primitives at the same time: for grid cells occupied by two primitives at the same time, calculate the intersection of the grid cell and the two primitives, and merge all the intersections to obtain the final actual intersection area;
[0076] This method can accurately calculate the intersection area under complex geometric shapes and provide a reliable basis for judging the validity of Boolean intersection operations;
[0077] The geometric inclusion test is used to determine whether all the union primitives are contained within the target primitive, specifically including the following steps:
[0078] For Boolean shear and Boolean union operations, select a reference point and project several rays from the reference point in different directions to detect the intersections between the rays and the primitives. For Boolean shear, if the intersections of all projected rays and the shear primitives are outside the target primitive, then the shear primitives are considered to be outside the target primitive. For Boolean union, if the intersections of all projected rays and the union primitives are inside the target primitive, then the union primitives are considered to be completely contained within the target primitive.
[0079] This method can effectively determine the spatial inclusion relationship between primitives, thereby accurately identifying invalid Boolean operations;
[0080] For invalid Boolean operations, parse the XML structure of the .mod file, determine the Entity nodes related to the invalid Boolean operations and delete them, and adjust the reference relationship between the corresponding parent nodes and sibling nodes to ensure the grammatical and semantic integrity of the XML file; for invalid Boolean intersection operations, determine that the entities involved in the invalid Boolean intersection operation are not referenced by other Boolean operations, and delete the entities involved in the operation; for invalid Boolean cut operations, determine that the cut entities are not referenced by other Boolean operations, delete the cut entities, and retain the target entities; for invalid Boolean union operations, determine that the union entities are not referenced by other Boolean operations, delete the union entities, and retain the target entities;
[0081] S7. Complete lightweight processing of the target substation GIM model.
[0082] Compared with the existing technology, the solution of the present invention first significantly reduces the data size of the model, reduces storage costs and transmission time through technical means such as geometric simplification, attribute optimization and deletion of invalid Boolean operations. In particular, the loading speed and interactive performance of the model are significantly improved in mobile terminals and remote collaboration scenarios; secondly, the present invention ensures the retention of key geometric features through geometric feature matching and curvature consistency detection during the simplification process, avoids model distortion, and improves the geometric accuracy and visualization effect of the model.
[0083] In addition, the present invention intelligently identifies and deletes redundant attributes through multi-level semantic similarity analysis and attribute value validity detection, ensuring the accuracy and consistency of attribute files, avoiding the loss of semantic information, and providing reliable data support for subsequent engineering analysis and decision-making; at the same time, the present invention simplifies the model structure and improves data processing and rendering efficiency by deleting invalid Boolean operations and invisible graphics elements, especially in large-scale power grid engineering applications, and can better support real-time visualization and collaborative work.
[0084] like Figure 2The above is a schematic diagram of the functional modules of the system of the present invention: the system disclosed in the present invention for realizing the lightweight processing method of the substation GIM model comprises a model acquisition module, a file optimization module, a model optimization module, a triangle surface optimization module, a primitive optimization module, an operation optimization module and a lightweight processing module; the model acquisition module, the file optimization module, the model optimization module, the triangle surface optimization module, the primitive optimization module, the operation optimization module and the lightweight processing module are connected in series in sequence; the model acquisition module is used to acquire the file of the target substation GIM model and upload the data information to the file optimization module; the file optimization module is used to optimize the attribute file of the acquired file based on semantic similarity analysis and attribute value validity detection according to the received data information, and upload the data information to the model optimization module; the model optimization module is used to optimize the attribute file of the acquired file based on geometric feature matching according to the received data information and the obtained file Combined with semantic consistency analysis, the geometric model is optimized and the data information is uploaded to the triangle surface optimization module; the triangle surface optimization module is used to optimize the non-parametric model triangle surface based on the received data information and the obtained file, based on the edge collapse algorithm and the vertex clustering algorithm, and upload the data information to the primitive optimization module; the primitive optimization module is used to optimize the invisible primitives in the parametric model based on the received data information and the obtained file, based on the OBB envelope box detection and spatial inclusion relationship analysis, and upload the data information to the operation optimization module; the operation optimization module is used to optimize the invalid Boolean operations in the parametric model based on the received data information and the obtained file, based on geometric analysis and logical judgment, and upload the data information to the lightweight processing module; the lightweight processing module is used to complete the lightweight processing of the target substation GIM model according to the received data information.
Claims
1. A lightweight processing method for a substation GIM model, comprising the following steps: S1. Obtain the target substation GIM model file; S2. Optimize the attribute file based on semantic similarity analysis and attribute value validity detection of the file obtained in step S1; S3. According to the file obtained in step S2, the geometric model is optimized based on geometric feature matching and semantic consistency analysis; S4. Based on the file obtained in step S3, optimize the triangular face of the non-parametric model using an edge collapse algorithm and a vertex clustering algorithm. Specifically, the steps include: Parsing the .stl file: extracting triangular facet data from the .stl file; the triangular facet data includes vertex coordinates, normal vectors, and triangular facet connectivity; spatially partitioning the triangular facets using a spatial index structure; and identifying high-curvature and low-curvature areas on the model surface using a curvature distribution analysis method; the high-curvature area is an area with a curvature higher than a set value, and the low-curvature area is an area with a curvature lower than a set value. Simplify low curvature areas: traverse all edges of the model and calculate the folding cost of each edge based on the geometric error metric function; Select the edge with the lowest folding cost for folding: merge the two vertices of the edge into a new vertex, the position of the new vertex is determined by the geometric error metric function; update the connection relationship of the affected triangles; Repeat this step until the geometric error of the model is within the set threshold and the number of simplified triangles reaches the predetermined target or further simplification is impossible. Complete simplification of low curvature areas; Simplify high-curvature areas: Use a clustering algorithm to divide the model space into several cubic cells, where the size of each cell is determined by the cluster radius. Merge the vertices within each cell into a representative vertex, whose position is determined by the average value of all vertices within the cell or by a geometric error metric function. After merging, regenerate the triangular facets, ensuring the continuity and completeness of the model surface. Repeat this step until the key geometric features of the set model are retained and the number of simplified triangles reaches the predetermined target or further simplification is impossible; the simplification of high curvature areas is completed; S5. According to the file obtained in step S4, optimization of invisible primitives in the parametric model is performed based on OBB envelope box detection and spatial inclusion relationship analysis; S6. Based on the file obtained in step S5, optimization of invalid Boolean operations in the parametric model is performed based on geometric analysis and logical judgment; specifically comprising the following steps: Identification of invalid Boolean operations: For Boolean intersection operations, a spatial index structure is used to detect whether the bounding boxes between primitives intersect, and the actual intersection area is calculated through geometric detection methods: if the intersection area is empty, the Boolean intersection operation is invalid; for Boolean cut operations, a geometric containment test is used to determine whether all cut primitives are located outside the target primitive: if all cut primitives are located outside the target primitive, the Boolean cut operation is invalid; for Boolean union operations, a geometric containment test is used to determine whether all union primitives are contained within the target primitive: if all union primitives are contained within the target primitive, the Boolean union operation is invalid; S7. Complete lightweight processing of the target substation GIM model.
2. The lightweight processing method of the substation GIM model according to claim 1 is characterized in that Step S2 optimizes the attribute file of the file obtained in step S1 based on semantic similarity analysis and attribute value validity detection, which specifically includes the following steps: Parse and preprocess .fam files: Parse the .fam files referenced by the .cbm and .dev files line by line, extract English and Chinese attribute names and values, and present the extracted data in a structured manner. Use a hash table to quickly index attribute names, and employ a natural language processing solution to segment and parse Chinese attribute names. Clean the extracted attribute values to ensure data integrity. Identification of semantic similarity: For English attribute names, string matching and edit distance are used to identify English attribute names that are identical or have a similarity higher than a set value. For Chinese attribute names, a word vector model is used to calculate semantic similarity, and Chinese attribute names that are identical or have a similarity higher than a set value are identified based on a set semantic similarity threshold. For English attribute names and Chinese attribute names that are identical or have a similarity higher than a set value, the attribute lines referenced by the .cbm file are retained, and the attribute lines referenced by the .dev file are deleted. Optimize .fam files: directly mark rows with empty or unfilled attribute values as invalid rows; use regular expressions or data type detection to identify rows whose attribute value formats do not meet the set requirements; The identified attribute rows and the attribute rows marked as invalid rows are directly deleted from the .fam file.
3. The lightweight processing method of the substation GIM model according to claim 2 is characterized in that Step S3, based on the file obtained in step S2, optimizes the geometric model based on geometric feature matching and semantic consistency analysis, specifically including the following steps: Extraction of model file data: For .stl models, parse the triangular face data and calculate the corresponding vertex coordinates, normal vectors and geometric features; For the .mod model, analyze the primitive structure, transformation matrix and Boolean operation relationship to generate the corresponding geometric representation; Use spatial index structure to partition the model into spaces to speed up the matching process of geometric features; Geometric feature matching and similarity assessment: In the first matching stage, the global geometric features of the .stl model and the .mod model are calculated, and possible matching model pairs are screened according to the set threshold. In the second matching stage, the geometric surfaces of the .stl model and the .mod model are aligned based on the ICP local registration method, and the average distance error between vertices is calculated. The curvature consistency detection method is used to evaluate the matching degree of the .stl model and the .mod model on the set key geometric features. If the average distance error and matching degree both meet the set requirements, the .stl model and the .mod model are considered to be consistent; otherwise, the .stl model and the .mod model are considered to be inconsistent. Semantic consistency analysis: parse the primitive structure of the .mod model and the corresponding XML file, extract the semantic information of each, and compare it with the metadata of the .stl model; if the similarity between the semantic inheritance and the metadata is higher than the set value, the semantics are determined to be consistent, otherwise the semantics are determined to be inconsistent; Verification of model substitutability: For .stl models and .mod models that are consistent in model and semantics, mark the .stl model as a redundant model, deprecate the redundant model in the model library, and update the corresponding reference relationship.
4. The lightweight processing method of the substation GIM model according to claim 3 is characterized in that After each edge collapse or vertex clustering operation, the normal vector change value of the affected triangle facets is detected: if the normal vector change value exceeds the set threshold, the position of the new vertex or representative vertex is adjusted, or the corresponding simplification operation is canceled to ensure the smoothness and visual quality of the model surface.
5. The lightweight processing method of the substation GIM model according to claim 4 is characterized in that Step S5, based on the file obtained in step S4, optimizes the invisible primitives in the parametric model based on OBB envelope detection and spatial inclusion relationship analysis, specifically including the following steps: Primitive parsing and data extraction: Parse all primitives in the .mod file and extract the corresponding geometric data and transformation matrix. Based on the transformation matrix, transform the primitive from the local coordinate system to the global coordinate system. Based on the vertex data of the primitive, use the principal component analysis method to determine the direction axis of the OBB envelope and calculate the OBB envelope. Use spatial index structure to divide the primitive space; Identification of invisible primitives: For each pair of primitives, check whether the corresponding OBB envelope boxes intersect: If they do, use ray intersection test and vertex inclusion test method to determine the inclusion relationship of the primitives; If they do not intersect, detect the spatial distance between the primitives: If the spatial distance is greater than the set threshold, it is determined that there is no spatial inclusion relationship between the two primitives, and the invisible primitives are not marked; If the spatial distance is less than or equal to the set threshold, continue with the remaining steps; The primitives that are determined to be completely contained in other primitives are marked as invisible primitives, marked as objects to be deleted, and the corresponding Entity identifiers of the invisible primitives in the .mod file are recorded; Delete the invisible entities and update the Entity part in the .mod file. Parse the tree structure of the XML file, locate and delete the Entity nodes corresponding to the deleted invisible entities, and adjust the reference relationship between the parent node and sibling nodes of the deleted invisible entities to ensure the grammatical and semantic integrity of the XML file.
6. The lightweight processing method of the substation GIM model according to claim 5 is characterized in that Step S6, based on the file obtained in step S5, optimizes invalid Boolean operations in the parameterized model based on geometric analysis and logical judgment, and specifically includes the following steps: The calculation of the actual intersection area by the geometric detection method specifically includes the following steps: Divide the geometric space of the two primitives involved in the Boolean intersection operation into uniform grid cells; Check whether each grid cell is occupied by two primitives at the same time: for grid cells occupied by two primitives at the same time, calculate the intersection of the grid cell and the two primitives, and merge all the intersections to obtain the final actual intersection area; The geometric inclusion test is used to determine whether all the union primitives are contained within the target primitive, specifically including the following steps: For Boolean shear and Boolean union operations, select a reference point and project several rays from the reference point in different directions to detect the intersections between the rays and the primitives. For Boolean shear, if the intersections of all projected rays and the shear primitives are outside the target primitive, then the shear primitives are considered to be outside the target primitive. For Boolean union, if the intersections of all projected rays and the union primitives are inside the target primitive, then the union primitives are considered to be completely contained within the target primitive. For invalid Boolean operations, parse the XML structure of the .mod file, determine the Entity nodes related to the invalid Boolean operations and delete them, and adjust the reference relationship between the corresponding parent nodes and sibling nodes to ensure the grammatical and semantic integrity of the XML file; for invalid Boolean intersection operations, determine that the entities involved in the invalid Boolean intersection operation are not referenced by other Boolean operations, and delete the entities involved in the operation; for invalid Boolean cut operations, determine that the cut entities are not referenced by other Boolean operations, delete the cut entities, and retain the target entities; for invalid Boolean union operations, determine that the union entities are not referenced by other Boolean operations, delete the union entities, and retain the target entities.
7. A system for implementing the lightweight processing method of the substation GIM model according to any one of claims 1 to 6, characterized in that It includes a model acquisition module, a file optimization module, a model optimization module, a triangular surface optimization module, a primitive optimization module, an operation optimization module and a lightweight processing module; the model acquisition module, the file optimization module, the model optimization module, the triangular surface optimization module, the primitive optimization module, the operation optimization module and the lightweight processing module are connected in series in sequence; the model acquisition module is used to obtain the file of the target substation GIM model and upload the data information to the file optimization module; The file optimization module is used to optimize the attribute files of the acquired files based on the received data information, based on semantic similarity analysis and attribute value validity detection, and upload the data information to the model optimization module; The model optimization module is used to optimize the geometric model based on the received data information and the obtained files, based on geometric feature matching and semantic consistency analysis, and upload the data information to the triangle surface optimization module; The triangle surface optimization module is used to optimize the triangle surface of the non-parametric model based on the received data information and the obtained file, based on the edge collapse algorithm and the vertex clustering algorithm, and upload the data information to the primitive optimization module; The primitive optimization module is used to optimize the invisible primitives in the parametric model based on the received data information and the obtained files, based on OBB envelope box detection and spatial inclusion relationship analysis, and upload the data information to the calculation optimization module; The operation optimization module is used to optimize invalid Boolean operations in the parametric model based on the received data information and the obtained files, based on geometric analysis and logical judgment, and upload the data information to the lightweight processing module; The lightweight processing module is used to complete the lightweight processing of the target substation GIM model based on the received data information.
Citation Information
Patent Citations
Digital twinning-oriented scene lightweight method
CN113888716A
BIM rapid lightweight method
CN118799529A