Abstract: The present disclosure relates to a piperazine derivative, a preparation method therefor, and use thereof in medicine. Specifically, the present invention relates to a piperazine derivative represented by general formula (I), a preparation method therefor, and a pharmaceutically acceptable salt or prodrug thereof, and use thereof as a therapeutic agent, in particular, as an inhibitor of coagulation factor XIa (FXIa), wherein the definition of each substituent in general formula (I) is the same as that in the description.