Traditional sheet metal processing enterprises are facing problems such as upgrading manufacturing systems, lower material utilization rate, and lower efficiency of CNC machining. In this paper, we design a flexible manufacturing production line for sheet metal processing of complex parts, use the DQN algorithm to optimize the scheduling of each part of the work in the production process of the production line, and optimize the adaptability of the DQN algorithm by using the action selection strategy and the reward function and so on. Then, the digital twin simulation system is constructed to simulate the process of a flexible manufacturing production line for sheet metal processing. The results show that the DQN algorithm can effectively assign the corresponding processing machines and processes to the workpieces in the production line, and the digital twin simulation system can also accurately simulate the actual situation of the production line. Meanwhile, it is found that the optimized production line can reach 87.52% of the production beat balance rate, which is 23.64% higher than the original production line balance rate, and it can improve the average utilization rate of the main operating units in the production line. The optimized production line proposed in this paper can effectively solve the practical problems in sheet metal production lines, improve the mobility of the production line and corporate efficiency, and provide new ideas for the lean production management of large-scale machinery manufacturing enterprises.