A method, system, and storage medium for rapidly constructing digital twin workshop scenes based on the Unity engine.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-08-14
AI Technical Summary
[0003]然而,现有数字孪生系统构建手段存在显著不足,难以满足工业场景的高效部署与灵活管理需求
[0016]本发明通过模块化设计整合项目管理、草稿存储、场景编辑、数据绑定等核心功能,搭配巡视、预警、回溯等扩展功能,形成全流程场景构建与管理体系,将建模周期从传统方案的数周缩短至数天,大幅提升构建效率;通过权限-项目-场景三级管控与本地-云端双重存储机制,解决多用户协作混乱与数据丢失问题,数据安全性与完整性显著提升;采用多协议兼容采集与自动绑定技术,将数据映射延迟控制在0.5秒以内,实现虚拟与物理车间的精准同步;通过分层UI面板与实战化管理功能,设备故障响应时间缩短75%,为管理者提供精准决策支撑,适配各类工业制造场景的管理需求。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention belongs to the field of digital twin technology, specifically relating to a method, system, and storage medium for rapidly constructing a digital twin workshop scene based on the Unity engine. Background Technology
[0002] Against the backdrop of the accelerated advancement of intelligent manufacturing, digital twins have become an important supporting technology for the digital transformation of industrial workshops. By constructing a mapping relationship between physical workshops and virtual scenes, they provide key support for equipment fault diagnosis, process optimization, and production efficiency improvement, and run through the entire product lifecycle, thereby effectively reducing R&D and operation and maintenance costs.
[0003] However, existing digital twin system construction methods have significant shortcomings, making it difficult to meet the needs of efficient deployment and flexible management in industrial scenarios. At the modeling level, traditional solutions rely on professional 3D modeling tools and experienced technicians, with cycles lasting several weeks and poor model reusability, requiring repeated modeling for different workshop scenarios. In terms of collaboration and data management, there is a lack of standardized project and permission control mechanisms, leading to unclear project ownership and permission conflicts during multi-user collaboration. Furthermore, scene editing drafts are often stored locally, making data loss easy due to equipment failure or misoperation. Data acquisition protocols are limited and cannot adapt to the diverse communication needs of industrial scenarios, such as RS485 and Modbus. Binding equipment data to virtual models requires manual operation, resulting in high latency in dynamic mapping. Interaction and management functions are insufficient; most systems only support basic scene display and lack practical functions such as workshop inspection, anomaly warning, and spatiotemporal backtracking. UI data is fragmented, making it difficult to provide global, visualized decision support.
[0004] Therefore, there is an urgent need for a digital twin workshop scenario construction method and system that integrates rapid modeling, access control, data collaboration, and dynamic mapping to solve the pain points of existing technologies and adapt to the efficient management needs of smart workshops. Summary of the Invention
[0005] To address the problems existing in current technologies, this invention provides a method, system, and storage medium for rapidly constructing digital twin workshop scenes based on the Unity engine. Through modular design and lightweight operation, it enables drag-and-drop rapid editing of scenes, multi-terminal data synchronization, real-time device data binding, and full-process operation and maintenance management, lowering the technical threshold while improving scene usability and management efficiency.
[0006] The objective of this invention can be achieved through the following technical solution: a method for rapidly constructing a digital twin workshop scene based on the Unity engine, comprising: Step 1: Manage and display projects within the user account's permission scope through the project library module, and obtain summary information of published scenarios under the project; The Drafts module displays and manages local draft scenes saved during scene editing; Step 2: Display the visual content of the scene through the scene editing module; perform CRUD operations on the objects in the visual content, save the editing results to the local draft box, or publish them to the cloud to achieve multi-terminal data sharing; Step 3: Bind and acquire the status and processing data of the physical equipment online through the data-driven binding module to complete the dynamic mapping between the digital twin workshop scene and the real workshop scene, and realize the online reflection of the workshop operation status.
[0007] Furthermore, the device model described in step 2 is constructed using 3D scanning and geometric reconstruction techniques, including: Step 2.1: Use a laser scanner to collect high-density point cloud data of the physical workshop; Step 2.2: Use point cloud processing software to filter, denoise, and simplify the point cloud data to generate a geometric white model; Step 2.3: Perform segmentation, material mapping, and rendering processing on the geometric white model in a 3D modeling tool to generate a high-fidelity device model.
[0008] Furthermore, the steps also include step 2.4: binding the joints of the device model to a parent-child hierarchy in Unity to achieve hierarchical management of the device structure; importing and storing the high-fidelity device model into the system model library based on the digital twin platform.
[0009] Furthermore, the specific implementation of performing CRUD operations on the objects in the visualized content in step 2 includes: Operation 1: Retrieve the device model from the system model library and add it to the 3D scene by dragging and dropping; Operation 2: Allow the device model to move freely in 3D space by dragging and dropping, or define the precise position of the device model by inputting 3D coordinates, and support the alignment of the device model by ground snapping, vertex snapping, bounding box snapping and plane snapping. Operation 3: Zoom in and out of the device model using the mouse wheel, or precisely adjust the model size by inputting the zoom ratio; Operation 4: Rotate the selected device model by dragging the control handle; Operation 5: Select one or more objects by using a selection box to perform batch add, delete, or modify operations.
[0010] Furthermore, step 4 includes: inspecting the operation of the digital twin workshop through the inspection function module using manual navigation or automatic inspection methods. The mobile game is played from a first-person perspective. Players control the movement of the viewpoint forward, backward, left, and right using the keyboard and adjust the zoom using the mouse wheel. The automatic inspection is based on path control and supports linear and curved paths. Each path contains multiple inspection nodes, and each inspection node is associated with position, rotation angle, camera height, pitch angle, waiting time, and event binding information. It supports adding, deleting, and dragging inspection nodes, and setting path attributes, including duration, closure status, loop type, and number of loops; It supports previewing path animations and triggers events when the inspection node is reached or stops, dynamically displaying equipment status, processing data, and alarm information.
[0011] Furthermore, step 5 includes: monitoring abnormal workshop operations through the early warning and alarm function module, specifically including: The system monitors the operational status of key equipment such as AGVs, automated warehouses, and lathes in real time. When equipment failures, order processing anomalies, or potential production risks occur, it triggers early warnings or alarms. These early warnings or alarms are displayed in a visual manner within the digital twin workshop scenario, and the abnormal locations are located by combining event nodes. The alarm information is correlated with production indicators to assist in monitoring production progress and the achievement of capacity targets.
[0012] Furthermore, step 6 includes: using the spatiotemporal backtracking function module to replay the historical process of workshop operation, specifically including: Step 6.1: The user selects the rewind time range and sets the rewind playback rate; Step 6.2: Extract historical data within the specified time range from the database, encapsulate it in JSON format, publish and subscribe via the MQTT protocol, and determine the data sending frequency based on the playback magnification. Step 6.3: Parse the received historical data and reproduce the corresponding time period's operating status in the digital twin workshop scenario for equipment fault diagnosis and tracing, process optimization, and production simulation.
[0013] Furthermore, the visualization content of the scene in step 2 also includes a UI panel, which is implemented through charts and UI panel functional modules, including: Displays production line statistics, real-time warehouse status, and order overview information; The system displays the operating status, equipment condition, and production run time of AGVs, automated warehouses, engraving machines, and robots. Displays statistics, operating status, and operating records for individual devices; Show the production line pass rate and scrap rate.
[0014] This application also provides a rapid construction system for digital twin workshop scenes based on the Unity engine, including: The project library module is used to manage and display projects within the user account's permission scope, and to obtain summary information of published scenarios under the project. The draft box module is used to display and manage local draft scenes saved during scene editing; The scene editing module displays the visual content of the scene, performs CRUD operations on objects in the visual content, and saves the editing results to the local draft box or publishes them to the cloud to achieve multi-terminal data sharing. The data-driven and binding module is used to bind and acquire the status data and processing data of physical equipment online, so as to complete the dynamic mapping between the digital twin workshop scene and the real workshop scene and realize the online reflection of the workshop operation status. The system model library is used to store high-fidelity device models and to perform the model management, retrieval, and calling functions.
[0015] This application also provides a computer-readable storage medium storing a rapid construction program for a digital twin workshop scene. When the rapid construction program for a digital twin workshop scene is executed by a processor, it implements the above-described rapid construction method for a digital twin workshop scene based on the Unity engine. Beneficial effects
[0016] This invention integrates core functions such as project management, draft storage, scene editing, and data binding through modular design, coupled with extended functions such as inspection, early warning, and backtracking, forming a full-process scene construction and management system. This significantly improves construction efficiency by reducing the modeling cycle from several weeks in traditional solutions to several days. Through a three-level control system of permissions, projects, and scenes, and a dual local-cloud storage mechanism, it solves the problems of chaotic multi-user collaboration and data loss, significantly improving data security and integrity. Employing multi-protocol compatible acquisition and automatic binding technology, it controls data mapping latency to within 0.5 seconds, achieving precise synchronization between virtual and physical workshops. Through a layered UI panel and practical management functions, equipment failure response time is reduced by 75%, providing managers with precise decision support and adapting to the management needs of various industrial manufacturing scenarios. Attached Figure Description
[0017] Figure 1 The method and system architecture diagram for rapidly constructing a digital twin workshop scene provided in the embodiments of this application; Figure 2 A flowchart illustrating the rapid construction method for a digital twin workshop scene provided in this application embodiment; Figure 3 A schematic diagram of a digital twin workshop is provided for an embodiment of this application. Detailed Implementation
[0018] This application provides a method, system, and storage medium for rapidly constructing digital twin workshop scenes based on the Unity engine. It constructs a low-code construction technology for digital twin systems, solving problems such as high barriers to entry, low efficiency, fragmented virtual-real mapping, chaotic management and collaboration, and poor functional scalability in the existing digital twin workshop scene construction process.
[0019] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments described below are only a part of the embodiments of this application, and not all of them. Other embodiments that can be obtained by those skilled in the art without creative effort are all within the protection scope of this application.
[0020] Example 1: This example is a rapid construction system for digital twin workshop scenes based on the Unity engine, including a project library module, a draft box module, a scene editing module, a data-driven and binding module, a system model library, as well as a patrol function module, an early warning and alarm function module, a spatiotemporal backtracking function module, and a chart display and UI panel function module. The project library module is used to manage and display projects within the user's account permission scope, and obtain summary information of the published scenes contained in the project; it supports editing project names and scene names, and enters the scene editing interface when the user clicks on the scene thumbnail to edit objects within the scene; the three-level association logic of "permission-project-scene" solves the problems of chaotic project permissions and unclear scene ownership when multiple users collaborate; The Drafts module is used to display and manage local draft scenes saved during scene editing, and to obtain a list of draft scenes; it supports entering the scene editing interface to continue editing objects in the scene when the user clicks on the scene thumbnail, supports deleting local draft files, and supports publishing the draft scenes to the cloud to update cloud data; The scene editing module is used to display and drag-and-drop edit the visual content of the scene. The visual content includes objects such as environment, device models, POI, layout, and charts. It supports adding, deleting, modifying, and querying the objects. After the editing results are saved, they are stored in the local draft box. After publishing, they are synchronized to the cloud to achieve data sharing across multiple terminals. The data-driven and binding module is used to bind the status and processing data of physical equipment acquired online, so as to complete the dynamic mapping between the digital twin workshop scene and the real workshop scene; The system model library is used to store high-fidelity device models. It adopts a unified naming convention to ensure the consistency and traceability of model data, and supports searching and calling target models based on model name, device type, manufacturer brand and tag parameters. The inspection function module is used to inspect the workshop operation status through manual navigation or automatic inspection. The early warning and alarm function module is used to monitor abnormal workshop operations, trigger early warning or alarm information, and display it in a visual manner; The time-space rewind function module is used to realize the historical playback of the workshop operation process; The chart display and UI panel functional modules are used to display multi-dimensional data such as production lines, equipment, and quality through the UI panel.
[0021] Furthermore, the equipment model is constructed using 3D scanning and geometric reconstruction techniques, including: using a laser scanner to collect high-density point cloud data of the physical workshop; using point cloud processing software to filter, denoise, and simplify the point cloud data to generate a geometric white model; and performing segmentation, material mapping, and rendering processing on the geometric white model in a 3D modeling tool to generate a high-fidelity equipment model.
[0022] Furthermore, the specific implementation of the data-driven and binding module "binding and acquiring the status data and processing data of the physical equipment in real time" includes: collecting static status data of the physical equipment through communication protocols such as RS485 and Modbus; collecting dynamic data of the physical equipment during the processing process through sensors, the dynamic data including force, vibration, acoustic emission, and power data; synchronously storing the static status data and dynamic data in a database; encapsulating the data in JSON format; and implementing the publication and subscription of the encapsulated data through the MQTT protocol to complete the online interaction and dynamic mapping between the workshop physical data and the digital twin scenario.
[0023] Furthermore, the scene editing module "performs CRUD operations on objects in the visualized content," including: retrieving device models from the system model library and adding them to the 3D scene via drag-and-drop operations; enabling free movement of device models in 3D space via drag-and-drop, or defining the precise position of device models by inputting 3D coordinates, and supporting ground snapping, vertex snapping, bounding box snapping, and plane snapping alignment of device models; scaling device models via mouse wheel, or precisely adjusting the model size by inputting a scaling ratio; rotating selected device models by dragging control handles within the system; and selecting one or more objects via a selection box to perform batch CRUD operations.
[0024] Furthermore, the manual navigation of the inspection function module is in first-person perspective, with the viewpoint moved forward, backward, left, and right using the keyboard and zoomed using the mouse wheel. Automatic inspection is based on path control, supporting both linear and curved paths. Each path contains multiple inspection nodes, each associated with a position, rotation angle, camera height, pitch angle, waiting time, and event binding information. It supports adding, deleting, and dragging inspection nodes, and setting path attributes, including duration, closure state, loop type, and number of loops. It supports previewing path animations and triggering events when an inspection node arrives or stops, dynamically displaying equipment status, processing data, and alarm information.
[0025] Furthermore, the early warning and alarm function module monitors the operating status of key equipment such as AGVs, automated warehouses, and lathes in real time; when equipment failure, order processing abnormalities, or potential production risks occur, early warning or alarm information is triggered; the early warning or alarm information is displayed in a visual manner in the digital twin workshop scenario, and the abnormal location is located in conjunction with event nodes; the alarm information is correlated with production indicators for analysis, which helps to monitor the production progress and the achievement of capacity targets.
[0026] Furthermore, the spatiotemporal backtracking function module enables historical playback of the workshop operation process, including: the user selecting a backtracking time range and setting the backtracking playback rate; extracting historical data within the time range from the database, encapsulating it in JSON format, publishing and subscribing via the MQTT protocol, and determining the data sending frequency based on the backtracking playback rate; parsing the received historical data, reproducing the corresponding time period's operating status in the digital twin workshop scenario, for equipment fault diagnosis and tracing, process optimization, and production simulation.
[0027] Furthermore, the UI panel includes: an overview panel for displaying production line statistics, real-time warehouse status, and order overview information; a production line panel for displaying the operating status, equipment condition, and production running time of AGVs, automated warehouses, engraving machines, and robots; an equipment panel for displaying statistical data, operating status, and operating records of individual devices; and a quality panel for displaying the production line pass rate and scrap rate, wherein the pass rate includes the overall production line pass rate, the category product pass rate, and the daily pass rate, and the scrap rate includes the overall production line scrap rate, the category product scrap rate, and the daily scrap rate.
[0028] The hardware and software environment of the digital twin system in this embodiment is shown below: Server: Intel Xeon E5-2680 v4 processor, 64GB DDR4 memory, NVIDIA Tesla P40 GPU (supports CUDA 10.0), 1TB SSD storage.
[0029] Terminal device: Industrial PC (Windows 10 x64, i7-10700K, 16 GB RAM, RTX3060 GPU, supports DX11 graphics API).
[0030] Core engine: Unity3D 2019.4.3f1, with UGUI, PhysX 5.1, AssetBundle, and TextMeshPro plugins installed.
[0031] Database: MySQL 8.0 InnoDB engine.
[0032] Communication middleware: EMQX 4.3.0 (MQTT Broker, Topic: "DiscreteManufacturingShop / Data", QoS level 2).
[0033] Development tools: .NET Framework 4.8, C# 7.3, Cyclone 9.0, 3ds Max 2020.
[0034] The digital twin system described in this embodiment adopts a three-layer architecture design, including a basic support layer, a core module layer, and a business application layer: 1. Basic Support Layer: Encapsulates the Unity3D 2019 engine rendering kernel, providing underlying computing and rendering capabilities; provides basic services such as data storage, protocol adaptation, and user access control.
[0035] 2. Core Module Layer: Develop the UnityRenderWrapper class to encapsulate core components such as Camera, Light, and MeshRenderer; provide standardized methods such as InitScene() and LoadModel(); develop the ProtocolAdapter component to implement driver adaptation for RS485 and MQTT protocols respectively, and output a unified DeviceData data structure.
[0036] 3. Business Application Layer: The project library module passes user role permissions through the AuthVerify API and calls LoadProjectList() to load authorized projects; the scene editing module obtains model resources through the ModelLoad API and calls Unity's AssetBundle.LoadFromFile() method to load model instances; the real-time data processing module subscribes to device data through the MQTT client, triggers the OnDataReceived() event, and calls the UpdateModelState() method to update the device state in the scene.
[0037] In this implementation, nine functional modules (login module, account module, project library module, draft box module, system model library module, scene editing module, data-driven and binding module, operation and maintenance application module, and chart display and UI panel module) achieve data interaction through the platform API. The overall architecture is as follows: Figure 1 As shown, the key interface logic is as follows: The login module calls the AuthVerifyAPI to verify credentials and returns the role and projectAuth parameters. After receiving the parameters, the project library module calls the LoadProjectListAPI to load the list of authorized projects.
[0038] System Model Library Scene Editing Module: The scene editing module obtains model resources through GetModelListAPI, calls LoadModelAPI to load FBX models, and instantiates the models using Unity's AssetBundle.LoadFromMemoryAsync() method.
[0039] Data-driven module and scene editing module: After receiving MQTT data, the data-driven module triggers the OnDataReceived event and calls the UpdateModelStateAPI to pass the device ID and dynamic parameters; after receiving the data, the scene editing module updates the model display and data panel through the SetMaterialColor() and UpdateUIText() methods.
[0040] In practice, the login interface adopts a three-area layout: software logo, illustration, and login area. It supports username and password input, and includes a "Remember username and password" checkbox. Once checked, the username and password for successful login are stored in the local database and automatically filled in on subsequent logins, with a response latency of ≤100ms. After the user clicks "Login," the system uses the AuthVerifyAPI to call the backend user database to verify credentials, match the account's corresponding role permissions (administrator / editor / viewer), and load the corresponding functional interface. If the username or password is incorrect, a "Username or password incorrect" message pops up; if the user does not have project permissions, only a "No permission for this project" message is displayed after entering the project library, preventing unauthorized access.
[0041] After logging in, the account avatar and username are displayed in the upper right corner of the interface. Clicking to expand the drop-down menu contains three function buttons: "System Operation Manual," "Logout," and "Exit Software." Clicking "System Operation Manual" opens "TwinEnabler V1 User Manual.pdf" in your local default PDF reader or browser, supporting default program adaptation for Windows 10 and above systems. Clicking "Logout" triggers the Logout API to clear the current session cache and redirects to the login interface. Clicking "Exit Software" calls Application.Quit() to close the process. If there are unsaved drafts, a "Save?" prompt will appear (linked to the drafts module).
[0042] The project library addresses the issue of unclear project ownership and permissions in multi-user collaboration. Implementation details are as follows: 1. Data Organization and Display: A three-level identifier of "User ID-Project ID-Scene ID" is adopted. The project list is arranged in reverse order of creation time. Each project block is separated by a dark blue-gray background and displays summary information such as project name, number of scenes, scene thumbnail, and creation time. When the number of scenes exceeds one line, the "Expand Scenes" button is displayed. Clicking it will display all scenes on a new line. The button then switches to "Collapse Scenes" to adapt to the display needs of different numbers of scenes.
[0043] 2. Search Function Implementation: Supports fuzzy / precise search for "project name + scene name". Fuzzy search is based on keyword matching algorithm, while precise search allows selection of an existing name from a drop-down list. The search response time is ≤200ms. Clicking the "Reset" button clears the input box and calls the ResetSearchAPI to load all project data.
[0044] 3. RBAC Permissions and Editing Controls: Administrators can create / delete projects and assign permissions; editors can modify project / scene names (double-click the name to enter edit mode) and edit scenes; viewers can only browse. 4. Scene navigation: Clicking the scene thumbnail loads the scene editing interface via the SceneEditAPI, passing the project ID and scene ID parameters.
[0045] The draft box connects scene editing with cloud publishing. Implementation details are as follows: 1. Caching strategy: The AutoSaveDraftAPI is triggered every 20 seconds during scene editing. The cached data includes model position, parameter configuration, and data binding relationship, and is stored in the local Draft folder to achieve automatic caching. After the user clicks "Save", the draft name can be customized, and the draft list will display the editing progress and save time to achieve manual caching.
[0046] 2. Flow mechanism: Clicking the draft thumbnail calls the LoadDraft API to restore the editing state without rebuilding the scene; clicking "More Publish" triggers secondary confirmation, and after verifying the integrity of the data, it is synchronized to the project library cloud via CloudSync API, and a publication success prompt pops up; clicking "More Delete" deletes local files after secondary confirmation, releasing storage resources.
[0047] The system model library provides prefabricated resources for scene construction. Implementation details are as follows: 1. Model Building Process: Point cloud data of the equipment is acquired using a Leica RTC360 laser scanner with an accuracy of ±0.1mm and a single device point cloud volume of ≥50 million points; Cyclone software is used to perform filtering, noise reduction (isolated point threshold of 5mm), and simplification (retaining 40% of the feature face number) to generate a geometric white model; in 3ds Max 2020, joints are split (e.g., machine tool is split into bed and spindle), materials are assigned (metal material reflectivity of 0.3), LOD components are added, and the model is exported in FBX / STEP format; the model is imported into the system model library through ModelImportAPI, automatically assigned an ID (e.g., "Machine Tool-M001"), and a parent-child hierarchy of "base and boom" is established.
[0048] 2. Resource Management and Retrieval: Categorized storage: Includes model library, POI library, theme library, etc. The model library is categorized by "device type - manufacturer brand" and supports tag filtering; Search optimization: Based on the FPFH feature histogram algorithm, it supports keyword search, sorts search results by similarity, and has a response time of ≤300ms.
[0049] The scene editing module, as the core of low-code scene building enabled by Unity, implements drag-and-drop visual editing based on the Unity engine. It is the core interactive carrier of the system, and the implementation details are as follows: The interface layout adopts a six-area layout of "management tool rack - tool rack - content library - model tree - attribute area - scene area", and is developed based on Unity UGUI. The rendering frame rate is stable at ≥60fps. The scene area supports perspective / orthographic projection switching. The viewing angle can be adjusted by dragging with the middle mouse button (moving the view), dragging with the right mouse button (rotating the view), and scrolling with the mouse wheel (zooming), which is adapted to the operating habits of industrial users.
[0050] Among the core editing functions, the tool rack operations cover movement / rotation / scaling, snapping, and collision detection: after selecting an object, the XYZ axes are displayed, supporting drag operations or inputting precise values (such as moving coordinates X=1000mm, Y=500mm, Z=0mm); the snapping function is a three-state button (face snapping / point snapping / no snapping), face snapping is based on Raycast ray detection (distance threshold 5mm) to ensure that the model fits the ground; clicking the "collision" button highlights the bounding boxes of colliding models in red to avoid layout conflicts.
[0051] Regarding content library access, dragging "Machine Tool-M001" from the model library to the scene automatically loads the model and its metadata (model, dimensions); dragging "Equipment Fault Marker Point" from the POI library to the side of the machine tool allows for customization of the red triangle icon and association with the device ID via POIBindAPI; embedding "Equipment Utilization Bar Chart" from the chart library binds to machine tool operating data, updating every minute. Model tree management supports locating objects by entering keywords in the search box, and allows creating new folders, renaming, showing / hiding (shortcut key H), and locking / unlocking (shortcut key Ctrl+K); Right-clicking on the device model supports operations such as scene focus (F), copy (Ctrl+C), and delete (Delete). For outputting the edited results, clicking "Save" in the management toolbar moves the data to the drafts folder; clicking "Publish" requires secondary confirmation and then synchronizes to the cloud, with a multi-terminal synchronization delay of ≤500ms; if not saved upon exit, a prompt will appear, selecting "Save" to update the draft, or "Do not save" to exit directly.
[0052] The data-driven and binding module, as the core of real-time mapping between virtual and real scenes, is implemented in the following details: The model standardization preprocessing adopts a Cartesian right-hand coordinate system, with the Z-axis as the orientation axis and the Y-axis as the rotation axis. Joints are named according to the rule "joint name_number_drive type" (e.g., "Joint_01_R", where R represents rotation), and the joint local coordinates / rotation are set to (0,0,0). In data acquisition and processing, static data (model, rated power) is acquired via RS485 + Modbus RTU (cycle time 1 minute / time); dynamic data (temperature, vibration) is acquired via sensors (cycle time 200ms / time) and transmitted via IoT gateway; data is synchronized to a MySQL database and encapsulated in JSON format (e.g., ...). Figure 1 As shown, it includes the fields deviceID, staticData, dynamicData, and timestamp; it is published to the Topic "DiscreteManufacturingShop / Data" via the MQTT protocol, and the system subscribes to this Topic. QoS level 2 ensures reliable data transmission.
[0053] In terms of binding and mapping logic, the digital model ID "Machine Tool-M001" matches the physical ID of the entity and is automatically associated through IDMatchAPI; AGV-A003 requires manual input of the physical ID due to ID format mismatch, and "positionX / Y" is set to map to the model coordinates; during dynamic response, the display panel updates in real time when the machine tool temperature rises to 45℃, and the model material switches to yellow when it exceeds 50℃. When the AGV position is updated, the model jumps synchronously and displays the speed "0.8m / s".
[0054] The operation and maintenance application module implements workshop management functions, among which the inspection function module supports manual navigation and automatic inspection: The mobile animation is in first-person perspective, with movement controlled by the W / A / S / D keys, zoom using the scroll wheel, and the spacebar to switch between "walk" and "fly". Key areas are highlighted when the camera is ≤1m away from the device. The automatic inspection can add 3 nodes (Node 1: X=1000mm, Y=500mm, camera height 2000mm, dwell time 5 seconds), set the path duration to 60 seconds, and loop infinitely. The camera moves along the path via the AnimationAPI, and a processing progress line graph pops up when a node stops.
[0055] The early warning and alarm function module allows you to set thresholds on the UI panel (AGV battery level ≤ 20% warning, machine tool vibration ≥ 50Hz alarm), which are stored in the alarm_threshold table. When an early warning is issued, a yellow POI is displayed next to the AGV, and a UI pop-up window prompts "Needs charging". When an alarm is triggered, the machine tool model turns red and flashes, the system locates the abnormal position, and the UI panel displays "May cause a 5% decrease in pass rate" to assist in decision-making.
[0056] In the time-space rewind function module, the administrator selects "2024-07-01 10:00-11:00", supports custom settings for playback speed, the system extracts historical data from MySQL, sends it via MQTT every 30 seconds, and after parsing the data, reproduces the running status - when the machine tool vibration rises to 60Hz at 10:30, the model vibration amplitude increases, and when the power drops sharply to 0 at 10:45, the model turns gray, reproducing the no-load shutdown scenario.
[0057] The chart display and UI panel module layout includes an overview panel (showing the total output of 500 units on July 1st, with a completion rate of 83.3%), a production line panel (AGV position X=3500mm, automated warehouse turnover rate 2 times / day), an equipment panel (machine tool pass rate 98%, 1 failure), and a quality panel (overall pass rate 97%, scrap rate 3%). Data binding supports static data (direct editing of JSON), interface data (GET / POST requests), and SQL data (input query statements). Data processing uses JS functions to convert formats.
[0058] The module collaboration closed-loop process is as follows: The administrator creates a "Discrete Manufacturing Workshop Digital Twin Project" through the project library and assigns "Editor" permissions to technicians; technicians retrieve equipment models from the system model library, complete the layout in the scene editing module, and save it to the draft box; the data-driven module receives equipment data through MQTT, completes the binding of the digital model and the entity, and achieves virtual-real synchronization; the administrator starts automatic inspection, and the early warning module detects low battery of the AGV and triggers a prompt; after a fault occurs, the administrator reproduces the state through spatiotemporal backtracking and optimizes the scheduling plan in combination with the chart panel; when the scene is iterated, editing is resumed from the draft box, and multiple terminals are updated synchronously after publication. In terms of terminal and storage media implementation, the industrial PC must meet the requirements of Windows 10 X64 architecture, memory ≥8GB, GPU support DX11, and the running environment must include .NET Framework 4.8; computer-readable storage media (SSD / cloud storage) stores the program, and the processor executes the logic of module calling (scene editing calls ModelLoadAPI to load resources), data processing (JSON encapsulation, outlier filtering algorithm), engine control (Unity rendering parameter configuration, perspective switching), and cloud synchronization (CloudSyncAPI data transmission and consistency verification).
[0059] Example 2: See Figure 2 This embodiment describes a rapid construction method for a digital twin workshop scene based on the Unity engine. The construction process is as follows: Step 1: Construct a high-fidelity model of the physical workshop equipment. High-density point cloud data of the physical workshop is acquired using a laser scanner; point cloud processing software is used for filtering, denoising, and simplification; model segmentation, material mapping, and rendering are completed in a 3D modeling tool; joints are decoupled and parent-child relationships are bound using Unity; finally, the high-fidelity model is imported into the model library of the digital generation system. Step 2: Quickly build a physical workshop twin scene. Drag and drop equipment models from the system model library and add them to the 3D scene; use the mouse wheel or input zoom level to precisely adjust the model size; adjust the position, orientation, and hierarchy of each equipment twin model according to the actual workshop layout to quickly complete the physical workshop scene construction. Step 3: Data Acquisition and Online Synchronization. Based on an adapted communication protocol, physical equipment status data is acquired, and dynamic processing data is obtained through sensors. The acquired data is synchronously stored in a database and encapsulated in JSON format. The MOTT protocol is used to publish and subscribe to the encapsulated data, completing real-time interaction and dynamic mapping between workshop physical data and the digital generation scenario. Step 4: Workshop Inspection, Early Warning, and Spatiotemporal Retrospective. The digital twin system displays an overall order overview, production line operation status, and equipment statistics through charts and UI panels; it supports visual inspection of workshop operations through manual navigation or automatic inspection; it monitors operational anomalies in real time and triggers early warnings; and it can also access historical data for spatiotemporal retrospective analysis of the workshop operation process.
[0060] This embodiment is applied to a discrete manufacturing workshop scenario, and its digital twin workshop scenario is as follows: Figure 3 As shown, the technical effectiveness verification results are as follows: In terms of construction efficiency, the scene construction cycle is shortened from the traditional 14 days to 3 days, and the single-device modeling time is reduced from 2 days to 2 hours; in terms of data synchronization, the data mapping latency is 0.5 seconds, and the multi-terminal synchronization error rate is 0; in terms of operation and maintenance efficiency, the equipment fault response time is shortened from 30 minutes to 7.5 minutes, and the fault diagnosis accuracy is improved by 95%. The above results show that this system, through modular design and low-code technology, effectively solves the problems of high threshold, low efficiency, and virtual-physical separation in existing solutions, and has significant industrial applicability.
[0061] Example 3: The present invention also discloses a computer-readable storage medium storing a digital twin workshop scene rapid construction editor thereon. When the digital twin workshop scene rapid construction editor is called and run by the processor, it is used to implement the above-mentioned digital twin workshop scene rapid construction method based on the Unity engine.
Claims
1. A method for rapidly constructing a digital twin workshop scene based on the Unity engine, characterized in that, include: Step 1: Manage and display projects within the user account's permission scope through the project library module, and obtain summary information of published scenarios under the project; The Drafts module displays and manages local draft scenes saved during scene editing; Step 2: Display the scene's visual content through the scene editing module; perform CRUD operations on the objects in the visual content, and save the editing results to the local draft box or publish them to the cloud to achieve multi-terminal data sharing; Step 3: Bind and acquire the status and processing data of the physical equipment online through the data-driven binding module to complete the dynamic mapping between the digital twin workshop scene and the real workshop scene, and realize the online reflection of the workshop operation status.
2. The method for rapid construction of a digital twin workshop scene based on the Unity engine according to claim 1, characterized in that, The device model described in step 2 is constructed using 3D scanning and geometric reconstruction techniques, including: Step 2.1: Use a laser scanner to collect high-density point cloud data of the physical workshop; Step 2.2: Use point cloud processing software to filter, denoise, and simplify the point cloud data to generate a geometric white model; Step 2.3: Perform segmentation, material mapping, and rendering processing on the geometric white model in a 3D modeling tool to generate a high-fidelity device model.
3. The method for rapidly constructing a digital twin workshop scene based on the Unity engine according to claim 2, characterized in that, The steps also include step 2.4: binding the joints of the device model to a parent-child hierarchy in Unity to achieve hierarchical management of the device structure; importing and storing the high-fidelity device model into the system model library based on the digital twin platform.
4. The method for rapidly constructing a digital twin workshop scene based on the Unity engine according to claim 1, characterized in that, The specific implementation of performing CRUD operations on objects in the visualized content in step 2 includes: Operation 1: Retrieve the device model from the system model library and add it to the 3D scene by dragging and dropping; Operation 2: Allow the device model to move freely in 3D space by dragging and dropping, or define the precise position of the device model by inputting 3D coordinates, and support the alignment of the device model by ground snapping, vertex snapping, bounding box snapping and plane snapping. Operation 3: Zoom in and out of the device model using the mouse wheel, or precisely adjust the model size by inputting the zoom ratio; Operation 4: Rotate the selected device model by dragging the control handle; Operation 5: Select one or more objects by using a selection box to perform batch add, delete, or modify operations.
5. The method for rapid construction of a digital twin workshop scene based on the Unity engine according to claim 1, characterized in that, It also includes step 4: inspecting the operation of the digital twin workshop through the inspection function module using manual or automatic inspection methods: The mobile game is played from a first-person perspective. Players control the movement of the viewpoint forward, backward, left, and right using the keyboard and adjust the zoom using the mouse wheel. The automatic inspection is based on path control and supports linear and curved paths. Each path contains multiple inspection nodes, and each inspection node is associated with position, rotation angle, camera height, pitch angle, waiting time, and event binding information. It supports adding, deleting, and dragging inspection nodes, and setting path attributes, including duration, closure status, loop type, and number of loops; It supports previewing path animations and triggers events when inspection nodes are reached or stopped, dynamically displaying equipment status, processing data, and alarm information.
6. The method for rapidly constructing a digital twin workshop scene based on the Unity engine according to claim 1, characterized in that, It also includes step 5: monitoring abnormal workshop operations through the early warning and alarm function module, specifically including: The system monitors the operational status of key equipment such as AGVs, automated warehouses, and lathes in real time. When equipment failures, order processing anomalies, or potential production risks occur, it triggers early warnings or alarms. These early warnings or alarms are displayed in a visual manner within the digital twin workshop scenario, and the abnormal locations are located by combining event nodes. The alarm information is correlated with production indicators to assist in monitoring production progress and the achievement of capacity targets.
7. The method for rapid construction of a digital twin workshop scene based on the Unity engine according to claim 1, characterized in that, It also includes step 6: realizing the historical playback of the workshop operation process through the spatiotemporal backtracking function module, specifically including: Step 6.1: The user selects the rewind time range and sets the rewind playback rate; Step 6.2: Extract historical data within the specified time range from the database, encapsulate it in JSON format, publish and subscribe via the MQTT protocol, and determine the data sending frequency based on the playback magnification. Step 6.3: Parse the received historical data and reproduce the corresponding time period's operating status in the digital twin workshop scenario for equipment fault diagnosis and tracing, process optimization, and production simulation.
8. The method for rapidly constructing a digital twin workshop scene based on the Unity engine according to claim 1, characterized in that, The visualization of the scene in step 2 also includes a UI panel, which is implemented through charts and UI panel functional modules, including: Displays production line statistics, real-time warehouse status, and order overview information; The system displays the operating status, equipment condition, and production run time of AGVs, automated warehouses, engraving machines, and robots. Displays statistics, operating status, and operating records for individual devices; Show the production line pass rate and scrap rate.
9. A rapid construction system for digital twin workshop scenes based on the Unity engine, characterized in that, include: The project library module is used to manage and display projects within the user account's permission scope, and to obtain summary information of published scenarios under the project. The draft box module is used to display and manage local draft scenes saved during scene editing; The scene editing module displays the visual content of the scene, performs CRUD operations on the objects in the visual content, and saves the editing results to the local draft box or publishes them to the cloud to achieve multi-terminal data sharing. The data-driven and binding module is used to bind and acquire the status data and processing data of physical equipment online, so as to complete the dynamic mapping between the digital twin workshop scene and the real workshop scene and realize the online reflection of the workshop operation status. The system model library is used to store high-fidelity device models and to perform the model management, retrieval, and calling functions.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a rapid construction program for a digital twin workshop scene. When the rapid construction program for a digital twin workshop scene is executed by a processor, it implements the steps of the rapid construction method for a digital twin workshop scene based on the Unity engine as described in any one of claims 1-8.