The application discloses a kind of deuterated benzamidediazepine compounds and preparation method and purposes thereof, and structure is as shown in general formula I.The compound is used as selective OX2R antagonist, and shows good activity, selectivity, brain exposure, brain blood ratio (the ratio of drug concentration in brain and drug concentration in blood, is called B / P), little toxic side effect, moderate half-life effect etc..It can be used for preventing, treating and / or reducing the disease related to orexin receptor.General formula I