The economic dispatch (ED) with valve point effects is a multi-constraint, non-linear, non-convex hybrid optimization problem, where dealing with the constraints of equality and inequality will seriously affect the quality of the solution. In this paper, based on the characteristics of the valve point effects of the generator unit, a novel constraints handling mechanism (NCHM) is proposed for solving ED problems with valve point effects. The NCHM consists of the virtual generator unit (VGU) method and the power allocation scheme (PAS) to address the constraints of equality and inequality. In VGU method, as a penalty function, the virtual generator unit is added to the ED objective function. Unlike the traditional penalty function, the characteristics of the virtual generator unit are close to that of the actual generator unit, which breaks the difficulty of parameter selection and makes the convergence better. For PAS method, the power of the generator unit is locked at the valve point with a certain probability to accelerate convergence. To demonstrate the effectiveness of the NCHM, it is tested on 13-, 40- and 80-unit systems combined with differential evolution algorithm. The simulation results show that the proposed NCHM is significantly superior in accuracy, stability and computing time compared with other previous constraints handling mechanism for solving the ED problems with valve point effects.