To solve the nonlinear constrained optimization problem, a particle swarm optimization algorithm based on the improved Deb criterion (CPSO) is proposed. Based on the Deb criterion, the algorithm retains the information of ‘excellent’ infeasible solutions. The algorithm uses this information to escape from the local best solution and quickly converge to the global best solution. Additionally, to further improve the global search ability of the algorithm, the DE strategy is used to optimize the personal best position of the particle, which speeds up the convergence speed of the algorithm. The performance of our method was tested on 24 benchmark problems from IEEE CEC2006 and three real-world constraint optimization problems from CEC2020. The simulation results show that the CPSO algorithm is effective.