Lightweight processing method and system of transformer substation GIM model
Through multi-level semantic similarity analysis and geometric feature matching and other technical means, the attribute files and geometric models of the substation GIM model are optimized, and the geometric distortion problem after the simplification of the model in the existing technology is solved. By deleting invalid Boolean operations and invisible primitives, the processing efficiency and accuracy of the model are improved.
Patent Information
- Application Number
- CN202510198798.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-05-09
- 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 geometric distortion after the model is simplified; in terms of attribute optimization and Boolean operation optimization, it is difficult to accurately identify semantic similarity and invalid operations, which affects the semantic integrity and data processing efficiency of the model.
Optimize attribute files through semantic similarity analysis and attribute value validity detection; optimize geometric model based on geometric feature matching and semantic consistency analysis; optimize non-parametric model triangle faces using edge folding algorithm and vertex clustering algorithm; optimize invisible primitives in the parametric model through OBB envelope box detection and spatial inclusion relationship analysis; optimize invalid Boolean operations based on geometric analysis and logic.
It realizes efficient and lightweight processing of the substation GIM model, ensures the retention of key geometric features, and improves the geometric accuracy and visualization of the model; by intelligently identifying and deleting redundant attributes and invalid Boolean operations, the model structure is simplified and data processing and rendering efficiency is improved.
Smart Images

Figure CN119962056A_ABST
Abstract
Description
Technical Field
[0001] The 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 the stable and reliable supply of electricity has become one of the most important tasks of the power system.
[0003] In the power industry, GIM (Grid Information Model) is an extension of BIM (Building Information Model) and is widely used in the 3D design and digital handover of power grid projects such as substations. The format of the 3D design model file (GIM model) of the substation project is *.gim, which adopts a hierarchical management structure and includes geometric models (*.mod, *.stl), geometric model groups (*.phm), physical models (*.dev), assembly models (*.cbm), and attribute information (*.fam). The geometric model is divided into parametric *.mod files and non-parametric *.stl files. The *.mod files are stored in a parametric way, while the *.stl files use triangular patches to represent geometric shapes. The geometric model group (*.phm) describes the model by referencing one or more *.mod or *.stl files, supporting peer references but not self-references. The physical model is stored in the *.dev file format, where the *.dev file describes the model by referencing the geometric model group (*.phm) and attribute files (*.fam), supporting peer 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) of 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, where the substation project includes geographic coordinates, elevation coordinates, and references to the full-station assembly model (*.cbm) file, and the line project includes references to the full-line assembly model (*.cbm) file. All model files should be stored according to the specified directory structure. The logical model uses a fixed file name as a unique identifier, and the remaining model files should use GUID as a unique identifier, and uniformly use standard UTF-8 (excluding BOM) encoding.
[0005] At present, with the increasing complexity of power grid projects, the amount of data in the GIM model is growing exponentially, which brings huge challenges to the storage, transmission and real-time visualization of the model. Therefore, a lightweight processing solution for the substation GIM model is of great significance.
[0006] Existing GIM model lightweight technologies mainly focus on geometric simplification, attribute optimization, and Boolean operation optimization. For example, the existing GIM modeling tools for substation primary equipment developed based on the Autodesk Revit platform and the GIM 3D design software for power transmission lines on the market today all use geometric simplification technologies such as triangular face simplification and parametric model replacement. However, such solutions still have some limitations. First, in terms of geometric simplification, when dealing with high-precision models, existing methods often find it difficult to reduce the number of triangular facets while retaining key geometric features, resulting in geometric distortion of the model after simplification, affecting subsequent engineering applications. Second, in terms of attribute optimization, when dealing with complex attribute files, existing methods find it difficult to accurately identify semantic similarities, which may lead to the accidental deletion or omission of attributes, affecting the semantic integrity of the model. Finally, in terms of Boolean operation optimization, when dealing with complex Boolean operations, existing methods find it difficult to fully detect invalid operations, which may lead to incomplete model structure or low data processing efficiency. Summary of the invention
[0007] One of the purposes 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 objective 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 comprises the following steps:
[0010] S1. Obtain the file of the GIM model of the target substation;
[0011] S2. Optimize the attribute file of the file obtained in step S1 based on semantic similarity analysis and attribute value validity detection;
[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. According to the file obtained in step S3, the non-parametric model triangular surface is optimized based on the edge collapse algorithm and the vertex clustering algorithm;
[0014] S5. According to the file obtained in step S4, based on OBB envelope box detection and spatial inclusion relationship analysis, optimize the invisible primitives in the parametric model;
[0015] S6. According to the file obtained in step S5, based on geometric analysis and logical judgment, optimize the invalid Boolean operations in the parameterized model;
[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, and specifically includes the following steps:
[0018] Parse and preprocess the .fam file: 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 perform a structured representation of the extracted data information; use a hash table to quickly index the attribute name, and use a natural language processing solution to perform word segmentation and semantic analysis on the Chinese attribute name; perform data cleaning on the extracted attribute values to ensure data completeness;
[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 the rows with empty or unfilled attribute values as invalid rows; use regular expressions or data type detection to identify the rows whose attribute value formats do not meet the set requirements; directly delete the identified attribute rows and the attribute rows marked as invalid rows from the .fam file.
[0021] According to the file obtained in step S2, step S3 optimizes the geometric model based on geometric feature matching and semantic consistency analysis, which specifically includes the following steps:
[0022] Extraction of model file data: for .stl models, parse the triangular patch data, calculate the corresponding vertex coordinates, normal vectors and geometric features; for .mod models, parse the primitive structure, transformation matrix and Boolean operation relationship to generate the corresponding geometric representation; use the spatial index structure to divide the model into spaces to speed up the matching process of geometric features;
[0023] Geometric feature matching and similarity evaluation: In the first matching stage, the global geometric features of the .stl model and the .mod model are calculated, and the 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 the 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 the matching degree both meet the set requirements, the .stl model and the .mod model are judged to be consistent, otherwise the .stl model and the .mod model are judged to be inconsistent;
[0024] Semantic consistency analysis: parse the graphic element structure of the .mod model and the corresponding XML file, extract the semantic information of a, 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, abandon the redundant model in the model library, and update the corresponding reference relationship.
[0026] According to the file obtained in step S3, the optimization of the triangular surface of the non-parametric model is performed based on the edge collapse algorithm and the vertex clustering algorithm, which specifically includes the following steps:
[0027] Parse the .stl file: extract the triangular patch data of the .stl file; the triangular patch data includes vertex coordinates, normal vectors and triangular patch connection relationships; use a spatial index structure to spatially divide the triangular patch; use a curvature distribution analysis method to identify high curvature areas and low curvature areas on the model surface; 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 the low curvature area: traverse all the 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 cannot be simplified further; complete the simplification of the low curvature area;
[0029] Simplify the high curvature area: Use a clustering algorithm to divide the model space into several cubic cells, and the size of each cell is determined by the clustering 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 cannot be further simplified; complete the simplification of the high curvature area.
[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] According to the file obtained in step S4, the optimization of invisible primitives in the parametric model is performed based on OBB envelope box detection and spatial inclusion relationship analysis, which specifically includes the following steps:
[0032] Primitive parsing and data extraction: parse all primitives in the .mod file, 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 box, and calculate the OBB envelope box; 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 intersect, use ray intersection test and vertex inclusion detection 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, and the invisible primitives are 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 graphics 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 graphics, and adjust the reference relationship between the parent node and sibling nodes of the deleted invisible graphics to ensure the syntax 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, and specifically includes 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 a geometric detection method: if the intersection area is empty, the Boolean intersection operation is determined to be invalid; for Boolean cut operations, a geometric inclusion 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 determined to be invalid; for Boolean union operations, a geometric inclusion 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 determined to be 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 unit is occupied by two primitives at the same time: for a grid unit occupied by two primitives at the same time, calculate the intersection of the grid unit and the two primitives, and merge all the intersections to obtain the final actual intersection area;
[0040] The method of judging whether all the union primitives are contained in the target primitive through the geometric inclusion test specifically includes the following steps:
[0041] For Boolean shearing and Boolean union operations, select a reference point, project several rays from the reference point in different directions, and detect the intersections between the rays and the primitives: For Boolean shearing, if the intersections of all projected rays and shearing primitives are outside the target primitive, then it is determined that all shearing primitives are outside the target primitive; For Boolean union, if the intersections of all projected rays and union primitives are inside the target primitive, then it is determined that all union primitives are contained inside 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 triangular surface optimization module, a primitive optimization module, a calculation 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 calculation 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 geometric feature matching and semantic consistency analysis according to the received data information and the acquired file The geometric model is optimized according to the received data information and the obtained file, and the triangular surface optimization module 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 file, 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 OBB envelope box detection and the spatial inclusion relationship analysis according to the received data information and the obtained file, 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 the 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.
[0044] The lightweight processing method and system of the substation GIM model provided by the present invention not only realizes the lightweight processing of the substation GIM model, but also has higher reliability, better accuracy and higher efficiency through optimization of attribute files, optimization of geometric models, optimization of triangular faces of non-parametric models, optimization of invisible primitives in parametric models and optimization of invalid Boolean operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 The figure is a schematic diagram of the method flow of the present invention.
[0046] Figure 2 Schematic diagram of the functional modules of the system of the present invention. DETAILED DESCRIPTION
[0047] like Figure 1 The method flow chart of the method of the present invention is shown as follows: The lightweight processing method of the substation GIM model disclosed in the present invention comprises the following steps:
[0048] S1. Obtain the file of the GIM model of the target substation;
[0049] S2. Optimize the attribute file of the file obtained in step S1 based on semantic similarity analysis and attribute value validity detection; specifically, the steps include:
[0050] Parse and preprocess the .fam file: The attribute format of the .fam file is "English attribute name = Chinese attribute name = attribute value", so the .fam file referenced by the .cbm file and the .dev file is parsed line by line to extract the English attribute name, Chinese attribute name and attribute value, and the extracted data information is structured; a hash table is used to quickly index the attribute name, and a natural language processing solution is used to perform word segmentation and semantic analysis on the Chinese attribute name; data cleaning is performed on the extracted attribute values (including processing of null values, duplicate values and format abnormal values, etc.) to ensure data completeness;
[0051] 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 (such as Word2Vec or BERT) 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 the set semantic similarity threshold; for example, "Voltage=Voltage=220V" and "VoltageLevel=VoltageLevel=220V" may be determined as semantically similar attributes; 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;
[0052] 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 (such as non-numeric attribute values containing letters or special characters); directly delete the identified attribute rows and the attribute rows marked as invalid rows 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, the steps include:
[0054] The geometric model should be in .mod or .stl file type, where .mod is a model file constructed by parameterization 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 mesh 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, while a .stl model needs to store thousands or even tens of thousands of triangle mesh data, which significantly increases the file size. Since the .stl model is based on triangle meshes, its file size is proportional to the geometric complexity of the model. For high-precision models, the number of triangle meshes 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 huge file size not only increases the storage cost, 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 the .stl file is usually stored in ASCII or binary format, it is necessary to parse the vertex coordinates and face information line by line or block by block when reading, which takes a long time. In addition, the .stl file lacks a hierarchical structure and spatial index. After loading, additional computing resources are required to build a spatial data structure (such as BVH or octree) to support subsequent rendering and interactive operations, which further reduces the loading efficiency.
[0056] Therefore, when building a geometric model, you should use *.mod files whenever possible;
[0057] Extraction of model file data: For .stl models, parse the triangular patch data, 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 relationship to generate the corresponding geometric representation; use spatial index structure (such as octree or BVH hierarchical bounding box tree) to divide the model into spaces to accelerate the matching process of geometric features;
[0058] Geometric feature matching and similarity evaluation: 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 the 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 judged to be consistent, otherwise the .stl model and the .mod model are judged to be inconsistent;
[0059] Semantic consistency analysis: parse the graphic element structure of the .mod model and the corresponding XML file, extract the semantic information of a (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 with consistent models and semantics, mark the .stl model as a redundant model, abandon the redundant model in the model library, and update the corresponding reference relationship;
[0061] S4. According to the file obtained in step S3, the non-parametric model triangular surface is optimized based on the edge collapse algorithm and the vertex clustering algorithm; specifically, the steps include:
[0062] Parse the .stl file: extract the triangular patch data of the .stl file; the triangular patch data includes vertex coordinates, normal vectors and triangular patch connection relationships; use a spatial index structure (such as an octree or a BVH hierarchical bounding box tree) to spatially divide the triangular patches; use 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 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;
[0063] Simplify the low curvature area (reduce the number of facets by merging adjacent vertices): traverse all edges of the model, and calculate the folding cost of each edge based on the geometric error metric function (such as the quadratic error metric, which is used to quantify the impact of edge folding on the model geometry); 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 to minimize the geometric deviation between the simplified model and the original model; 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 it cannot be simplified further; complete the simplification of the low curvature area; where the "set threshold range" refers to the maximum range of model geometric error allowed in advance according to actual needs, ensuring that the simplified model is consistent with the original model in terms of visual and geometric accuracy; the "predetermined target" can be the requirements for model complexity based on the application scenario, such as reducing the number of triangles to a certain proportion of the original number; "cannot be simplified further" means that under the current simplification strategy and parameter settings, continued simplification will cause obvious geometric distortion of the model or fail to meet other constraints;
[0064] Simplify the high curvature area (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, and the size of each cell is determined by the clustering 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 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 it is impossible to continue to simplify; Complete the simplification of the high curvature area; Among them, "key geometric features" refers to the geometric parts of the model that are important for subsequent applications (such as engineering analysis, visualization, etc.), such as edges, corners, etc.; "predetermined target" can be based on the requirements of the model complexity according to the application scenario, such as reducing the number of triangular facets to a certain proportion of the original number; "cannot continue to simplify" means that under the current simplification strategy and parameter settings, continued simplification will cause obvious geometric distortion of the model or fail to meet other constraints;
[0065] At the same time, in order to improve reliability, normal vector consistency detection is introduced to avoid the problem of sudden changes in model surface normal vectors caused by simplification operations: after each edge folding 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. According to the file obtained in step S4, based on OBB envelope box detection and spatial inclusion relationship analysis, optimization of invisible primitives in the parametric model is performed; specifically comprising the following steps:
[0067] Primitive parsing and data extraction: parse all primitives in the .mod file, 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 box (in order to more accurately describe the spatial distribution of the primitive), and calculate the OBB envelope box; use the spatial index structure (such as the BVH hierarchical bounding box tree) to divide the primitive space;
[0068] Identification of invisible primitives: For each pair of primitives, check whether the corresponding OBB envelope boxes intersect: If they intersect, use ray intersection test and vertex inclusion detection 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 "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, it may still be necessary to consider their mutual influence, such as electromagnetic interference, etc.) The primitives that are determined to be completely contained in other primitives are marked as invisible primitives, and the invisible primitives are 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 primitives 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 primitives, and adjust the reference relationship between the parent node and sibling nodes of the deleted invisible primitives to ensure the syntax and semantic integrity of the XML file;
[0070] S6. According to the file obtained in step S5, based on geometric analysis and logical judgment, optimize the invalid Boolean operations in the parameterized model; specifically, the steps include:
[0071] Invalid Boolean operations mainly include situations where the Boolean intersection is empty, the Boolean cut has no effect, and the Boolean union has no new geometry. These operations not only increase the complexity of the model, but may also cause performance problems during data processing and rendering. Therefore, deleting invalid Boolean operations is an effective way to make the model lightweight.
[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 determined to be invalid; for Boolean shear operations, a geometric inclusion test is used to determine whether all sheared primitives are located outside the target primitive: if all sheared primitives are located outside the target primitive, the Boolean shear operation is determined to be invalid; for Boolean union operations, a geometric inclusion test is used to determine whether all the union primitives are contained within the target primitive: if all the union primitives are contained within the target primitive, the Boolean union operation is determined to be 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 unit is occupied by two primitives at the same time: for a grid unit occupied by two primitives at the same time, calculate the intersection of the grid unit 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, providing a reliable basis for judging the validity of Boolean intersection operations;
[0077] The method of judging whether all the union primitives are contained in the target primitive through the geometric inclusion test specifically includes the following steps:
[0078] For Boolean shearing and Boolean union operations, select a reference point, project several rays from the reference point in different directions, and detect the intersections between the rays and the primitives: For Boolean shearing, if the intersections of all projected rays and shearing primitives are outside the target primitive, then it is determined that all shearing primitives are outside the target primitive; For Boolean union, if the intersections of all projected rays and union primitives are inside the target primitive, then it is determined that all union primitives are contained inside 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 primitives involved in the invalid Boolean intersection operation are not referenced by other Boolean operations, and delete the primitives involved in the operation; for invalid Boolean cut operations, determine that the cut primitives are not referenced by other Boolean operations, delete the cut primitives, and retain the target primitives; for invalid Boolean union operations, determine that the union primitives are not referenced by other Boolean operations, delete the union primitives, and retain the target primitives;
[0081] S7. Complete lightweight processing of the target substation GIM model.
[0082] Compared with the prior art, the solution of the present invention firstly significantly reduces the data scale of the model, reduces the storage cost and transmission time through technical means such as geometric simplification, attribute optimization and deletion of invalid Boolean operations, especially in mobile terminals and remote collaboration scenarios, the loading speed and interactive performance of the model are significantly improved; 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 uses multi-level semantic similarity analysis and attribute value validity detection to intelligently identify and delete redundant attributes, thereby 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, which 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 triangular surface optimization module, a primitive optimization module, a calculation 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 calculation 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 The geometric model is optimized according to the semantic consistency analysis, 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 file, and upload the data information to the primitive optimization module; the primitive optimization module is used to optimize the invisible primitives in the parameterized model based on the OBB envelope box detection and spatial inclusion relationship analysis according to the received data information and the obtained file, and upload the data information to the operation optimization module; the operation optimization module is used to optimize the invalid Boolean operations in the parameterized 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 comprises the following steps: S1. Obtain the file of the GIM model of the target substation; S2. Optimize the attribute file of the file obtained in step S1 based on semantic similarity analysis and attribute value validity detection; S3. According to the file obtained in step S2, the geometric model is optimized based on geometric feature matching and semantic consistency analysis; S4. According to the file obtained in step S3, the non-parametric model triangular surface is optimized based on the edge collapse algorithm and the vertex clustering algorithm; S5. According to the file obtained in step S4, based on OBB envelope box detection and spatial inclusion relationship analysis, optimize the invisible primitives in the parametric model; S6. According to the file obtained in step S5, based on geometric analysis and logical judgment, optimize the invalid Boolean operations in the parameterized model; 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, and specifically includes the following steps: Parse and preprocess the .fam file: 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 perform a structured representation of the extracted data information; use a hash table to quickly index the attribute name, and use a natural language processing solution to perform word segmentation and semantic analysis on the Chinese attribute name; perform data cleaning on the extracted attribute values to ensure data completeness; 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 lines and the attribute lines marked as invalid lines 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 According to the file obtained in step S2, step S3 optimizes the geometric model based on geometric feature matching and semantic consistency analysis, which specifically includes the following steps: 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 the .mod model, parse the primitive structure, transformation matrix and Boolean operation relationship to generate the corresponding geometric representation; The spatial index structure is used to divide the model into spaces to accelerate the matching process of geometric features; Geometric feature matching and similarity evaluation: In the first matching stage, the global geometric features of the .stl model and the .mod model are calculated, and the 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 the 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 the matching degree both meet the set requirements, the .stl model and the .mod model are judged to be consistent, otherwise the .stl model and the .mod model are judged to be inconsistent; Semantic consistency analysis: parse the graphic element structure of the .mod model and the corresponding XML file, extract the semantic information of a, 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, abandon 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 According to the file obtained in step S3, the optimization of the triangular surface of the non-parametric model is performed based on the edge collapse algorithm and the vertex clustering algorithm, which specifically includes the following steps: Parse the .stl file: extract the triangular patch data of the .stl file; the triangular patch data includes vertex coordinates, normal vectors and triangular patch connection relationships; use a spatial index structure to spatially divide the triangular patch; use a curvature distribution analysis method to identify high curvature areas and low curvature areas on the model surface; 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 smallest folding cost to perform the folding operation: 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 cannot be further simplified; Complete simplification of low curvature areas; Simplify high curvature areas: Use a clustering algorithm to divide the model space into several cubic cells, and the size of each cell is determined by the clustering 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 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 triangles reaches the predetermined target or cannot be further simplified; the simplification of the high curvature area is completed.
5. The lightweight processing method of the substation GIM model according to claim 4 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.
6. The lightweight processing method of the substation GIM model according to claim 5 is characterized in that According to the file obtained in step S4, the optimization of invisible primitives in the parametric model is performed based on OBB envelope box detection and spatial inclusion relationship analysis, which specifically includes the following steps: Primitive parsing and data extraction: parse all primitives in the .mod file, 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 box, and calculate the OBB envelope box; 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 intersect, use ray intersection test and vertex inclusion detection 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, and the invisible primitives are marked as objects to be deleted, and the corresponding Entity identifiers of the invisible primitives in the .mod file are recorded; Delete the invisible graphics 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 graphics, and adjust the reference relationship between the parent node and sibling nodes of the deleted invisible graphics to ensure the syntax and semantic integrity of the XML file.
7. The lightweight processing method of the substation GIM model according to claim 6 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: 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 a geometric detection method: if the intersection area is empty, the Boolean intersection operation is determined to be invalid; for Boolean cut operations, a geometric inclusion 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 determined to be invalid; for Boolean union operations, a geometric inclusion 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 determined to be invalid; 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 unit is occupied by two primitives at the same time: for a grid unit occupied by two primitives at the same time, calculate the intersection of the grid unit and the two primitives, and merge all the intersections to obtain the final actual intersection area; The method of judging whether all the union primitives are contained in the target primitive through the geometric inclusion test specifically includes the following steps: For Boolean shearing and Boolean union operations, select a reference point, project several rays from the reference point in different directions, and detect the intersections between the rays and the primitives: For Boolean shearing, if the intersections of all projected rays and shearing primitives are outside the target primitive, then it is determined that all shearing primitives are outside the target primitive; For Boolean union, if the intersections of all projected rays and union primitives are inside the target primitive, then it is determined that all union primitives are contained inside 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.
8. A system for implementing the lightweight processing method of the substation GIM model according to any one of claims 1 to 7, 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, a calculation 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 calculation 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 GIM model of the target substation 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 the 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 triangular surface optimization module; The triangular surface optimization module is used to optimize the triangular surface of the non-parametric model according to 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 parameterized model based on the received data information, the obtained files, 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.
Citation Information
Patent Citations
BIM-based lightweight deep processing work method
CN108595858A
Digital twinning-oriented scene lightweight method
CN113888716A
BIM rapid lightweight method
CN118799529A
Cited By
Low-voltage power grid data automatic modeling method and system based on visual acquisition and recording
CN120706281A
Automatic Modeling Method and System for Low-Voltage Power Grid Data Based on Visual Acquisition
CN120706281B
Construction whole-process simulation method for building of green assembly type comprehensive pipe gallery
CN120745059A