## 5 Algorithm Design for Capacity Forecasting Driven by Twin Data
Begin  Initialize data by first-order difference  Data transformation into supervised learning
``` -Offline model training process-  Normalize the data set //include \(\Delta T_{i1}\), \(\Delta T_{i2}\), \(\Delta T_{i3}\), and \(y\)  Training the LSTM_model If (\(RMSE(y,y^{\prime})\leq\delta\)) then  Export the LSTM_model Else  Adjusting parameters and re-fitting the LSTM_model End if -Online model Test process- ```
For\(i\) in range (normalized test data) \(X\)= test_scaled[i, 0: \(-1\)] \(y\)= test_scaled[i, \(-1\)]  Forecast_data= forecast_lstm(lstm_model, 1, \(X\)) End for  Restore the first-order differential data  Store predicted values //calculate the \(C_{loss}^{i}\) and \(\eta_{i}\)  Draw the comparison curve End
```

**Algorithm 1**Algorithm for LSTM-based production capacity

## 6 Experimental Verification

The commemorative disk custom production line exemplifies a small, customized production line that belongs to a typical discrete manufacturing workshop. In the design process, facing the verification process of production line capacity is inevitable. As shown in Figure 4, the commemorative plate customization production line consists of seven modules, including lean material racks, grinding workstations, UV printing workstations, laser marking workstations, packaging workstations, storage workstations, and AGV workstations. The process is determined by the customer's order, where customers can choose a specific style of commemorative plate, text, and pattern according to their own needs. Using the RFID tag that facilitates the identification of binding information, the system determines the operational status of each workstation and verifies the completion of customized processing content. Once the processing is completed, all of these products enter the storage system and are subsequently transported to a fixed location by the AGV for delivery. The twin system modeling approach for the commemorative disk custom production line based on twin data mainly includes three aspects. Among them, in terms of workshop element modeling, the three-dimensional geometric model based on CAD design, production process model, equipment motion model, and robot rule model is assembled and fused into workstation modules, such as storage workstations and assembly workstations. The workshop production line model is formed by assembling the workstation model. Among these models, the geometry, behavior, and rules of equipment and production lines are described. The production process modeling includes collected order data from the order system, actual production data from the simulation system, equipment processing efficiency data, and quality inspection data. According to the processing and fusion of various data, multi-dimensional analysis and optimization of production status can be realized. In terms of constructing the production system model, the complete production process of the commemorative disk custom production line is constructed based on the twin data and the virtual model, which provides effective support for subsequent production process data monitoring and visual analysis. Since the production capacity is time series data, according to the above twin system model construction, the data are counted for one hour for production capacity statistics, as listed in Table 3.

This paper utilizes the twin data collected from the production process simulation to realize the entire workshop production capacity prediction process through the LSTM algorithm. And this article depicts the production status analysis process based on the combination of virtual and real models, which can be seen in Figure 5. The parameters used in the algorithm include a time window size (N) of 60, a step size of 1, 128 memory units, and three hidden layers. The prediction results are shown in Figures 6-8 for 1000, 2000, and 5000 iterations on the model, with the number of neurons set to four. Figure 4: Customized production process of discrete workshop.