A Framework for Service-Oriented Digital Twin Systems for Discrete Workshops and Its Practical Case Study

: To address issues in discrete manufacturing workshops, such as the difﬁculty for management personnel to coordinate workshop production and the challenge of visualizing and supervising a massive amount of temporary data, this paper proposes a service-oriented digital-twin-system framework for discrete workshops using the industrial IoT platform as the system-service platform to solve the problems of the opaque monitoring of operators in discrete workshops, the low interactivity of 2D monitoring systems, and the difﬁculty of the visual monitoring of workshop data. Firstly, the current situation of intelligent manufacturing workshop-monitoring demand in the context of new-generation information technology is analyzed, and a six-dimensional digital-twin-workshop-monitoring architecture is proposed, whereby a discrete workshop monitoring system based on the digital twin is constructed with IoT as the service platform. We will conduct research on the construction of virtual workshops for the system development process, twin data collection based on edge computing gateways, and dynamic monitoring of the production process. Finally, through the application of this system framework in a movable-arm-production workshop, the more intelligent human–machine interaction process of browsing and controlling workshop information, such as the equipment layout and production processes in the virtual workshop, has been realized. This includes data acquisition based on edge-computing gateways, dynamic real-time monitoring of the production process, etc., which provides a reference for realizing the visual monitoring of the discrete workshop.


Introduction
With the rapid development of modern information technology (Internet of Things, edge computing, cloud computing, digital twin, etc.) and the acceleration of industrialization, the strategic position of smart manufacturing has increased significantly.In order to organically combine the development of information technology with modern manufacturing, each manufacturing powerhouse has put forward corresponding development strategies (such as the Industrial Internet, Industry 4.0, Made in China 2025, etc.), which has promoted the development of modern information technology (New IT) in the direction of smart manufacturing [1].As a powerful lever for the development of industrial intelligence, the digital twin effectively realizes the integration of physical information and digital feedback from the real physical world to the networked space [2], which is of great significance in the field of intelligent manufacturing.
In recent years, with the renewed development of industry and emerging technologies, technology is no longer the only important factor, and industrial development has begun to adhere to the core concept of being people-oriented [3].Zizic et al. [4] used COVID-19 as a concrete example to emphasize the importance of people, organization, and technology in industrial development.To achieve the development of intelligent manufacturing in the modern industrial context, how to better achieve human-machine interaction and Systems 2023, 11, 156 2 of 26 collaboration is the key to realizing intelligent manufacturing workshops in the modern industrial context.
However, in today's industrial manufacturing, the production equipment in discrete workshops is complex, the production tasks are diverse, the forms of workshop information interaction are varied, and a large amount of bottom-level data is generated.It is difficult for management to comprehensively monitor the production status of workshop equipment, perform real-time monitoring and management of workshop production data, and make reasonable adjustments to the layout or production tasks of workshop equipment.Realtime, intuitive, and transparent visualization of workshop monitoring and a certain degree of human-machine interaction have become the keys to solving these problems, as well as the implementation and realization of digital twin workshops.
This article takes the Internet-of-Things platform as a system-service platform and proposes a six-dimensional model-monitoring system for discrete workshops based on digital twins, starting from the actual production-process monitoring needs of various levels of management personnel in discrete workshops.The six-dimensional architecture based on the digital twin is constructed with the production of the discrete workshop as the object, where the three key modules of the monitoring system development are explained, and the implementation process and functions of the monitoring system are illustrated, with the actual production workshop as the implementation case.The proposed and implemented digital twin system enables production monitoring and data visualization on the shop floor, the simulation and optimization of production processes, and versatile user-oriented presentation services.
The paper is organized as follows: Section 2 introduces the literature review, Section 3 analyzes the discrete workshop-monitoring requirements and describes the workshop digital-twin-visualization-monitoring architecture, and Section 4 describes the key technologies in the implementation of the workshop digital twin monitoring system.Section 5 applies and validates the proposed monitoring model through concrete implementation cases, and the conclusions are given in Section 6.

Literature Review
With the rising strategic position of smart manufacturing in the industrialization process, the digital twin workshop has also started to be widely studied and applied.
To cope with the technological wave of Industry 4.0 and realize the information fusion between virtual and physical worlds in the construction and visual monitoring of the digital twin workshop, Tao Fei et al. [5] firstly proposed and elaborated the relationship between twin architectures, such as the physical workshop, virtual workshop, workshop service system, and twin data, and studied and analyzed the concept of the digital twin workshop from the four dimensions of physical fusion, model fusion, data fusion, and service fusion to provide a basis for the digital.Zhongyu Zhang [6] proposed a workshop system framework based on the digital twin which deeply integrated the workshop model, data collection, and information decision, synchronized data in real time, reduced logistics costs, and improved system productivity.Fei Tao [7] provided a systematic analysis of currently available digital twin models from multiple perspectives.A complete summary of the whole digital-twin-modeling process is presented from several aspects, which provides a theoretical basis for twin-model building.Zhang et al. [8] started from the multiscale modeling of a digital twin shop and proposed a multilayer modeling framework from the unit level of the model to the system level of the model, as well as a discussion of the model assembly, fusion, and update process.Y. F. Zhang [9] proposed a discrete manufacturing shop-simulation model-mapping scheme to fuse and map data models, logical models, and visualization models, and validated their models with real-time production data and performance.Zhang et al. [10] used digital twin technology to integrate the product definition model, geometry and shape model, artificial-manufacturing-attribute model, behavior-and-rule model, and data-fusion model to construct a digital twin informationphysical production system by fusing the five models to achieve intelligent interconnection and information interaction.Qingwei Bao [11] proposed an ontology-based DT modeling and evolution method for assembly plants to optimize the assembly process of production systems.Rolle et al. [12] proposed a digital twin modular architecture that uses open-source tools based on process control, lightweight protocols, and model-visualization methods to implement a system architecture design that provides a reference for the implementation of digital twin systems.Sangsu Choi [13] proposed a digital twin architecture and system based on an interoperable data model, which was applied to a specific production.Zhuang et al. [14] proposed an intelligent workshop control architecture based on the digital twin, which illustrates the system construction process.
The collection of shop-floor data and the integration of information in the shop-floor model are the keys to the digital twin workshop, and the IoT platform has the advantages of strong device access, perfect data services, and a high-system-development rate in the collection of shop-floor information.Wang Chuang et al. [15] uses RFID readers and intelligent sensors to monitor the production status of workpieces, record production data, and monitor operations in a digital twin workshop based on the Internet of Things and cyber-physical production systems.Cheng et al. [16] utilized the industrial internet of things (IIoT) as a platform and proposed a digital twin IIoT reference framework for intelligent manufacturing.They designed and developed a system with a focus on constructing various scenarios at the product, workshop, and enterprise levels.In terms of information processing and integration in the workshop, edge computing extended the computing, analysis, and storage capabilities of the cloud service center to the edge side of the network to achieve the real-time and efficient processing of lightweight data in close proximity to relieve the pressure of the main station storage and computing system.Muchen Yang [17] combined historical data from manufacturing production with digital twin systems to introduce the value of specific applications of historical data.Xin Tong et al. [18] proposed a real-time machining-data application and service based on the IMT digital twin, which realized the visualization and analysis of CNC machine tool-machining data.Heng Cao [19] took the digital twin system of the actual workshop production line as the basis and adopted Web-development technology to realize the real-time alarm.Guoshun Wang [20] proposed a workshop control system based on the digital twin for workshop intelligence, built a virtual model of the digital workshop control, and finally realized the real-time monitoring of digital twin workshops.
Regarding better human-machine collaboration and human-machine interaction for digital twin workshops, Jian Zhang [21] developed an information-physical-machine tool based on edge-computing technology to realize remote sensing, real-time monitoring, and remotely interactable high-performance digital twin applications.George J. Tsinarakis [22] combined Petri nets with modeling tasks in the development process to enable humanmachine collaboration and information interaction in the digital twin monitoring process of electric vehicle design, manufacturing, and assembly.Jasper Wilhelm et al. [23] analyzed the integration and interaction of human and digital twins in intelligent manufacturing systems according to the PRISMA-Scr approach, presented state-of-the-art DT-based human-machine interaction (HMI) and its impact, and proposed future research directions.Tian Wang [24] proposed a collaborative human-machine-modeling approach based on digital twins in the direction of smart manufacturing, and implemented the technology, as well as the human-machine interaction of the product, in a case study.
Concepts such as digital workshops and production-line simulations have long been proposed, but they cannot be directly used for the real-time visual monitoring of digital twin workshops to achieve intelligent human-machine interaction and guide workshop production to achieve better human-machine collaborative functions.With the emergence of the development of IoT technology and its application in the digital twin workshop, theoretical research, as well as application practice, in workshop data collection, workshop monitoring models, edge-computing gateways, 3D visual monitoring of workshops, digital twin workshops, etc., have been generated.
In summary, the research on the 3D monitoring of digital twin workshops still has the following shortcomings: 1 Most of the research applications on the digital twin workshop are focused on the one-way-mapping process from information collection to twin workshop modeling and 3D monitoring; furthermore, in terms of the presentation dimension of the system, the degree of interactivity is relatively low; 2 The development of IoT has made workshop-data-collection technology increasingly mature, but in the organic combination of real-time information and workshop-modeling methods, most of the research only focuses on the data value itself, the data visualization is mostly represented by 2D data and graphics, and the visualization degree is relatively low; 3 The massive amount of workshop data also puts the main system of the IoT platform under pressure.The visualization of data is mostly expressed in two-dimensional data and graphics, and the degree of visualization is relatively low.
To address the above problems, this paper proposes a 3D visualization and monitoring method based on the digital twin, firstly starting from the 3D visualization and monitoring needs of the shop-floor managers, thereby establishing a multilevel collaborative-display 3D visualization and monitoring method, and studies the digital-twin-workshop-modeling method and the human-computer interaction process, the dynamic monitoring of production processes, and data-collection technology based on edge-computing gateways in the key implementation method.

Visual-Monitoring-Requirement Analysis
The digital twin workshop integrates the physical workshop, virtual workshop, information system, and twin data, and the physical workshop and virtual workshop realize two-way mapping through the twin data.The virtual workshop model needs to be built from geometric, physical, behavior, and rule multidimensions.In the geometric dimension, the virtual workshop needs to truly reflect the production environment of the workshop; in the physical dimension, the virtual workshop model needs to truly reflect the physical attributes and characteristic information of the workshop resources; in the behavior dimension, the virtual workshop needs to specifically map the production dynamics of the workshop; in the rule dimension, the virtual workshop needs to truly constrain the state information of the workshop.
The workshop is a multilevel management place, and the workshop staff can be divided into the main management, basic management, and operators.The main management is mainly responsible for the macrocontrol of the workshop, production-task formulation and coordination, and the control and monitoring of the comprehensive indicators of the workshop, such as the production efficiency, equipment utilization, and production-task balance; the basic management is responsible for arranging workers to execute the detailed operation production and monitoring the real-time production status, task progress, equipment condition, etc.; the executive level is responsible for the specific production operations and monitoring the equipment operation in the production process.The operational personnel need to be responsible for specific production operations, as well as monitoring the equipment operation information and production materials during the production process.
Due to the complexity of the workshop equipment, the management staff are unable to fully monitor the production progress of the workshop through ordinary two-dimensional monitoring systems, which makes it difficult to coordinate the production.As a result, the grassroots management staff lack operational coordination, leading to a situation where some stations are idle while others are busy.Furthermore, the workshop's twodimensional monitoring system has some monitoring blind spots, making it challenging for the executive-level staff to obtain comprehensive information on workshop-equipment operations.As a result, they need to patrol the workshop-equipment-alarm information to avoid unplanned downtime.

Digital-Twin-Visual-Monitoring Architecture
Digital twin theoretical models mainly include the classical digital twin conceptual model, the digital twin six-dimensional model, the Intelligent Manufacturing System 5C (connectivity, cloud computing, big data, intelligent control, content) model, etc.The digital twin workshop is consistent with its theoretical model, which can be summarized as the three core elements of data, model, and service.Referring to the above theoretical model, combined with the advantages of IoT, supporting multiple-device access, supporting multiple data protocols, and facilitating system development, we propose a six-dimensional system model, M DT , based on the digital twin workshop 3D visualization and monitoring system with the IoT platform as the service platform, including the physical workshop (PS), virtual workshop (VS), system services (Ss), digital data (DD), edge-computing gateway (Connection, CN), and user display (UD).The relationship between each dimension is: M DT = (PS, VS, Ss, DD, CN, UD).
(1) The physical workshop (PS).The PS is the basis of the six-dimensional model and is mainly used to execute the task instructions issued by the shop service system.The PS can be divided into the equipment layer, unit layer, production-line layer, and shop layer according to the functional structure.The equipment layer, as the minimum production component of the shop, includes each piece of equipment in the shop; the unit layer is a collection of equipment performing the same task or process, such as the grouping unit, robot-welding unit, filler-welding unit, machine-processing unit, and pipe-clamping welding unit, etc.; the production-line layer is a collection of units performing the same production task, such as the moving-arm production line.The unit level is a collection of equipment performing the same task or process, such as the grouping unit, robot-welding unit, filler-welding unit, machine-processing unit, and pipe-clamping unit, etc.; the production-line level is a collection of units performing the same production task, such as the moving-arm production line.Each shop level works together to complete the shop production tasks.(2) The virtual workshop (VS).The VS, as a proportional virtual map for the PS, is mainly responsible for the operation index of the PS.Through 3D modeling software, the workshop equipment is constructed in multiple dimensions and the model is fused at the multiscale level to achieve a realistic mapping of the whole workshop.The model is further refined by adding materials, lighting, effects, rendering, and a virtual reality modeling language through Unity 3D to make it consistent with the PS production states (properties, event state), dynamic behavior, and 3D scenes.(3) The system service (Ss).The Ss contains the services needed in the process of digitaltwin-workshop realization, mainly provided by 3D modeling software, the IoT service platform, virtual development software, etc.According to the demand of the service, it can be divided into the functional service (FS) and business service (BS).The functional service mainly includes: (i) a model service based on virtual model construction, virtual scene construction, and model rendering; (ii) a data-management service based on data storage, cleaning, encapsulation, mining, fusion, and analysis; (iii) a connection-support service based on an interface service and protocol service.Operational services mainly include a series of user-oriented services, such as multilevel-monitoring forms (large-screen kiosks, augmented-reality devices, mobile devices, etc.), and expressed through the user-display (UD) dimension.(4) Digital twin data (DD).DD mainly provides the data engine when the VS, PS, Ss, UD, and other functional services are running, including (i) physical properties and the data of the PS, such as the workshop environment, equipment parameters, etc.; (ii) the VS-oriented data describing the PS model, such as the geometric model, physical model, behavior model, and rule model; (iii) the interaction data between the PS and VS, including real-time-operation data and historical-operation data.(5) The edge-computing gateway (CN).The CN mainly represents the connection interaction relationship between other dimensions in the six-dimensional model.It mainly includes the connection between the PS and VS.The CN targets the char-acteristics of multiple devices with multiple sources of heterogeneous data in the workshop, and the CN plays the functions of edge computing, communication, connection, protocol adaptation, the conversion and physical mapping of information in the six-dimensional model, receiving, sensing, parsing, and the transmission of the PS real-time data, on the one hand, and receiving, parsing, and transmitting commands from the virtual workshop, on the other.(6) The user display (UD): The UD is a specific extension of the business service as the display dimension of the M DT .The specific content of the workshop production is displayed in this dimension through real-time monitoring, model-driven monitoring, and the workshop simulation operation at multiple levels and from multiple perspectives.We propose a multilevel interaction with 3D virtual workshop scenes and real-time monitoring as the main focus, complemented by scene roaming and simulation operation.
First of all, Figure 1 provides a graphical overview of the monitoring requirements at the workshop level, as discussed in the previous section.The goal is to ensure that the monitoring needs of all personnel at different levels are met, and that all factors and processes involved in the workshop production are monitored.The monitoring form should primarily be in 3D scenes, complemented by the dynamic process status and operational parameters.
Systems 2023, 11, x FOR PEER REVIEW 6 of 26 (5) The edge-computing gateway (CN).The CN mainly represents the connection interaction relationship between other dimensions in the six-dimensional model.It mainly includes the connection between the PS and VS.The CN targets the characteristics of multiple devices with multiple sources of heterogeneous data in the workshop, and the CN plays the functions of edge computing, communication, connection, protocol adaptation, the conversion and physical mapping of information in the six-dimensional model, receiving, sensing, parsing, and the transmission of the PS real-time data, on the one hand, and receiving, parsing, and transmitting commands from the virtual workshop, on the other.(6) The user display (UD): The UD is a specific extension of the business service as the display dimension of the MDT.The specific content of the workshop production is displayed in this dimension through real-time monitoring, model-driven monitoring, and the workshop simulation operation at multiple levels and from multiple perspectives.We propose a multilevel interaction with 3D virtual workshop scenes and real-time monitoring as the main focus, complemented by scene roaming and simulation operation.
First of all, Figure 1 provides a graphical overview of the monitoring requirements at the workshop level, as discussed in the previous section.The goal is to ensure that the monitoring needs of all personnel at different levels are met, and that all factors and processes involved in the workshop production are monitored.The monitoring form should primarily be in 3D scenes, complemented by the dynamic process status and operational parameters.To fulfill the monitoring requirements of the personnel at every level of the workshop-production process, this paper proposes a six-dimensional architecture for the digital twin monitoring system, as illustrated in Figure 2. The system achieves comprehensive and process-oriented monitoring of physical workshops by providing services such as To fulfill the monitoring requirements of the personnel at every level of the workshopproduction process, this paper proposes a six-dimensional architecture for the digital twin monitoring system, as illustrated in Figure 2. The system achieves comprehensive and process-oriented monitoring of physical workshops by providing services such as monitoring production efficiency, production status, and dynamic production processes in a virtual workshop.

Monitoring
The management can obtain a clearer grasp of the production progress and status in the workshop, allowing for a more rational allocation of production tasks and the issuance of scientifically grounded production targets, guiding the coordinated production of different workstations to achieve better human-machine collaboration via the employment of the sixdimensional monitoring system.Additionally, the system enables the grassroots executing personnel to break free from the limitations of blind workshop patrols and achieve the realtime monitoring of workshop equipment, resulting in a more efficient and higher-quality completion of the assigned job targets.
Systems 2023, 11, x FOR PEER REVIEW 7 of 26 monitoring production efficiency, production status, and dynamic production processes in a virtual workshop.
The management can obtain a clearer grasp of the production progress and status in the workshop, allowing for a more rational allocation of production tasks and the issuance of scientifically grounded production targets, guiding the coordinated production of different workstations to achieve better human-machine collaboration via the employment of the six-dimensional monitoring system.Additionally, the system enables the grassroots executing personnel to break free from the limitations of blind workshop patrols and achieve the real-time monitoring of workshop equipment, resulting in a more efficient and higher-quality completion of the assigned job targets.

Key Implementations for Digital Twin Shop-Floor Monitoring
This paper combines the visual-monitoring architecture with key implementation methods, such as the digital-twin-shop-modeling method, the dynamic monitoring of production processes, and data collection technologies based on the edge-computing gateway.

Digital-Twin-Workshop Model Construction
The digital twin workshop realizes the integration and fusion of the full factors, the full process, and whole-business data of the workshop service system through the two-

Key Implementations for Digital Twin Shop-Floor Monitoring
This paper combines the visual-monitoring architecture with key implementation methods, such as the digital-twin-shop-modeling method, the dynamic monitoring of production processes, and data collection technologies based on the edge-computing gateway.

Digital-Twin-Workshop Model Construction
The digital twin workshop realizes the integration and fusion of the full factors, the full process, and whole-business data of the workshop service system through the two-way mapping and real-time interaction between the VS and the PS.For the construction of the digital twin workshop, this paper discusses several aspects of the workshop full-factor multidimensional and multiscale construction [8], human-machine interaction and scenario optimization, and the details of each part, as follows.

Multidimensional Construction
The VS is essentially a collection of workshop models which realize the expression of all elements of the workshop in four dimensions: geometry, physics, behavior, and rules, respectively.For the geometric dimension, the VS model mainly describes the geometric structure of workshop elements, such as men, machines, materials, and environment, mainly through SolidWorks, 3Ds Max, CATIA, and other modeling software to portray the geometric model of the workshop equipment (such as parts to be processed, the gantry crane, the grouping equipment, the robot-welding equipment, machine-processing equipment, etc.).For the physical dimension, the material properties and physical parameters (such as color, material, etc.) of the workshop equipment can be rendered by 3Ds Max, Unity, Unity 3D, and other software.For the behavioral dimension, the coupling relationship between the parts of the equipment is analyzed to build a behavior or response model that can portray the characteristics of the equipment.For the rule dimension, the rules describe the evolution of the equipment operation.

Multiscale Construction
The correlation and integration between virtual shop models is the key to realizing the operation of the virtual digital twin shop.Since there is a lot of equipment in the workshop, this paper analyzes the VS model from the scale of production elements (parts-componentsequipment) and the production system (equipment-production line-workshop) to make a reasonable correlation.For the production factor scale, the spatial position relationship between the parts (vertical, parallel, tangent, etc.) is analyzed according to the physical objects, and the parts model is built and used as the basis of the production line according to the hierarchical fusion.For the scale of the production system, we analyze the correlation between the spatial layout of workshop equipment and the mechanical level of the equipment production line, and fuse the equipment model according to the spatial location relationship to the complete layout of the whole production line.As shown in Figure 3, the model construction of the whole workshop level is realized through the multilevel fusion of production elements and system models.way mapping and real-time interaction between the VS and the PS.For the construction of the digital twin workshop, this paper discusses several aspects of the workshop fullfactor multidimensional and multiscale construction [8], human-machine interaction and scenario optimization, and the details of each part, as follows.

Multidimensional Construction
The VS is essentially a collection of workshop models which realize the expression of all elements of the workshop in four dimensions: geometry, physics, behavior, and rules, respectively.For the geometric dimension, the VS model mainly describes the geometric structure of workshop elements, such as men, machines, materials, and environment, mainly through SolidWorks, 3Ds Max, CATIA, and other modeling software to portray the geometric model of the workshop equipment (such as parts to be processed, the gantry crane, the grouping equipment, the robot-welding equipment, machine-processing equipment, etc.).For the physical dimension, the material properties and physical parameters (such as color, material, etc.) of the workshop equipment can be rendered by 3Ds Max, Unity, Unity 3D, and other software.For the behavioral dimension, the coupling relationship between the parts of the equipment is analyzed to build a behavior or response model that can portray the characteristics of the equipment.For the rule dimension, the rules describe the evolution of the equipment operation.

Multiscale Construction
The correlation and integration between virtual shop models is the key to realizing the operation of the virtual digital twin shop.Since there is a lot of equipment in the workshop, this paper analyzes the VS model from the scale of production elements (parts-components-equipment) and the production system (equipment-production line-workshop) to make a reasonable correlation.For the production factor scale, the spatial position relationship between the parts (vertical, parallel, tangent, etc.) is analyzed according to the physical objects, and the parts model is built and used as the basis of the production line according to the hierarchical fusion.For the scale of the production system, we analyze the correlation between the spatial layout of workshop equipment and the mechanical level of the equipment production line, and fuse the equipment model according to the spatial location relationship to the complete layout of the whole production line.As shown in Figure 3, the model construction of the whole workshop level is realized through the multilevel fusion of production elements and system models.

Scene-Building and Optimization
The building effect of the VS scene directly affects the efficiency of the digital-twinmonitoring-system service.The workshop equipment is complicated and there are many models, so the model needs to be lightened in the process of the VS construction to improve the service-response speed.On the one hand, we can try to adopt the modeling method with a smaller number of points, lines, and surfaces in the multidimensional and multiscale modeling; on the other hand, we can optimize the already-built model and reduce the surface of the workshop model with modeling software or other optimization software without changing the geometric features of the model.
The VS scene is based on multidimensional and multiscale modeling to complete the spatial layout of the workshop-equipment model through the optimization of the model rendering so to make the model closer to the real scene, such as building the workshop surrounding environment (plant, ground, etc.) to make the workshop scene more rich, using parallel light to simulate the effect of natural lighting, adding collision detection for the equipment to simulate the real scene, using particle effects to simulate welding, grinding-sparks-splash effect, etc., thus providing the VS scene with higher realism and immersion.

Human-Computer Interaction
The advantage of digital twin workshop monitoring over real-time video monitoring is the human-computer interaction response.Through the Unity 3D UI interface design and system-service integration, the response of the digital twin workshop to external input can be realized, such as mouse, keyboard, and other click events that can realize the geometric transformation of the VS model and monitoring perspective (pan, rotate, zoom, forward, backward, etc.).It can realize interactive functions such as multi-view display, scene roaming, and virtual production simulation of the VS.
Through the human-machine interaction function of the virtual workshop, the staff can intuitively understand the production-equipment information and process-time-node information in the workshop.Workshop managers can also browse the workshop layout from multiple perspectives and make virtual simulations in the scene to optimize and adjust the workshop layout.The use of this technology enhances the efficiency of workshop management and improves the accuracy of decision making.

Edge-Computing-Gateway-Based Data Collection
Once the virtual workshop model is constructed, the crucial step to achieve digitaltwin-workshop monitoring is to establish a connection (CN) between the physical workshop (PS) and the virtual workshop (VS).The perception of workshop data is the foundation and prerequisite for realizing the digital-twin-workshop monitoring, but the underlying equipment of the workshop production line is complicated and the communication standards are different, and the massive temporary data presents the characteristics of multisource heterogeneity, which makes the collection, management, and sharing of workshop data difficult.The edge-computing gateway has the ability to sense, store, process, and analyze data, and supports multiple collection protocols such as OPC, Modbus, TCP, and PLC, as well as cloud-oriented northbound protocols such as MQTT and JSON.In this paper, we build a data-collection architecture for IoT edge computing to realize the efficient sensing and processing of workshop-production-line information.

Data Acquisition
In edge-layer devices, data-protocol types are numerous and it is difficult to interoperate information between them.Through the edge-computing gateway, the data collected by various types of IoT sensors can be stored and managed in a unified manner.At the edge layer, data sensing of the production line equipment is achieved by configuring RFID devices, sensors, UWB, and other types of sensing devices at the workshop site and accessing processing equipment such as CNC machine tools, PLCs, industrial robots, etc. Existing RFID devices mostly use TCP/IP protocol middleware technology, CNC machine tools, and industrial robots to mostly directly support OPC UA or use serial communication to access data, and other environmental sensors directly access data through the PLC.Other environmental sensors obtain data directly through the PLC.

Data Processing
Edge-computing gateways enable data preprocessing of data uploaded by IoT sensing devices.Being closer to the edge side, the edge-computing gateway responds to the data faster.Firstly, the edge node performs data preprocessing of sensing data through STEM32-embedded devices configured with MCU, filters out a large amount of invalid temporary data at the edge side, and computes and analyzes the valid multivariate data after processing through the edge-computing-gateway server.It avoids uploading all workshop-production-line data to the data center for calculation and decision making, which greatly reduces the traffic pressure on the data center and improves the efficiency of production decision making at the same time.

Data Transmission
For data following different communication protocols at the edge layer, protocol adaptation and conversion are realized through the IoT edge-computing gateway.Currently, two ways are mostly used for protocol adaptation: 1 integration of object linking and embedded process control (OLE; for process control, OPC) technology and MTConnect middleware; 2 integration of dedicated communication protocol packages.After unifying the data architecture, it can be uploaded to the data center for storage or recalled through the server publish-subscribe method.
The data center stores and calls the data from the edge layer by configuring application servers and database servers with a high computing performance.Since the OPC UA unified architecture supports the "write" feature, the data and commands can be processed through method calls and the massive data on the production line of the workshop can be calculated and analyzed through powerful computing performance.Based on the collected data, the data center can control the edge devices by issuing control or correction commands to achieve a complete closed loop of data management on the shop floor.

Dynamic Monitoring of the Production Process
The digital twin workshop is a data-driven VS to achieve a synchronized virtual mapping of the PS.Workshop-production dynamic monitoring is based on workshopproduction-line modeling, and the data-driven workshop model runs to realize workshopproduction dynamic monitoring.The discrete shop-floor-production system has asynchronous and concurrent characteristics and is a typical discrete-event dynamic system, where production tasks can be abstracted into events and states, which is suitable for modeling with Petri nets describing discrete systems.By transforming the real-time information of shop-floor production into shop-floor events and states to drive the production-state transition, the data-driven virtual-shop-floor operation is realized through multilevel mapping to realize the dynamic monitoring of shop-floor production.

Production-Dynamic-System Modeling
Petri nets are developed on the basis of the basic Petri net E/N system to form judgment nets (EP-N), change nets (TP-N), coloring nets (CP-N), and extended stochastic high-level evaluation Petri nets (ESHLEP-N).The virtual shop floor (VS) state-change has high requirements for change rules, and the ESHLEP-N method has double tokens and double identification, which makes the system easier for decision reasoning after introducing scheduling rules; therefore, this paper adopts ESHLEP-N nets to construct the shop-floor-production dynamic model.As shown in Figure 4, the three-channel group to process the ESHLEP-N modeling is used as an example, and the library house variation and variation rules in the model are shown in Figure 5.The workshop "state event" can basically map the workshop-production dynamics, but if we want to specifically show the real-time accurate dynamic mapping of workshopproduction resources, we still need to build multilayer-mapping rules in the ESHLEP-N model.In this paper, based on the data-driven shop operation, the mapping system is built based on three levels of logistics, equipment, and products, as shown in Figure 6.The workshop "state event" can basically map the workshop-production dynamics, but if we want to specifically show the real-time accurate dynamic mapping of workshopproduction resources, we still need to build multilayer-mapping rules in the ESHLEP-N model.In this paper, based on the data-driven shop operation, the mapping system is built based on three levels of logistics, equipment, and products, as shown in Figure 6.ESHLEP-N modeling is used as an example, and the library house variation and variation rules in the model are shown in Figure 5.
In Figure 4, ○ indicates the library, indicates the change, and indicates the change rule.The token in the decision point in the ESHLEP-N can be reused, but instead of moving out from the output library to the input library, the token is moved out to the corresponding output library with the workshop event as the trigger condition.Take the first work station of the moving-arm production as an example, the work step can be divided into: 1. Moving-arm-parts group-pair assembly; 2. Moving-arm group-pair internal welding; 3. Moving-arm top-plate welding.Then, p1 means the group-pair part input buffer waiting library, w1 library means the group-pair assembly worker is idle, f1 library means the group-pair machine is idle, and so on.
When a pairing task is issued, token I1 of the production plan will be available in library p1, and tokens a1 and b1 will be available in libraries w1 and f1 when both workers ESHLEP-N modeling is used as an example, and the library house variation and variation rules in the model are shown in Figure 5.
In Figure 4, ○ indicates the library, indicates the change, and indicates the change rule.The token in the decision point in the ESHLEP-N can be reused, but instead of moving out from the output library to the input library, the token is moved out to the corresponding output library with the workshop event as the trigger condition.Take the first work station of the moving-arm production as an example, the work step can be divided into: 1. Moving-arm-parts group-pair assembly; 2. Moving-arm group-pair internal welding; 3. Moving-arm top-plate welding.Then, p1 means the group-pair part input buffer waiting library, w1 library means the group-pair assembly worker is idle, f1 library means the group-pair machine is idle, and so on.
When a pairing task is issued, token I1 of the production plan will be available in library p1, and tokens a1 and b1 will be available in libraries w1 and f1 when both workers indicates the change rule.The token in the decision point in the ESHLEP-N can be reused, but instead of moving out from the output library to the input library, the token is moved out to the corresponding output library with the workshop event as the trigger condition.Take the first work station of the moving-arm production as an example, the work step can be divided into: 1. Moving-arm-parts group-pair assembly; 2. Moving-arm group-pair internal welding; 3. Moving-arm top-plate welding.Then, p1 means the group-pair part input buffer waiting library, w1 library means the group-pair assembly worker is idle, f1 library means the group-pair machine is idle, and so on.
When a pairing task is issued, token I1 of the production plan will be available in library p1, and tokens a1 and b1 will be available in libraries w1 and f1 when both workers and pairing machines are idle, forming a combination token <a1, I1, b1>.Then, according to the decision point s1 rule, the change t11 is triggered by the workshop event (such as the production plan being issued or the required resources being idle) to start the first process, to start the pair assembly of the moving arm, and the combination token <a1, I1, b1> is consumed to form the token to enter the d1 library, which is in the process of the pair assembly of the moving arm; then, according to the decision point s3 rule, t12 is triggered in real-time to complete the pair assembly of the moving arm.The complete pair-assembly task is completed in real-time according to the decision point s3 rule.
After the group-pair assembly is completed, the tokens in d1 are also decomposed into a1, f1, and the new I2, where a1 and f1 return to the original library, waiting for the combined tokens to realize the change.The s2 decision-point drives the state transition through real-time data, triggering the next work-step state to occur.The newly generated I2 has the possibility to output to the output buffer o1; when the visual inspection or RFID detects that the buffer has been parked on a moving arm, it then enters the input buffer p2 of the second work-step, waiting for the internal grouping welding, and so on, to complete the whole production processing of the moving arm.
Workshop events and states constitute the temporal expression of the workshopoperation process.The states describe the stable operation of the production-operation steps, and the events make decisions on the transformation of the workshop-production state, promoting the next state in turn to complete the dynamic production process of the whole production line.Therefore, the workshop dynamic production can build a complex ESHLEP-N model according to the process flow and convert the data collected from the workshop into corresponding workshop events, such as when the presence of parts is detected, it can be converted into the event of process parts entering the buffer area, and according to the position information of the AGV carts, it can be converted into the event of the moving arm entering, leaving, and existing, etc.These events are introduced into the change rules to participate in the decision making of the production status.Combined with the event transformation of real-time information, the ESHLEP-N model can realize the dynamic mapping of the whole workshop-production process.

Data-Driven Multilevel-Mapping of Shop-Floor Operations
The workshop "state event" can basically map the workshop-production dynamics, but if we want to specifically show the real-time accurate dynamic mapping of workshopproduction resources, we still need to build multilayer-mapping rules in the ESHLEP-N model.In this paper, based on the data-driven shop operation, the mapping system is built based on three levels of logistics, equipment, and products, as shown in Figure 6.(1) Logistics mapping The workshop logistics mapping is based on the workshop behavior model, and the (

1) Logistics mapping
The workshop logistics mapping is based on the workshop behavior model, and the logistics mapping is realized by transforming the real-time-operation data into corresponding workshop events to drive the flow of products between work stations in the VS.To realize the dynamic display of the product-logistics status, the continuous logistics process is fitted by real-time updating the interpolation of the workpiece location data in the workshop production process, thus realizing the workshop-logistics-process mapping driven by real-time location data.
(2) Device mapping Equipment mapping is based on the establishment of the parent-child relationship of the VS model through the IoT platform and interface technology and other sensing to obtain the real-time action of the equipment and through the twin data to drive the VS model to achieve synchronous mapping.In the PS production, there will be manual workstations, and it can be very complicated to obtain production information through sensors.Therefore, displaying the corresponding equipment mapping through manual animations can be used as an alternative approach..
(3) Product mapping Product mapping is based on logistics mapping and equipment mapping, and on the premise of known workpiece production processes, based on real-time data (such as location information) and the ongoing process operation of the workpiece as an eventdriven virtual shop model to achieve a dynamic display of the product in different process states.
The product mapping includes the process information and quality of the product, but since it is a production workshop for excavator arms, the main task is the assembly and welding of the excavator arm.Meanwhile, the fourth station is for manual welding and will repair and reweld all defective welds and polish them so that the quality of the product can be ignored during the monitoring process and only the process information of the product in the assembly process needs to be mapped.
The digital-twin-workshop-monitoring system gives operators a comprehensive and intuitive control of the current state of workshop production, based on the real-time mapping of multilevel data, the real-time monitoring of the location and operating status of workshop logistics equipment, the task progress of production operations, and the real-time production-simulation operation of workshop equipment at the geometric level.Moreover, because some workstations are manual workstations, the Petri net can be used to comb through the production process, and the multilevel mapping structure can also provide clearer guidance for production, thus better realizing human-machine collaborative production.

Workshop-Production Scene
According to the six-dimensional architecture of the discrete workshop-monitoring system based on the digital twin proposed in the previous paper, this paper designs and develops a prototype workshop monitoring system on a movable-arm production workshop as an example.The workshop production consists of five stations: the assembly station, robot welding, manual welding, robot processing, and pipe-clamping welding to form a complete production-line structure.The specific stations are shown in Figure 7. First, after manual inspection, to make sure the moving-arm parts are ready, the movingarm parts are assembled and fixed by the gantry crane on the assembly machine at the assembly station; then, the gantry crane is lifted to the displacement machine for internal welding, where it is then transferred to the top-plate welding position by the logistics truck for welding and fixing the top-plate trunnion.After the welding is completed, the robot is transported to the robot-welding station by the AGV.The M20ia six-axis robot will weld the long welding seam; then, it will be transferred to the manual welding station for the welding and grinding operation.After completion, it will be transferred to the machine-processing station by an overhead crane for the rough and fine boring of the innerand outer-end surfaces and holes of the movable arm; finally, it will be transferred to the pipe-clamp welding station for the welding and grinding of the pipe-clamp fixing block.Finally, the production of the movable arm will be completed and moved to the finished product area next to it.
tion, robot welding, manual welding, robot processing, and pipe-clamping welding to form a complete production-line structure.The specific stations are shown in Figure 7. First, after manual inspection, to make sure the moving-arm parts are ready, the movingarm parts are assembled and fixed by the gantry crane on the assembly machine at the assembly station; then, the gantry crane is lifted to the displacement machine for internal welding, where it is then transferred to the top-plate welding position by the logistics truck for welding and fixing the top-plate trunnion.After the welding is completed, the robot is transported to the robot-welding station by the AGV.The M20ia six-axis robot will weld the long welding seam; then, it will be transferred to the manual welding station for the welding and grinding operation.After completion, it will be transferred to the machine-processing station by an overhead crane for the rough and fine boring of the innerand outer-end surfaces and holes of the movable arm; finally, it will be transferred to the pipe-clamp welding station for the welding and grinding of the pipe-clamp fixing block.Finally, the production of the movable arm will be completed and moved to the finished product area next to it.

System Design
Based on the above moving-arm-production workshop scenario, this paper develops a six-dimensional workshop monitoring system based on the digital twin with IoT as the service platform, and successfully applies it to the workshop production.The utilization of the system frees workshop management and workers from simple physical activities,

System Design
Based on the above moving-arm-production workshop scenario, this paper develops a six-dimensional workshop monitoring system based on the digital twin with IoT as the service platform, and successfully applies it to the workshop production.The utilization of the system frees workshop management and workers from simple physical activities, such as blindly inspecting the workshop, and enables them to engage in more intellectually demanding tasks.For example, through the virtual human-machine interaction function, they can understand the workshop production progress and production processes from a global perspective.Additionally, the technology allows for better human-machine coordination between manual workstations and mechanized workstations through visual monitoring.By improving the decision-making capacity of the workshop management team, the technology leads to more informed and strategic decisions, resulting in optimized productivity levels in the workshop.

Virtual Scene Construction
As a faithful representation of the PS, the VS scene should ensure the comprehensiveness and realism of the production elements in the workshop.Firstly, the layout of the actual workshop is analyzed.The workshop of the moving-arm production line contains five stations, as shown in Figure 7.The first station is the assembly station for the movingarm parts and partial spotwelding processing.The second station is the robot-welding station, where the assembled arm is transported via the AGV to the robot-welding work-station to weld the arm welds.The third station is the manual-welding station, where the welds welded by the robot are optimized and manually welded.The fourth station is the machine-processing station, which polishes the end-face of the arm.The fifth station is the pipe-clamping welding station, which performs the welding and slag-removal of the clamping block on top of the arm.
To begin with, we start from the equipment level of each workstation and use 3ds MAX, CATIA, and other 3D-modeling software to construct a multidimensional and multiscale virtual geometric model of the workshop equipment.In the construction process, in geometry, by measuring the size of the equipment model, the spatial location relationship, and physical information such as color, material, and other appearances, to ensure that the virtual model and the workshop equipment is of proportional geometric appearance; in behavior, it is to fully understand the constraints between the parts of the workshop equipment, to achieve the establishment of the parent-child relationship of the equipment model, and to ensure that the model child objects move with the parent object, while the parent object will not move with the child object.The parent object does not move with the child object.
Figure 7 shows the layout of the main page of the 3D modeling software 3ds MAX, where the first part is the scene-resource manager of the model, which manages the workshop-equipment-model resources, describes the parent-child relationship structure of the workshop-equipment model, and portrays the behavior dimension of the workshop model; the second part is the building block of the geometric model of the workshop equipment, and the display of the geometric structure of the equipment model is in the fourth part; the third part is the scene-material editor, which expresses the physical attributes such as color, material, and the diffuse reflection of the workshop model.After the workshop equipment is constructed, it is laid out according to the workshop space to form the production-line structure.Figure 7 shows the layout of the complete production line of the movable-arm production workshop.
The virtual-workshop-modeling process is illustrated by taking the welding machine on the displacement machine in the grouping station as an example.Firstly, the geometricdimension model of the welding machine is completed in 3Ds Max based on the weldingmachine data in the workshop, such as size and location, as shown in marker 1 in Figure 8.Secondly, the physical-dimension model is completed by assigning materials, as shown in marker 2 in the same figure, to make it look more like a metal material.After the lightweighting process, the model is exported as an .fbxfile and imported into Unity3D for texture rendering to make it more realistic, as shown on the left side of marker 3. Multidimensional modeling in the modeling process is shown on the right side of marker 3, where the construction of submodels is completed first, and then the complete welder model is achieved through the fusion of layers.Finally, the model is driven by interactive operations, and the other models in the workshop are built in the same manner.
Figure 9, on the left, shows the workshop production-line model after modeling and assigning materials only.Figure 10, on the right, shows the effect after importing into Unity3D to add materials, skyboxes, lights, physical collisions, and other components, and rendering the overall layout of the scene.
Multidimensional modeling in the modeling process is shown on the right side of marker 3, where the construction of submodels is completed first, and then the complete welder model is achieved through the fusion of layers.Finally, the model is driven by interactive operations, and the other models in the workshop are built in the same manner.model is achieved through the fusion of layers.Finally, the model is driven by interactive operations, and the other models in the workshop are built in the same manner.After constructing the virtual workshop, staff can directly observe equipment-parameter information and layout from the virtual scene.For suboptimal equipment layouts, virtual simulations allow for experimentation and optimization, promoting a trial-and-error approach.This technology enhances the understanding of the workshop equipment and layout, facilitating informed decision making and optimization.Using virtual simulations not only saves resources but also provides a safe and controlled environment for experimentation.Workshops can leverage this technology to continuously improve and optimize their processes, leading to increased efficiency and productivity.After constructing the virtual workshop, staff can directly observe equipment-parameter information and layout from the virtual scene.For suboptimal equipment layouts, virtual simulations allow for experimentation and optimization, promoting a trialand-error approach.This technology enhances the understanding of the workshop equipment and layout, facilitating informed decision making and optimization.Using virtual simulations not only saves resources but also provides a safe and controlled environment for experimentation.Workshops can leverage this technology to continuously improve and optimize their processes, leading to increased efficiency and productivity.
Due to the large number of workshop models, in order to prevent the system from loading jams, the geometric model needs to be lightened during the modeling.This paper proposes three optimization methods: ① in the geometric modeling process, the rectangular modeling method with fewer points, lines, and surfaces can be used compared to the curve modeling; ② on the premise of ensuring the geometric characteristics of the model, the unnecessary points, lines, and surfaces of the model are refined and optimized, such as without affecting the model function, which optimizes the internal structure of the model without affecting the model function; ③ the modeling software comes with an optimization function to optimize the model, such as the professional optimization modifier of 3Ds MAX, which can select points, lines, and surfaces for percentage optimization.Due to the many workshop models, we only selected the robot-welding-station ,assembly station andthe general layout of the model to do a comparison is shown in Figure 11.Due to the large number of workshop models, in order to prevent the system from loading jams, the geometric model needs to be lightened during the modeling.This paper proposes three optimization methods: 1 in the geometric modeling process, the rectangular modeling method with fewer points, lines, and surfaces can be used compared to the curve modeling; 2 on the premise of ensuring the geometric characteristics of the model, the unnecessary points, lines, and surfaces of the model are refined and optimized, such as without affecting the model function, which optimizes the internal structure of the model without affecting the model function; 3 the modeling software comes with an optimization function to optimize the model, such as the professional optimization modifier of 3Ds MAX, which can select points, lines, and surfaces for percentage optimization.Due to the many workshop models, we only selected the robot-welding-station, assembly station and the general layout of the model to do a comparison is shown in Figure 11.After constructing the virtual workshop, staff can directly observe equipment-parameter information and layout from the virtual scene.For suboptimal equipment layouts, virtual simulations allow for experimentation and optimization, promoting a trialand-error approach.This technology enhances the understanding of the workshop equipment and layout, facilitating informed decision making and optimization.Using virtual simulations not only saves resources but also provides a safe and controlled environment for experimentation.Workshops can leverage this technology to continuously improve and optimize their processes, leading to increased efficiency and productivity.

Not optimized Optimized
Due to the large number of workshop models, in order to prevent the system from loading jams, the geometric model needs to be lightened during the modeling.This paper proposes three optimization methods: ① in the geometric modeling process, the rectangular modeling method with fewer points, lines, and surfaces can be used compared to the curve modeling; ② on the premise of ensuring the geometric characteristics of the model, the unnecessary points, lines, and surfaces of the model are refined and optimized, such as without affecting the model function, which optimizes the internal structure of the model without affecting the model function; ③ the modeling software comes with an optimization function to optimize the model, such as the professional optimization modifier of 3Ds MAX, which can select points, lines, and surfaces for percentage optimization.Due to the many workshop models, we only selected the robot-welding-station ,assembly station andthe general layout of the model to do a comparison is shown in Figure 11.The size of the virtual workshop model directly affects the response speed of the digital-twin-workshop monitoring system in Unity3D for interactive operations.Therefore, importing all the equipment models of the virtual workshop after lightweighting will significantly reduce the system-response time when switching scenes, as the workshop monitoring system needs to load the model when switching scenes.The optimized model is imported into the virtual workshop, and the system-response time when switching from the digital twin system page to the main page can be indicated by the time difference in the upper left corner, as shown in Figure 12.When using the same method to import the unoptimized model, the system-response time is approximately 10 s, while the interval time for loading scenes is about 7 s, resulting in a response speed improvement of about 25%-35%.The size of the virtual workshop model directly affects the response speed of the digital-twin-workshop monitoring system in Unity3D for interactive operations.Therefore, importing all the equipment models of the virtual workshop after lightweighting will significantly reduce the system-response time when switching scenes, as the workshop monitoring system needs to load the model when switching scenes.The optimized model is imported into the virtual workshop, and the system-response time when switching from the digital twin system page to the main page can be indicated by the time difference in the upper left corner, as shown in Figure 12.When using the same method to import the unoptimized model, the system-response time is approximately 10 s, while the interval time for loading scenes is about 7 s, resulting in a response speed improvement of about 25%-35%.

Data Mapping Based on Edge-Computing Gateways
The CN dimension is responsible for achieving bidirectional data mapping between the PS and VS dimensions.However, due to the different communication protocols used by the physical shop equipment, the key to achieving the digital twin shop lies in how to extract the data that can accurately represent the production status of the PS from the large amount of heterogeneous data from multiple sources in the shop.The underlying equipment-sensing data in the workshop mainly has protocol data (such as bus type, API data, etc.) and sensing data.Protocol data can be collected directly by software, by collection box, protocol conversion, etc.; sensor data collection is done by the data collector.However, there are many workshop devices and the protocol standards are not the same.In order to reduce the difficulty of workshop data collection and management, and to facilitate the efficient deployment of the digital-twin-workshop-monitoring system, this paper adopts the data-collection and management method based on edge-computing gateways in industrial IoT as the service platform, as shown in Figure 13.

Data Mapping Based on Edge-Computing Gateways
The CN dimension is responsible for achieving bidirectional data mapping between the PS and VS dimensions.However, due to the different communication protocols used by the physical shop equipment, the key to achieving the digital twin shop lies in how to extract the data that can accurately represent the production status of the PS from the large amount of heterogeneous data from multiple sources in the shop.The underlying equipment-sensing data in the workshop mainly has protocol data (such as bus type, API data, etc.) and sensing data.Protocol data can be collected directly by software, by collection box, protocol conversion, etc.; sensor data collection is done by the data collector.However, there are many workshop devices and the protocol standards are not the same.In order to reduce the difficulty of workshop data collection and management, and to facilitate the efficient deployment of the digital-twin-workshop-monitoring system, this paper adopts the data-collection and management method based on edge-computing gateways in industrial IoT as the service platform, as shown in Figure 13.The workshop is divided into five grouping stations, robot welding, manual welding, machine-processing, pipe-clamping welding, and IoT equipment, which mainly includes The workshop is divided into five grouping stations, robot welding, manual welding, machine-processing, pipe-clamping welding, and IoT equipment, which mainly includes the FANUC M-20iA welding robot, Zhongjie machine tools, the AGV trolley, the EWM welding machine, the Megmeet welding machine, etc.The FANUC M-20iA welding robot operates through the control cabinet to achieve data acquisition, as well as through the ethernet network connected to the edge-computing gateway; machine-processing uses the Zhongjie FBC160 CNC floor-milling and boring machine, which uses a built-in PLC Siemens SINUMERIK 840D CNC control system, using Profibus and MPI communication; AGV Systems 2023, 11, 156 20 of 26 operates through ZigBee, Bluetooth, or industrial wireless client and other communication interfaces and vehicle sensors (RFID reader, GPS locator, camera identification, etc.).The protocol adaptation-conversion function of the edge-computing gateway converts the different data communication protocols observed by the workshop equipment into standard OPC UA communication protocols to provide data services for the SCADA system.The edge-computing gateway also provides interfaces such as Mqtt and http to provide data services for the IoT platform.The virtual-real mapping of the workshop based on the edge-computing gateway is shown in Figure 14.
the FANUC M-20iA welding robot, Zhongjie machine tools, the AGV trolley, the EWM welding machine, the Megmeet welding machine, etc.The FANUC M-20iA welding robot operates through the control cabinet to achieve data acquisition, as well as through the ethernet network connected to the edge-computing gateway; machine-processing uses the Zhongjie FBC160 CNC floor-milling and boring machine, which uses a built-in PLC Siemens SINUMERIK 840D CNC control system, using Profibus and MPI communication; AGV operates through ZigBee, Bluetooth, or industrial wireless client and other communication interfaces and vehicle sensors (RFID reader, GPS locator, camera identification, etc.).The protocol adaptation-conversion function of the edge-computing gateway converts the different data communication protocols observed by the workshop equipment into standard OPC UA communication protocols to provide data services for the SCADA system.The edge-computing gateway also provides interfaces such as Mqtt and http to provide data services for the IoT platform.The virtual-real mapping of the workshop based on the edge-computing gateway is shown in Figure 14. Figure 14 shows the robotic-welding workstation, which uploads the collected workshop-equipment data (such as the welding current, robot-arm joint angle, wire current, voltage, and other information) to the IoT platform for storage and invocation through the edge-computing gateway, and drives the operation of the VS model by converting realtime data into workshop events (equipment start/stop, etc.) to achieve the real-time datavisualization mapping of the robotic-welding production process.

Digital Twin Monitoring System
The digital-twin-workshop monitoring system enables a direct data connection between the PS and VS through the CN dimension.The processing of DD based on the service dimension of the IoT platform system enables real-time monitoring and data-visualization display of the workshop in the UD dimension.It mainly includes the UI interface design, VS multidimensional perspective display, production, virtual simulation, workshop-data visualization, display, real-time digital twin monitoring, and other functions.
Due to the confidentiality requirements of production (e.g., system access is only open to relevant internal personnel), it is necessary to set access rights to the shop-floor monitoring system by designing the system UI interface in Unity 3D and establishing a SQL database to record the account password information of accessible personnel, Figure 14 shows the robotic-welding workstation, which uploads the collected workshopequipment data (such as the welding current, robot-arm joint angle, wire current, voltage, and other information) to the IoT platform for storage and invocation through the edgecomputing gateway, and drives the operation of the VS model by converting real-time data into workshop events (equipment start/stop, etc.) to achieve the real-time datavisualization mapping of the robotic-welding production process.

Digital Twin Monitoring System
The digital-twin-workshop monitoring system enables a direct data connection between the PS and VS through the CN dimension.The processing of DD based on the service dimension of the IoT platform system enables real-time monitoring and data-visualization display of the workshop in the UD dimension.It mainly includes the UI interface design, VS multidimensional perspective display, production, virtual simulation, workshop-data visualization, display, real-time digital twin monitoring, and other functions.
Due to the confidentiality requirements of production (e.g., system access is only open to relevant internal personnel), it is necessary to set access rights to the shop-floor monitoring system by designing the system UI interface in Unity 3D and establishing a SQL database to record the account password information of accessible personnel, allowing only those with relevant login rights to access the system to view the shop-floor production monitoring.
Firstly, we analyze the spatial geometry of the workshop equipment and use 3Ds MAX software to model the geometry of the production-line equipment, give the model materials, map and adjust the parent-child relationship constraints between the equipment parts in the modeling process, and finally finish the multidimensional and multiscale construction of the production-line equipment through multilevel model fusion.The workshop model is imported into Unity 3D into the .fbxformat to add lighting components, physical collision, spatial-position components, material mapping, particle effects, etc., to achieve the spatial layout and rendering of the workshop equipment.Moreover, in the user interface, the detailed process of each workshop workstation will be displayed.By clicking on the workstation button, it will jump to the corresponding workstation position, where the viewpoint can be rotated by keyboard and mouse, as well as provide first-person automatic scene roaming.Figure 15 shows the actual workshop machine-processing stations, and Figure 16 shows the monitoring system machine-processing station navigation.
Firstly, we analyze the spatial geometry of the workshop equipment and MAX software to model the geometry of the production-line equipment, give th materials, map and adjust the parent-child relationship constraints between th ment parts in the modeling process, and finally finish the multidimensional a tiscale construction of the production-line equipment through multilevel mode The workshop model is imported into Unity 3D into the .fbxformat to add lighti ponents, physical collision, spatial-position components, material mapping, pa fects, etc., to achieve the spatial layout and rendering of the workshop equipmen over, in the user interface, the detailed process of each workshop workstation wi played.By clicking on the workstation button, it will jump to the correspondin station position, where the viewpoint can be rotated by keyboard and mouse, a provide first-person automatic scene roaming.Figure 15 shows the actual works chine-processing stations, and Figure 16 shows the monitoring system mach cessing station navigation.In workshop production, a complete production process of a manipulator quires a significant amount of time.We aim to rapidly understand the technolog information of the production line through dynamic simulation.Using the 3D m software 3Ds Max, as well as the Unity 3D simulation animation function, the pro time is scaled equally, and we can complete the detailed production simulatio whole production-line process in a short time.Figure 17 shows the production sim process of the front and rear support and side-plate welding-seam steps of the rob ing station, which can be clicked on to view the single-step process and the comp duction process.Firstly, we analyze the spatial geometry of the workshop equipment and MAX software to model the geometry of the production-line equipment, give th materials, map and adjust the parent-child relationship constraints between th ment parts in the modeling process, and finally finish the multidimensional a tiscale construction of the production-line equipment through multilevel mode The workshop model is imported into Unity 3D into the .fbxformat to add lighti ponents, physical collision, spatial-position components, material mapping, pa fects, etc., to achieve the spatial layout and rendering of the workshop equipmen over, in the user interface, the detailed process of each workshop workstation wi played.By clicking on the workstation button, it will jump to the correspondin station position, where the viewpoint can be rotated by keyboard and mouse, as provide first-person automatic scene roaming.Figure 15 shows the actual works chine-processing stations, and Figure 16 shows the monitoring system mach cessing station navigation.In workshop production, a complete production process of a manipulator quires a significant amount of time.We aim to rapidly understand the technologi information of the production line through dynamic simulation.Using the 3D m software 3Ds Max, as well as the Unity 3D simulation animation function, the pro time is scaled equally, and we can complete the detailed production simulatio whole production-line process in a short time.Figure 17 shows the production sim process of the front and rear support and side-plate welding-seam steps of the rob ing station, which can be clicked on to view the single-step process and the comp duction process.In workshop production, a complete production process of a manipulator arm requires a significant amount of time.We aim to rapidly understand the technological flow information of the production line through dynamic simulation.Using the 3D modeling software 3Ds Max, as well as the Unity 3D simulation animation function, the production time is scaled equally, and we can complete the detailed production simulation of the whole production-line process in a short time.Figure 17 shows the production simulation process of the front and rear support and side-plate welding-seam steps of the robot-welding station, which can be clicked on to view the single-step process and the complete production process.The simulation animation function enables staff to quickly comprehend the workshop-production process and associated time-node information, allowing management to allocate tasks more rationally and scientifically.This enhances production quality while increasing workshop-production efficiency.The visualization provided by simulation animations enables more comprehensive process analysis and optimization.
The edge-computing gateway collects data and uploads it to the IoT platform for invocation, and through editing C# scripts in Unity 3D to invoke data in real-time to drive the VS model to complete the real-time monitoring of the workshop, to achieve equipment and product level data mapping, and to convert the workshop collected data, such as the AGV-position data, visual-inspection information, etc., into workshop events (equipment start/stop, etc.) so to drive dynamic production between workstations.Realize logistics level mapping and unify data visualization display in user display dimension.
The digital-twin-workshop monitoring system uses the state machine in Unity3D to enable the dynamic monitoring of the production process based on the Petri net.The state machine describes the system's behavior and transition rules between states, corresponding to the event model in the Petri net.When certain events, such as the completion of the processing in the previous station or the start of the next equipment process, are detected, the state machine makes decisions and triggers state events to drive the model operation in Unity3D, achieving the dynamic mapping of the production data.Figure 18 illustrates the state machine model, which includes the entire production process at five stations in the workshop.As the state transitions, the system triggers the next stage of behavior until the production operation is completed.The simulation animation function enables staff to quickly comprehend the workshopproduction process and associated time-node information, allowing management to allocate tasks more rationally and scientifically.This enhances production quality while increasing workshop-production efficiency.The visualization provided by simulation animations enables more comprehensive process analysis and optimization.
The edge-computing gateway collects data and uploads it to the IoT platform for invocation, and through editing C# scripts in Unity 3D to invoke data in real-time to drive the VS model to complete the real-time monitoring of the workshop, to achieve equipment and product level data mapping, and to convert the workshop collected data, such as the AGV-position data, visual-inspection information, etc., into workshop events (equipment start/stop, etc.) so to drive dynamic production between workstations.Realize logistics level mapping and unify data visualization display in user display dimension.
The digital-twin-workshop monitoring system uses the state machine in Unity3D to enable the dynamic monitoring of the production process based on the Petri net.The state machine describes the system's behavior and transition rules between states, corresponding to the event model in the Petri net.When certain events, such as the completion of the processing in the previous station or the start of the next equipment process, are detected, the state machine makes decisions and triggers state events to drive the model operation in Unity3D, achieving the dynamic mapping of the production data.Figure 18 illustrates the state machine model, which includes the entire production process at five stations in the workshop.As the state transitions, the system triggers the next stage of behavior until the production operation is completed.Take the most automated robotic-welding station as an example, as shown in Figure 19.First, the movable arm is transferred to the positioner via the AGV, and then automated welding is achieved by utilizing the FANUC M-20iA six-axis robot in collaboration with the positioner.The main monitoring page displays a real-time data-driven model of the robotic welding workstation, which visualizes welding current, voltage, torch status, and the angle data of each joint of the robotic arm on both sides of the monitoring page.The monitoring system allows workers to keep track of the workstation's production progress and equipment operation in real-time, and provides emergency alerts when unexpected conditions occur (e.g., high voltage or current).Through the workshop real-time monitoring, the operator can manage the workshop production tasks, effectively solving the workshop monitoring status quo of nontransparent production process and the single form of monitoring in discrete workshops, based on the use of the IoT edge-computing gateway, which also accelerates the processing and transmission of massive temporary data, improving the efficiency of the whole closed-loop production decision from the edge decision to the cloud decision and back to the edge decision.Take the most automated robotic-welding station as an example, as shown in Figure 19.First, the movable arm is transferred to the positioner via the AGV, and then automated welding is achieved by utilizing the FANUC M-20iA six-axis robot in collaboration with the positioner.The main monitoring page displays a real-time data-driven model of the robotic welding workstation, which visualizes welding current, voltage, torch status, and the angle data of each joint of the robotic arm on both sides of the monitoring page.The monitoring system allows workers to keep track of the workstation's production progress and equipment operation in real-time, and provides emergency alerts when unexpected conditions occur (e.g., high voltage or current).Through the workshop realtime monitoring, the operator can manage the workshop production tasks, effectively solving the workshop monitoring status quo of nontransparent production process and the single form of monitoring in discrete workshops, based on the use of the IoT edgecomputing gateway, which also accelerates the processing and transmission of massive temporary data, improving the efficiency of the whole closed-loop production decision from the edge decision to the cloud decision and back to the edge decision.
The construction of a six-dimensional digital twin monitoring system provides a realtime and comprehensive display of workshop production from multiple perspectives and viewpoints.Through human machine interaction, workshop personnel can intuitively understand the production process, task progress, equipment status, and virtual simulation of the workshop layout, thereby increasing the number of low-cost trial-and-error opportunities.This system frees workshop management personnel from physical labor, such as workshop inspections, allowing them to focus more on intellectual tasks, such as scientific performance indicators, more efficient human-machine coordination, and high-quality product production.The construction of a six-dimensional digital twin monitoring system provides a realtime and comprehensive display of workshop production from multiple perspectives and viewpoints.Through human machine interaction, workshop personnel can intuitively understand the production process, task progress, equipment status, and virtual simulation of the workshop layout, thereby increasing the number of low-cost trial-and-error opportunities.This system frees workshop management personnel from physical labor, such as workshop inspections, allowing them to focus more on intellectual tasks, such as scientific performance indicators, more efficient human-machine coordination, and high-quality product production.

Conclusions
The digital twin is the key technology of smart manufacturing and the concrete implementation of the Made in China 2025 strategy in the manufacturing industry.As a new mode of workshop operation, the digital twin workshop solves the problem of interaction and commonality between the PS and information workshops.In this paper, we proposed a discrete workshop monitoring system based on digital twins from the perspective of the monitoring demand of the discrete workshop, as well as the difficulty of real-time workshop monitoring and the massive temporary data of the workshop, and researched and elaborated on the overall architecture and key implementation technologies of the system.The system is built with modules, such as the multidimensional and multiscale modeling of the workshop, data acquisition and mapping, and production-process monitoring, with functions such as the production simulation of the production line, the real-time monitoring of the workshop production, and the visual management of the production data.Moreover, the application of the edge-computing gateway reduced the data transmission speed of the IoT cloud platform from seconds to about 500 milliseconds, and after offloading the computing tasks from the cloud to the edge, the system-energy consumption was also reduced by 20%-30%, which greatly reduces the transmission cost.
The digital twin, as a powerful tool of smart manufacturing, has promoted the development of digital workshops.The follow-up research will focus on the following aspects in depth: 1.In this paper, only the main equipment of the workshop is mapped for data collection.With the development of a smart factory, the manufacturing process requires real-time monitoring and management, as well as the status display of all equipment

Conclusions
The digital twin is the key technology of smart manufacturing and the concrete implementation of the Made in China 2025 strategy in the manufacturing industry.As a new mode of workshop operation, the digital twin workshop solves the problem of interaction and commonality between the PS and information workshops.In this paper, we proposed a discrete workshop monitoring system based on digital twins from the perspective of the monitoring demand of the discrete workshop, as well as the difficulty of real-time workshop monitoring and the massive temporary data of the workshop, and researched and elaborated on the overall architecture and key implementation technologies of the system.The system is built with modules, such as the multidimensional and multiscale modeling of the workshop, data acquisition and mapping, and productionprocess monitoring, with functions such as the production simulation of the production line, the real-time monitoring of the workshop production, and the visual management of the production data.Moreover, the application of the edge-computing gateway reduced the data transmission speed of the IoT cloud platform from seconds to about 500 milliseconds, and after offloading the computing tasks from the cloud to the edge, the system-energy consumption was also reduced by 20%-30%, which greatly reduces the transmission cost.
The digital twin, as a powerful tool of smart manufacturing, has promoted the development of digital workshops.The follow-up research will focus on the following aspects in depth: 1.
In this paper, only the main equipment of the workshop is mapped for data collection.
With the development of a smart factory, the manufacturing process requires real-time monitoring and management, as well as the status display of all equipment in the workshop.In terms of the human-machine interaction, the operation design should be more convenient and efficient, and provide more simulation and design tools to enable management personnel to adjust, optimize, and simulate workshop production at a minimal cost.

2.
With the development of the digital twin technology, the digital twin workshop should have full virtual real mapping, as well as interactive functions, and be able to complete the adjustment of the equipment status in the virtual system, realizing the complete closed loop from the real to virtual and from the virtual to the real.

3.
The use of IoT in the workshop has basically eliminated information silos, but there is still a certain delay in data communication that needs to be further explored.

Systems 2023 ,
11, x FOR PEER REVIEW 8 of 26

Figure 3 .
Figure 3. Multidimensional multiscale model of the workshop.

Figure 5 .
Figure 5. Place, transition, and transition rules.In Figure4, indicates the library, indicates the change, and Systems 2023, 11, x FOR PEER REVIEW 11 of 26

Figure 9 ,
Figure 9, on the left, shows the workshop production-line model after modeling and assigning materials only.Figure 10, on the right, shows the effect after importing into Unity3D to add materials, skyboxes, lights, physical collisions, and other components, and rendering the overall layout of the scene.

Figure 9 ,
Figure 9, on the left, shows the workshop production-line model after modeling and assigning materials only.Figure 10, on the right, shows the effect after importing into Unity3D to add materials, skyboxes, lights, physical collisions, and other components, and rendering the overall layout of the scene.

Figure 11 .
Figure 11.Comparison of model memory before and after optimization.

Figure 11 .
Figure 11.Comparison of model memory before and after optimization.