To solve the problem of using by-product gas with optimal allocation in iron and steel enterprise, improve the utilization rate of by-product gas, analysis the situation of recovery storage, excess, shortage. According to the gas tank, self-provided power plant boiler, and the actual conversion efficiency, by-product gas optimization model is proposed. It establishes on the basis of optimal allocation of gas tank counters and self-provided power plant boiler. The spare gas is used for Maximum by this model. According to the property of by-product gas, the model exchanges it into electricity, liquid gas, etc. so that to get extra economic benefits for the enterprise. Finally, the simulation is executed by Matlab, and the simulation data certify that the gas income is on the rise, and secondary energy is used efficiently on internal process in iron and steel enterprise. At the same time, experimental results show that the model can realize the gas scattered, get the considerable economic benefits, and achieve energy conservation and emissions reduction.