Accurate energy consumption prediction in the injection molding process is crucial for optimizing energy efficiency in polymer processing. Traditional parameter optimization methods face challenges in achieving optimal energy prediction due to complex energy transmission. In this study, a data-driven approach based on the Rolling Learning Informer model is proposed to enhance the accuracy and adaptability of energy consumption forecasting. The Informer model addresses the limitations of long-sequence prediction with sparse attention mechanisms, self-attention distillation, and generative decoder techniques. Rolling learning prediction is incorporated to enable continuous updating of the model to reflect new data trends. Experimental results demonstrate that the RL-Informer model achieves a normalized root mean square error of 0.1301, a root mean square error of 0.0758, a mean absolute error of 0.0562, and a coefficient of determination of 0.9831 in energy consumption forecasting, outperforming other counterpart models like Gated Recurrent Unit, Temporal Convolutional Networks, Long Short-Term Memory, and two variants of the pure Informer models without Rolling Learning. It is of great potential for practical engineering applications.