The invention relates to hexahydropentaleno derivatives, the preparation method and use in medicine thereof, and in particular to hexahydropentaleno derivatives or stereo-isomers or pharmaceutically acceptable salts thereof as shown in general formula (I), and to the preparation method therefor and pharmaceutical compositions comprising the derivatives, and to the use thereof as a therapeutical agent, especially as a DPP-IV inhibitor. The definition of each substituent in formula (I) is the same as the definition in the description.