The invention discloses a cooling device used for cooling an air compressor. The cooling device comprises at least one fan, a temperature sensor, a controller and a frequency converter, wherein the temperature sensor is used for detecting exhaust temperature of the air compressor; the controller is connected with the temperature sensor and is used for comparing the exhaust temperature with preset exhaust temperature and outputting a signal after comparison; and the frequency converter is respectively connected with the at least one fan and the controller and is used for controlling the at least one fan to output cooling air volume corresponding to the signal after comparison according to the signal after comparison. When the cooling device is in use, a cooing temperature is firstly set, the exhaust temperature of the air compressor is detected by the temperature sensor, when the controller determines that the temperature is lower than the cooling temperature, the power supply frequency of the fan is reduced by the frequency converter, the power of the corresponding fan can be reduced, and the cooling air volume is reduced, therefore, the energy consumption is reduced, the energy sources are saved, and the service life of lubricating oil in the air compressor is effectively prolonged simultaneously. The invention also discloses a cooling method.