A reversing valve, comprising a pilot valve and a main valve; the main valve comprises: a valve body with a valve chamber, wherein the valve chamber is provided with a valve seat therein, and the valve seat is provided with five valve ports thereon; five flow path ports are correspondingly communicated with the five valve ports, characterised in that the valve chamber is cylinder-shaped; the first valve port, the second valve port, the third valve port, the fourth valve port and the fifth valve port are set at one side of the valve chamber, and are linearly distributed in the axis direction of the valve chamber; a sliding valve core is matched with the valve seat; and a drive component driving the sliding valve core to selectively open or close the valve ports, wherein, the five valve ports comprise a first valve port, a second valve port, a third valve port, a fourth valve port, and a fifth valve port; the five flow path ports comprise an S port which is communicated with the first valve port, an E port is communicated with the second valve port, a C port is communicated with the third valve port, a D1 port is communicated with the fourth valve port and a D2 port is communicated with the fifth valve port; when the sliding valve core slides to a first preset position, the D1 port is communicated with the E port, and the S port is communicated with the C port, a medium entering through the D2 port is enclosed in the valve chamber; when the sliding valve core slides to a second preset position, the D2 port is communicated with the C port, and the S port is communicated with the E port, a medium entering through the D1 port is enclosed in the valve chamber. a valve body with a valve chamber, wherein the valve chamber is provided with a valve seat therein, and the valve seat is provided with five valve ports thereon; five flow path ports are correspondingly communicated with the five valve ports, characterised in that the valve chamber is cylinder-shaped; the first valve port, the second valve port, the third valve port, the fourth valve port and the fifth valve port are set at one side of the valve chamber, and are linearly distributed in the axis direction of the valve chamber; a sliding valve core is matched with the valve seat; and a drive component driving the sliding valve core to selectively open or close the valve ports, wherein, the five valve ports comprise a first valve port, a second valve port, a third valve port, a fourth valve port, and a fifth valve port; the five flow path ports comprise an S port which is communicated with the first valve port, an E port is communicated with the second valve port, a C port is communicated with the third valve port, a D1 port is communicated with the fourth valve port and a D2 port is communicated with the fifth valve port; when the sliding valve core slides to a first preset position, the D1 port is communicated with the E port, and the S port is communicated with the C port, a medium entering through the D2 port is enclosed in the valve chamber; when the sliding valve core slides to a second preset position, the D2 port is communicated with the C port, and the S port is communicated with the E port, a medium entering through the D1 port is enclosed in the valve chamber.