Digital twin pipeline model generation system and method
By automatically parsing table files to generate 3D pipeline models, the problem of low efficiency and poor parameter consistency in existing manual modeling technologies is solved. This enables the construction of efficient and low-error digital twin pipeline models, supporting operation by non-technical personnel.
Patent Information
- Application Number
- CN202511734060.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2025-12-23
AI Technical Summary
The construction of existing digital twin pipeline models relies on manual modeling, which is inefficient, error-prone, has poor parameter consistency, and has a high operational threshold, making it difficult for non-professionals to complete independently.
It automatically parses pipeline data by importing spreadsheet files and generates editable 3D pipeline models, including data import, parsing, conversion, and 3D modeling modules, lowering the barrier to entry and supporting operation by non-technical personnel.
Significantly improves generation efficiency, ensures consistency between the model and actual data, reduces human error, supports rapid updates and editing, and expands the usage scenarios for non-technical personnel.
Smart Images

Figure CN121190682A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of building energy, and in particular to a digital twin pipeline model generation system and method. BACKGROUND
[0002] In the field of building energy, a digital twin pipeline model can present the heating, cooling, water, and gas pipelines of a building as a three-dimensional model image, and can even access real-time data from the field. Management personnel can clearly see the status of each pipeline and device on the screen, so that when an anomaly occurs, the problem location can be quickly located, reducing downtime and maintenance costs. Before modification or expansion, the model can also be used for rehearsal, reducing rework and risk.
[0003] In the prior art, the construction of a digital twin pipeline model usually relies on general three-dimensional modeling software such as 3DMax and Revit, and the model is built by manually establishing pipe sections, nodes, and their connection relationships. This manual modeling method has obvious shortcomings: first, the number of nodes in the pipeline system is large, and the topological connection relationship is complex, so manual building and checking is time-consuming and labor-intensive, and errors such as missing connections and incorrect connections are likely to occur, resulting in low overall efficiency; second, the consistency of the model with actual engineering parameters (such as pipe diameter and length) is difficult to guarantee, and the degree of parameterization is limited, so when the field parameters change, the model often needs to be rebuilt or extensively modified by hand, resulting in high maintenance costs; third, the process highly depends on personnel with professional modeling skills, and the operation threshold is high, so non-technical personnel cannot independently complete model construction and maintenance. The above problems to some extent restrict the rapid delivery and iterative update of the digital twin pipeline model. SUMMARY
[0004] To solve the problems in the prior art, the present application provides a digital twin pipeline model generation system and method, which can enable users to generate editable three-dimensional pipeline models without manual modeling, by only importing a table file, thereby reducing the use threshold and facilitating error correction and maintenance.
[0005] According to an embodiment of the present application, in one aspect, a digital twin pipeline model generation system is provided, which includes: A data import module is configured to import pipeline model data from a spreadsheet file, and the spreadsheet file includes one or more worksheets. a data parsing module, configured to parse the pipeline model data, and generate a corresponding custom data structure for each worksheet; the data parsing module is further configured to identify the content of the header row, identify and extract the content of the cells other than the header row, classify the extracted information based on a preset rule to obtain multiple groups of pipeline data, and construct a mapping table associated with the cell content according to the index information of the cell and the corresponding header item; the data parsing module is further configured to encapsulate the mapping table, the cell content and the pipeline data in the corresponding custom data structure; the pipeline data includes node class information and connection class information, and the node class information includes one or more of node ID, type, diameter and length; a data conversion module, configured to convert the pipeline data in the custom data structure into self-owned data, the self-owned data including node information and connection information associated with each pipeline, the node information at least including node ID, type, diameter and endpoint coordinates, and the connection information being used to represent the topological connection relationship between nodes; a three-dimensional modeling module, configured to call a parameterized component library, generate corresponding three-dimensional components according to the node information, and assemble the three-dimensional components according to the connection information to generate a three-dimensional pipeline model; a display and interaction module, configured to render the three-dimensional pipeline model, and provide at least one of zooming, rotating, roaming, object selecting and attribute querying interaction functions; a storage module, configured to store the custom data structure, the self-owned data and the three-dimensional pipeline model; the storage module further pre-stores the parameterized component library for the three-dimensional modeling module to call; wherein a node is defined as a modeling unit of a pipeline, each pipeline is associated with multiple nodes and corresponds to a group of pipeline data; the modules communicate data and instructions through a data interface.
[0006] Further, When the data parsing module identifies the content of the header row, the identified string is parsed into an enumeration value within a preset range according to a preset rule, and the enumeration value is associated with the index information of the cell in which the string is located; When the data parsing module identifies and extracts the content of the cells other than the header row, if the header item corresponding to the target cell is numerical information, the cell content is parsed into numerical information and the parsing result is extracted; if the target cell contains a connection field, the connection field is parsed into an information list according to the separator in the connection field and a preset rule, and the parsing result is extracted; if the target cell contains a string that can be mapped into an enumeration value, the identified string is parsed into an enumeration value within a preset range according to a preset rule; The data analysis module associates the extracted analysis result with the corresponding table header item through the index information corresponding to the target cell.
[0007] Further, when the data analysis module classifies the extracted information based on the preset rule, it distributes the node class information and the connection class information associated with the same pipeline to the corresponding cache set according to the mapping relationship between the index information of the cell and the table header item, and obtains multiple groups of pipeline data. Before being distributed to the corresponding cache set, the data analysis module filters the node class information and the connection class information of the corresponding node according to the type in the node class information and the preset type mapping rule, and removes the data items that do not match the type. When being distributed to the corresponding cache set, the node ID in the node class information is sequentially arranged according to the adjacent relationship determined by the connection class information.
[0008] Further, when the data analysis module distributes the node class information and the connection class information associated with the same pipeline to the corresponding cache set, it generates a node pipeline connection list according to the node ID, type in the node class information and the connection class information, and verifies the node pipeline connection list. If there is a null value in the node pipeline connection list, the null value is replaced with a default value. The node pipeline connection list is used to represent the connection relationship between different pipelines.
[0009] Further, when the data conversion module converts the pipeline data into self-owned data, it performs corresponding conversion operations on the node class information according to the type of the node to finally obtain node information, including: If the type is a straight pipe, the node is marked as a straight pipe segment object, and the start point coordinates and end point coordinates of the node are calculated according to the length and coordinates; If the type is an elbow, the node is marked as a curved segment object, and the start point coordinates and end point coordinates of the node are calculated according to the connection class information; If the type is a three-way or four-way, the node is marked as a branch node object, and the end point coordinates of the node are calculated according to the corresponding connection class information.
[0010] Further, when the three-dimensional modeling module generates a three-dimensional pipeline model: The end point coordinates corresponding to adjacent nodes are verified. If the two end point coordinates of the connection relationship are inconsistent, the downstream end point coordinates are updated to the upstream end point coordinates, and a three-dimensional pipeline model is generated according to the updated node information. The straight pipe segment objects connected to both ends of the curved segment object are detected, two direction vectors are calculated according to the start point coordinates and end point coordinates of the straight pipe segment objects, a bending angle of the curved segment object is calculated according to the two direction vectors, and a three-dimensional pipe model is generated according to the bending angle. The end points corresponding to the adjacent nodes are checked, if the diameters of the two end points of the connection relationship are inconsistent, a variable diameter pipe fitting is inserted between the two end points according to the diameters of the two end points.
[0011] Further, when the three-dimensional modeling module generates a three-dimensional pipe model, if the self-owned data contains multiple continuous straight pipe segment objects, the multiple straight pipe segment objects are merged into one straight pipe segment object, and a three-dimensional pipe model is generated accordingly.
[0012] Further, when the display and interaction module receives an editing operation of the three-dimensional pipe model by a user, the editing operation is converted into an update instruction for the self-owned data, which is submitted through a data interface to trigger an incremental update of the three-dimensional modeling module, and the updated self-owned data is synchronously stored by the storage module.
[0013] On the other hand, according to an embodiment of the present application, a digital twin pipe model generation method is provided, which is implemented based on the digital twin pipe model generation system as described above; the digital twin pipe model generation method comprises the following steps: S1: obtaining pipe model data; S2: based on a preset analysis rule, analyzing the pipe model data, generating a custom data structure and caching; S3: converting the custom data structure into self-owned data recognizable by the system; S4: according to the self-owned data, calling a parameterized component library to generate an interactive three-dimensional pipe model.
[0014] On the other hand, according to an embodiment of the present application, a digital twin pipe model generation method is provided, which is implemented based on the digital twin pipe model generation system as described above; the digital twin pipe model generation method comprises the following steps: S5: obtaining a pre-stored three-dimensional pipe model from a storage module, and displaying and interacting through a display and interaction module; S6: when receiving an editing operation of the three-dimensional pipe model by a user, converting the editing operation into an update instruction for the self-owned data, submitting through a data interface to trigger an incremental update of the three-dimensional modeling module, and synchronously storing the updated self-owned data (and the updated three-dimensional pipe model) by the storage module.
[0015] The technical scheme provided by the embodiment of the present disclosure can include the following beneficial effects: The data is automatically parsed based on the table file, manual modeling is not required, the generation efficiency is significantly improved, the model is directly associated with the coordinates and parameters in the table, the model is highly consistent with the actual data, human error is minimized, subsequent editing is supported, the model can be updated by modifying the table data or scene operation, and no re-modeling is required, and non-technical personnel can also complete pipeline model generation by editing the table file, and the use threshold is significantly reduced.
[0016] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and are not limiting to the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiment or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0018] Figure 1 FIG. 1 is a module schematic diagram of a digital twin pipeline model generation system in an embodiment; Figure 2 FIG. 2 is an interface schematic diagram when the digital twin pipeline model generation system opens a configuration scene in an embodiment; Figure 3 FIG. 3 is an interface schematic diagram when the digital twin pipeline model generation system clicks to import a configured table in an embodiment; Figure 4 FIG. 4 is an interface schematic diagram when the digital twin pipeline model generation system generates a configured pipeline and pipe fitting in an embodiment; Figure 5 FIG. 5 is a related code schematic diagram used for caching data in the digital twin pipeline model generation system in an embodiment; Figure 6 FIG. 6 is a flow schematic diagram of a digital twin pipeline model generation method in an embodiment; Figure 7 FIG. 7 is a flow schematic diagram of a digital twin pipeline model generation method in an embodiment; Figure 8 FIG. 8 is a flow schematic diagram of a digital twin pipeline model generation method in an embodiment. DETAILED DESCRIPTION
[0019] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative effort fall within the scope of the present application.
[0020] The traditional digital twin pipeline model needs to be manually modeled through external software such as 3DMax and Revit, and the following problems exist: 1. The pipeline nodes are many, the connection relationship is complex, manual modeling is low in efficiency and prone to errors; 2. The model has low matching degree with actual parameters (such as pipe diameter and length), and needs to be re-modeled for later modification, which is high in maintenance cost; 3. It depends on professional modeling personnel, and non-technical personnel are difficult to operate.
[0021] The digital twin pipeline model generation system and method provided by the embodiments of the present application are applied to a building energy field digital twin system (such as a heating, ventilation and air conditioning, water supply and drainage, and fire pipeline system), automatically recognize pipeline and pipe information based on an Excel table data, and generate a pipeline model, involve data analysis technology, 3D pipeline generation algorithm, information interaction technology, and the like, provide a method for automatically generating a pipeline model based on an Excel table data for a digital twin pipeline system development and maintenance personnel, do not need external modeling tools, directly generate an editable 3D pipeline model through coordinates, pipeline parameters and connection relationships in the table, reduce development cost, support rapid deployment and secondary editing, and expand the use scenarios of non-technical personnel.
[0022] Referring to Figure 1 In one embodiment, a digital twin pipeline model generation system is provided, comprising: A data import module, configured to import pipeline model data from a spreadsheet file, the spreadsheet file comprising one or more worksheets; A data analysis module, configured to analyze the pipeline model data, and generate a corresponding custom data structure for each worksheet; the data analysis module is further configured to identify the content of a header row, identify and extract the content of cells other than the header row, classify the extracted information into multiple groups of pipeline data based on a preset rule, and construct a mapping table associated with the content of the cells according to the index information of the cells and the corresponding header items; the data analysis module is further configured to encapsulate the mapping table, the content of the cells and the pipeline data in the corresponding custom data structure; the pipeline data comprises node class information and connection class information, and the node class information comprises one or more of a node ID, a type, a diameter and a length. a data conversion module configured to convert pipeline data in the custom data structure into self-owned data, the self-owned data including node information and connection information associated with each pipeline, the node information including at least node ID, type, diameter, and endpoint coordinates, and the connection information being used to represent a topological connection relationship between nodes; a three-dimensional modeling module configured to call a parameterized component library, generate corresponding three-dimensional components according to the node information, and assemble the three-dimensional components according to the connection information to generate a three-dimensional pipeline model; a display and interaction module configured to render the three-dimensional pipeline model and provide at least one of zooming, rotating, roaming, object selecting, and attribute querying functions; a storage module configured to store the custom data structure, the self-owned data, and the three-dimensional pipeline model; the storage module also pre-stores the parameterized component library for the three-dimensional modeling module to call; wherein a node is defined as a modeling unit of a pipeline, each pipeline is associated with multiple nodes and corresponds to a group of pipeline data; the modules are connected through data interfaces for data and instruction transmission.
[0023] The spreadsheet file can be in a file format of xls, xlsx, csv, etc. A user establishes and edits the spreadsheet file in software such as Excel, for example, a header row records header item names such as “pipeline ID”, “node ID”, “type”, “coordinates”, “diameter”, “radius”, and “length”; and each of the following rows fills in corresponding information according to the names in the header row, for example, the “pipeline ID” column fills in the ID number of the pipeline, the “node ID” column fills in multiple node IDs of the pipeline, or multiple “node ID” columns are established.
[0024] In an embodiment, when the data analysis module identifies the content of the header row, it parses the identified string into an enumeration value within a preset range according to a preset rule, and associates the enumeration value with index information of the cell where the string is located, for example, the header row information is mapped to numbers 1-20 by default, and the imported data has header items of “pipeline ID”, “node ID”, “type”, “coordinates”, “radius”, and “length”, which are converted into 1, 2, 3, 4, 7, and 8, respectively.
[0025] When the data analysis module identifies and extracts the content of the cells other than the header row, if the header item corresponding to the target cell is numerical information such as "length", "diameter" and "coordinate", the content of the cell is parsed as numerical information and the parsed result is extracted; if the target cell contains a connection field, the connection field is parsed into an information list according to the separator in the connection field and the preset rule, and the parsed result is extracted, such as splitting the multiple node IDs connected by the separator in the same cell into a node ID list; if the target cell contains a string that can be mapped to an enumeration value, such as "three-way" and "elbow", the identified string is parsed into an enumeration value within a preset range according to the preset rule; the data analysis module associates the extracted parsed result with the corresponding header item through the index information corresponding to the target cell.
[0026] In one embodiment, when the data analysis module classifies the extracted information based on the preset rule, it assigns the node class information and the connection class information associated with the same pipe to the corresponding cache set according to the mapping relationship between the index information of the cell and the header item based on different pipes, to obtain multiple groups of pipe data. Before being assigned to the corresponding cache set, the data analysis module filters the node class information and the connection class information of the corresponding node according to the type in the node class information and according to the preset type mapping rule, and removes the data items that do not match the type. When being assigned to the corresponding cache set, the node IDs in the node class information are sequentially arranged according to the adjacent relationship determined by the connection class information.
[0027] In one embodiment, when the data analysis module assigns the node class information and the connection class information associated with the same pipe to the corresponding cache set, it generates a node pipe connection list according to the node ID, type in the node class information and the connection class information, and verifies the node pipe connection list. If there is a null value in the node pipe connection list, the null value is replaced with a default value. The node pipe connection list is used to represent the connection relationship between different pipes.
[0028] Referring to Figure 2 and Figure 3 In one specific embodiment, when a user (such as a non-technical person) uses the system, the user can operate according to the following steps: entering the pipe configuration scene; clicking the "Import Excel Pipe Configuration" function button to pop up the local resource import panel; the panel displays an Excel format file (supporting.xls), selects the target table (such as "J2205_ Reheat (Cold Section) Steam Drain Pipe Installation Drawing") and confirms the import; the Excel parsing script parses the table data and extracts the content of each row (including pipe ID, node ID, node type, coordinate, etc.), and stores the extracted content in a custom data structure.
[0029] Excel parsing script relies on NPOI, pandas and other libraries to achieve efficient processing. After the user selects the file, the script loads the file through FileStream, creates a corresponding DataRowCollection collection container according to the number of worksheets, accurately stores the content according to the cell row and column index, and intelligently processes merged cells to ensure data integrity. The script automatically identifies the header row and builds a "field name-column index" mapping table to flexibly adapt to different table field orders. When extracting data line by line, accurately convert coordinates, radius, and other numerical values, split connection relationship fields, convert string types to enumeration values, and then encapsulate them into PipeNode objects, sorted by worksheet and stored in the memory list and global dictionary.
[0030] During the process, null values, format errors and other exceptions are accurately marked, and logs containing line numbers and original data are generated to provide high-quality structured data for subsequent caching, achieving smooth conversion from files to system usable data.
[0031] That is, open and read the content of the Excel file using FileStream. Excel has multiple sheets (Sheet). The script will prepare a "data container" (similar to DataTable's Rows, that is, DataRowCollection, used to store data by row) for each sheet according to the number of sheets. When reading each cell, put the value in the corresponding position in the container according to its row number and column number, ensuring accurate positioning. If a merged cell is encountered, the script will copy the value in the merged area to each cell position in that area, or record the merged range, ensuring that subsequent data usage will not lose information due to merging. Specifically, assuming that A1 to C1 in the first sheet are merged and display "Node ID", after reading, the script will correspond "Node ID" to A1, B1, C1 three positions (or at least remember that A1 is the start of the merge, and the merge range is A1:C1).
[0032] By building a "field name-column index" mapping, each field name is mapped to its corresponding column number (e.g. "type" in column 5), even if different users have different column orders due to personal input habits, the corresponding column can still be accurately read by field name.
[0033] Specifically, the accurate conversion of numerical values refers to converting text such as coordinates and radii (e.g., "12.5" or "1,234.56") into a unified format of numerical type, and processing unit conversion (such as mm to m), blank, thousandth symbol, regional decimal point, etc. if necessary. Splitting the connection field refers to the script splitting the connection list according to the agreed separator if a column writes multiple connection objects in a cell (e.g., "N001;N002,N003" or "N001|N002"). Converting string type to enumeration value converts text such as "straight pipe", "elbow", "valve" to enumeration constants in the program (e.g., PipeType.Straight / PipeType.Elbow / PipeType.Valve).
[0034] Assemble the fields parsed above (coordinates, radii, types, connections, etc.) into a PipeNode instance, classify them according to the worksheet, and put them into the corresponding memory list; at the same time, put them into a global dictionary with a globally unique key (such as NodeId) for quick lookup and cross-table association.
[0035] By converting string type to enumeration value, such as node type only having fixed values of Straight / Elbow / Valve / Unknown, avoid using free strings such as "elbow" and "valve" everywhere in the code, reduce bugs caused by spelling errors and case differences.
[0036] In a specific embodiment, after importing the table data, the cell content is first cleaned: Trim to remove spaces, unify full-width / half-width, unify case or Chinese synonyms, and then converted through a mapping table or Enum.TryParse, such as { "straight pipe" → Straight, "elbow" → Elbow, "valve" → Valve}; If not found, set to Unknown and record the error. If the cell contains "elbow", it is converted to the enumeration PipeType.Elbow; if the cell contains "Valve", it is converted to the enumeration PipeType.Valve; if the cell contains "unknown type X", it is set to PipeType.Unknown, and a prompt "unrecognized type: unknown type X" is given in the log. When splitting the connection relationship field, the original cell content is "N001; N002,N003" or "N001|N002", and the processing is to split it according to the separators ";, |", clean up the spaces, and get the connection array [N001, N002, N003]. Subsequently, these IDs can be used to find the corresponding nodes in the global dictionary to establish the topological relationship Each sheet has its own List for easy page handling or exporting; the global dictionary is like Dictionary<string, PipeNode>, with the key usually being the NodeId, for fast lookup, deduplication, and cross-sheet connection.
[0037] When identifying the table header, keyword matching or reserved tolerance can be used, such as "radius / pipe diameter / radius" being identified as Radius. When performing numerical analysis, localize the decimal point, thousandth, and unit. The data parsed from each row is assembled into a PipeNode instance and then placed in two places simultaneously: the "list" by sheet (one List per table) and the global "dictionary" (a large index for fast lookup by unique key). Encapsulation into a PipeNode object refers to packing the fields of this row (such as NodeId, coordinates, radius, type, connection relationship list, etc.) into a structured entity. This way, the data has clear types and attributes, making subsequent processing and verification easier.
[0038] Each sheet corresponds to a list in memory, which is used to save all PipeNodes in the table, preserving the order and grouping within the table, making it easy to perform statistics, export, and verify individual sheets. Storing in the global dictionary means that the same PipeNode is also placed in a global dictionary (key-value pair set) using its unique identifier (usually NodeId or SheetName+NodeId) as the key. This allows quick node lookup by key anywhere, facilitating the establishment of cross-table connection relationships (for example, a row "connected to N001" uses the global dictionary to find N001. For example, a workbook has two sheets: the main trunk and the branch; the data parsing module reads a row from the main trunk table, gets NodeId = N001, type = straight pipe, coordinates / radius, etc., and generates a PipeNode(N001,...).
[0039] PipeNode (Pipe Network Node) is a data object / class used to represent "nodes" in the pipe network, not a single pipe, but a point or component position in the pipe network, such as: pipe end point, turning point (elbow), branching / converging point (tee, cross), connection point with devices / valves / flanges, any key coordinate point defining the topology of the pipeline, source sheet name, notes, material, medium, etc.
[0040] An example of converting an Excel row to a PipeNode is given to help understand: The information obtained from Excel is ID=N001, X=120.5, Y=45.0, R=100, Type=Elbow, ConnectedIds=[N002,N003]. After parsing, we get: Id=N001, coordinate(120.5,45.0), radius=100, Type=Elbow, ConnectedIds=[N002,N003].
[0041] The import data operation is triggered by the "Import Excel Pipeline Configuration" function button, which is bound to the UI interaction event of the pipeline configuration scene. After clicking, it calls the local file selection interface. The interface has built-in file format verification. For example, when.xlsx and other formats are not supported, only Excel files with the.xls extension are displayed to avoid importing non-compatible files. The import panel calls the operating system's local file browsing interface (such as OpenFileDialog in Windows) to support users to navigate and select the target table through hierarchical folders. Users need to grant the application permission to read local files. After selecting the file, the interface displays a "Importing" status prompt (such as a progress bar or text prompt), and returns a confirmation message "Configuration table import complete" after successful import. If the file is damaged or the format is incorrect, the interface will pop up an error prompt "File cannot be parsed, please check the format" to help users know the current running status.
[0042] During import, if data is missing, the system uses a unified default value filling mechanism: whether it is a key field (such as "Pipeline ID", "Node ID", "Coordinate X") or a non-key field (such as "Node Length"), it is assigned a default value according to the preset rules (for example, the length of a straight pipe is 0 by default, and the coordinates are (0, 0, 0) by default), and no record is skipped. The data error handling method is: Format errors (such as non-numeric string coordinates) are directly skipped, without correction or filling; Content errors (such as negative pipe diameter, angle exceeding 360°) are not detected by the system and are handled directly according to the original value.
[0043] During this process, there is no special error prompt, active error correction or data completion mechanism. Missing value filling and format error skipping are automatically executed in the background and do not provide specific exception information to the user. Users will see the generated results through the display and interaction module, and correct errors through the generated results, which is more intuitive and convenient.
[0044] When extracting and classifying pipeline and pipe information, based on the imported Excel table data, the information is extracted and cached according to the following rules: 1. Basic information extraction: read the "pipe ID" "node ID" "node type" (straight pipe, tee, elbow) "node length" "node radius" "coordinates (X, Y, Z)" "connection relationship" (such as pipe ID and node ID of three-four pipe head link) in each row; 2. Classification cache: Read the Excel table data row by row, extract the core information of each row including "pipe ID" "node ID" "node type" "node parameters" "connection object", etc., to provide basic data support for subsequent classification cache and relationship record; Take "pipe ID" as the grouping basis, and classify the node information of the corresponding row into the cache set of this pipe, and refine the cache content according to the node type (straight pipe, tee, elbow), such as the radius and angle of the elbow cache, the branch connection relationship of the tee cache, the length and diameter of the straight pipe cache, to realize the centralized and clear storage of the node information of the same pipe; Synchronously record the node connection relationship, extract the "node ID" and "connection object" information of each row, and clearly associate the node with the pipe segment (such as the specific pipe segment connected by a tee node), form a "node-pipe connection relationship table", and guarantee the continuity of the pipe segment and avoid connection rupture or information loss.
[0045] When constructing the "node-pipe connection relationship table" in the classification cache stage, if there are data errors such as isolated nodes or pipe conflicts, the processing methods are as follows: for isolated nodes: when the "connection object" is empty or points to a non-existent node ID, the system does not perform special marking or prompting, and only processes according to the default rules - if the "connection object" field is missing, fill in the default value (such as an empty string by default), continue the cache process, and do not skip this node or provide any error feedback. For pipe conflicts: whether the node coordinates overlap (such as different pipe nodes at the same location) or the connection relationship is contradictory (such as nodes associated with nodes of different pipes), the system does not detect or process. The format error conflict data is directly skipped, and the content error conflict data (such as logically contradictory connection relationship) is stored in the cache according to the original value, without automatic correction or conflict marking or user prompting, and completely relies on the original table data to complete the cache and subsequent process. The entire process has no error, correction or completion mechanism, and all data errors are automatically processed by the system background according to the simplified rules, without feedback of abnormal information to the user.
[0046] In one embodiment, when the data conversion module converts the pipe data into self-owned data, the node class information is converted according to the type of the node to obtain the node information, including: If the type is a straight pipe, the node is marked as a straight pipe segment object, and the start point coordinates and end point coordinates of the node are calculated according to the length and coordinates; If the type is elbow, mark the node as bend object and calculate the start and end coordinates of the node according to the connection class information; If the type is tee or cross, mark the node as branch node object and calculate the coordinates of each end point of the node according to the corresponding connection class information.
[0047] In a specific embodiment, when converting the cached table data into a system-recognizable proprietary data format, the specific rules are as follows: 1. Pipeline body data: create a structured object for each pipeline ID, containing "node list" (each node contains ID, type, length, radius, coordinates) and "connection relationship table" (records the connection nodes with other pipelines); 2. Fitting data conversion: Straight pipe: associate node coordinates, length and radius, and convert into "straight pipe segment" object (such as node "001-01": start coordinates (-49295, 3484, 11050), end coordinates (calculated based on length and angle), radius 325); Elbow: convert into "bend segment" object based on "horizontal angle" and "radius" (such as node "004-02": angle 90°, radius 1067, associated with the coordinates of the front and rear straight pipe segments); Tee or cross: convert into "branch node" object based on "tee / cross pipe head / tail link" information (such as node "002-02": main pipeline ID "001", branch pipeline ID "003" "004", record the coordinates of three directions); The "node" concept here is essentially equivalent to "a specific segment of pipeline (or fitting)", rather than the traditional "spatial point". It is a digital abstraction of a specific pipeline, and the inclusion of start and end coordinates is to accurately define the spatial range of the pipeline - the start point marks the beginning of the pipeline, and the end point marks the end, together determining the length, direction and spatial path of the pipeline, providing core parameters for 3D model generation (such as the extension direction of straight pipe and the bending path of elbow). At the same time, since the system's error handling logic is "do not report errors or continue to generate remaining models after reporting errors, and manual correction is required to modify the table", the start and end points included in the node are more necessary as explicit digital basis: if the coordinate data of a segment of pipeline is incorrect (such as the start and end points coincide, resulting in abnormal length), the system will report an error but continue to generate other models, and the user needs to manually correct the start and end point fields of this node in the table to ensure that the spatial parameters of this pipeline are accurate when regenerating. Therefore, the inclusion of start and end points in the node is both a digital feature of "a segment of pipeline" and a basic data carrier that supports manual error correction.
[0048] The node class information and the connection class information obtained by the data analysis module are directly obtained from the imported data and only undergo preliminary analysis. The node information and the connection information obtained by the data conversion module have a high degree of consistency with the node class information and the connection class information. The difference is that the node class information can have length and coordinate information but does not have endpoint coordinate information. The data conversion module calculates the endpoint coordinates (the start point, the end point, or each endpoint of a multi-end point) according to the length and the coordinates, so that the node information includes information that is not included in the node class information (that is, information that is not included in the table file).
[0049] In one embodiment, when the three-dimensional modeling module generates a three-dimensional pipeline model, the endpoint coordinates corresponding to adjacent nodes are checked. If the two endpoint coordinates of the connection relationship are inconsistent, the downstream endpoint coordinate is updated to the upstream endpoint coordinate, and a three-dimensional pipeline model is generated according to the updated node information. The three-dimensional modeling module also detects straight pipe segment objects connected at both ends of a curved segment object, calculates two direction vectors according to the start point coordinates and the end point coordinates of the straight pipe segment objects, calculates the bending angle of the curved segment object according to the two direction vectors, and generates a three-dimensional pipeline model according to the bending angle. The three-dimensional modeling module also checks the endpoints corresponding to adjacent nodes. If the diameters of the two endpoints of the connection relationship are inconsistent, a variable-diameter pipe fitting is inserted between the two endpoints according to the diameters of the two endpoints.
[0050] In one embodiment, when the three-dimensional modeling module generates a three-dimensional pipeline model, if the self-owned data according to which the three-dimensional pipeline model is generated includes multiple consecutive straight pipe segment objects, the multiple straight pipe segment objects are merged into one straight pipe segment object, and a three-dimensional pipeline model is generated accordingly.
[0051] Referring to Figure 4 In one specific embodiment, when a pipeline model is generated by a 3D engine (such as a unity engine) based on the converted self-owned data, the following cases are included: 1. Straight pipe segment generation: according to the node coordinate list (such as the node 01 coordinates (-49295, 3484, 11050) to the node 02 coordinates of the pipeline “001”), combined with the radius parameter, a straight pipe 3D model is generated by a “pipeline generation algorithm”; 2. Generation of other pipe fittings: Elbow: according to the angle (such as 90°), the radius (such as 1067), and the coordinates of the front and rear straight pipe segments, a curved pipeline model with the corresponding angle and radian is generated to ensure smooth connection with the straight pipe segments; Three-way joint: based on the coordinate directions of the three branches, a three-way joint model with three interfaces is generated, and the interface sizes are matched with the radii of the connected pipelines; 3. Overall assembly: According to the connection table, the straight pipe sections and fittings of the same pipeline are spliced according to coordinates and angles to form a complete pipeline system 3D model, ensuring that each section is connected without gaps.
[0052] To ensure that each section is connected without gaps, the following measures are taken: (1) Coordinate reference unification and high-precision storage All node coordinates use the same world coordinate system (such as taking the reference point of the building mechanical and electrical model as the origin), avoiding misplacement caused by coordinate system offset.
[0053] Coordinate values are stored using double-precision floating-point type (double) instead of single-precision (float), reducing the accumulated floating-point error in large scenes (such as the coordinate error of a 1000m long pipeline can be controlled within 0.1mm).
[0054] (2) Forced alignment of connection point coordinates For adjacent nodes (such as the end of a straight pipe and the start of an elbow), after extracting the coordinate values of both, the latter coordinate is forced to be equal to the former (such as elbow start coordinate = straight pipe end coordinate), rather than relying on the original data in the table.
[0055] (3) Accurate calculation and matching of direction vectors For straight pipe sections: Calculate the direction vector from the start point to the end point (such as dir = endPos - startPos), ensuring that the inlet direction of the subsequent connected fittings (such as elbows) is consistent with this vector.
[0056] For elbows / three-way fittings: Calculate the bending angle based on the direction of the straight pipes connected at both ends (such as the angle between the inlet direction vector and the outlet direction vector of the elbow), ensuring that the angle error is ≤0.5°, avoiding gaps caused by angle deviation.
[0057] Direction vectors use unit vectors (normalized), reducing the impact of length deviation on direction calculation.
[0058] (4) Parameterized fitting adaptation The port size of all fittings (elbows, three-way fittings) strictly matches the diameter of the connected straight pipe (such as a straight pipe with a diameter of 100mm, and the elbow port also has an inner diameter of 100mm), ensuring physical size compatibility through parameterized models.
[0059] For different diameter connections (such as a straight pipe with a diameter of 100mm connected to a pipe with a diameter of 80mm), automatically insert a "reducing fitting" that adapts to different diameters at both ends, avoiding gaps caused by size mismatch.
[0060] In one embodiment, the display and interaction module, upon receiving a user's editing operation on the three-dimensional pipeline model, converts the editing operation into an update instruction for the self-owned data, submits via a data interface to trigger an incremental update of the three-dimensional modeling module, and synchronously stores the updated self-owned data by the storage module.
[0061] Specifically, regarding the model data storage and secondary editing method, it includes: 1. The generated pipeline model data is stored in a local configuration file, including pipeline ID, node parameters, 3D model association information, etc. 2. Enter the corresponding pipeline scene, the system reads the configuration file and generates a 3D pipeline model through the "pipeline generation algorithm"; Support secondary editing: can directly modify table data (such as adjusting node coordinates, pipe diameter) or manually edit in the scene (such as dragging the pipeline node, modifying the elbow angle), and automatically synchronize to the configuration file after modification, and the model is updated in real time.
[0062] In one specific embodiment, the pipeline generation algorithm includes the following stages and details: (1) Data preprocessing stage Data cleaning: filter invalid rows in the table (such as records missing pipeline ID, node coordinates), correct abnormal values (such as negative radius, out-of-range angle) (such as automatically set to the default value 50mm when radius <0).
[0063] Coordinate standardization: convert relative coordinates in the table (such as offset values relative to a device) to absolute coordinates in the world coordinate system (calculated through scene reference point parameters), ensuring uniformity of all node coordinates.
[0064] Relationship mapping: based on the "node-pipeline connection relationship table", a hash table (such as Dictionary<string, List <string>> ), store "Pipe ID -> Node ID list" "Node ID -> Associated Node ID list", facilitate quick query of connection relationship.
[0065] (2) Node sorting phase Path identification: for nodes under the same pipe ID, trace the path through the "connection relationship" (such as starting from the starting node, traversing in the order of "Node A -> Node B -> Node C"), generate a linear node sequence (avoid pipe breakage caused by unordered generation).
[0066] Branch processing: for three-way nodes, first determine the main pipe path (such as Node A -> three-way -> Node B), then branch the branch line (such as three-way -> Node C), and ensure the main branch line logic is clear.
[0067] (3) Segmentation generation phase According to the node type, call the corresponding generation function, the core logic is as follows: Straight pipe segment generation: Input the coordinates of two adjacent nodes (startPos, endPos) and the radius r, generate a cylinder through the Mesh API of the engine: Calculate the cylinder length L = Vector3.Distance(startPos, endPos); Generate a basic cylinder Mesh along the Z axis (radius r, length L, number of circular segmentations 32); Align the cylinder to the endPos - startPos direction vector through the rotation matrix, ensure that the straight pipe extends along the node connection line.
[0068] Elbow generation: Input the coordinates of the inlet node, outlet node, and bending angle θ, generate an arc-shaped elbow: Calculate the inlet direction vector dirIn = inlet node -> elbow node, and the outlet direction vector dirOut = elbow node -> outlet node; Take the elbow node as the center, calculate the arc path based on θ and the pipe radius r (such as the arc radius of a 90° elbow is 1.5r); Generate a Mesh with an arc along the arc path, ensure that the inlet is aligned with the previous straight pipe, and the outlet is aligned with the subsequent straight pipe.
[0069] Three-way generation: Input the main pipe direction (dirMain) and branch direction (dirBranch), generate a three-way structure; Generate a three-way model, the branch interface direction of the model and the main pipe direction correspond to the input direction.
[0070] (4) Connection optimization phase Mesh merge: merge consecutive straight pipes and fittings of the same pipe into a single mesh to reduce draw calls (e.g., 100 straight pipes merged into 1 mesh, rendering efficiency improved by 10 times).
[0071] UV mapping correction: automatically adjust UV coordinates after merging to ensure that pipe materials (such as insulation texture) are continuous and error-free at the connection point.
[0072] Normal unification: correct the mesh normal direction of the connection area to avoid visual gaps caused by lighting calculation (e.g., inconsistent light and shade on both sides of the connection point).
[0073] (5) Rendering adaptation stage LOD setting: create multiple levels of detail for the pipe model: display complete mesh (including thread and weld detail) at close range, simplify to basic cylinder at medium range, and display as a line at long range, balancing accuracy and performance.
[0074] Material binding: automatically bind the corresponding material according to the "pipe type" field in the table (e.g., steam pipe, water pipe) (e.g., use red high-temperature material for steam pipe, use blue material for water pipe).
[0075] Collision body addition: add non-convex collision bodies (such as MeshCollider) to the generated pipe model to support subsequent scene interaction operations (such as click selection, distance measurement).
[0076] Figure 5 Part of the code example of the cached data is given.
[0077] Referring to Figure 1 , Figure 6 and Figure 7 , in one embodiment, a digital twin pipe model generation method is provided, which is based on the digital twin pipe model generation system as described above; the digital twin pipe model generation method comprises the following steps: S1: obtaining pipe model data; S2: based on the preset analysis rule, analyzing the pipe model data, generating a custom data structure and caching; S3: converting the custom data structure into a system-recognizable self-owned data; S4: according to the self-owned data, calling the parametric component library to generate an interactive three-dimensional pipe model.
[0078] Referring to Figure 1 , Figure 6 and Figure 8 In one embodiment, a digital twin pipeline model generation method is provided, which is implemented based on the digital twin pipeline model generation system as described above; the digital twin pipeline model generation method comprises the following steps: S5: Obtain the pre-stored three-dimensional pipeline model from the storage module, and display and interact through the display and interaction module; S6: When receiving the editing operation of the user on the three-dimensional pipeline model, convert the editing operation into an update instruction for the self-owned data, submit via the data interface to trigger the incremental update of the three-dimensional modeling module, and synchronously store the updated self-owned data (and the updated three-dimensional pipeline model) by the storage module.
[0079] The digital twin pipeline model generation system and method provided by the embodiments of the present application have the following advantages: 1. Efficiency: automatically parse data based on Excel tables, no need for manual modeling, and generation efficiency is improved by more than 80%; 2. Accuracy: directly associate coordinates and parameters in the table to ensure that the model completely matches the actual data and reduces human error; 3. Maintainability: support secondary editing, modify table data or scene operation to update the model, without the need for re-modeling; 4. Ease of use: non-technical personnel can complete pipeline model generation by editing Excel tables, reducing the use threshold.
[0080] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and actual implementation can have another division method, for example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the indirect coupling or communication connection of the device or module can be electrical, mechanical or other forms.
[0081] The modules described as separate components can or can not be physically separated, and the components displayed as modules can or can not be physical modules, and some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0082] In addition, each functional module in each embodiment of the present application can be integrated in one processing unit, or each module can exist physically, or two or more modules can be integrated in one unit. The above integrated unit can be realized in the form of hardware or in the form of hardware plus software functional unit.
[0083] It has to be noted that, in the present document, the terms "first", "second", etc. merely serve the purpose of differentiation and do not require or imply any kind of ordering or sequence of the entities or actions associated therewith. Furthermore, the terms "comprising", "containing", or any other similar term are intended to encompass non-exclusive inclusions, such that processes, methods, articles, or apparatuses that comprise a list of elements are not limited to those elements, but can include other elements not expressly listed or inherent to such processes, methods, articles, or apparatuses.< / string>
Claims
1. A digital twin pipeline model generation system, characterized in that, The digital twin pipeline model generation system includes: A data import module is used to import pipeline model data from a spreadsheet file, the spreadsheet file including one or more worksheets; The data parsing module is used to parse the pipeline model data and generate a corresponding custom data structure for each worksheet. The data parsing module is also used to identify the content of the header row, identify and extract the content of cells other than the header row, classify the extracted information into multiple sets of pipeline data based on preset rules, and construct a mapping table associated with the cell content based on the cell index information and the corresponding header item. The data parsing module is also used to encapsulate the mapping table, the cell content, and the pipeline data in the corresponding custom data structure. The pipeline data includes node class information and connection class information. The node class information includes one or more of the following: node ID, type, diameter, and length. The data conversion module is used to convert the pipeline data in the custom data structure into proprietary data. The proprietary data includes node information and connection information associated with each pipeline. The node information includes at least node ID, type, diameter and endpoint coordinates. The connection information is used to characterize the topological connection relationship between nodes. The 3D modeling module is used to call the parametric component library, generate corresponding 3D components based on the node information, and assemble the 3D components according to the connection information to generate a 3D pipeline model. The display and interaction module is used to render the three-dimensional pipeline model and provide at least one interactive function among scaling, rotation, roaming, object selection and attribute query. The storage module is used to store the custom data structure, the proprietary data, and the 3D pipeline model; the storage module also pre-stores the parametric component library for the 3D modeling module to call. In this context, nodes are defined as modeling units for pipelines, with each pipeline associated with multiple nodes and corresponding to a set of pipeline data; the modules transmit data and instructions through data interfaces.
2. The digital twin pipeline model generation system as described in claim 1, characterized in that: When the data parsing module identifies the content of the header row, it parses the identified string into an enumeration value within a preset range according to a preset rule, and associates the enumeration value with the index information of the cell where the string is located. When the data parsing module identifies and extracts the content of cells other than the header row, if the header item corresponding to the target cell is numeric information, the cell content is parsed into numerical information and the parsing result is extracted. If the target cell contains a connection field, the connection field is parsed into an information list according to the delimiter and preset rules in the connection field and the parsing result is extracted; if the target cell contains a string that can be mapped to an enumeration value, the recognized string is parsed into an enumeration value within a preset range according to the preset rules. The data parsing module associates the extracted parsing results with the corresponding header items using the index information of the target cell.
3. The digital twin pipeline model generation system as described in claim 1, characterized in that, When classifying the extracted information based on preset rules, the data parsing module uses different pipelines as a basis and, according to the mapping relationship between the cell index information and the header item, allocates the node class information and connection class information associated with the same pipeline to the corresponding cache set to obtain multiple sets of pipeline data. Before being allocated to the corresponding cache set, the data parsing module filters the node class information and connection class information of the corresponding node according to the type in the node class information and according to the preset type mapping rules, and removes data items that do not match the type. When allocating to the corresponding cache set, the node IDs in the node class information are arranged in order according to the adjacency relationship determined by the connection class information.
4. The digital twin pipeline model generation system as described in claim 3, characterized in that, When the data parsing module allocates node class information and connection class information associated with the same pipeline to the corresponding cache set, it generates a node pipeline connection list based on the node ID, type, and connection class information in the node class information, and verifies the node pipeline connection list. If there are empty values in the node pipeline connection list, the empty values are replaced with default values. The node pipeline connection list is used to represent the connection relationship between different pipelines.
5. The digital twin pipeline model generation system as described in claim 1, characterized in that, When the data conversion module converts pipeline data into its own data, it performs corresponding conversion operations on node class information according to the node type to finally obtain node information, including: If the type is a straight pipe, then the node is marked as a straight pipe segment object, and the starting coordinates and ending coordinates of the node are calculated based on the length and coordinates. If the type is an elbow, the node is marked as a curved segment object, and the starting and ending coordinates of the node are calculated based on the connection class information. If the type is a three-way or four-way, the node is marked as a branch node object, and the coordinates of each endpoint of the node are calculated according to the corresponding connection class information.
6. The digital twin pipeline model generation system as described in claim 5, characterized in that, When the 3D modeling module generates a 3D pipeline model: The coordinates of the endpoints corresponding to adjacent nodes are verified. If the coordinates of two endpoints with a connection are inconsistent, the coordinates of the downstream endpoint are updated to the coordinates of the upstream endpoint, and a three-dimensional pipeline model is generated based on the updated node information. The system detects the straight pipe segments connected to both ends of the curved segment object, calculates two direction vectors based on the starting and ending coordinates of the straight pipe segment object, calculates the bending angle of the curved segment object based on the two direction vectors, and generates a three-dimensional pipe model based on the bending angle. Verify the endpoints corresponding to adjacent nodes. If the diameters of the two endpoints that are connected are inconsistent, insert a reducing pipe between the two endpoints according to their diameters.
7. The digital twin pipeline model generation system as described in claim 5, characterized in that, When the 3D modeling module generates a 3D pipeline model, if the proprietary data on which it is based contains multiple consecutive straight pipe segment objects, then the multiple straight pipe segment objects are merged into one straight pipe segment object, and then a 3D pipeline model is generated accordingly.
8. The digital twin pipeline model generation system as described in claim 1, characterized in that, When the display and interaction module receives an editing operation from the user on the 3D pipeline model, it converts the editing operation into an update instruction for the proprietary data, submits it via the data interface to trigger an incremental update of the 3D modeling module, and the storage module synchronously stores the updated proprietary data.
9. A method for generating a digital twin pipeline model, characterized in that, The digital twin pipeline model generation method is implemented based on the digital twin pipeline model generation system as described in any one of claims 1-8; the digital twin pipeline model generation method includes the following steps: S1: Obtain pipeline model data; S2: Based on preset parsing rules, parse the pipeline model data, generate a custom data structure, and cache it; S3: Convert the custom data structure into system-recognizable proprietary data; S4: Based on the provided data, call the parameterized component library to generate an interactive 3D pipeline model.
10. A method for generating a digital twin pipeline model, characterized in that, The digital twin pipeline model generation method is implemented based on the digital twin pipeline model generation system as described in any one of claims 1-8; the digital twin pipeline model generation method includes the following steps: S5: Retrieve the pre-stored 3D pipeline model from the storage module and display and interact with it through the display and interaction module; S6: When receiving an editing operation from the user on the three-dimensional pipeline model, the editing operation is converted into an update instruction for the proprietary data, submitted via the data interface to trigger an incremental update of the three-dimensional modeling module, and the updated proprietary data is synchronously stored by the storage module.