In recent years, with the continuous expansion of natural gas pipelines, the energy consumption of natural gas pipelines has gradually increased. In order to further reduce the energy consumption of the natural gas pipeline, a general steady-state operation model of a natural gas long-distance pipeline is established in this paper, which can calculate the pressure and temperature changes along the pipeline. The paper takes the China-Russia eastern natural gas pipeline as a practical case, and uses the Grey Wolf optimization algorithm to solve it. The results show that the overall pressure drop and temperature drop of the pipeline are reduced after the optimization of the algorithm, and the energy consumption of the pipeline can be reduced by 17.52%, which provides a theoretical basis for the field operation.