Based on the instantaneous power theory, the active power and reactive power of single-phase pulse-width modulated rectifier are theoretically derived. Based on the second-order generalized integrator method, the expression of active power and reactive power is established in the static $\alpha-\beta$ reference coordinate system by constructing virtual orthogonal signals, and the evaluation function is optimized based on the modulation function to obtain the control variables of the model predictive control. Considering the influence of the error between the input inductance and the actual input inductance in the model prediction on the modulation function, a direct power control algorithm with online estimation of the input inductance is proposed, and the accuracy of online estimation of the input inductance is guaranteed by adding a low-pass filter.