A method for constructing a three-dimensional model of building equipment and a digital twin system
Through parameterized modeling and templated modeling technology, combined with dynamic data ID, the problem of automation and real-time synchronization of device model construction in digital twin systems is solved, and efficient and accurate three-dimensional model construction and physical system interaction are achieved.
Patent Information
- Application Number
- CN202411218605.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-09-02
AI Technical Summary
When building a three-dimensional model of construction equipment, the existing digital twin system has a long development cycle and high cost, the model is large in size and lacks real-time interaction capabilities with the physical system, making it difficult to meet the needs of complex energy management systems.
Parameterized modeling, rule-based modeling and template modeling are adopted, and CAD drawings are obtained for preprocessing, model layer and object location information is determined, prefabricated models are selected, and the model is automated and real-time, combined with dynamic data ID is used to realize the automatic construction of the model and real-time synchronous.
It greatly improves the degree of automation and accuracy of equipment model construction, reduces the time and cost of manual modeling, reduces human errors, and realizes real-time synchronization between the model and the physical system.
Smart Images

Figure CN118736139B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital twin systems, and in particular to a method for constructing a three-dimensional model of building equipment and a digital twin system. Background Art
[0002] In the building energy digital twin system, the energy systems including HVAC systems, water supply and drainage systems, fresh air systems, fire protection pipe systems, etc. are composed of various building spaces, equipment, pipelines, and terminal facilities to form a large and complex system, which has problems such as high difficulty in development and maintenance, and difficulty in application and deployment.
[0003] Traditional digital twin system models are generally developed directly based on external 3D engines. Although this method can create a highly realistic virtual environment, it usually requires deep programming skills and a deep understanding of the engine, resulting in a long development cycle and high costs. In addition, the customization and flexibility of external engines are limited, making it difficult to meet the complex needs of specific energy management systems.
[0004] Or modeling through external 3D editing software, such as Revit, 3DMax and other tools, although they can create fine 3D models, the models are large and detailed, resulting in poor performance when loaded and rendered in the digital twin system later. In addition, these models often lack the ability to interact with the physical system in real time, requiring additional development work to achieve dynamic update and synchronization of data.
[0005] In addition, as the physical system runs, data will continue to be generated and changed. How to achieve accurate synchronization between the virtual model and the physical system while ensuring the real-time nature of the data is a technical challenge. Summary of the invention
[0006] In response to the above technical problems, the present invention proposes a method for constructing a three-dimensional model of building equipment and a digital twin system, which combines the advantages of parametric modeling, rule-based modeling, and template-based modeling, greatly improving the automation and accuracy of equipment model construction. This solves the problems of the existing digital twin system, such as long development cycle, high cost, and large model volume.
[0007] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:
[0008] A first aspect of the present invention provides a method for constructing a three-dimensional model of construction equipment, comprising:
[0009] Obtaining CAD drawings and preprocessing the CAD drawings to display the two-dimensional models corresponding to the CAD drawings in 3D space;
[0010] On the 2D model, determine the model layer and model object of the 3D model to be created;
[0011] Determine the position information of each model object on the two-dimensional plane, the position information in the vertical direction, and its own height information to determine the three-dimensional coordinates of the three-dimensional model in the 3D space;
[0012] Determine the type of 3D model and select the corresponding prefabricated model from the preset model resource library;
[0013] An instance of the prefab model is created for each model object, and the position of each instance in the 3D space is determined according to the calculated three-dimensional coordinates to obtain a three-dimensional model.
[0014] Optionally, the CAD drawing is preprocessed to display the two-dimensional model corresponding to the CAD drawing in the 3D space, including:
[0015] Use the DWG format parsing script to parse the DWG format drawings and extract the drawing objects and their attribute information in the drawings. The attribute information includes coordinate information, size information and layer information.
[0016] The extracted drawing objects are classified and stored into corresponding preset data structures according to data types and layer information;
[0017] The stored drawing objects are traversed, and corresponding graphic elements are created in the 3D space according to the data types and attribute information of the drawing objects to obtain a two-dimensional model.
[0018] Optionally, on the 2D model, determine a model layer and a model object of a 3D model to be created, including:
[0019] When a legend line in a 2D model is selected, identify the name of the selected legend line and the layer name to which it belongs;
[0020] Traverse the selected layers, filter out all legend lines that match the selected legend line name, and get the model object.
[0021] Optionally, the extracted drawing objects are classified and stored into corresponding preset data structures according to data types and layer information, including:
[0022] The parsed drawing object is created as an instance according to the data type and layer, the instance stores the insertion point coordinates, the start and end point coordinates or the text content, and the instance is stored in a data table of the corresponding type;
[0023] Data types include any one or a combination of the following: block, line, curve, text, circle, ellipse, image.
[0024] Optionally, determine the height information of each model object itself, including:
[0025] The height value of the model object in the vertical direction input by the user is received, or the corresponding height value is automatically generated according to the association relationship between the prefabricated body model and the height value of the model object in the vertical direction.
[0026] Optionally, the method further comprises:
[0027] Extract label data related to the model object from the two-dimensional model;
[0028] Calculate the distance between each extracted label data and the model object;
[0029] Find the minimum distance from the calculated distances and bind the label data corresponding to the minimum distance to the model object.
[0030] Optionally, the method further comprises:
[0031] Get the card type of the 3D model;
[0032] Select the card template and card ID corresponding to the card type from the card resource library, and bind the card ID to the model object;
[0033] When the building equipment is running, confirming whether the card ID attribute of the model object is displayed and / or hidden according to the corresponding event;
[0034] When the detection result is displayed, the corresponding card information is displayed.
[0035] Optionally, the method further comprises:
[0036] A dynamic data ID is configured for the three-dimensional model, and the dynamic data ID is used to retrieve a corresponding data value from a data source, wherein the data source is operation data of building equipment;
[0037] Bind the dynamic data ID to the card object of the 3D model to display the retrieved data value on the card.
[0038] A second aspect of the present invention provides a digital twin system for constructing a three-dimensional model of construction equipment, comprising:
[0039] A drawing preprocessing module is used to obtain CAD drawings and preprocess the CAD drawings to display the two-dimensional model corresponding to the CAD drawings in 3D space;
[0040] A model creation module, used for determining a model layer and a model object of a three-dimensional model to be created on a two-dimensional model;
[0041] The model creation module is also used to determine the position information of each model object on the two-dimensional plane, the position information in the vertical direction, and its own height information, so as to determine the three-dimensional coordinates of the three-dimensional model in the 3D space;
[0042] The model creation module is also used to determine the type of the three-dimensional model and select the corresponding prefabricated model from the preset model resource library; create an instance of the prefabricated model for each model object, and determine the position of each instance in the 3D space according to the calculated three-dimensional coordinates to obtain the three-dimensional model.
[0043] Optionally, the system further comprises:
[0044] The label processing module is used to extract label data related to the model object from the two-dimensional model; calculate the distance between each extracted label data and the model object; find the minimum distance from the calculated distances, and bind the label data corresponding to the minimum distance to the model object.
[0045] Optionally, the system further comprises:
[0046] The card processing module is used to select the corresponding card template and card ID from the preset card resource library according to the selected card type when the card type is selected, and bind the card ID to the model object; when the building equipment is running, the card ID attribute of each model object is detected; when the card ID attribute exists and is valid, the corresponding card information is displayed.
[0047] Optionally, the system further comprises:
[0048] The data source processing module is used to configure a dynamic data ID for each 3D device, and the dynamic data ID is used to retrieve the corresponding data value from the data source; the dynamic data ID is bound to the card object of the 3D device to display the retrieved data value on the card.
[0049] The method for constructing a three-dimensional model of building equipment and the digital twin system provided by the present invention combine the advantages of parametric modeling, rule-based modeling, and template-based modeling, greatly improving the automation and accuracy of equipment model construction. By defining layer models and parameter information rules, the system can automatically parse the equipment information in the CAD drawings and generate three-dimensional equipment models in batches according to the rules configured by the user. This process greatly reduces the time and cost of manual modeling, while reducing the possibility of human error. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The drawings described herein are used to provide an optional understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:
[0051] Figure 1 A schematic diagram showing a flow chart of a method for constructing a three-dimensional model of building equipment provided by some embodiments of the present invention;
[0052] Figure 2 A schematic diagram showing a flow chart of a method for constructing a three-dimensional model of building equipment provided by some embodiments of the present invention
[0053] Figure 3 A schematic diagram showing a flow chart of a method for constructing a three-dimensional model of building equipment provided by some embodiments of the present invention;
[0054] Figure 4 A schematic diagram showing a flow chart of a method for constructing a three-dimensional model of building equipment provided by some embodiments of the present invention;
[0055] Figure 5 A schematic block diagram of a digital twin system provided by some embodiments of the present invention is shown;
[0056] Figure 6 A schematic diagram showing a flow chart of a method for constructing a three-dimensional model of building equipment provided by other embodiments of the present invention;
[0057] Figure 7 A schematic diagram of a method for importing a DWG format drawing into a three-dimensional scene provided by some embodiments of the present application is shown;
[0058] Figure 8 A schematic diagram of a method for identifying CAD layer data and generating a model provided in some embodiments of the present application is shown;
[0059] Fig. 9 A schematic diagram of a method for mapping cards and models and displaying them in batches provided in some embodiments of the present application is shown;
[0060] Fig.10 A schematic diagram of a method for identifying CAD layer data and generating a model provided in some embodiments of the present application is shown;
[0061] Fig.11 A schematic diagram of a method for mapping a data source with a card and displaying unique data provided by some embodiments of the present application is shown. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.
[0063] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0064] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it need not be optionally defined and explained in subsequent drawings.
[0065] The first aspect of this embodiment provides a method for constructing a three-dimensional model of building equipment. In some embodiments, Figure 1 , the method includes S1 to S5, wherein:
[0066] S1, obtaining a CAD drawing and preprocessing the CAD drawing to display a two-dimensional model corresponding to the CAD drawing in a 3D space.
[0067] The user starts the digital twin system and selects or creates a new 3D scene configuration environment. The DWG drawing file to be imported is selected from the user's local computer. The system starts processing the DWG file and prepares to convert its content into elements in the 3D scene. Through this step, the digital twin system successfully imports the CAD drawings in DWG format and converts them into models in the 3D scene, providing a basis for subsequent simulation, analysis and optimization.
[0068] S2, determining a model layer and a model object of a three-dimensional model to be created on the two-dimensional model.
[0069] Optionally, you can click on a specific legend line in the CAD model, which can be one or more. When a specific legend line is selected, the system captures the click event, obtains the layer name and legend name to which the line belongs, and filters out all legend lines with the same name, thereby obtaining a model object; when multiple specific legend lines are selected, the model object is directly obtained.
[0070] S3, determining the position information of each model object on the two-dimensional plane, the position information in the vertical direction, and its own height information, so as to determine the three-dimensional coordinates of the three-dimensional model in the 3D space.
[0071] Parse the position of each model object on the two-dimensional plane and in the vertical direction so that it can be correctly displayed in the three-dimensional space. Combine the two-dimensional plane coordinates with the height information to calculate the complete coordinates of the three-dimensional model in the 3D space.
[0072] S4, determining the type of the three-dimensional model, and selecting a corresponding prefabricated model from a preset model resource library.
[0073] The system retrieves and loads the corresponding prefab model file from the internal resource library or external database according to the model type and possible model ID selected by the user.
[0074] S5, creating an instance of the prefabricated model for each model object, and determining the position of each instance in the 3D space according to the calculated three-dimensional coordinates to obtain a three-dimensional model.
[0075] The system creates an instance of the prefab model for each selected legend, which is used to reconstruct the CAD model in the 3D scene. The calculated 3D coordinates are assigned to each model instance, which is then placed at the corresponding position in the 3D scene, completing the conversion from CAD layer data to 3D model. Through this series of steps, CAD layer data can be efficiently utilized to automatically generate 3D models.
[0076] The method for constructing a three-dimensional model of building equipment provided in this embodiment combines the advantages of parametric modeling, rule-based modeling, and templated modeling, greatly improving the degree of automation and accuracy of equipment model construction. This method provides convenience for developers and maintainers of digital twin systems such as HVAC systems, water supply and drainage systems, fresh air systems, and fire protection pipe systems. After the user imports the CAD drawings provided by the subsystem manufacturer and defines the model and parameter information rules of the layer, the configured rules can be used to batch generate equipment models for construction. The equipment model can be automatically generated without the need for external modeling, and the electromechanical drawing work of each system can be done based on the equipment model, reducing the development cost of the digital twin system and allowing for rapid replication. It can also be convenient for non-technical personnel to use and expand the scope of application.
[0077] Optionally, combined Figure 2 , S1 includes S11~S13, among which:
[0078] S11, using a DWG format parsing script to parse the DWG format drawing, extracting the drawing objects and their attribute information in the drawing, where the attribute information includes coordinate information, size information, and layer information;
[0079] The attribute information also includes color, etc.
[0080] S12, classifying the extracted drawing objects according to data types and layer information and storing them in corresponding preset data structures.
[0081] Use the DWG format parsing script to extract key information such as line names, coordinates, text content, layers and legend names in the drawings. The system creates corresponding data storage classes based on the extracted data types (such as line coordinates, text content, etc.), and stores the data by field. After standardization, it is convenient for subsequent data processing and 3D modeling.
[0082] S13, traversing the stored drawing objects, creating corresponding graphic elements in the 3D space according to the data types and attribute information of the drawing objects, and obtaining a two-dimensional model.
[0083] For example, the stored line coordinate information is traversed, and the line drawing method is used to draw the corresponding lines in the three-dimensional space. These lines will be accurately redrawn according to the position and attributes in the original DWG drawing to form a drawing model in the three-dimensional scene. During the drawing process, the line color, line type, line width and other attributes need to be considered to maintain consistency with the original DWG drawing.
[0084] Optionally, combined Figure 3 , S2 includes S21~S22, where:
[0085] S21, when a legend line in the two-dimensional model is selected, identifying the name of the selected legend line and the name of the layer to which it belongs;
[0086] S22, traverse the selected layer, filter out all legend lines that match the selected legend line name, and obtain the model object.
[0087] When a user clicks a specific legend line in the CAD model, the system captures the click event and obtains the layer name and legend name to which the line belongs. The legend name in each layer is checked to find all legend lines that match the selected legend name, thereby obtaining a model object. Building equipment includes one or more model objects.
[0088] Optionally, S12 includes: creating an instance of the parsed drawing object according to its data type and layer, storing the insertion point coordinates, the start and end point coordinates or the text content in the instance, and storing the instance in a data table of the corresponding type; the data type includes any one of the following or a combination thereof: insertion block, straight line, curve, text, circle, ellipse, image. The curve includes arc, polyline, etc.
[0089] In a specific implementation, the process of converting CAD drawing data into 3D scene data is as follows:
[0090] Use the DWG format parsing script to read the file stream, parse the bytes according to the DWG file format, and parse out the drawing objects of CAD drawings such as Insert, Line, Text, Layer, etc.
[0091] Create a new DWG format storage class, which contains a collection of drawing objects that save all CAD drawings, and a Layer list that saves all drawing object layers. The collection adds Line list, Lwpolyline list, Text list, Circle list, Arc list, Insert list, Ellipse list, Solid list, and Image list according to the drawing type of the CAD drawing.
[0092] Create an instance of the parsed object according to its drawing type in the CAD drawing, store the insertion point coordinates, start and end point coordinates, text content and other information in the instance, and store the instance in the corresponding type list. For example, store the Layer of the parsed object in the Layer list.
[0093] Get the root path of the generated drawing in the 3D scene, read each layer information of the Layer list in the storage class in turn, and create an object with the same name as the Layer under the root path.
[0094] Read the collection of drawing objects in the storage class, get each object instance in each type list in turn, create objects under the corresponding layer according to the layer information of the object, and draw lines or text in 3D space according to the type of the object.
[0095] Optionally, determining the position information of the model object in the vertical direction in S3 includes: receiving a height value of the model object in the vertical direction input by a user, or automatically generating a corresponding height value according to an association relationship between the prefabricated model and the height value of the model object in the vertical direction.
[0096] Specifically, the user inputs a height value through the function panel to assign a vertical position to the model object. Or the prefabricated model has an associated relationship with the height value, and the prefabricated model can correspond to the vertical height value of the three-dimensional model.
[0097] Optionally, in some other embodiments, combined with Figure 4 The method further includes S61 to S63, wherein:
[0098] S61, extracting label data related to the model object from the two-dimensional model.
[0099] Specifically, by clicking on the labels on the CAD model (such as equipment name, size, material, etc.), the system identifies the layers where these labels are located, thereby determining the source and type of data, which is the basis for subsequent data extraction and processing. The system extracts all relevant label data from the layer specified by the user, including text content, location information, etc.
[0100] S62, calculating the distance between each extracted label data and the model object.
[0101] Since the labels in the CAD model may not directly correspond to specific model objects, the system needs to find the most relevant labels for each model object by calculating the coordinates of the labels and model objects (such as equipment models, building models, etc.).
[0102] S63, finding the minimum distance from the calculated distances, and binding the label data corresponding to the minimum distance to the model object.
[0103] In this embodiment, all relevant label data text content is extracted from the selected layer. Usually, OCR (Optical Character Recognition) technology is involved if the label is in text form; if it is a parametric label, it may be directly extracted through the API of the CAD software. The coordinates of each label data are compared with the coordinates of the model object (such as a room, equipment, etc. in a three-dimensional model) to find the closest label. For example, the K nearest neighbor (KNN) algorithm is used.
[0104] The extracted and processed tag data is bound to the attributes of the model object according to its association with the model object. If there is a one-to-one correspondence between the tag and the model object, the tag data can be directly assigned to the model object as an attribute value.
[0105] The method provided in this embodiment realizes the preliminary association between label data and model objects through spatial position relationship, and provides a basis for subsequent data binding.
[0106] As the physical system runs, data will continue to be generated and changed. How to achieve accurate synchronization between the virtual model and the physical system while ensuring the real-time nature of the data is a technical challenge. Figure 4 The method further includes S71 to S73, wherein:
[0107] S71, obtaining the card type of the three-dimensional model; selecting a card template and a card ID corresponding to the card type from a card resource library, and binding the card ID to the model object.
[0108] According to business needs, design multiple card types (such as information display cards, interactive button cards, etc.), assign a unique ID to each card type, and establish a mapping relationship between the ID and the card type, which is stored in the configuration file or database. The card resource library is used to store card template files (HTML / CSS / JavaScript) and image resources. When the user selects a card type, the corresponding card template and ID are retrieved from the resource library according to the card type selected by the user.
[0109] S72, when the construction equipment is running, confirming whether the card ID attribute of the model object is displayed and / or hidden according to the corresponding event;
[0110] The corresponding event may exemplarily include clicking on a card of the model object, operating the card of the model object, etc.
[0111] S73, when the detection result is yes, the corresponding card information is displayed.
[0112] Of course, before displaying it, the card needs to be filled with the necessary data.
[0113] Optionally, combined Figure 4 The method further includes S81-S82, wherein:
[0114] S81, configuring a dynamic data ID for the three-dimensional model, where the dynamic data ID is used to retrieve a corresponding data value from a data source, where the data source is operating data of a building equipment;
[0115] S82, binding the dynamic data ID to the card object of the three-dimensional model to display the retrieved data value on the card.
[0116] Assign a globally unique identifier (GUID) or other unique encoding to each device as the device's dynamic data ID. Bind the device's dynamic data ID to the card object so that the card can access and display the data of the corresponding device. Specifically, when creating or editing a card, introduce a field to store the bound device data ID. The card retrieves and obtains the latest device data from the data source (such as a database, real-time data stream, etc.) through its bound dynamic data ID, displays the retrieved data value in real time on the corresponding control of the card, and sets an automatic update mechanism to ensure the real-time nature of the data. Specifically, set a timer or listener, such as triggering a data update operation every 3 seconds.
[0117] Through the method provided in this embodiment, the digital twin system can achieve accurate mapping and real-time data display between data sources and cards, providing strong support for digital monitoring and management of the physical world.
[0118] like Figure 5 As shown, the second aspect of this embodiment provides a digital twin system 1 for constructing a three-dimensional model of construction equipment, including:
[0119] The drawing preprocessing module 102 is used to obtain the CAD drawing and preprocess the CAD drawing to display the two-dimensional model corresponding to the CAD drawing in the 3D space;
[0120] In this embodiment, the function button for importing DWG drawings is found and activated in the system interface. This button may be located in the file menu, toolbar, or a specific import / export area. Through the pop-up file selection dialog box, browse the local file system to find and select the DWG file to be imported. After selecting the file, click the "Open" or "Confirm" button to start the import process.
[0121] The drawing preprocessing module 102 is specifically used to parse the DWG format drawings using the DWG format parsing script, extract the drawing objects and their attribute information in the drawings, and the attribute information includes coordinate information, size information and layer information; store the extracted drawing objects into corresponding preset data structures according to data type and layer information; traverse the stored drawing objects, and create corresponding graphic elements in the 3D space according to the data type and attribute information of the drawing objects to obtain the two-dimensional model.
[0122] Parse the CAD drawings. During the parsing process, it is necessary to extract key information from the drawings, such as line names, coordinates, text content, layers, and legend names. The extracted information needs to be stored for subsequent processing. According to the extracted data format, design and create corresponding storage classes or data structures. These classes or structures should be able to efficiently store and access the properties of elements such as lines and text. This information is usually stored in a structured manner (such as a dictionary, list, or database table).
[0123] The model creation module 104 is used to determine the model layer and model object of the three-dimensional model to be created on the two-dimensional model.
[0124] When the user clicks a specific legend line in the CAD model, the system captures the click event and obtains the layer name and legend name to which the line belongs. The legend names in each layer are checked to find all legends that match the selected legend name.
[0125] The model creation module 104 is also used to determine the position information of each model object on the two-dimensional plane, the position information in the vertical direction and its own height information, so as to determine the three-dimensional coordinates of the three-dimensional model in the 3D space.
[0126] Parse the position of each model object on the two-dimensional plane and assign a vertical position to the model so that it can be displayed correctly in three-dimensional space. Combine the two-dimensional plane coordinates with the height information to calculate the complete coordinates of the model in three-dimensional space.
[0127] The model creation module 104 is also used to determine the type of the three-dimensional model and select the corresponding prefabricated model from the preset model resource library; create an instance of the prefabricated model for each model object, and determine the position of each instance in the 3D space according to the calculated three-dimensional coordinates to obtain the three-dimensional model.
[0128] The system retrieves and loads the corresponding prefab model file from the internal resource library or external database according to the model type and possible model ID selected by the user. The system creates an instance of the prefab model for each filtered legend, which is used to reconstruct the CAD model in the 3D scene. The calculated 3D coordinates are assigned to each model instance, which is then placed at the corresponding position in the 3D scene to complete the conversion from CAD layer to 3D model. Through this series of steps, CAD layer data can be efficiently utilized to automatically generate 3D models.
[0129] The digital twin system provided in this embodiment combines the advantages of parametric modeling, rule-based modeling, and templated modeling, greatly improving the automation and accuracy of equipment model construction. This method is mainly for developers and maintenance personnel of digital twin systems such as HVAC systems, water supply and drainage systems, fresh air systems, and fire protection pipe systems. After the user imports the CAD drawings provided by the subsystem manufacturer and defines the model and parameter information rules of the layer, the equipment model can be generated in batches according to the user-configured rules for building equipment models. The equipment model can be automatically generated without the need for external modeling, and the electromechanical drawing work of each system can be done based on the equipment model, which reduces the development cost of the digital twin system and allows for rapid replication. It can also be convenient for non-technical personnel to use and expand the scope of application.
[0130] Optionally, the system also includes: a label processing module 106, which is used to extract label data related to the model object from the two-dimensional model; calculate the distance between each extracted label data and the model object; find the minimum distance from the calculated distances, and bind the label data corresponding to the minimum distance to the model object.
[0131] Optionally, the system also includes: a card processing module 108, which is used to select a corresponding card template and card ID from a preset card resource library according to the selected card type when a card type is selected, and bind the card ID to the model object; when the construction equipment is running, detect the card ID attribute of each model object; when the card ID attribute exists and is valid, display the corresponding card information.
[0132] Optionally, the system also includes: a data source processing module 110, which is used to configure a dynamic data ID for the three-dimensional model, and the dynamic data ID is used to retrieve corresponding data values from the data source, where the data source is the operating data of the construction equipment; the dynamic data ID is bound to the card object of the three-dimensional model to display the retrieved data value on the card.
[0133] In other embodiments, in combination Figure 6 The method comprises the following steps 1 to 6:
[0134] Step 1: Import DWG format drawings into the 3D scene;
[0135] Step 2, CAD layer data recognition and model generation;
[0136] Step 3, mapping the layer label data with the model and generating model data;
[0137] Step 4: The image pop-up window is mapped with the model and displayed in batches;
[0138] Step 5: Map the data source to the card and display the unique data.
[0139] Specifically, Figure 7 As shown, step 1 includes the following steps:
[0140] (1) Initialization step: First, enter the 3D scene configuration environment.
[0141] (2) Import operation: Activate the local resource import panel by clicking the "Import DWG drawings" function button.
[0142] (3) Drawing selection: Browse and select the CAD drawing file in DWG format in the import panel.
[0143] (4) Confirm import: After selecting the drawing, confirm to import it into the current 3D configuration scene.
[0144] (5) Data parsing and extraction: Use the DWG format parsing script to extract key information such as line names, coordinates, text content, layers and legend names in the drawings.
[0145] (6) Data storage: Create a storage class based on the data format extracted from the drawing and store fields in the corresponding format.
[0146] (7) Drawing lines: Traverse the stored line coordinate information and use the line drawing method to redraw the drawing lines in 3D space.
[0147] Specifically, Figure 8 As shown, step 2 includes the following steps:
[0148] (1) Use layer picking: Open the function panel and click the "Pick Model Layer" button to enter the layer selection state.
[0149] (2) Select a legend line: Click a legend line in the CAD model to obtain its layer name and legend name.
[0150] (3) Filter legends: Traverse the layer and find all model legends that match the selected legend name.
[0151] (4) Positioning plane coordinates: Based on the plane coordinate information of each legend, determine the position of the model on the two-dimensional plane.
[0152] (5) Set height information: Enter the height value through the function panel to assign a vertical position to the model.
[0153] (6) Calculate spatial coordinates: Combine the plane coordinates and height information to calculate the complete coordinates of the model in 3D space.
[0154] (7) Select model type: Select the model type you want to create in the function panel.
[0155] (8) Prefab matching: According to the model ID, the corresponding prefab model is retrieved and loaded from the resource library.
[0156] (9) Instantiate model: Create a prefab instance for each legend and place it in the 3D scene.
[0157] (10) Coordinate assignment: Assign the calculated 3D space coordinates to each model instance.
[0158] Specifically, Fig. 9 As shown, step 3 includes the following steps:
[0159] (1) Enter the data picking state: Click the "Pick Data Layer" button in the function panel to prepare to extract data from the CAD drawing.
[0160] (2) Select label data: Click the label data text on the drawing to identify the layer it is on.
[0161] (3) Extract label content: Extract all relevant label data text content from the layer.
[0162] (4) Calculate the nearest distance: Compare the coordinates of the label data and the model legend to find the label with the closest distance.
[0163] (5) Data binding: Bind the found tag data to the corresponding model object attributes.
[0164] Specifically, Fig.10 As shown, step 4 includes the following steps:
[0165] (1) Select the card type: In the function panel, select the card type you want to associate with the model.
[0166] (2) Get card resources: Retrieve the card template and ID from the resource library based on the selected card type.
[0167] (3) Bind card ID: Bind the card ID as an attribute to the generated model object. Compare the coordinates of the label data with the model legend to find the label that is closest to it.
[0168] (4) Runtime display: In the project's runtime environment, check the properties of each model object. If there is a bound card ID, create and display the corresponding card.
[0169] Specifically, Fig.11 As shown, step 5 includes the following steps:
[0170] (1) Configure device ID: In the device management panel, configure a unique dynamic data ID for the 3D device.
[0171] (2) Binding data ID: When binding or creating a card for a device, the dynamic data ID of the device is also bound to the card object.
[0172] (3) Data query: The card retrieves the corresponding data value from the data source through its bound dynamic data ID.
[0173] (4) Data display: Display the retrieved data value on the corresponding control of the card and set the data to be automatically updated every 3 seconds.
[0174] The method provided in this embodiment is mainly for developers and maintenance personnel of digital twin systems such as HVAC systems, water supply and drainage systems, fresh air systems, and fire protection pipe systems. It provides a scenario in which legends and layer information are automatically identified based on CAD drawings and equipment models are automatically generated. The unique equipment label information is matched based on the generated model, and the equipment model can be automatically generated without the need for external modeling. The electromechanical drawing of each system can be done based on the equipment model, thereby reducing the development cost of the digital twin system and enabling rapid replication. At the same time, it can also be convenient for non-technical personnel to use and expand the scope of application.
[0175] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A method for constructing a three-dimensional model of building equipment, characterized in that: include: Acquire a CAD drawing, and pre-process the CAD drawing to display a two-dimensional model corresponding to the CAD drawing in a 3D space; On the two-dimensional model, determining a model layer and a model object of a three-dimensional model to be created; Determine the position information of each model object on the two-dimensional plane, the position information in the vertical direction, and the height information thereof, so as to determine the three-dimensional coordinates of the three-dimensional model in the 3D space; Determine the type of the three-dimensional model, and select a corresponding prefabricated model from a preset model resource library; Creating an instance of the prefab model for each model object, and determining the position of each instance in the 3D space according to the calculated three-dimensional coordinates to obtain the three-dimensional model; On the two-dimensional model, determining a model layer and a model object of a three-dimensional model to be created includes: When a legend line in the two-dimensional model is selected, identifying the name of the selected legend line and the name of the layer to which it belongs; Traversing the selected layer, filtering out all legend lines matching the selected legend line name, and obtaining the model object; Determining the height information of each model object itself includes: receiving a height value of the model object in the vertical direction input by a user; Obtaining the card type of the three-dimensional model, selecting a card template and a card ID corresponding to the card type from a card resource library, and binding the card ID to the model object; Configuring a dynamic data ID for the three-dimensional model, wherein the dynamic data ID is used to retrieve a corresponding data value from a data source, wherein the data source is operation data of the building equipment; The dynamic data ID is bound to the card object of the three-dimensional model to display the retrieved data value on the card.
2. The method according to claim 1, characterized in that Preprocessing the CAD drawing to display the two-dimensional model corresponding to the CAD drawing in a 3D space includes: Use the DWG format parsing script to parse the DWG format drawings, extract the drawing objects in the drawings and their attribute information, the attribute information including coordinate information, size information and layer information; The extracted drawing objects are classified and stored into corresponding preset data structures according to data types and layer information; The stored drawing objects are traversed, and corresponding graphic elements are created in the 3D space according to the data types and attribute information of the drawing objects to obtain the two-dimensional model.
3. The method according to claim 2, characterized in that The extracted drawing objects are classified and stored into corresponding preset data structures according to data types and layer information, including: The parsed drawing object is created as an instance according to the data type and layer, the instance stores the insertion point coordinates, the start and end point coordinates or the text content, and the instance is stored in a data table of the corresponding type; The data type includes any one of the following items or a combination thereof: inserted block, straight line, curve, text, circle, ellipse, image.
4. The method according to any one of claims 1 to 3, characterized in that Also includes: Extracting label data related to the model object from the two-dimensional model; Calculate the distance between each extracted label data and the model object; The minimum distance is found from the calculated distances, and the label data corresponding to the minimum distance is bound to the model object.
5. The method according to claim 4, characterized in that Also includes: When the building equipment is running, confirming whether the card ID attribute of the model object is displayed and / or hidden according to the corresponding event; When the detection result is displayed, the corresponding card information is displayed.
6. A digital twin system for constructing a three-dimensional model of construction equipment, characterized in that: include: A drawing preprocessing module, used to obtain a CAD drawing and preprocess the CAD drawing to display a two-dimensional model corresponding to the CAD drawing in a 3D space; The model creation module is used to determine the model layer and model object of the three-dimensional model to be created on the two-dimensional model; determining the model layer and model object of the three-dimensional model to be created on the two-dimensional model includes: when a legend line in the two-dimensional model is selected, identifying the name of the selected legend line and the name of the layer to which it belongs; traversing the selected layer, screening out all legend lines that match the selected legend line name, and obtaining the model object; The model creation module is further used to determine the position information of each model object on the two-dimensional plane, the position information in the vertical direction and its own height information to determine the three-dimensional coordinates of the three-dimensional model in the 3D space; determining the height information of each model object itself includes: receiving the height value of the model object in the vertical direction input by the user; The model creation module is further used to determine the type of the three-dimensional model and select a corresponding prefabricated model from a preset model resource library; create an instance of the prefabricated model for each model object, and determine the position of each instance in the 3D space according to the calculated three-dimensional coordinates to obtain the three-dimensional model; A card processing module, which obtains the card type of the three-dimensional model, selects a card template and a card ID corresponding to the card type from a card resource library, and binds the card ID to the model object; The data source processing module configures a dynamic data ID for the three-dimensional model, and the dynamic data ID is used to retrieve the corresponding data value from the data source, wherein the data source is the operating data of the building equipment, and the dynamic data ID is bound to the card object of the three-dimensional model to display the retrieved data value on the card.
7. The system according to claim 6, characterized in that Also includes: A label processing module, used to extract label data related to the model object from the two-dimensional model; The distance between each extracted tag data and the model object is calculated; the minimum distance is found from the calculated distances, and the tag data corresponding to the minimum distance is bound to the model object.
