Electric power is an important energy in steel industry. Electricity accounts for roughly 20% to 30% of the gross energy consumption and costs about 10% of the gross cost of energy. In this paper, under the premise of ensuring the stability of energy supply and the normal production safety, the mathematical programming method and the dynamic mathematical optimization model were used to set up the surplus gas in the optimal allocation among the buffer users and steam production dispatching for the production equipment. The application of this optimization model can effectively improve the energy efficiency and the accuracy of power generation, making full use of secondary energy and residual heat. It also can realize the rationalization of the electricity production structure optimization which can effectively reduce the flare of the gas and steam on one hand, and save energy and decrease production cost on the other.