A centrifugal pump, comprising a pump casing and a first drive mechanism, a second drive mechanism, a pump shaft, and an impeller that are disposed in the pump casing, wherein the pump casing comprises a first pump chamber and a second pump chamber that are connected, an axis of the pump shaft coincides with axes of the first pump chamber and the second pump chamber, an inner diameter of the second pump chamber is greater than that of the first pump chamber, the impeller is connected to an end of the pump shaft, the first drive mechanism and the second drive mechanism are connected to the pump shaft and located on a side, away from the impeller, of the pump shaft, the first drive mechanism is configured to drive the pump shaft to rotate, the second drive mechanism is configured to drive the pump shaft to move along the axis, and the impeller is driven by the pump shaft to rotate in the first pump chamber or the second pump chamber, characterized in that the first drive mechanism comprises a first bearing, a motor, and a second bearing that are sequentially connected to the pump shaft, the motor is configured to drive the pump shaft to rotate, the first bearing and the second bearing are sleeved outside the pump shaft, and the first bearing is located on the side, away from the impeller, of the pump shaft, and wherein the second drive mechanism comprises a coil, a spring, and an armature, the armature is disposed on a side, facing away from the motor, of the first bearing, the armature is connected to the first bearing through the spring, a direction of contraction of the spring is parallel to or coincides with a direction of the axis of the pump shaft, the armature is connected to the coil, and the coil may be energized to turn the armature into a magnetic attraction structure. the pump casing comprises a first pump chamber and a second pump chamber that are connected, an axis of the pump shaft coincides with axes of the first pump chamber and the second pump chamber, an inner diameter of the second pump chamber is greater than that of the first pump chamber, the impeller is connected to an end of the pump shaft, the first drive mechanism and the second drive mechanism are connected to the pump shaft and located on a side, away from the impeller, of the pump shaft, the first drive mechanism is configured to drive the pump shaft to rotate, the second drive mechanism is configured to drive the pump shaft to move along the axis, and the impeller is driven by the pump shaft to rotate in the first pump chamber or the second pump chamber, characterized in that the first drive mechanism comprises a first bearing, a motor, and a second bearing that are sequentially connected to the pump shaft, the motor is configured to drive the pump shaft to rotate, the first bearing and the second bearing are sleeved outside the pump shaft, and the first bearing is located on the side, away from the impeller, of the pump shaft, and wherein the second drive mechanism comprises a coil, a spring, and an armature, the armature is disposed on a side, facing away from the motor, of the first bearing, the armature is connected to the first bearing through the spring, a direction of contraction of the spring is parallel to or coincides with a direction of the axis of the pump shaft, the armature is connected to the coil, and the coil may be energized to turn the armature into a magnetic attraction structure.