A method and a device for controlling the gas ratio of a breathing machine. The method comprises: a: acquiring an opening flow rate relationship of an air ratio valve and an oxygen ratio valve of the breathing machine b: controlling the air ratio valve and the oxygen ratio valve according to the opening flow rate relationships and a preset oxygen concentration value and c: fine tuning the air ratio valve and the oxygen ratio valve according to a current oxygen concentration value and the preset oxygen concentration value. The control device comprises: an acquisition module (401) configured to acquire the opening flow rate relationship of an air ratio valve and an oxygen ratio valve of the breathing machine a control module (403) configured to control the air ratio valve and the oxygen ratio valve and a fine tuning module (405) configured to fine tune the air ratio valve and the oxygen ratio valve. Through the method and the device the oxygen concentration of the gas can be monitored in real time so as to perform double loop control on the oxygen concentration so that the oxygen concentration of the provided gas is the same as the set oxygen concentration thereby improving the accuracy of oxygen mixture control.