To the heated crude oil pipeline whose transportation plan is fixed,the cost of transporting oil consists of power consumption cost of oil pump and fuel cost of fire furnace.It is important to decrease the cost of transporting oil under the premise of accomplishing safely and timely transporting task and making the total consumption minimal.To decrease energy consumption,taking the minimal sum of thermal energy consumption and power consumption as the objective function,a running model of long distance heated crude oil pipeline was set up. Two-layer nesting method was used to solve the model,that is,its principle is to calculate all possible pump running schemes as outer layer nesting,and to optimize inlet temperature of inner layer nesting by dynamic planning method and total energy cost is computed.To travel different schemes will get different total energy cost.Among all energy cost,the minimal one is an optimal solution.According to the model,a corresponding software has been programmed which provides a decision-making basic for optimizing transmission of long distance heated crude oil pipeline.