The present invention relates to an oxopicolinamide derivative, a preparation method therefor and the pharmaceutical use thereof. In particular, the present invention relates to the oxopicolinamide derivative as shown in the general formula (AI), a preparation method therefor and a pharmaceutical composition comprising the derivative, and to the use thereof as a therapeutic agent, in particular as an inhibitor of blood coagulation factor XIa (Factor XIa, FXIa for short) and the use thereof in the preparation of a drug for treating diseases such as thromboembolism, wherein the definition of each substituent in the general formula (AI) is the same as defined in the description.