# Research on a Real-Time Control System for Discrete Factories Based on Digital Twin Technology
## 2 Methods
### Development of System Software
#### 2.3.2 Element/Process Virtualization  
The visualization of the physical factory mainly includes the establishment of basic geometric model libraries, scene constructions, action predefinition, scene optimization, and human-machine interactions [23], as shown in Figure 3. The geometric model library includes a collection of equipment, such as machining devices, logistics and warehousing facilities, and testing units. The scene construction is mainly reflected in the environmental elements, using lighting, special effects, and other methods to simulate the actual physical environment of the gear factory. Action predefinition is the characterization of the different states of the equipment in the production process, thus improving the equipment action attributes and making them relate more closely to the production reality. Scene optimization is the process of enhancing the smoothness, balance, and visibility of a system through rendering, lightweight processing, and other methods. Human-computer interaction refers to the ability of users to roam virtual scenes from the first-person perspective, and the system can receive external commands in order to guide the physical factory production, thus achieving virtual control over reality. The virtualization of elements and processes is mainly completed using virtualizing window. In this window, some images from the prestored digital library will be displayed, and the prestored virtual images and the process prediction simulation videos will be played. In order to generate a virtual gear factory or achieve predictive simulation displayed in a virtualizing window, the static resources and dynamic processes of the physical factory need to be processed through a series of complex algorithms and programs, such as mapping, fusion, calculation, simulation, and update. Sometimes, it is also necessary to use it in conjunction with the monitoring window. The physical factory is a multifaceted  
Figure 3: The model of scene virtualization process. and complex scene, mainly divided into the process equipment, auxiliary equipment, and production material. Below are the virtualization methods for products, devices, and so on. 1. Virtualization software tools  
The 3D MAX (2015-2024, ten versions) is a 3D-modeling software from the Autodesk Corporation, and the WebGL (Web Graphics Library) is a 3D-drawing technology; the combination of the two can effectively achieve the construction of a virtual factory. By using HTML and JavaScript languages without the need for other plugins, interactive 3D visualization can be achieved on the web side. The physical factory mainly includes various types of equipment, product logistics, etc. The 3D MAX software can be used to build models through polygon modeling, 2D to 3D conversion, and surface modeling. And different modeling methods can be flexibly combined during the modeling process, effectively reducing the modeling workload. 2. Product virtualization methods  
Taking a kind of dual gear as the product to be virtualized, the dual gear is the intermediate shaft dual gear found in a new energy vehicle gearbox, as shown in Figure 4.  
The dual gear is a type of double gear assembly made up of a shaft gear and a disc gear pressed together. The manufacturing process flow of the shaft gear is shown as: gear blank, precision turning, spline rolling, hole drilling, gear hobbing, gear burring, heat treatment, laser marking, hole grinding, end turning, cylindrical grinding, gear grinding, spline inspecting, crack detecting, gear cleaning. The manufacturing process flow of the disc gear is shown as: gear blank, spline broaching, gear hobbing, gear burring, heat treatment, laser marking, end turning, spline inspecting, gear cleaning. And the manufacturing process flow of the dual gear is press fitting, laser marking, gear grinding, bite inspecting, gear cleaning, product packaging.