The invention discloses a vanillin derivative containing dithioacetals, a preparation method and a purpose thereof. A structural general formula of the derivative is shown in a specification, wherein, R1 is a substituted aromatic ring, heterocycle or 1,1-dichloroethylene; a methyl atom, a nitro atom or a halogen atom is contained on an o-position, a meta-position and a para-position of the aromatic ring, the halogen atom can be fluorine, chlorine, or bromine; the heterocycle is five-membered or six-membered heterocycle, and one halogen atom is contained on the heterocycle. R2 is substituted aromatic ring, 1-propanol or heterocycle; fluorine or chlorine is contained on para-position of the aromatic ring, and the heterocycle is furan ring. The compound can inhibit plant virus such as tobacco mosaic virus, cucumber mosaic virus and potato y potyvirus.