RIPK1 inhibitors for inhibiting necroptosis and their preparation methods. The RIPK1 inhibitors are as shown in general formula I, wherein, X1, X2, X3, X4, X5, Z1, Z2, Z3, L1, L2, L3, R, R1, ring D and n are as disclosed in the specification. Preparation methods of general formula I and the test results of inhibition of necroptosis and RIPK1 activity are also provided. The compounds in formula I can be used for used for treating and preventing inflammatory and degenerative diseases.