Industrial digital twin system function modularization method
Patent Information
- Application Number
- CN202310191538.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-02
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2043-03-02
AI Technical Summary
但是,在数字孪生系统构建过程中,由于设备模型众多,脚本功能各异、操作步骤繁琐和数据量多等各种因素,导致生产线数字孪生构建的人力和时间成本较大、效率不高以及通用性低等问题
[0032]This invention designs and implements four types of functional libraries based on the Unity3D engine: a twin model library, a material library, an interface library, and a script library. These libraries cover the needs of model building, functional design, simulation driving, and virtual-real interaction in the process of building a digital twin system. These four types of functional libraries can simplify and standardize the model building process, quickly find and add functional scripts, and conveniently realize the connection and interaction between virtual scenes and external hardware and software. This simplifies the operation process, reduces repetitive work, improves the building efficiency, and enhances the versatility, convenience, and flexibility of building digital twin systems.
Smart Images

Figure CN116360646B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial digital twins, and designs a method for modularizing the functions of an industrial digital twin system. Background Technology
[0002] Intelligent manufacturing is the engine driving future industrial development, promoting the transformation of traditional manufacturing to intelligent manufacturing. With the rapid development and application of new-generation information technology, digital twin technology is gradually becoming a new trend in intelligent manufacturing, and industrial manufacturing is moving towards intelligent and digital development. Therefore, in the process of building digital twin systems, researching and developing convenient, efficient, and flexible functional modules and tool components is of great significance.
[0003] Professor Michael Grieves of the University of Michigan defines a digital twin as a three-dimensional model comprising a physical prototype, a virtual entity, and a twin environment. The team led by Tao Fei at Beihang University expanded upon Professor Grieves's three-dimensional model, adding two dimensions: twin data and services. This resulted in a five-dimensional digital twin model, where services refer to the service-oriented encapsulation of data, models, algorithms, simulations, and structures required for the application of the digital twin system. Achieving effective virtual-real interaction, real-time monitoring of production lines and workshops, and prediction of equipment failures and lifespan are the goals pursued in building digital twin systems. However, during the construction of digital twin systems, various factors such as numerous equipment models, diverse script functions, cumbersome operation steps, and large amounts of data lead to problems such as high manpower and time costs, low efficiency, and low versatility in building digital twins for production lines.
[0004] However, many current industrial digital twin software programs are primarily designed for the processing and assembly of specific products, lacking the ability to quickly switch production lines to adapt to other processing technologies and thus lacking versatility. Some industrial digital twin software programs aim for versatility and flexibility, enabling transformation between industrial scenarios for different processes; however, their operation processes are cumbersome, lacking convenience and difficult to learn. Therefore, simplifying operation processes and reducing repetitive work during the construction of digital twin systems, thereby accelerating the construction speed, reducing construction costs, and improving construction efficiency, is a crucial aspect of designing and implementing digital twin systems. Summary of the Invention
[0005] The present invention aims to overcome the above-mentioned defects of the prior art and provide a modular method for industrial digital twin systems.
[0006] This invention is based on the UI system provided by the Unity3D engine. It encapsulates services from multiple aspects such as model building, functional design, simulation driving, and virtual-real interaction. It studies and develops four types of functional libraries: model library, material library, interface library, and script library. It uses a "library group" service encapsulation method to achieve the goal of quickly and efficiently building a digital twin system.
[0007] To address the aforementioned technical problems, the present invention provides a modular method for the functional design of an industrial digital twin system, comprising the following steps:
[0008] Step S1: Design and implement the digital twin model library, including layout planning and function implementation. Import the 3D models of commonly used devices into Unity3D for processing and configuration to build digital twin models. Then, classify the various digital twin models, encapsulate them, and import them into the model library.
[0009] Step S2: Design and implement the material library, including layout planning and functionality. Create as many material spheres as possible, categorize them, and encapsulate them for import into the material library;
[0010] Step S3: Design and implement the interface library, including layout planning and function implementation. Encapsulate the interface scripts into interface components, categorize and encapsulate these components, and import them into the interface library; instantiate the interface data and associate the interface data with the interface components through the interface library.
[0011] Step S4: Design and implement the script library, including layout planning and function implementation. Categorize the various scripts required to build a digital twin system and encapsulate them for import into the script library;
[0012] Step S5: Based on the four types of function libraries constructed, a virtual scene of an industrial production line is built to realize the simulation verification and virtual debugging of the production line.
[0013] Step S6: Connect the virtual production line with the physical production line through the interface component to realize the virtual-physical interaction of the production line.
[0014] Specifically, step S1 includes:
[0015] Based on the usage requirements of the models, a suitable model library interface layout and functional design were planned. Firstly, considering that models should be clearly categorized and that different types of models can be displayed by selecting a category, the model library interface is divided into two areas: the left area is a menu bar for selecting model types, which can be divided into eight types: robotic arms, end effectors, machines, conveyor modules, sensors, AGVs, workpieces, and others. The right area displays the corresponding twin models. To accommodate the large number of models and their detailed content, a "dual-mode hybrid" model library browsing mode is proposed, including both a "library browsing" mode and a "single device browsing" mode. In "library browsing" mode, the model library displays all twin models, but the model content is concise, displaying only the model's name, appearance, and simple descriptive information using icons and text labels. In "single device browsing" mode, a 3D preview interface is designed to further display twin model information in detail. Users can drag the mouse to view the model in a 3D perspective, and twin information such as name, function, size, and device model is displayed at the bottom of the interface, facilitating a comprehensive and detailed understanding of the model. To facilitate quick model addition, two methods are provided: one is a precise method that adds models by inputting 3D coordinates, which adds the model precisely to a specified position in the virtual scene; the other is a shortcut method that adds models by dragging and dropping with the mouse, which does not require inputting 3D coordinates, and the selected model will be added at approximately the position of the mouse cursor.
[0016] After implementing the model library according to the plan, the 3D models need to be processed. The 3D models are converted into FBX format files and imported into Unity. In Unity, the hierarchical relationships of the model's parts are configured; for example, for a robotic arm, the base to the end effector components need to be set as parent-child relationships from bottom to top. After setting this up, a twin model script is attached to the model, and twin information is input to build a digital twin model. Finally, the twin models are categorized, packaged, and imported into the model library.
[0017] Specifically, step S2 includes:
[0018] The material library interface layout and functionality should be designed according to the usage requirements of the materials. Since materials and models are similar, the layout can be planned in the same way as a model library, dividing the material library interface into two areas: the left area is a menu bar for selecting material types, categorizing materials into four types: ordinary materials, plastic materials, metal materials, and special materials; the right area displays the corresponding material information. Material information is displayed in the right area using icons and text labels, and buttons are added for quickly adding materials to the model. Since the required materials can be selected intuitively via material icons, a preview interface is unnecessary in the material library.
[0019] After implementing the material library as planned, create as many material spheres as possible, including seven colors from red to purple, black, gray, and other colors. Create material spheres with plastic or metallic sheen by modifying transparency and adding texture maps. Categorize the material spheres, encapsulate them, and import them into the material library.
[0020] Specifically, step S3 includes:
[0021] Based on the usage requirements of the interface components, a suitable interface library interface layout and functional design are planned. Firstly, considering that the interaction between interface components and external controllers requires not only the interface scripts for the interface protocol but also different types of data such as boolean, integer, and floating-point numbers, the interface library interface is divided into three areas: upper left, lower left, and right. The interface components in the library are collectively referred to as interface objects, and the data as value objects. The upper left is the interface operation area, used to add and delete all interface objects; the lower left is the interface object table, used to display information about all interface objects in the scene; the right is the value object table, used to display all value objects contained under an interface object. The interface object table and the value object table have a parent-child relationship; one interface object corresponds to one value object table. By selecting an interface object, its contained value object information will be displayed in the value object table on the right.
[0022] Secondly, to facilitate the operation and management of interface components and their data, the interface library should at least possess four types of functions: area adjustment, object display and management, value object format detection, and real-time data refresh. Area adjustment refers to the ability to resize three areas in the library interface by dragging with the mouse, adapting to different window sizes for a suitable interface layout. Object display and management involves displaying relevant information about interface objects and value objects in the interface library and providing operational functions such as adding, deleting, copying, and selecting. Value object format detection addresses the fact that different interface components have different format requirements for data types and addresses, and format errors can occur when manually adding data. Therefore, it is necessary to perform format checks on objects in the value object table, such as checking for empty names, duplicate names, empty addresses, duplicate addresses, addresses out of range, and incorrect address formats. The real-time data refresh function reads information from numerical objects in the scene at a certain frame rate, updating the interface library with data values read from the virtual production line or actual controller in real time, and working in conjunction with various operational functions in the library to monitor and manage interface data.
[0023] After implementing the interface library as planned, various types of interface components will be organized, encapsulated, and imported into the library. A dropdown menu will be provided to allow selection and use of different types of interface components. Furthermore, interface data will be instantiated, presenting data values as text (i.e., value objects), and the data values will be associated with interface components through the interface library.
[0024] Specifically, step S4 includes:
[0025] Plan a suitable script library interface layout and functional design based on the usage requirements of the functional scripts. Considering that finding and adding scripts are the main operational needs, the script library only needs to categorize scripts and provide a quick add function. Use a collapsible title menu control in the script library to classify and organize scripts. Scripts can be divided into control type, numerical type, function type, interface type, etc., according to their function. Arrange the collapsible title menu control vertically from top to bottom. The script content can be expanded or collapsed by clicking the lower left triangle arrow of the control.
[0026] After the script library is implemented according to the plan, the various functional scripts required to build a digital twin system will be classified, packaged and imported into the script library. Each script corresponds to a button, and the script can be quickly added by clicking the button.
[0027] Specifically, step S5 includes:
[0028] Based on steps S1 to S4, four types of function libraries were constructed. First, models were selected from the model library and quickly added to the virtual scene. The model poses were adjusted to make the virtual production line layout consistent with the physical production line. If there were models with different appearances (mainly referring to color and gloss), the model materials could be quickly modified through the material library. Then, according to the processing technology of different twin models, corresponding function scripts were added from the script library to first realize the process simulation of a single model, and then connect the various twin models to realize the simulation verification of the entire production line. Finally, the interface protocol used by the actual controller was confirmed, the corresponding interface object was added from the interface library, and the IP address and other information were configured. The virtual scene was connected to the actual controller through network cables to realize the virtual debugging of the production line.
[0029] Specifically, step S6 includes:
[0030] Based on the completion of virtual debugging, the virtual production line is connected to the physical production line through interface components. The virtual production line collects and processes the operating data from the actual production line and transmits it to each equipment model. The equipment model receives the data and performs simulation operation. At the same time, the twin data generated during the simulation operation of the virtual production line will be transmitted back to the actual production line, forming a closed-loop data feedback, thereby realizing the virtual-physical interaction of the production line.
[0031] The present invention has the following beneficial effects:
[0032] This invention designs and implements four types of functional libraries based on the Unity3D engine: a twin model library, a material library, an interface library, and a script library. These libraries cover the needs of model building, functional design, simulation driving, and virtual-real interaction in the process of building a digital twin system. These four types of functional libraries can simplify and standardize the model building process, quickly find and add functional scripts, and conveniently realize the connection and interaction between virtual scenes and external hardware and software. This simplifies the operation process, reduces repetitive work, improves the building efficiency, and enhances the versatility, convenience, and flexibility of building digital twin systems. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort and still fall within the scope of the present invention.
[0034] Figure 1 A framework diagram of the functional modularization method for an industrial digital twin system provided in an embodiment of the present invention;
[0035] Figure 2 This is a diagram of the twin model library interface in the modularization method for the industrial digital twin system provided in this embodiment of the invention.
[0036] Figure 3 This is a 3D preview interface diagram of the model in the modular method for industrial digital twin system provided in this embodiment of the invention;
[0037] Figure 4 This is a material library interface diagram in the functional modularization method of the industrial digital twin system provided in this embodiment of the invention;
[0038] Figure 5 This is an interface library diagram of the modularization method for industrial digital twin systems provided in this embodiment of the invention.
[0039] Figure 6 This is a diagram of the script library interface in the modularization method for an industrial digital twin system provided in this embodiment of the invention.
[0040] Figure 7 This invention provides a method for modularizing the industrial digital twin system, which utilizes four types of function libraries to construct a virtual scene diagram of a hardware U-tube production line.
[0041] Figure 8 This is a diagram illustrating the effect of virtual-real interaction in the U-tube production line for hardware in the modular industrial digital twin system provided in this embodiment of the invention. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings.
[0043] like Figure 1 As shown in the figure, this invention provides a modular method for industrial digital twin systems. This method is based on the Unity3D engine and designs and implements four types of functional libraries, including a twin model library, a material library, an interface library, and a script library, covering all aspects of the digital twin system construction process.
[0044] During the construction of the model library, 3D models of commonly used industrial equipment undergo processing such as file format conversion and hierarchical configuration to create twin models. These twin models are categorized into eight types: robotic arms, end effectors, machines, conveyor modules, sensors, AGVs, workpieces, and others. They are then packaged and imported into the model library. In the construction of the material library, as many material spheres as possible with different colors, gloss levels, and transparency are created. These material spheres are then categorized and organized into four types: ordinary materials, plastic materials, metal materials, and special materials, and imported into the material library. The models and materials in both the model and material libraries are universal, and functional controls such as buttons within the libraries help users quickly select and add the required models and materials, facilitating the rapid construction of twin models and achieving the goal of quickly building virtual industrial scenes.
[0045] During the construction of the interface library, various required interface protocols, such as PLC, Modbus, RoboDK, OPC UA, MySQL, and Redis, were organized and imported into the interface library according to the needs of industrial scenarios. The interface library enables operations such as selecting, adding, deleting, and copying various interface objects, simplifying the operation process and facilitating rapid interaction and communication between the virtual scene and external hardware and software.
[0046] During the construction of the script library, various functional scripts, including linear drive, rotary drive, detection, robotic arm control, and motor drive, were designed and developed for the equipment's processing technology. These scripts were then categorized, encapsulated, and imported into the script library. Using the script library makes it easier to find various scripts, saving search time and facilitating rapid simulation verification of the model's processing technology.
[0047] Based on the four types of function libraries, it is possible to quickly build a virtual industrial scene and realize the interaction and linkage between the virtual scene and the actual controller and physical equipment in a more convenient way, thereby realizing virtual debugging and virtual-real interaction, thus improving the versatility, convenience and flexibility of digital twin system construction.
[0048] like Figures 2 to 6As shown, the functional modularization method of the industrial digital twin system in this embodiment of the invention will be further explained:
[0049] Model library such as Figure 2 As shown, the model library interface is divided into two main areas, left and right. The left area is a menu bar for selecting model types, including eight types: robotic arms, end effectors, machines, conveyor modules, sensors, AGVs, workpieces, and others. Clicking a menu item will display the corresponding twin model in the right area. The right area displays the content of a specific type of twin model. The image shows the "Library Browse" mode, which displays all imported twin models, briefly showing the model's name, appearance, and simple description using icons and text labels. Clicking an icon initiates a drag-and-drop event, allowing you to quickly add the model to the scene by dragging it with the mouse; alternatively, you can enter 3D coordinates and then click the "Click to Add This Device" button to precisely add the model to the specified location in the virtual scene. Clicking the "Click to View This Device" button switches the browsing mode to "Single Device Browse" mode, where the right area will display a 3D preview of a single device model, such as... Figure 3 As shown. In the preview interface, you can drag the mouse to rotate and view the shape, structure, color, etc. of the model from a 3D perspective. You can also scroll the mouse wheel or drag the slider to adjust the size of the model. At the same time, the preview interface displays detailed information such as the name, function and purpose, size, and model number of this equipment model. If the model is a robotic arm model, the corresponding DH parameter information will also be displayed.
[0050] After implementing the model library interface, the 3D models of commonly used devices are converted into FBX files, imported into Unity3D, and the hierarchical relationships of each part in the model are configured. Twin model scripts are then attached, and twin information is input to construct a digital twin model. Next, the various twin models are categorized, packaged, and imported into the model library.
[0051] Material library such as Figure 4As shown, the material library interface is divided into left and right sections. The left section is a menu bar for selecting material types, including four types: ordinary materials, plastic materials, metal materials, and special materials. Clicking the menu item will display the corresponding material information in the right section. Ordinary materials mainly refer to material spheres with different colors, including seven colors from red to purple, black, gray, etc., and each color can be further divided into light, dark, and muted shades. Plastic materials refer to material spheres with colors and glosses similar to real-life plastic. Metal materials refer to material spheres with glosses and transparency similar to real-life aluminum and iron. Special materials refer to material spheres with special textures added for specific situations, such as materials used to simulate surrounding ground and walls. The right section displays the material name, color, gloss, and other information using icons and text labels, and materials can be quickly added to the selected model by clicking the "Add this device" button. After implementing the model library interface, create as many material spheres as possible, categorize them, encapsulate them, and import them into the material library.
[0052] Interface libraries such as Figure 5 As shown, the interface library is divided into three areas: upper left, lower left, and right. The upper left area is the interface operation panel, used to add and delete existing interface objects; the lower left area is the interface object table, used to display information about all interface objects in the scene; and the right side is the value object table, used to display all value objects contained under an interface object. The interface object table and the value object table have a parent-child relationship; one interface object corresponds to one value object table. By selecting an interface object, its contained value object information will be displayed in the value object table on the right.
[0053] The interface library's functionality mainly includes four parts: region adjustment, object display and management, value object format detection, and real-time data refresh. Region adjustment refers to the ability to resize three regions within the library interface by dragging with the mouse. Adjusting the region size allows for adaptation to different window sizes, ensuring a suitable interface layout. The coordinate system uses the top-left corner of the library interface as the origin, with the horizontal x-axis increasing from left to right and the vertical y-axis increasing from top to bottom. Each region is defined as a parameter class containing parameters x (the mapping of the starting coordinates on the x-axis), y (the mapping of the starting coordinates on the y-axis), width (the width of the region, i.e., the length of the interval on the x-axis), and height (the height of the region, i.e., the length of the interval on the y-axis). Let the three regions be A1, A2, and A3, with a total width of W and a total height of H. To clearly display the region boundaries and facilitate mouse dragging for resizing, a horizontal thin rectangle (called the height adjustment bar R1) is placed between regions A1 and A2, and a vertical thin rectangle (called the width adjustment bar R2) is placed between regions A1, A2, and A3. The calculation formulas for the parameters of the three regions and the two adjustment bars are shown in equations (1) to (21):
[0054] x1=0 (1)
[0055] y1=0 (2)
[0056] w1=W*μ w (3)
[0057] h1=H*μ n (4)
[0058] x2=0 (5)
[0059] y2=h1+Δh (6)
[0060] w2=W*μ w (7)
[0061] h2=H*(1-μ h )-Δh (8)
[0062] x3=w1+Δw (9)
[0063] y3=0 (10)
[0064] w3=W*(1-μ w )-Δw (11)
[0065] h3=H (12)
[0066] x4=0 (13)
[0067] y4=h1 (14)
[0068] w4=W*μ w (15)
[0069] h4=Δh (16)
[0070] x5=w1 (17)
[0071] y5=0 (18)
[0072] w5=Δw (19)
[0073] h5=H (20)
[0074] Δh=Δw=10 (21)
[0075] In the formula, x1, y1, w1, and h1 represent the parameters x, y, width, and height of the upper left region A1, respectively; x2, y2, w2, and h2 represent the parameters x, y, width, and height of the lower left region A2, respectively; x3, y3, w3, and h3 represent the parameters x, y, width, and height of the right right region A3, respectively; x4, y4, w4, and h4 represent the parameters x, y, width, and height of the adjustment bar R1, respectively; x5, y5, w5, and h5 represent the parameters x, y, width, and height of the adjustment bar R2, respectively; Δh is the height of the adjustment bar R1, which is a fixed value of 10 pixels; Δw is the width of the adjustment bar R2, which is a fixed value of 10 pixels; and μ... w It is the proportionality coefficient of region A1 to the total width, μ h It is the proportion coefficient of region A1 to the total height.
[0076] Write an algorithm to identify whether the mouse cursor is within the range of adjustment bar R1 or R2. If it is within the range and the left mouse button is pressed and dragged, adjust the parameter μ in real time by calculating the ratio of the mouse cursor position to the total height or width. h or μ w This enables the function of regional adjustment, and its calculation formula is shown in equations (22) and (23):
[0077]
[0078]
[0079] In the formula, M x M represents the mouse position coordinates mapped onto the x-axis. y This represents the mouse position coordinates mapped onto the y-axis.
[0080] Object display and management refers to displaying information about interface objects and value objects in the interface library and providing operation functions for these two types of objects. In the interface object table, an interface object is defined as a class containing a sequence number, name, type, four operation components, and an interface component (corresponding to the type). The operation components are Browse (browse the value object information contained under this interface object), Select (select the position of the interface component of this object in the scene for quick location), Copy, and Delete. In the value object table, a value object is defined as a class containing a sequence number, name, data type, address, value, four operation components, a numeric object (corresponding to the data type), and a parent interface object. The operation components are Edit (edit and modify the name, data type, and address of this value object), Select (select the position of the numeric object of this object in the scene for quick location), Copy, and Delete. For both the interface object table and the value object table, the following operations are designed: Add, Add previous, Delete all, Copyall, Select all, and Sort. The sorting function provides two methods: sorting by object order and sorting by type. Considering that an interface component may involve a large amount of data, an Import Excel function is designed into the value object table. This allows users to select an Excel or CSV file from their local machine and quickly import the data into the table. For example, when using Siemens TIA Portal software, the variable table can be exported as an Excel spreadsheet, and then the data can be quickly imported into the interface library by selecting that file. Using this function can save significant manpower and time costs when dealing with large amounts of data.
[0081] Value object format detection refers to the fact that different interface components have different format requirements for data types and addresses. Furthermore, format errors can occur when data is manually added. Therefore, it is necessary to perform format detection on objects in the value object table. Format detection includes six aspects: whether the name is empty, whether the name is the same as another's, whether the address is empty, whether the address is duplicated, whether the address is out of range, and whether the address format is incorrect. By detecting the information content of objects in the table in real time, objects that do not meet the requirements are highlighted in red to remind the user to make corrections.
[0082] The real-time data refresh function reads information from numerical objects in the scene at a certain frame rate, updating the data values read from the virtual scene or the actual controller to the interface library in real time. This, combined with various operational functions within the library, enables the monitoring and management of interface data. During the operation of the digital twin system, viewing, monitoring, and managing different types of interface components and interface data can be achieved solely through the interface library. After implementing the interface library interface, the interface components are organized, encapsulated, and imported into the interface library.
[0083] script libraries such as Figure 6 As shown, a collapsible title menu control is used to categorize and organize scripts. This control is arranged vertically from top to bottom, and the script content can be expanded or collapsed by clicking the down arrow on the left side of the control. Functional scripts are divided into four types: control, numerical, effect, and interface. After implementing the script library interface, each type of functional script is categorized and imported into the script library, with each script corresponding to a button. Since adding a script requires a specific object, users must first select the object to which the script will be added in the scene, and then click the button to quickly add the script.
[0084] Based on the four types of function libraries constructed, the virtual production line for U-tube hardware can be quickly built, such as... Figure 7 As shown. Select the required equipment models from the model library and add them to the virtual scene, including four six-axis robotic arms, a necking machine, a punching press, a hot melt drilling machine, a tapping machine, and a material box, etc., and adjust the layout of the models according to the actual production line. For models that need to be modified in color, open the material library, select the required material, and click to add it. Next, open the script library to add functional scripts to the models to realize the simulation of the processing technology. The punching press and the hot melt drilling machine need to add linear drive and motor simulation drive scripts to realize the simulation of the top-down punching and drilling actions; the tapping machine needs to add rotary drive and linear drive scripts to realize the simulation of the rotating feeding of the platform and the tapping action of the tapping head from top to bottom; all six axes of the robotic arms need to add drive scripts and set the direction of axis rotation. The robotic arm's grasping and placing actions are simulated by setting the end point and solving the inverse kinematics. After realizing the simulation verification of each equipment model, connect the equipment models to complete the simulation of the entire production line's processing flow. Next, add a PLC interface component and export PLC signal data from Siemens TIA Portal software to the interface library. Enter the correct IP address and select the PLC model in the interface component, and connect it to the actual PLC controller. Add a Modbus interface component, enter the correct IP address, port number, and station number, and connect it to the actual robotic arm controller. Finally, through interaction with PLC signals and robotic arm data, verify the operation of the virtual production line and its automated control logic, thereby achieving virtual commissioning of the production line.
[0085] Virtual and real interaction in the U-tube production line for hardware, such as Figure 8 As shown, a digital production line in a virtual environment is connected to a physical production line via a network cable. The virtual production line collects operational data from the actual production line, processes it, and transmits it to each equipment model. The equipment models receive the data and perform simulation operations. Simultaneously, the twin data generated during the virtual production line simulation is transmitted back to the actual production line, forming a closed-loop data feedback. Through real-time acquisition and processing of production line data and real-time interaction of twin data, interactive linkage of the production line is achieved, realizing the effect of virtual-real interaction.
[0086] Implementing the embodiments of the present invention has the following beneficial effects:
[0087] In this embodiment of the invention, four types of functional libraries—a twin model library, a material library, an interface library, and a script library—were designed and implemented based on the Unity3D engine. These libraries cover the needs of model building, functional design, simulation driving, and virtual-real interaction in the construction process of a digital twin system. These four types of functional libraries simplify and standardize the model building process, enable quick searching and adding of functional scripts, and facilitate convenient connection and interaction between virtual scenes and external hardware and software. This simplifies the operation process, reduces repetitive work, improves construction efficiency, and enhances the versatility, convenience, and flexibility of digital twin system construction.
[0088] The embodiments described in this specification are merely examples of implementations of the inventive concept. The scope of protection of this invention should not be considered as limited to the specific forms stated in the embodiments. The scope of protection of this invention also extends to equivalent technical means that can be conceived by those skilled in the art based on the inventive concept.
Claims
1. A method of functional modularization of an industrial digital twin system, characterized in that, Including the following: Step S1: Design and implement the digital twin model library, including layout planning and function implementation; import the 3D models of commonly used devices into Unity3D for processing and configuration to build digital twin models, and then classify each digital twin model and encapsulate them for import into the model library. Step S2: Design and implement the material library, including layout planning and function implementation; create multiple material spheres, classify each material sphere, and encapsulate and import them into the material library; Step S3: Design and implement the interface library, including layout planning and function implementation; encapsulate the interface scripts into interface components, classify the interface components and import them into the interface library; instantiate the interface data and associate the interface data with the interface components through the interface library; Step S4: Design and implement the script library, including layout planning and function implementation; classify the various scripts required to build a digital twin system and encapsulate them for import into the script library; Step S5: Based on the four types of function libraries constructed, a virtual scene of an industrial production line is built to realize the simulation verification and virtual debugging of the production line. Step S6: Connect the virtual production line with the physical production line through the interface component to realize the virtual-physical interaction of the production line; Step S1 specifically includes: Based on the usage requirements of the models, the layout and functional design of the model library interface are planned. The model library interface is divided into two areas: the left area is a menu bar for selecting model types, categorizing models into eight types: robotic arms, end effectors, machines, conveyor modules, sensors, AGVs, workpieces, and others; the right area displays the corresponding twin models, proposing a "dual-mode hybrid" model library browsing mode that includes both "library browsing" and "single device browsing" modes. In "library browsing" mode, the model library displays all twin models, showing the model's name, appearance, and brief description information only through icons and text labels. In "single device browsing" mode, a 3D preview interface for the model is designed, allowing users to view the model in a 3D perspective by dragging the mouse, and displaying twin information including name, function, size, and device model at the bottom of the interface. Two methods for adding models are provided: one is a precise method of adding models by inputting 3D coordinates, which adds the model precisely to a specified position in the virtual scene; the other is a shortcut method of adding models by dragging the mouse, which does not require inputting 3D coordinates, and the selected model is added at the mouse cursor position. After implementing the model library according to the plan, the 3D models need to be processed. The 3D models are converted into FBX format files and imported into Unity. In Unity, the hierarchical relationship of each part of the model is configured. The robotic arm needs to set the parent-child relationship of each part from the base to the end tool in the order from bottom to top. After setting, the twin model script is attached to the model and the twin information is input to build a digital twin model. Finally, the twin model is classified, packaged and imported into the model library.
2. The method of claim 1, wherein, Step S2 specifically includes: The layout and functionality of the material library interface are planned according to the usage requirements of the materials. The layout is planned in the same way as the model library, dividing the material library interface into two areas: the left area is a menu bar for selecting material types, which are divided into four types: ordinary materials, plastic materials, metal materials, and special materials. The right area is used to display the material content of the corresponding type. Material information is displayed in the right area in the form of icons and text labels, and buttons are added for quickly adding materials to the model. There is no need to design a preview interface in the material library. After implementing the material library as planned, create multiple material spheres, including seven colors from red to purple, black, and gray, and create material spheres with plastic and metallic luster by modifying transparency and adding texture maps; categorize the material spheres and package them for import into the material library.
3. The method of claim 1, wherein, Step S3 specifically includes: The interface layout and functional design of the interface library are planned according to the usage requirements of the interface components. The interface library interface is divided into three areas: upper left, lower left, and right. The interface components in the library are collectively referred to as interface objects, and the data is referred to as value objects. The upper left is the interface operation area, used to add and delete all interface objects. The lower left is the interface object table, used to display information about all interface objects in the scene. The right is the value object table, used to display all value objects contained under an interface object. The interface object table and the value object table have a parent-child relationship. One interface object corresponds to one value object table. By selecting an interface object, the value object information contained under it can be displayed in the value object table on the right. The interface library should have at least four functions: area adjustment, object display and management, value object format detection, and real-time data refresh. Area adjustment refers to the ability to resize three areas in the library interface by dragging the mouse, adapting to different window sizes for a better layout. Object display and management displays relevant information about interface objects and value objects, providing operations such as adding, deleting, copying, and selecting. Value object format detection checks the format of objects in the value object table, including whether the name is empty, identical, empty, duplicate, out of range, or incorrect. Real-time data refresh reads information from numerical objects in the scene at a certain frame rate, updating the interface library with data values read from the virtual production line or actual controller, and working with various operation functions in the library to monitor and manage interface data. After implementing the interface library as planned, various types of interface components will be organized, encapsulated, and imported into the interface library. The selection and use of different types of interface components will be provided through drop-down menus. In addition, interface data will be instantiated and presented as data values in text form, i.e., value objects. The data values will be associated with interface components through the interface library.
4. The method of claim 1, wherein, Step S4 specifically includes: The script library interface layout and functional design are planned according to the usage requirements of the functional scripts; the scripts are classified in the script library and a quick add function is provided; the scripts are classified and organized in the script library using a collapsible title menu control, and the scripts are divided into control type, numerical type, function type and interface type according to their functions; the collapsible title menu control is arranged vertically from top to bottom, and the script content can be expanded or collapsed by clicking the lower triangle arrow on the left side of the control; After the script library is implemented according to the plan, the various functional scripts required to build a digital twin system will be classified, packaged and imported into the script library. Each script corresponds to a button, and the script can be quickly added by clicking the button.
5. The method of claim 1, wherein, Step S5 specifically includes: Based on steps S1 to S4, four types of function libraries were constructed. First, models were quickly added to the virtual scene from the model library, and the virtual production line layout was made consistent with the physical production line by adjusting the model pose. If there were models with different appearances, the model materials could be quickly modified through the material library. Then, according to the processing technology of different twin models, corresponding function scripts were added from the script library to first realize the process simulation of a single model, and then connect the various twin models to realize the simulation verification of the entire production line. Finally, the interface protocol used by the actual controller was confirmed, the corresponding interface object was added from the interface library, and the IP address information was configured. The virtual scene was connected to the actual controller via a network cable to realize the virtual debugging of the production line.
6. The method of claim 1, wherein, Step S6 specifically includes: Based on the completion of virtual debugging, the virtual production line is connected to the physical production line through interface components. The virtual production line collects and processes the operating data from the actual production line and transmits it to each equipment model. The equipment model receives the data and performs simulation operation. At the same time, the twin data generated during the simulation operation of the virtual production line will be transmitted back to the actual production line, forming a closed-loop data feedback, thereby realizing the virtual-physical interaction of the production line.
7. The method according to claim 3, characterized in that, The interface library area adjustment method includes: The interface library is divided into three areas: upper left, lower left, and right. Interface components within the library are collectively referred to as interface objects, and data as value objects. The upper left area is the interface operation panel, the lower left area is the interface object table, and the right area is the value object table. The upper left corner of the interface is the origin of the coordinate system, with the horizontal direction as the x-axis, increasing from left to right, and the vertical direction as the y-axis, increasing from top to bottom. Each area is defined as a parameter class containing parameters x, y, width, and height. Here, x refers to the mapping of the starting coordinates on the x-axis, and y refers to the mapping of the starting coordinates on the x-axis. The mapping on the y-axis is as follows: width refers to the width of the region, that is, the length of the interval occupied on the x-axis, and height refers to the height of the region, that is, the length of the interval occupied on the y-axis. Let the three regions be A1, A2, and A3, the total width of the entire interface be W, and the total height be H. A thin rectangle in the horizontal direction is placed between regions A1 and A2, called the height adjustment bar R1, and a thin rectangle in the vertical direction is placed between regions A1, A2, and A3, called the width adjustment bar R2. From this, the calculation formulas for the parameters of the three regions and the two adjustment bars can be obtained, as shown in equations (1) to (21): In the formula, , , , Let x, y, width, and height be the parameters for the upper left region A1, respectively. , , , Let x, y, width, and height be the parameters for the lower left region A2, respectively. , , , Let x, y, width, and height be the parameters of the right-hand region A3, respectively. , , , These are the parameters x, y, width, and height for adjusting bar R1. , , , These are the parameters x, y, width, and height for adjusting bar R2. The height of adjustment bar R1 is set to a fixed value of 10 pixels. The width of adjustment bar R2 is set to a fixed value of 10 pixels. It is the proportion of region A1 to the total width. It is the proportion coefficient of region A1 to the total height; Develop an algorithm to detect whether the mouse cursor is within the R1 or R2 range of the adjustment bar. If it is within the range and the left mouse button is pressed and dragged, adjust the parameters in real time by calculating the ratio of the mouse cursor position to the total height or width. or This enables the function of regional adjustment, and its calculation formula is shown in equations (22) and (23): In the formula, This represents the mouse position coordinates mapped onto the x-axis. This represents the mouse position coordinates mapped onto the y-axis.