To ensure the octane number of blended gasoline accurately,decrease the waste of octane and avoid the accident that the octane number less standard. We developed an on-line optimal control system that its method is fit for China . This system has been successfully applied in TianJing/LuoYang oil refinery of SINOPEC. it is good in octane number control and the recipe optimization of gasoline blending . and economic effect has obtained