Provided are a compound of formula I which can be used as a drug against small RNA virus infections, and optical isomers, pharmaceutically acceptable salts, solvates or hydrates thereof. Also provided are the preparation method of the compound, the method for using the compound for treating bacterial infections and the use of the compound in the preparation of a drug for preventing and/or treating viral diseases caused by small RNA viruses.