The present invention relates to an oxa spiro derivative, a preparation method therefor, and applications thereof in medicines. Particularly, the present invention relates to an oxa spiro derivative represented by formula (I), a preparation method therefor, and a pharmaceutical composition comprising the derivative, applications thereof as an MOR receptor agonist, and applications in the preparation of drugs for treating and/or preventing pains and pains-related diseases. Substituent groups in the formula (I) are same as definitions in the specifications.