The invention discloses a piperazine-containing ferulic acid derivative and a preparation method and application thereof, and belongs to the technical field of drug synthesis and agricultural disease control, the structural general formula of the piperazine-containing ferulic acid derivative is shown in the specification, in the formula, R1 is ethyl, allyl, isopropyl, propynyl, benzyl, o-methylbenzyl, m-methylbenzyl and o-fluorobenzyl; R2 is ethyl sulfonyl, 4-methyl benzenesulfonyl, 4-nitrobenzenesulfonyl, 4-trifluoromethyl benzenesulfonyl, 4-fluorobenzenesulfonyl, 2, 5-dichlorobenzenesulfonyl, 4-bromobenzenesulfonyl, 4-bromine-3-trifluoromethyl benzenesulfonyl, 3-trifluoromethyl benzoyl, 4-fluorobenzoyl, 2-fluorobenzoyl, 4-methoxybenzoyl, 5-chlorovaleryl, 4-chlorobutyryl, 4-fluorobenzyl, 2-methoxybenzyl, 3, 4, 4-trifluorobutyl-3-alkene 1-yl, 2-methoxy-2-oxoethyl, 2-oxo-2-phenylethyl. The drug molecule is high in activity, the inhibitory activity on TMV and CMV is remarkable, the structure of the drug is derived from natural products, and the drug is environmentally friendly, easy to metabolize and degrade, simple and safe in preparation process and relatively stable in physicochemical property.