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 R 1 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; R 2 , R 3 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 C 1 -C 3 straight-chain or branched-chain alkylene; Y is selected from -CHR 4 -, O, S, -S(O)-, -SO 2 -, -NR 4 - and substituted or unsubstituted phenylene, in which R 4 represents H, C 1 -C 6 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.