A human-machine synchronization method and device of an invasive ventilator operating in a noninvasive ventilation mode. The method includes steps of: measuring an airway pressure, an inspiratory flow, and an expiratory flow; calculating a gas leakage flow according to a pre-established gas leakage estimation model and by using the airway pressure, the inspiratory flow and the expiratory flow; and compensating a basic flow according to the gas leakage flow. In the above method, the gas leakage flow is estimated by means of the gas leakage estimation model, to compensate the gas leakage, thereby facilitating the noninvasive ventilation of the invasive ventilator and improving the human-machine synchronization.