A heat recovery variable-frequency multi-connected heat pump system, comprising an outdoor unit and at least two indoor units, wherein the outdoor unit and the indoor units are connected through a high-pressure liquid pipe, a high-pressure gas pipe, and a low-pressure gas return pipe, wherein: the outdoor unit comprises a four-way valve, an outdoor heat exchanger, an outdoor electronic expansion valve, a second electromagnetic valve, a third electromagnetic valve, and at least one compressor; an exhaust end of the compressor is connected with an A end of the four-way valve; a B end of the four-way valve is connected with the outdoor heat exchanger, and an other end of the outdoor heat exchanger is connected with the high-pressure liquid pipe through the outdoor electronic expansion valve; a C end of the four-way valve is connected with a suction end of the compressor; a D end of the four-way valve is connected with the low-pressure gas return pipe; characterized in that the third electromagnetic valve is connected between the high-pressure gas pipe and the low-pressure gas return pipe; and one end of the second electromagnetic valve is connected with the A end of the four-way valve, and the other end thereof is connected between the third electromagnetic valve and the high-pressure gas pipe; each of the indoor units comprises a first indoor heat exchanger, a first electronic expansion valve, a second indoor heat exchanger, and a second electronic expansion valve; and one end of the first indoor heat exchanger is connected with the high-pressure gas pipe, and an other end of the first indoor heat exchanger is connected with the high-pressure liquid pipe through the first electronic expansion valve; and one end of the second indoor heat exchanger is connected with the low-pressure gas return pipe, and an other end of the second indoor heat exchanger is connected with the high-pressure liquid pipe through the second electronic expansion valve. the outdoor unit comprises a four-way valve, an outdoor heat exchanger, an outdoor electronic expansion valve, a second electromagnetic valve, a third electromagnetic valve, and at least one compressor; an exhaust end of the compressor is connected with an A end of the four-way valve; a B end of the four-way valve is connected with the outdoor heat exchanger, and an other end of the outdoor heat exchanger is connected with the high-pressure liquid pipe through the outdoor electronic expansion valve; a C end of the four-way valve is connected with a suction end of the compressor; a D end of the four-way valve is connected with the low-pressure gas return pipe; characterized in that the third electromagnetic valve is connected between the high-pressure gas pipe and the low-pressure gas return pipe; and one end of the second electromagnetic valve is connected with the A end of the four-way valve, and the other end thereof is connected between the third electromagnetic valve and the high-pressure gas pipe; each of the indoor units comprises a first indoor heat exchanger, a first electronic expansion valve, a second indoor heat exchanger, and a second electronic expansion valve; and one end of the first indoor heat exchanger is connected with the high-pressure gas pipe, and an other end of the first indoor heat exchanger is connected with the high-pressure liquid pipe through the first electronic expansion valve; and one end of the second indoor heat exchanger is connected with the low-pressure gas return pipe, and an other end of the second indoor heat exchanger is connected with the high-pressure liquid pipe through the second electronic expansion valve.