Provided in the present invention is a linker and a preparation method thereof, wherein one end of the linker may covalently link a small molecule compound and the like and the other end may specifically and covalently link a targeting substance site under the action of Sortase enzyme. The linker of the present invention can be used to prepare a targeting drug conjugate.