The invention discloses acetylhydrazone-based compounds and a preparation method thereof. The acetylhydrazone-based compounds are 2-(1-methyl-6-chloro-2,4 (1H, 3H)-quinazolinedione) acetylhydrazone-based compounds expressed by a general formula I. In-vitro antimicrobial activity tests find that the acetylhydrazone-based compounds have certain inhibitory activity on gram-positive bacteria (staphylococcus aureus, methicillin-resistant staphylococcus aureus and bacillus subtilis), gram-negative bacteria (escherichia coli, proteusbacillus vulgaris and pseudomonas aeruginosa), and fungi (candida albicans, aspergillus flavus, aspergillus fumigatus and cryptococcus neoformans), and some compounds have the inhibitory activity on some tested strains that is close and even prior to the inhibitory activity of the existing drug streptomycin sulfate polyoxin B, so that the compounds can be used for preparing antibacterial and / or antifungal drugs. The preparation method for the compounds is simple, the raw materials are easily available, and the cost is relatively low.