The invention discloses a current source type PWM (Pulse-Width Modulation) rectifier and a grid-connected control method based on a virtual resistor. A grid-connected rectifier consists of commercial power, an alternating-current filtering inductor, an alternating-current filtering capacitor, a three-phase current source type rectifier, a direct-current inductor, a direct-current capacitor and a digital controller. Sampled alternating-current filtering capacitance voltage is transmitted to a microprocessor to perform digital phase locking, and after phase locking is finished, the alternating-current filtering capacitance voltage and phase are transmitted to an alternating-current controller. The alternating-current controller consists of a coordinate converter, a virtual impedance regulator and a divider. The coordinate converter converts the three-phase alternating-current filtering capacitance voltage into the voltage under a two-phase static coordinate system, after the voltage is regulated by the virtual resistance regulator, current passing through a virtual resistor is obtained, control amount of the alternating-current side is obtained through the divider, the control amount is superposed on the control amount on the direct-current side, a driving signal obtained through a PWM generator is transmitted to a driving plate, and after the signal is amplified by the driving plate, the connection and disconnection of a three-phase current source type rectifying bridge switch are controlled. The control effect of the virtual resistance regulator in the alternating-current controller is equivalent to the control effect that a resistor is directly connected in parallel on an alternating-current capacitor, so that oscillation can be effectively damped, loss is not caused, and ultraharmonics in grid-connected current can be effectively inhibited. The rectifier is high in dynamic response speed, stable in dynamic response and high in power factor, the total harmonic distortion rate of the grid-connected current is low, and the method can be applied to an uninterruptible power supply.