Disclosed are an aryl glycoside compound as represented by formula I or formula I, a pharmaceutically acceptable salt thereof, optical isomer thereof or a prodrug thereof. The present invention relates to a method of preparing said aryl glycoside compound and the use thereof. The aryl glycoside compound of the present invention has an excellent ability to inhibit SGLT activity, especially SGLT2 activity, and is a diabetes-fighting medicine with great potential.