Continuously growing demands due to the predictable faults or abnormal events of the flexible production line are becoming a challenge to easily cause the energy waste, which needs to accurately predict the real-time energy consumption of the actual production process. By reviewing the related works about prediction model approach and energy consumption analysis in the actual production application, it is necessary to overcome two main challenges: optimal prediction selection and internal relation mining of energy consumption under different equipment working conditions. To deal with the existing challenges, the paper proposes a novel attention-based Long and Short-Term Memory (LSTM) approach to predict energy consumption with temporal series under various equipment working conditions. This method offers forecasting support to form a complete prediction framework for the automatic Miniature Circuit Breaker (MCB) production line, which can be used to predict the specific working condition based on attention-based LSTM approach. By comparing various prediction approaches for energy consumption under the working condition prediction with various equipment of different production line, the Fully Connected Neutral (FCN) network approach can achieve a high accuracy and effectiveness based on MAE, R2 and MSE evaluations.