Ethylene production prediction is crucial for improving energy efficiency and optimizing processes in the petrochemical industry. However, the production process data of ethylene are highly complex, and the interaction relationships between variables vary at different time granularities. Ignoring these feature relationships can affect the accuracy of ethylene prediction. Traditional prediction methods model data at a single time granularity only and fail to effectively extract multigranularity features. Therefore, to address the complex multigranularity time-varying characteristics of ethylene production, a multigranularity parallel pyramidal Transformer (MPPT) model is proposed to capture and integrate features from ethylene production data at multiple time granularities, enabling accurate production prediction and energy efficiency optimization. The MPPT model integrates three key modules: multiscale decomposition (MSD), parallel pyramid Transformer (PPT), and multigranularity fusion (MF). The MSD converts industrial process data into multigranularity formats, while the PPT extracts both local and global interaction features across different time granularities using a parallel pyramid structure. Finally, the MF module fuses these features to establish a mapping for accurate prediction. We conducted comparative prediction experiments on an ethylene industrial production dataset, where the MPPT model achieved the best performance among all compared prediction models, with an MAE and RMSE of 0.006 and 0.1755, respectively. Furthermore, we leveraged the accuracy of MPPT in ethylene production prediction to optimize production inputs, achieving energy efficiency optimization in ethylene production.