The present invention discloses a class of polypeptide compounds targeting PD-1 receptors. The polypeptide compounds include compound 1, compound 2, compound 3, compound 4 and compound 5; wherein, the amino acid sequence of compound 1-5 is as shown in SEQ ID NO : as shown in 1‑5. The invention also discloses a preparation method of a polypeptide compound targeting the PD-1 receptor, including the following process: using solid-phase synthesis, sequentially coupling the amino acids of compound 1-5 to a solid-phase resin according to the peptide sequence Above, the target compound is obtained through cleavage reagent cleavage, freeze-drying, preparation and purification. The invention also discloses the application of a class of polypeptide compounds targeting PD‑1 receptors in the preparation of analgesic drugs. The small molecule polypeptide of the present invention: compounds 1-5 can bind to PD-1, and have significant inhibitory effects on inflammatory pain and visceral pain under intrathecal administration; and the synthesis is simple, easy to purify, and facilitates large-scale synthesis.