CN118887333B - A three-dimensional modeling method, system and device based on GIM data - Google Patents

A three-dimensional modeling method, system and device based on GIM data Download PDF

Info

Publication number
CN118887333B
CN118887333B CN202410914351.7A CN202410914351A CN118887333B CN 118887333 B CN118887333 B CN 118887333B CN 202410914351 A CN202410914351 A CN 202410914351A CN 118887333 B CN118887333 B CN 118887333B
Authority
CN
China
Prior art keywords
information
point
file
line
gim
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410914351.7A
Other languages
Chinese (zh)
Other versions
CN118887333A (en
Inventor
张亚平
荣经国
王浩
张卓群
张苏
孙小虎
王菲
胡亚山
何宏杰
范子恺
田方媛
马唯婧
苑博
赵春晖
张济勇
李丹利
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Jiangsu Electric Power Co Ltd
State Grid Economic and Technological Research Institute Co Ltd
Economic and Technological Research Institute of State Grid Jiangsu Electric Power Co Ltd
Original Assignee
State Grid Jiangsu Electric Power Co Ltd
State Grid Economic and Technological Research Institute Co Ltd
Economic and Technological Research Institute of State Grid Jiangsu Electric Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Jiangsu Electric Power Co Ltd, State Grid Economic and Technological Research Institute Co Ltd, Economic and Technological Research Institute of State Grid Jiangsu Electric Power Co Ltd filed Critical State Grid Jiangsu Electric Power Co Ltd
Priority to CN202410914351.7A priority Critical patent/CN118887333B/en
Publication of CN118887333A publication Critical patent/CN118887333A/en
Application granted granted Critical
Publication of CN118887333B publication Critical patent/CN118887333B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three-dimensional [3D] modelling for computer graphics
    • G06T17/005Tree description, e.g. octree, quadtree
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/18Network design, e.g. design based on topological or interconnect aspects of utility systems, piping, heating ventilation air conditioning [HVAC] or cabling
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2113/00Details relating to the application field
    • G06F2113/04Power grid distribution networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Geometry (AREA)
  • Business, Economics & Management (AREA)
  • Health & Medical Sciences (AREA)
  • Economics (AREA)
  • Human Resources & Organizations (AREA)
  • Computational Mathematics (AREA)
  • Strategic Management (AREA)
  • Tourism & Hospitality (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • General Health & Medical Sciences (AREA)
  • Water Supply & Treatment (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Primary Health Care (AREA)
  • Public Health (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Software Systems (AREA)
  • Processing Or Creating Images (AREA)

Abstract

本发明公开了一种基于GIM数据的三维建模方法、系统和设备,涉及GIM数据处理技术领域,通过解析GIM文件,得到所述GIM文件的各层级间文件的引用关系,作为层级信息;从所述层级信息中筛选得到MOD文件和位姿矩阵信息,并根据所述位姿矩阵信息对所述MOD文件进行坐标转换;读取坐标转换后的所述MOD文件,得到第一点信息和第一线信息;综合采用八叉树和kd树算法,对所述第一点信息进行合并,得到第二点信息;结合所述第二点信息和所述第一线信息,精确线段连接,得到第二线信息;根据所述第二线信息,建立实体的三维网格模型。采用本发明实施例,能够将GIM中复杂的数据关系转化为清晰、有序的数据结构,并有效消除坐标精度不足对实体三维建模准确度的影响。

The present invention discloses a three-dimensional modeling method, system and device based on GIM data, and relates to the technical field of GIM data processing. By parsing a GIM file, a reference relationship between files at each level of the GIM file is obtained as level information; a MOD file and a pose matrix information are screened from the level information, and the MOD file is subjected to coordinate transformation according to the pose matrix information; the MOD file after coordinate transformation is read to obtain first point information and first line information; the first point information is merged by comprehensively adopting an octree and a kd tree algorithm to obtain second point information; the second point information and the first line information are combined to obtain second line information by precise line segment connection; and a three-dimensional mesh model of a solid is established according to the second line information. By adopting the embodiment of the present invention, the complex data relationship in the GIM can be converted into a clear and orderly data structure, and the influence of insufficient coordinate precision on the accuracy of solid three-dimensional modeling can be effectively eliminated.

Description

Three-dimensional modeling method, system and equipment based on GIM data
Technical Field
The invention relates to the technical field of GIM data processing, in particular to a three-dimensional modeling method, system and equipment based on GIM data.
Background
The Grid Information Model (GIM) is widely applied to the power industry, is used for describing and managing a data model of power system information, and can represent information such as various devices, lines, topological structures, operation states and the like in a power grid so as to support planning, design, operation and management of a power system.
However, at present, because the file provided by the GIM is inevitably affected by the acquisition precision, precision loss in the projection transformation process and the like, the problem exists in the precision of point coordinates, and a large number of coordinate points which are supposed to coincide are offset. This migration causes serious errors in the model topology, which not only affects the aesthetics of the model, but also reduces the resolution speed and accuracy of three-dimensional modeling of the GIM model with redundant node information.
Disclosure of Invention
The invention provides a three-dimensional modeling method, a system and equipment based on GIM data, which can convert complex data relations in the GIM into clear and ordered data structures, and effectively eliminate the influence of insufficient coordinate precision on the accuracy of solid three-dimensional modeling through data weight reduction. By simplifying redundant data node information, the data processing efficiency and the analysis speed are improved, the accuracy and the stability of three-dimensional modeling are further improved, and the reliability performance of the model in various engineering applications is ensured.
In order to solve the above technical problems, an embodiment of the present invention provides a three-dimensional modeling method based on GIM data, including:
Analyzing a GIM file to obtain a reference relation of files among all levels of the GIM file as level information;
Screening the hierarchical information to obtain an MOD file and pose matrix information, and performing coordinate transformation on the MOD file according to the pose matrix information;
reading the MOD file after coordinate conversion to obtain first point information and first line information;
combining the first point information by comprehensively adopting an octree algorithm and a kd tree algorithm to obtain second point information;
Combining the second point information with the first line information, and connecting accurate line segments to obtain second line information;
and establishing a three-dimensional grid model of the entity according to the second line information.
As an improvement of the above solution, the parsing the GIM file, to obtain a reference relationship of files between each level of the GIM file, includes, as level information:
Analyzing the GIM file, and obtaining the reference relation of the file among the CBM level, the DEV level, the PHM level and the MOD level from the GIM file, wherein the reference relation comprises a peer reference relation and a nested reference relation;
and constructing a B-tree data structure according to the reference relation as hierarchy information.
As an improvement of the above solution, the filtering to obtain MOD files and pose matrix information from the hierarchical information, and performing coordinate transformation on the MOD files according to the pose matrix information includes:
screening the hierarchical information to obtain MOD hierarchical files as MOD files;
extracting homogeneous transformation matrixes in each level file from the level information to serve as pose matrix information;
For each node in the MOD hierarchy, inquiring a file of the previous hierarchy of the current hierarchy file by indexing according to the hierarchy information until the file of the highest hierarchy is inquired;
and after the inquiry of any level is completed, carrying out coordinate transformation on the MOD file according to the pose matrix information.
As an improvement of the above solution, the reading the MOD file after coordinate conversion to obtain first point information and first line information includes:
Reading the MOD file after coordinate conversion row by row;
Taking the identified line beginning with P as first point information, and converting point coordinates in the first point information into a vector form;
the identified row beginning with "R" is taken as the first line information.
As an improvement of the above solution, the integrating adopts octree and kd-Tree algorithm, and combines the first point information to obtain second point information, including:
According to the first point information, obtaining three-dimensional space ranges corresponding to all the first point information, and constructing an octree, wherein the three-dimensional space ranges are root nodes of the octree;
Starting from the root node, determining a current node, recursively dividing the current node into eight leaf nodes according to the average value of first point information in the current node until the number of the first point information in the current node is smaller than a preset number threshold or reaches a preset first division depth threshold, and obtaining a depth leaf set;
Constructing a kd tree according to the depth leaf set, and recursively performing binary segmentation on the depth leaf set in a multidimensional space until a preset second segmentation depth threshold is reached;
and carrying out nearest neighbor search on each node of the segmented kd tree, and merging nodes with nearest neighbor search distance smaller than a preset distance threshold value to obtain second point information.
As an improvement of the above solution, the combining the second point information and the first line information, and accurate line segment connection, to obtain second line information, includes:
Reading a start point ID and an end point ID of a line from the first line information;
Searching coordinates and line width information of target points corresponding to the starting point ID and the end point ID in the second point information;
and updating the first line information according to the point coordinates and the line width information to serve as second line information.
As an improvement of the above-described aspect, the retrieving, in the second point information, coordinates and line width information of the target point corresponding to the start point ID and the end point ID includes:
Determining coordinate information of a corresponding candidate point according to the starting point ID and the end point ID;
Matching the coordinate information of the candidate points with the coordinate information of each point in the merging point set of the second point information, and taking the point corresponding to the coordinate information of the candidate points in the second point information as a target point corresponding to the starting point ID and the end point ID when the matching is successful;
and screening the second point information to obtain the coordinate and line width information of the target point.
As an improvement of the above solution, the establishing a three-dimensional grid model of the entity according to the second line information includes:
creating a continuous curved object according to the second line information;
And establishing a three-dimensional grid model of the entity according to the curved surface object.
The embodiment of the invention also provides a three-dimensional modeling system based on GIM data, which comprises:
the hierarchical information acquisition module is used for analyzing the GIM file to obtain the reference relation of the file among all the hierarchies of the GIM file as hierarchical information;
The file screening module is used for screening the MOD file and the pose matrix information from the level information and carrying out coordinate conversion on the MOD file according to the pose matrix information;
the information acquisition module is used for reading the MOD file after coordinate conversion to obtain first point information and first line information;
The point merging module is used for merging the first point information by comprehensively adopting an octree and kd-Tree algorithm to obtain second point information;
the line information updating module is used for combining the second point information with the first line information, and connecting accurate line segments to obtain second line information;
and the modeling module is used for establishing a three-dimensional grid model of the entity according to the second line information.
As an improvement of the above solution, the hierarchical information acquisition module is specifically configured to:
Analyzing the GIM file, and obtaining the reference relation of the file among the CBM level, the DEV level, the PHM level and the MOD level from the GIM file, wherein the reference relation comprises a peer reference relation and a nested reference relation;
and constructing a B-tree data structure according to the reference relation as hierarchy information.
As an improvement of the above solution, the file screening module is specifically configured to:
screening the hierarchical information to obtain MOD hierarchical files as MOD files;
extracting homogeneous transformation matrixes in each level file from the level information to serve as pose matrix information;
For each node in the MOD hierarchy, inquiring a file of the previous hierarchy of the current hierarchy file by indexing according to the hierarchy information until the file of the highest hierarchy is inquired;
and after the inquiry of any level is completed, carrying out coordinate transformation on the MOD file according to the pose matrix information.
As an improvement of the above solution, the information acquisition module is specifically configured to:
Reading the MOD file after coordinate conversion row by row;
Taking the identified line beginning with P as first point information, and converting point coordinates in the first point information into a vector form;
the identified row beginning with "R" is taken as the first line information.
As an improvement of the above solution, the point merging module is specifically configured to:
According to the first point information, obtaining three-dimensional space ranges corresponding to all the first point information, and constructing an octree, wherein the three-dimensional space ranges are root nodes of the octree;
Starting from the root node, determining a current node, recursively dividing the current node into eight leaf nodes according to the average value of first point information in the current node until the number of the first point information in the current node is smaller than a preset number threshold or reaches a preset first division depth threshold, and obtaining a depth leaf set;
Constructing a kd tree according to the depth leaf set, and recursively performing binary segmentation on the depth leaf set in a multidimensional space until a preset second segmentation depth threshold is reached;
and carrying out nearest neighbor search on each node of the segmented kd tree, and merging nodes with nearest neighbor search distance smaller than a preset distance threshold value to obtain second point information.
As an improvement of the above solution, the line information updating module is specifically configured to:
Reading a start point ID and an end point ID of a line from the first line information;
Searching coordinates and line width information of target points corresponding to the starting point ID and the end point ID in the second point information;
and updating the first line information according to the point coordinates and the line width information to serve as second line information.
As an improvement of the above-described aspect, the retrieving, in the second point information, coordinates and line width information of the target point corresponding to the start point ID and the end point ID includes:
Determining coordinate information of a corresponding candidate point according to the starting point ID and the end point ID;
Matching the coordinate information of the candidate points with the coordinate information of each point in the merging point set of the second point information, and taking the point corresponding to the coordinate information of the candidate points in the second point information as a target point corresponding to the starting point ID and the end point ID when the matching is successful;
and screening the second point information to obtain the coordinate and line width information of the target point.
As an improvement of the above solution, the modeling module is specifically configured to:
creating a continuous curved object according to the second line information;
And establishing a three-dimensional grid model of the entity according to the curved surface object.
The embodiment of the invention also provides a three-dimensional modeling device based on GIM data, which comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein the three-dimensional modeling method based on GIM data is realized when the processor executes the computer program.
Compared with the prior art, the three-dimensional modeling method, system and equipment based on GIM data are disclosed, the reference relation of files among all levels of the GIM files is obtained through analyzing the GIM files and is used as level information, MOD files and pose matrix information are obtained through screening from the level information, the MOD files are subjected to coordinate conversion according to the pose matrix information, the MOD files after the coordinate conversion are read to obtain first point information and first line information, an octree and kd tree algorithm is comprehensively adopted to merge the first point information to obtain second point information, the second point information and the first line information are combined, accurate line segment connection is achieved to obtain second line information, and a three-dimensional grid model of an entity is built according to the second line information. By adopting the embodiment of the invention, the complex data relationship in the GIM can be converted into a clear and ordered data structure, and the influence of insufficient coordinate precision on the accuracy of the three-dimensional modeling of the transformer substation can be effectively eliminated.
Drawings
FIG. 1 is a schematic flow chart of steps of a three-dimensional modeling method based on GIM data according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a hierarchical structure of a GIM file according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a three-dimensional modeling system based on GIM data according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the description of the specification and claims, it should be understood that the terms first, second, etc. are used solely for the purpose of distinguishing between similar features and not necessarily for the purpose of describing a sequential or chronological order, and not necessarily for the purpose of indicating or implying a relative importance or implicitly indicating the number of features indicated. The terms are interchangeable where appropriate. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature.
The GIM provides a data model containing rich level information, so that related personnel of the power system can share and understand the information of the power system, and the intelligent, automatic and efficient operation of the power system can be realized. When GIM data is processed, the integrity of the data and the accuracy of a model need to be ensured, and the traditional analysis method is difficult to care for large-scale and high-complexity data, so that the problems of data loss or low analysis efficiency are caused.
In addition, because of numerous sources of GIM data, different precision and different projection transformation methods may be adopted when data acquisition is performed, offset of the overlapped coordinate points may occur, serious errors are further caused in the model topology, and especially at the intersection point of a plurality of lines of the tower group, almost all wires cannot be accurately intersected at one point, so that the attractiveness of the model is affected, and the analysis speed of the model is reduced due to redundant node information.
Based on the above considerations, the embodiment of the invention provides a step flow diagram of a three-dimensional modeling method based on GIM data. Referring to fig. 1, in the present embodiment, the three-dimensional modeling method based on GIM data is specifically performed by steps S1 to S6:
S1, analyzing the GIM file to obtain the reference relation of the file among all the layers of the GIM file as the layer information.
Illustratively, the classification of a substation is subdivided into five levels according to its function, partition, and scale size. These levels are, from high to low, the total station level F1 level system (topmost level system), the system/zone level F2 level system (secondary subsystem), the subsystem/sub-zone level F3 level system (tertiary subsystem), the device level F4 level system, and the component level DEV system, respectively. During the storage of the GIM, starting from the start file project. The first five levels of CBM files are nested and invoked sequentially, in order from high to low. The F1 level system is not only associated with multiple IFC models, but also invokes DEV files under the F4 level system. The DEV file can call the DEV file with the same hierarchy and the PHM file. Likewise, the PHM file can call the PHM file of the same hierarchy or the MOD/STL file of the next hierarchy.
It should be noted that, in the GIM file, the CBM file provides information of building height, roof type, layer number, floor area, ownership and the like of the model, and is mainly used for management of building and ownership, and the attribute file of the DEV provides electrical properties of equipment of the power transmission line and defines electrical properties of the equipment in the power system, such as voltage level, wire type, wire split number and the like, mechanical properties and physical properties and mechanical properties describing the equipment, including equipment type, total length, winding type and the like, installation properties and detailed information related to installation and configuration of the equipment, such as model and material of insulators, winded area, hanging point number, wiring point information and the like.
S2, screening the hierarchical information to obtain an MOD file and pose matrix information, and performing coordinate transformation on the MOD file according to the pose matrix information.
It should be noted that pose matrix information is provided in the PHM file, the CBM file, and the DEV file, where the pose matrix information is used to describe a position and a pose of an object in a three-dimensional space, and may be used to determine an absolute spatial position of a reconstructed model in an MOD hierarchy. The efficiency and accuracy of modeling work of the MOD hierarchy can be improved through the obtained hierarchy information in the steps.
S3, reading the MOD file after coordinate conversion to obtain first point information and first line information.
It will be appreciated that to convert text formatted primitives to a three-dimensional model, a deep understanding of the unique geometric characteristics of each primitive is required. In the embodiment of the invention, the geometric characteristics of the primitive are depicted by extracting the point information and the line information of the model, so that an accurate three-dimensional model is further built.
And S4, comprehensively adopting an octree and kd-Tree algorithm, and combining the first point information to obtain second point information.
It can be appreciated that the reasons for the problem of coordinate accuracy in the GIM model file may be various, such as different coordinate systems being adopted, and the loss of coordinate accuracy being caused when the same coordinate system is used for projection transformation, and the difference of measuring equipment or technical accuracy being used in the process of multiple data acquisition being caused. Therefore, the problem of coordinate accuracy is almost an unavoidable problem in the GIM data, and further causes a shift in a large number of coordinate points that should be coincident. According to the embodiment of the invention, the octree and the kd-Tree algorithm are comprehensively adopted to combine the first point information, so that the problem that wiring cannot meet due to coordinate point deviation in the subsequent three-dimensional model building process can be avoided.
S5, combining the second point information with the first line information, and connecting accurate line segments to obtain second line information.
The line information plays an important role in the modeling process, and if the line segments of the line information are not accurately connected, the accuracy and the aesthetic degree of the model are negatively affected, so that the analysis of planning, design, operation and management of a power system is not facilitated. In the embodiment of the invention, the second point information is the combined point information, so that the offset problem of the coordinate point is eliminated, and the line information can be updated by further combining the second point information with the first line information.
And S6, establishing a three-dimensional grid model of the entity according to the second line information.
According to the scheme, the complex data relationship in the GIM can be converted into a clear and ordered data structure by analyzing the GIM file and obtaining the hierarchical information, the point cloud data quantity can be obviously reduced by identifying the geometric characteristics of primitives in the MOD file and performing space segmentation and preliminary merging through an octree algorithm, then the kd tree algorithm is utilized for fine merging, the precision and density of the point cloud data are further improved, a three-dimensional grid model is established according to the obtained second point information and the second line information, the accurate connection of line segments involved in the point correction in the parameter modeling can be realized, the topological error in the graph is effectively corrected, and the precision of the merging result is improved.
As a preferred embodiment, step S1, parsing the GIM file to obtain a reference relationship of each file between the layers of the GIM file, where the reference relationship is used as layer information, specifically:
Analyzing the GIM file, and obtaining the reference relation of the file among the CBM level, the DEV level, the PHM level and the MOD level from the GIM file, wherein the reference relation comprises a peer reference relation and a nested reference relation;
and constructing a B-tree data structure according to the reference relation as hierarchy information.
Referring to FIG. 2, in some embodiments, GIM files have four levels, a CBM level, a DEV level, a PHM level, and a MOD level, respectively, each corresponding to their files. For the CBM level, DEV level and PHM level, it can call not only the next level of files, but also the same level of files. In the process of analyzing the GIM file, a depth-first traversal algorithm is adopted to comprehensively and systematically traverse each data node in the GIM file, and in the traversal process, the hierarchy to which the data node belongs and the reference relation with other files are determined. In addition, each hierarchical file is provided with a property file (FAM file) for storing specific property contents thereof, so that the hierarchical level of the data node can be further determined and verified based on the property file.
It should be noted that B-tree is a self-balancing tree, and is commonly used for index structures of databases and file systems. It can keep data stable and ordered, and its insertion and modification have a relatively average complexity. In the embodiment of the invention, the B-tree data structure is used for storing the hierarchical information of the GIM model, so that the integrity and the order of data can be ensured.
In some embodiments, after step S1, the integrity and accuracy of the parsing is also verified according to the hierarchical information. As the reference relationship among all layers of the GIM file is foreseeable, by adopting a rule-based method, for example, whether the reference relationship of the constructed B tree accords with the preset reference relationship is judged, if so, the integrity and the accuracy are verified to pass, otherwise, the integrity and the accuracy are not verified to pass.
As a preferred embodiment, step S2, screening the hierarchical information to obtain an MOD file and pose matrix information, and performing coordinate transformation on the MOD file according to the pose matrix information, which specifically includes:
screening the hierarchical information to obtain MOD hierarchical files as MOD files;
extracting homogeneous transformation matrixes in each level file from the level information to serve as pose matrix information;
For each node in the MOD hierarchy, inquiring a file of the previous hierarchy of the current hierarchy file by indexing according to the hierarchy information until the file of the highest hierarchy is inquired;
and after the inquiry of any level is completed, carrying out coordinate transformation on the MOD file according to the pose matrix information.
According to the above scheme, according to the hierarchy information, the parent-child tree among the files of each hierarchy can be built from bottom to top from the MOD hierarchy, the MOD hierarchy finds the parent-child tree relation of the previous hierarchy through indexes, and coordinate conversion is performed by using the corresponding matrix, and the whole process is recursively performed until the coordinate conversion operation with the parent-child tree of the highest hierarchy is completed.
Preferably, in step S3, the MOD file after coordinate conversion is read to obtain first point information and first line information, which specifically are:
Reading the MOD file after coordinate conversion row by row;
Taking the identified line beginning with P as first point information, and converting point coordinates in the first point information into a vector form;
the identified row beginning with "R" is taken as the first line information.
In some embodiments, the coordinates of the first point information are converted to numpy. The advantage of converting the information coordinates into numpy array in the memory aspect is mainly reflected in the memory efficiency and the calculation efficiency by converting the first point information coordinates into numpy. The numpy arrays optimize the utilization of the memory space in a continuous storage mode, and compared with a common Python list, fewer memories can be used for storing the same amount of data so as to achieve the purpose of simplifying the data.
It should be noted that, by converting the point coordinates of the first point information into a vector form, a large amount of point coordinate data can be rapidly and accurately processed, and a complicated process of processing data elements one by one is avoided, so that the calculation speed is greatly improved, and powerful support is provided for subsequent point merging and model optimization.
In a preferred embodiment, step S4, a combination of octree and kd-tree algorithm is adopted to combine the first point information to obtain second point information, specifically:
According to the first point information, obtaining three-dimensional space ranges corresponding to all the first point information, and constructing an octree, wherein the three-dimensional space ranges are root nodes of the octree;
Starting from the root node, determining a current node, recursively dividing the current node into eight leaf nodes according to the average value of first point information in the current node until the number of the first point information in the current node is smaller than a preset number threshold or reaches a preset first division depth threshold, and obtaining a depth leaf set;
Constructing a kd tree according to the depth leaf set, and recursively performing binary segmentation on the depth leaf set in a multidimensional space until a preset second segmentation depth threshold is reached;
and carrying out nearest neighbor search on each node of the segmented kd tree, and merging nodes with nearest neighbor search distance smaller than a preset distance threshold value to obtain second point information.
In order to facilitate the subsequent updating of the line information, the second point information includes information of each point in the merging point set, but it is understood that it is not necessary to store all information of each point, and only part of information that can be used to identify the point may be stored. Such as ID and/or point coordinates, etc.
In the scheme, the first point information is optimized by adopting the octree algorithm, the space segmentation and the preliminary merging are carried out, the data quantity of the first point can be obviously reduced, and the kd-Tree algorithm is utilized for fine merging, so that the precision and the density of the point cloud data are further improved. By adopting the embodiment of the invention, the influence of insufficient coordinate precision on the accuracy of the three-dimensional modeling of the transformer substation can be effectively eliminated, the precision of the merging result is improved, and finally the obtained second point information is further simplified.
Preferably, step S5, combining the second point information with the first line information, and connecting accurate line segments to obtain second line information, includes:
Reading a start point ID and an end point ID of a line from the first line information;
Searching coordinates and line width information of target points corresponding to the starting point ID and the end point ID in the second point information;
and updating the first line information according to the point coordinates and the line width information to serve as second line information.
Still further, preferably, the retrieving, in the second point information, coordinates and line width information of the target point corresponding to the start point ID and the end point ID includes:
Determining coordinate information of a corresponding candidate point according to the starting point ID and the end point ID;
Matching the coordinate information of the candidate points with the coordinate information of each point in the merging point set of the second point information, and taking the point corresponding to the coordinate information of the candidate points in the second point information as a target point corresponding to the starting point ID and the end point ID when the matching is successful;
and screening the second point information to obtain the coordinate and line width information of the target point.
In the above solution, the starting point and the end point in the first line information correspond to the first point information, but the first point information is not accurate enough, so that the coordinate position of the second point information obtained after the merging may not be the same as any point in the merging point set, and if the target points corresponding to the starting point ID and the end point ID are directly searched in the second point information, a search error may occur. By adopting the embodiment of the invention, the accurate connection of the line segments involved in the midpoint correction in the parameter modeling is realized, the topology error in the graph is effectively corrected, and the precision of the merging result is improved.
As a preferred embodiment, the building a three-dimensional grid model of the entity according to the second line information includes:
creating a continuous curved object according to the second line information;
And establishing a three-dimensional grid model of the entity according to the curved surface object.
In the scheme, the curved surface object is created by using the line segments, the combined points and lines are successfully converted into continuous and visualized curved surfaces, the structure and the details of the model are clearly shown, and higher precision and richer expression forms are provided for the visualization of the model.
By identifying the geometric characteristics of primitives in the MOD file and combining adjacent points, a three-dimensional grid model is built according to the obtained second point information and the second line information, accurate connection of line segments involved in point correction in parameter modeling can be achieved, topological errors in graphs are effectively corrected, accuracy of combining results is improved, and influence of insufficient coordinate accuracy on accuracy of three-dimensional modeling of a transformer substation is effectively eliminated.
Referring to fig. 3, an embodiment of the present invention provides a schematic structural diagram of a three-dimensional modeling system based on GIM data. The three-dimensional modeling system based on the GIM data comprises a hierarchical information acquisition module 11, a file screening module 12, an information acquisition module 13, a point merging module 14, a line information updating module 15 and a modeling module 16, wherein:
The hierarchical information acquisition module 11 is used for analyzing the GIM file to obtain the reference relation of the file among all the hierarchies of the GIM file as hierarchical information;
The file screening module 12 is configured to screen the hierarchical information to obtain an MOD file and pose matrix information, and perform coordinate transformation on the MOD file according to the pose matrix information;
an information obtaining module 13, configured to read the MOD file after coordinate conversion to obtain first point information and first line information;
a point merging module 14, configured to combine the first point information to obtain second point information by comprehensively adopting an octree and kd-Tree algorithm;
the line information updating module 15 is configured to combine the second point information and the first line information, and connect accurate line segments to obtain second line information;
The modeling module 16 is configured to build a three-dimensional grid model of the entity according to the second line information.
As a preferred embodiment, the hierarchical information obtaining module 11 is specifically configured to:
Analyzing the GIM file, and obtaining the reference relation of the file among the CBM level, the DEV level, the PHM level and the MOD level from the GIM file, wherein the reference relation comprises a peer reference relation and a nested reference relation;
and constructing a B-tree data structure according to the reference relation as hierarchy information.
As a preferred embodiment, the file screening module 12 is specifically configured to:
screening the hierarchical information to obtain MOD hierarchical files as MOD files;
extracting homogeneous transformation matrixes in each level file from the level information to serve as pose matrix information;
For each node in the MOD hierarchy, inquiring a file of the previous hierarchy of the current hierarchy file by indexing according to the hierarchy information until the file of the highest hierarchy is inquired;
and after the inquiry of any level is completed, carrying out coordinate transformation on the MOD file according to the pose matrix information.
As a preferred embodiment, the information obtaining module 13 is specifically configured to:
Reading the MOD file after coordinate conversion row by row;
Taking the identified line beginning with P as first point information, and converting point coordinates in the first point information into a vector form;
the identified row beginning with "R" is taken as the first line information.
As a preferred embodiment, the point combining module 14 is specifically configured to:
According to the first point information, obtaining three-dimensional space ranges corresponding to all the first point information, and constructing an octree, wherein the three-dimensional space ranges are root nodes of the octree;
Starting from the root node, determining a current node, recursively dividing the current node into eight leaf nodes according to the average value of first point information in the current node until the number of the first point information in the current node is smaller than a preset number threshold or reaches a preset first division depth threshold, and obtaining a depth leaf set;
Constructing a kd tree according to the depth leaf set, and recursively performing binary segmentation on the depth leaf set in a multidimensional space until a preset second segmentation depth threshold is reached;
and carrying out nearest neighbor search on each node of the segmented kd tree, and merging nodes with nearest neighbor search distance smaller than a preset distance threshold value to obtain second point information.
As a preferred embodiment, the line information updating module 15 is specifically configured to:
Reading a start point ID and an end point ID of a line from the first line information;
Searching coordinates and line width information of target points corresponding to the starting point ID and the end point ID in the second point information;
and updating the first line information according to the point coordinates and the line width information to serve as second line information.
Further, preferably, the retrieving, in the second point information, coordinates and line width information of the target point corresponding to the start point ID and the end point ID includes:
Determining coordinate information of a corresponding candidate point according to the starting point ID and the end point ID;
Matching the coordinate information of the candidate points with the coordinate information of each point in the merging point set of the second point information, and taking the point corresponding to the coordinate information of the candidate points in the second point information as a target point corresponding to the starting point ID and the end point ID when the matching is successful;
and screening the second point information to obtain the coordinate and line width information of the target point.
As a preferred embodiment, the modeling module 16 is specifically configured to:
creating a continuous curved object according to the second line information;
And establishing a three-dimensional grid model of the entity according to the curved surface object.
The three-dimensional modeling system based on the GIM data can convert complex data relations in the GIM into clear and ordered data structures by analyzing the GIM file and obtaining the hierarchical information, remarkably reduces the amount of point cloud data by identifying the geometric characteristics of primitives in the MOD file and performing space segmentation and preliminary merging through an octree algorithm, further improves the precision and density of the point cloud data by using a kd tree algorithm, establishes a three-dimensional grid model according to the obtained second point information and second line information, can realize accurate connection of line segments involved in midpoint correction of parameter modeling, effectively corrects topological errors in the graph, improves the precision of merging results, and effectively eliminates the influence of insufficient coordinate precision on the accuracy of three-dimensional modeling of a transformer substation.
The embodiment of the invention also provides a three-dimensional modeling device based on GIM data, which comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein the three-dimensional modeling method based on the GIM data is realized when the processor executes the computer program, and the working principles and beneficial effects of the three-dimensional modeling device based on the GIM data are in one-to-one correspondence, so that the description is omitted.
The present invention may take the form of a computer program product embodied on one or more storage media (including, but not limited to, magnetic disk storage, CD-ROM, optical storage, etc.) having program code embodied therein. Computer-readable storage media include both non-transitory and non-transitory, removable and non-removable media, and information storage may be implemented by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information that can be accessed by a computing device.
It is to be understood that the embodiments of the application are not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be made without departing from the scope thereof. The scope of embodiments of the application is limited only by the appended claims.
The above examples merely represent a few implementations of the present examples, which are described in more detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that various modifications and improvements can be made to the present application without departing from the spirit of the embodiments of the application.

Claims (15)

1. A three-dimensional modeling method based on GIM data, comprising:
Analyzing a GIM file to obtain a reference relation of files among all levels of the GIM file as level information;
Screening the hierarchical information to obtain an MOD file and pose matrix information, and performing coordinate transformation on the MOD file according to the pose matrix information;
reading the MOD file after coordinate conversion to obtain first point information and first line information;
combining the first point information by comprehensively adopting an octree algorithm and a kd tree algorithm to obtain second point information;
Combining the second point information with the first line information, and connecting accurate line segments to obtain second line information;
Establishing a three-dimensional grid model of the entity according to the second line information;
the step of combining the first point information by comprehensively adopting an octree and kd-Tree algorithm to obtain second point information comprises the following steps:
According to the first point information, obtaining three-dimensional space ranges corresponding to all the first point information, and constructing an octree, wherein the three-dimensional space ranges are root nodes of the octree;
Starting from the root node, determining a current node, recursively dividing the current node into eight leaf nodes according to the average value of first point information in the current node until the number of the first point information in the current node is smaller than a preset number threshold or reaches a preset first division depth threshold, and obtaining a depth leaf set;
Constructing a kd tree according to the depth leaf set, and recursively performing binary segmentation on the depth leaf set in a multidimensional space until a preset second segmentation depth threshold is reached;
and carrying out nearest neighbor search on each node of the segmented kd tree, and merging nodes with nearest neighbor search distance smaller than a preset distance threshold value to obtain second point information.
2. The three-dimensional modeling method based on GIM data according to claim 1, wherein the parsing the GIM file to obtain a reference relationship of files between each hierarchy of the GIM file as hierarchy information comprises:
Analyzing the GIM file, and obtaining the reference relation of the file among the CBM level, the DEV level, the PHM level and the MOD level from the GIM file, wherein the reference relation comprises a peer reference relation and a nested reference relation;
and constructing a B-tree data structure according to the reference relation as hierarchy information.
3. The three-dimensional modeling method based on GIM data according to claim 1, wherein the filtering from the hierarchical information to obtain MOD files and pose matrix information, and performing coordinate transformation on the MOD files according to the pose matrix information, comprises:
screening the hierarchical information to obtain MOD hierarchical files as MOD files;
extracting homogeneous transformation matrixes in each level file from the level information to serve as pose matrix information;
For each node in the MOD hierarchy, inquiring a file of the previous hierarchy of the current hierarchy file by indexing according to the hierarchy information until the file of the highest hierarchy is inquired;
and after the inquiry of any level is completed, carrying out coordinate transformation on the MOD file according to the pose matrix information.
4. The GIM data-based three-dimensional modeling method of claim 1, wherein reading the MOD file after coordinate transformation to obtain first point information and first line information includes:
Reading the MOD file after coordinate conversion row by row;
Taking the identified line beginning with P as first point information, and converting point coordinates in the first point information into a vector form;
the identified row beginning with "R" is taken as the first line information.
5. The GIM data-based three-dimensional modeling method of claim 1, wherein the combining the second point information and the first line information, the accurate line segment connection, to obtain second line information, includes:
Reading a start point ID and an end point ID of a line from the first line information;
Searching coordinates and line width information of target points corresponding to the starting point ID and the end point ID in the second point information;
And updating the first line information according to the coordinates of the target point and the line width information to serve as second line information.
6. The GIM data-based three-dimensional modeling method of claim 5, wherein retrieving coordinates and line width information of the target point corresponding to the start point ID and the end point ID in the second point information includes:
Determining coordinate information of a corresponding candidate point according to the starting point ID and the end point ID;
Matching the coordinate information of the candidate points with the coordinate information of each point in the merging point set of the second point information, and taking the point corresponding to the coordinate information of the candidate points in the second point information as a target point corresponding to the starting point ID and the end point ID when the matching is successful;
and screening the second point information to obtain the coordinate and line width information of the target point.
7. The GIM data-based three-dimensional modeling method of claim 1, wherein the building a three-dimensional mesh model of an entity based on the second line information comprises:
creating a continuous curved object according to the second line information;
And establishing a three-dimensional grid model of the entity according to the curved surface object.
8. A GIM data-based three-dimensional modeling system, comprising:
the hierarchical information acquisition module is used for analyzing the GIM file to obtain the reference relation of the file among all the hierarchies of the GIM file as hierarchical information;
The file screening module is used for screening the MOD file and the pose matrix information from the level information and carrying out coordinate conversion on the MOD file according to the pose matrix information;
the information acquisition module is used for reading the MOD file after coordinate conversion to obtain first point information and first line information;
The point merging module is used for merging the first point information by comprehensively adopting an octree and kd-Tree algorithm to obtain second point information;
the line information updating module is used for combining the second point information with the first line information, and connecting accurate line segments to obtain second line information;
The modeling module is used for establishing a three-dimensional grid model of the entity according to the second line information;
The point merging module is specifically configured to:
According to the first point information, obtaining three-dimensional space ranges corresponding to all the first point information, and constructing an octree, wherein the three-dimensional space ranges are root nodes of the octree;
Starting from the root node, determining a current node, recursively dividing the current node into eight leaf nodes according to the average value of first point information in the current node until the number of the first point information in the current node is smaller than a preset number threshold or reaches a preset first division depth threshold, and obtaining a depth leaf set;
Constructing a kd tree according to the depth leaf set, and recursively performing binary segmentation on the depth leaf set in a multidimensional space until a preset second segmentation depth threshold is reached;
and carrying out nearest neighbor search on each node of the segmented kd tree, and merging nodes with nearest neighbor search distance smaller than a preset distance threshold value to obtain second point information.
9. The GIM data-based three-dimensional modeling system of claim 8, wherein the hierarchical information acquisition module is specifically configured to:
Analyzing the GIM file, and obtaining the reference relation of the file among the CBM level, the DEV level, the PHM level and the MOD level from the GIM file, wherein the reference relation comprises a peer reference relation and a nested reference relation;
and constructing a B-tree data structure according to the reference relation as hierarchy information.
10. The GIM data-based three-dimensional modeling system of claim 8, wherein the file screening module is specifically configured to:
screening the hierarchical information to obtain MOD hierarchical files as MOD files;
extracting homogeneous transformation matrixes in each level file from the level information to serve as pose matrix information;
For each node in the MOD hierarchy, inquiring a file of the previous hierarchy of the current hierarchy file by indexing according to the hierarchy information until the file of the highest hierarchy is inquired;
and after the inquiry of any level is completed, carrying out coordinate transformation on the MOD file according to the pose matrix information.
11. The GIM data-based three-dimensional modeling system of claim 8, wherein the information acquisition module is specifically configured to:
Reading the MOD file after coordinate conversion row by row;
Taking the identified line beginning with P as first point information, and converting point coordinates in the first point information into a vector form;
the identified row beginning with "R" is taken as the first line information.
12. The GIM data-based three-dimensional modeling system of claim 8, wherein the line information updating module is specifically configured to:
Reading a start point ID and an end point ID of a line from the first line information;
Searching coordinates and line width information of target points corresponding to the starting point ID and the end point ID in the second point information;
And updating the first line information according to the coordinates of the target point and the line width information to serve as second line information.
13. The GIM data-based three-dimensional modeling system of claim 12, wherein the retrieving coordinates and line width information of the target point corresponding to the start point ID and the end point ID in the second point information includes:
Determining coordinate information of a corresponding candidate point according to the starting point ID and the end point ID;
Matching the coordinate information of the candidate points with the coordinate information of each point in the merging point set of the second point information, and taking the point corresponding to the coordinate information of the candidate points in the second point information as a target point corresponding to the starting point ID and the end point ID when the matching is successful;
and screening the second point information to obtain the coordinate and line width information of the target point.
14. The GIM data-based three-dimensional modeling system of claim 8, wherein the modeling module is specifically configured to:
creating a continuous curved object according to the second line information;
And establishing a three-dimensional grid model of the entity according to the curved surface object.
15. A GIM data-based three-dimensional modeling apparatus comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing a GIM data-based three-dimensional modeling method as claimed in any one of claims 1 to 7 when the computer program is executed.
CN202410914351.7A 2024-07-09 2024-07-09 A three-dimensional modeling method, system and device based on GIM data Active CN118887333B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410914351.7A CN118887333B (en) 2024-07-09 2024-07-09 A three-dimensional modeling method, system and device based on GIM data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410914351.7A CN118887333B (en) 2024-07-09 2024-07-09 A three-dimensional modeling method, system and device based on GIM data

Publications (2)

Publication Number Publication Date
CN118887333A CN118887333A (en) 2024-11-01
CN118887333B true CN118887333B (en) 2025-04-22

Family

ID=93227160

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410914351.7A Active CN118887333B (en) 2024-07-09 2024-07-09 A three-dimensional modeling method, system and device based on GIM data

Country Status (1)

Country Link
CN (1) CN118887333B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109345619A (en) * 2018-08-10 2019-02-15 华北电力大学(保定) A method for spatial management of massive point clouds based on octree-like coding
CN113221297A (en) * 2021-03-29 2021-08-06 湘潭大学 Method for converting power grid information model into FBX three-dimensional model and storing attributes

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101950433A (en) * 2010-08-31 2011-01-19 东南大学 Building method of transformer substation three-dimensional model by using laser three-dimensional scanning technique
CN111985161B (en) * 2020-08-21 2024-06-14 广东电网有限责任公司清远供电局 A method for reconstructing three-dimensional model of substation
CN112419488B (en) * 2020-12-08 2023-08-29 国网江苏省电力工程咨询有限公司 A method for converting power grid information model GIM into point cloud
CN116597294B (en) * 2023-05-04 2025-11-25 杭州市北京航空航天大学国际创新研究院(北京航空航天大学国际创新学院) SLAM map topology evaluation methods, devices, electronic equipment and storage media

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109345619A (en) * 2018-08-10 2019-02-15 华北电力大学(保定) A method for spatial management of massive point clouds based on octree-like coding
CN113221297A (en) * 2021-03-29 2021-08-06 湘潭大学 Method for converting power grid information model into FBX three-dimensional model and storing attributes

Also Published As

Publication number Publication date
CN118887333A (en) 2024-11-01

Similar Documents

Publication Publication Date Title
Tsai Delaunay triangulations in TIN creation: an overview and a linear-time algorithm
CN113269870B (en) Multi-resolution digital terrain integration method based on three-dimensional subdivision grids
CN110415362B (en) Overlapping point cloud fusion method
CN112465949B (en) Large-scale point cloud data organization method based on nested octree
CN112181991B (en) A Grid Remapping Method for Earth Simulation System Based on Rapid Construction of KD Tree
CN114898043A (en) Laser point cloud data tile construction method
CN113094463A (en) Unstructured point cloud storage method, device, equipment and medium
CN120807802B (en) Drawing method for manufacturing three-dimensional model based on three-dimensional laser point cloud
CN119962056B (en) Lightweight processing method and system for substation GIM model
CN113326343B (en) Road network data storage method and system based on multi-level grids and file indexes
CN118887333B (en) A three-dimensional modeling method, system and device based on GIM data
Jones et al. The implicit triangulated irregular network and multiscale spatial databases
CN120976476A (en) A Method for Constructing Electronic Fences for Substation Equipment Alarms Based on 3D Modeling
CN113849495B (en) A point cloud dynamic hash partitioning method and device
CN118229556B (en) Geographic information element merging method and device
CN121435423A (en) A method for digital reconfiguration of power distribution networks based on 3D point clouds
CN108509618B (en) Big data multidimensional data indexing method based on space filling curve
CN118012867A (en) Method, equipment and medium for quickly constructing BOM (binary object model) relationship tree
CN117235080A (en) Index generation and similarity search methods and devices for large-scale high-dimensional data
CN115952250A (en) Spatial sub-table method based on spatial dynamic grid
CN116303436A (en) A data storage method and system based on an extensible multi-dimensional learning index structure
CN116168178A (en) Automatic modeling method and device based on substation site cloud data
CN108170987B (en) BIM technology-based PBS structure automatic hanging method
CN120721064B (en) A Robot Localization and Mapping Method Based on an Improved Octree Structure
CN120746453B (en) Artificial Intelligence-Based Tooling Management and Warehouse Layout Optimization Method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant