Compounds represented by general formula (I), their stereoisomers, tautomers, derivatives, prodrugs or pharmaceutically acceptable salts, and their preparation methods or uses for the manufacture of a medicament of analgesics. In which R1 is selected from H, substituted or unsubstituted phenyl, or substituted or unsubstituted heteroaryl; A is bond, or saturated or unsaturated straight-chain or branched-chain hydrocarbon radical; R2, R3 are each independently hydrogen or methyl, which linked with any position of spirocyclo-structure; n and m are each independently integer between 0-2, do not represent 0 at the same time; B and D are each independently C1-C3 straight-chain or branched-chain alkylene; Y is selected from —CHR4—, O, S, —S(O)—, —SO2—, —NR4— and substituted or unsubstituted phenylene, in which R4 represents H, C1-C6 saturated or unsaturated alkyl, methyl or ethyl substituted by substituted or unsubstituted aryl or heteroaryl; and X− is pharmaceutical acceptable organic or inorganic anion. These compounds can be used as muscarine receptor (M-receptor) and/or nicotine acetylcholine receptor (N-receptor) agonist or antagonist. These compounds have good analgesic effect without side effect such as addiction.