Provided is a lactam compound, a tautomer, a stereoisomer, a racemate, a nonequal mixture of enantiomers, a geometric isomer, a solvate, a pharmaceutically acceptable salt thereof, or a solvate of the salt of the compound, and a pharmaceutical composition containing the compound. Also provided are the use of such compounds and their pharmaceutical compositions as drugs, especially as antiviral drugs.