The current research proposes an energy optimization model to the production systems in reaction to the increased levels of demand concerning enhanced energy management in real-time in the industrial sector of manufacturing. The proposed framework is based on digital twin technology, which plays the role of the core enabling mechanism in the methodology. First, a simulation architecture of production lines is created, then a thorough explanation is given on how the digital twin model is designed along four different dimensions, namely geometry, physics, production behavior, and simulation rules. BP neural networks are used to create specific energy consumption models of each device to represent the energy properties of each piece of equipment. Then a method of optimization is created that targets workshop-level production processes and combines a multi-objective objective function based on several assessment criteria. They are tool life, robot motion smoothness and production time. This dynamic model is fed directly into this optimization process using energy consumption data extracted out of the digital twin model. When dealing with the collaborative adjustment of machining parameters between several machines when producing low carbon products, the artificial bee colony algorithm is applied, providing a strong global search capability, which is well suited to the complexity of this optimization problem. The proposed strategy is verified using a case study focusing on the production process of a particular workpiece. During normal operating conditions, the optimization of both workshop energy consumption and production time reduces energy use by 29.71 percent compared to the traditional approach. In rework situations, more emphasis on tool life and robot motion smoothness results in a 12.63 percent lower plant energy consumption than the current baseline. These findings indicate that the framework is effective in supporting energy monitoring and optimization in all aspects of shop floor production activities.