Gasoline blending scheduling optimization can bring significant economic and efficient benefits to refineries. However, the optimization model is complex and difficult to build, which is a typical mixed integer nonlinear programming (MINLP) problem. Considering the large scale of the MINLP model, in order to improve the efficiency of the solution, the mixed integer linear programming - nonlinear programming (MILP-NLP) strategy is used to solve the problem. This paper uses the linear blending rules plus the blending effect correction to build the gasoline blending model, and a relaxed MILP model is constructed on this basis. The particle swarm optimization algorithm with niche technology (NPSO) is proposed to optimize the solution, and the high-precision soft-sensor method is used to calculate the deviation of gasoline attributes, the blending effect is dynamically corrected to ensure the accuracy of the blending effect and optimization results, thus forming a prediction-verification-reprediction closed-loop scheduling optimization strategy suitable for engineering applications. The optimization result of the MILP model provides a good initial point. By fixing the integer variables to the MILP-optimal value, the approximate MINLP optimal solution can be obtained through a NLP solution. The above solution strategy has been successfully applied to the actual gasoline production case of a refinery (3.5 million tons per year), and the results show that the strategy is effective and feasible. The optimization results based on the closed-loop scheduling optimization strategy have higher reliability. Compared with the standard particle swarm optimization algorithm, NPSO algorithm improves the optimization ability and efficiency to a certain extent, effectively reduces the blending cost while ensuring the convergence speed.