The invention relates to a device and a method for detecting corrosion of a metal structure under a protective layer through a microwave resonance cavity. The device comprises an automatic network analyzer and further comprises a frequency scanning source, an isolator, a distributor and a first coupling probe arranged in a resonance cavity body which are connected with the automatic network analyzer in turn, wherein a second coupling probe arranged in the resonance cavity body is connected with an attenuator, the distributor, the isolator, a signal microprocessor circuit and the automatic network analyzer in turn through a coaxial cable; a plurality of corrosion degree indicator lamps are connected with the automatic network analyzer; and an opening of the resonance cavity body is formed at the lower end of the resonance cavity body. The method comprises the following steps: detecting amplitude-frequency characteristics of the resonance cavity and a detected object at different corrosion degrees, and obtaining resonant frequency, peak power and half-power bandwidth, thereby obtaining the corrosion degree of the metal structure under the protective layer. The device has the advantages of simple structure, high speed and convenience in detection, high reliability, and capability of realizing the detection for the corrosion degrees of the metal structures under the protective layers in different thickness.