The present invention relates to a urea compound and a preparation method and an application thereof. The structure of the present compound is represented by formula (I), the definition of each variable in the formula being as described in the description. The compound can block interaction between the PD-1/PD-L1 signalling pathways. The compound of the present invention can be used for treating or preventing diseases related to the signalling pathways, such as cancer, autoimmune disease, chronic infectious disease, and other diseases.