# Dynamic Scheduling Optimization of Production Workshops Based on Digital Twin
## 5 Dynamic Scheduling Strategy and Case Analysis Based on Digital Twin
### Case Study
#### 5.3.2 Complete Rescheduling Strategy Scheduling Scheme  
In the digital twin environment, 12 \(\times\) 6 scale production tasks were in the production process according to the original scheduling scheme. The digital twin service system obtained the wavelet packet energy of the vibration signal of the machine 4 spindle at time T1. It is different from the normal state wavelet packet energy spectrum distribution. The digital twin service system used the neural network to test its abnormal state, judge that machine 4 will fail, and trigger the rescheduling process. At time T1, the workpiece being processed on each normal machine continued to complete processing. The remaining processes on the faulty machine and the non-faulty machine formed a scheduling set and the scheduling algorithm was used to generate a rescheduling scheme. The resulting scheduling scheme is shown in Figure 9.  
Figure 8: Gantt diagram of initial scheduling with 12 \(\times\) 6 scale.  
Figure 9: Complete rescheduling Gantt diagram under digital twin with 12 \(\times\) 6 scale.  
When digital twinning technology was not used, machine 4 fails at time T2. The workpiece processed on machine 4 needs to be reprocessed. The unprocessed process on machine 4 was arranged to other alternative machines. The remaining processes on the faulty machine and the non-faulty machine formed a scheduling set and the scheduling algorithm was used to generate a rescheduling scheme. The resulting scheduling scheme is shown in Figure 10.  
It can be seen from Figures 8-10 that the digital twin system finds the abnormality of the machine at an early time by monitoring the vibration signal of the machine spindle, so as to adjust the scheduling scheme. Without using the digital twin system, the machine will make adjustments after it breaks down and sends out an alarm. The adjustment time is late. Compared with the initial scheduling scheme, because the processing task is not arranged on the faulty machine, the machine and processing time used in the workpiece process in the rescheduling scheme have changed greatly. Based on the scheduling of digital twin system, it is found that the disturbance is earlier, and the rescheduled workpiece processes are more than those without digital twin system. It can make adjustments earlier according to the disturbance and make more reasonable arrangements for the workpiece process.  
As shown in Table 8, compared with the scheduling scheme without digital twin, the scheduling scheme based on digital twin has 3.4% less processing end time, 2.4% less energy consumption, 41.9% less time deviation and 17.6% less machine deviation. The time deviation and mechanical deviation in Table 8 are calculated by using Equations (5) and (6) above. It can be seen that the processing end time and energy consumption of the scheduling scheme based on the digital twin complete rescheduling strategy are less than those of the scheduling scheme without the digital twin system. The time deviation and machine deviation of the scheduling scheme based on digital twin complete rescheduling strategy are mostly smaller than those of the scheduling scheme without the digital twin system.