The invention disclose a pyridine salt compound containing 1,3,4-oxadiazolyl (thiadiazolyl) and a preparation method and application thereof. The compound is of the structure shown in the general formula (I). Based on the 1,3,4- oxadiazole (thiadiazole) thioether (sulfoxide or sulfone) compound, a pyridine base capable of improving the biological activity of the target compound is introduced into the system, and a series of 1,3,4- oxadiazole (thiadiazole) oxygen ether, thioether, sulfoxide or sulfone amphipathic molecules containing pyridine salt are synthesized. It is found that the compound has the good restraining effect on pathogenic bacteria and fungi such as Xanthomonas oryzae pv. oryzae, Ralstonia solanacearum, Xanthomonas axonopodis pv. citri, Gibberella zeae, Phytophythora infestans, Rhizoctonia solani, Borrytis cinerea, Fusarium oxysporum and Phytophythora infestans, and provides an important scientific foundation for new pesticide research, development and creation.