Provided are a compound of formula (I), pharmaceutically acceptable salts thereof, preparation methods and applications thereof for inhibiting thrombin, and applications in the treatment and prevention of thrombin-mediated and thrombin-related diseases.