## 5 Algorithm Design for Capacity Forecasting Driven by Twin Data
\begin{table}
\begin{tabular}{c c c c} \hline
**Serial Number** & \multicolumn{2}{c}{**Order Processing Time (h)**} & \multicolumn{2}{c}{**Product Processing Quantity**} & \multicolumn{1}{c}{**Average Completion Time (s)**} \\ \hline
1 & 5 & 23 & 782.5 \\
2 & 5 & 29 & 620.5 \\
3 & 5 & 27 & 666.5 \\
4 & 5 & 27 & 666.5 \\ \(\dots\)\(\dots\)\(\dots\) & \(\dots\)\(\dots\) & \(\dots\)\(\dots\) & \(\dots\)\(\dots\) \\
144 & 5 & 14 & 1285.5 \\ \hline \end{tabular}
\end{table} 
Table 3: Production capacity statistics. Figure 5: Production status analysis driven by digital twin data. Figure 6: LSTM production capacity prediction results (**a**) and variance (**b**) after 1000 iterations (1000/4). By calculating the algorithm results, the prediction accuracy of the algorithm is 0.869, 0.878, and 0.918, respectively. These results indicate that the system design conforms to the real performance and situation. Furthermore, as the number of iterations increases, the prediction accuracy gradually increases. At the same time, LSTM is a variant of traditional RNNs, which can effectively capture the semantic association between long sequences and alleviate the phenomenon of gradient disappearance or explosion compared with classic RNNs. In addition, the method is controlled by the gate structure, including the forget gate, input gate, cell state, and output gate, and its function is equivalent to adding a \"processor\" to judge whether the information is useful. It is also worth noting that the LSTM can better handle time series tasks and has better accuracy than a multi-layer perceptron (MLP: an artificial neural network that tends to structure). As shown in Figure 9, the LSTM has a better performance advantage than the MLP when the number of cycles is the same. Figure 8: LSTM production capacity prediction results (**a**) and variance (**b**) after 5000 iterations (5000/4). Figure 7: LSTM production capacity prediction results (**a**) and variance (**b**) after 2000 iterations (2000/4). ## 7 Conclusions

Before processing new products, the workshop's production capacity predictions are inaccurate, and the delivery date of new products often cannot be fulfilled due to the many types of products in discrete manufacturing workshops, small batches, and frequent production changes. To address the difficulty of predicting the production capacity of discrete manufacturing workshops, this paper analyzed the existing problems and related research in academia and proposed a digital twin-driven production capacity prediction framework for discrete manufacturing workshops. According to multiple disturbances, such as material shortages, equipment abnormalities, and process changes, a mathematical model for the production capacity reduction in discrete manufacturing workshops was given, and a production capacity prediction method of \"twin data + LSTM algorithm\" was innovatively proposed. Finally, the accuracy rate of production capacity prediction was verified using the commemorative disk custom production line as a prototype platform. The verification showed that the accuracy rate of the production line capacity prediction could reach 91.8%. The research in this paper was expected to predict the production capacity of new products from the current state and historical state of the workshop to establish a theoretical basis for evaluating product delivery. In addition, this paper only analyzed and discussed production capacity through the constructed digital twin model and did not explore deep-seated issues such as model evolution and iterative updates in the production process. Future research will investigate the evolution mechanism of the digital twin model for production processes, considering the iterative update of the twin data. Additionally, the impact of various elements of the production control process on workshop capacity will be further analyzed. Conceptualization, H.C. and J.W. ; Methodology, H.C. and J.W. ; Software, H.C. and B.C. ; Validation, H.C. and B.C.