A method for controlling a permanent magnet motor , wherein the method comprises: Obtaining (S201) system parameters of the permanent magnet motor , wherein the system parameters comprise: a resonance bandwidth of the stator of the permanent magnet motor and a natural frequency of a stator of the permanent magnet motor ; setting (S202) a power frequency of the permanent magnet motor according to the system parameters; obtaining a battery cell temperature of the power battery and operating status of the permanent magnet motor ; supplying (S203) power to the permanent magnet motor by using alternating current at the power frequency when a power battery meets a self-heating condition; wherein the power battery meets a self-heating condition comprises: the battery cell temperature is less than a preset temperature threshold, and the operating status is stopped status and therefore the rotor is at standstill or in a blocking state; wherein an even multiple of the power frequency is outside a resonance frequency band, and the resonance frequency band is determined according to the natural frequency of the stator and the resonance bandwidth of the stator of the permanent magnet motor ; wherein positive and negative electrodes of the power battery are connected to a direct current side of the inverter , and an alternating current side of the inverter is connected to a stator winding of the permanent magnet motor , and the power batter supplies power to the permanent magnet motor through the inverter . Obtaining (S201) system parameters of the permanent magnet motor , wherein the system parameters comprise: a resonance bandwidth of the stator of the permanent magnet motor and a natural frequency of a stator of the permanent magnet motor ; setting (S202) a power frequency of the permanent magnet motor according to the system parameters; obtaining a battery cell temperature of the power battery and operating status of the permanent magnet motor ; supplying (S203) power to the permanent magnet motor by using alternating current at the power frequency when a power battery meets a self-heating condition; wherein the power battery meets a self-heating condition comprises: the battery cell temperature is less than a preset temperature threshold, and the operating status is stopped status and therefore the rotor is at standstill or in a blocking state; wherein an even multiple of the power frequency is outside a resonance frequency band, and the resonance frequency band is determined according to the natural frequency of the stator and the resonance bandwidth of the stator of the permanent magnet motor ; wherein positive and negative electrodes of the power battery are connected to a direct current side of the inverter , and an alternating current side of the inverter is connected to a stator winding of the permanent magnet motor , and the power batter supplies power to the permanent magnet motor through the inverter . the battery cell temperature is less than a preset temperature threshold, and the operating status is stopped status and therefore the rotor is at standstill or in a blocking state; wherein an even multiple of the power frequency is outside a resonance frequency band, and the resonance frequency band is determined according to the natural frequency of the stator and the resonance bandwidth of the stator of the permanent magnet motor ; wherein positive and negative electrodes of the power battery are connected to a direct current side of the inverter , and an alternating current side of the inverter is connected to a stator winding of the permanent magnet motor , and the power batter supplies power to the permanent magnet motor through the inverter . <EOS>