The invention relates to valerolactam enterovirus 71 (EV71) 3C protease inhibitors, wherein a structure general formula of the inhibitors is represented by a compound M, various variables in the structure is defined in an instruction, and EV71 replication is effectively inhibited or blocked with the compounds. The present invention relates to discoveries and applications of the compounds containing the structure represented by the formula (M), optical isomers, metabolites with pharmaceutical activities, pharmaceutically acceptable salts, solvates, and prodrugs thereof in preparations of anti-virus drugs for treatment of hand-foot-mouth disease infection. The present invention further relates to an intermediate of the structure compound represented by the formula (M) and a synthesis method thereof.