Provided are a compound for the prevention and treatment of diseases associated with PD-L1, a preparation method therefor and use thereof. Specifically, provided are the compound of formula I, the stereoisomer and the racemate thereof, or pharmaceutically acceptable salts thereof, and also provided is an application thereof in the preparation of a drug for the prevention and treatment of diseases associated with PD-L1.