The invention relates to a propanamide coupled piperidinoxadiazole and imidazo[1,2-a]pyrazine derivative shown as a formula I and / or medicinal salts thereof and a preparation method thereof, as well as a pharmaceutical composition comprising the compound. The compound shown as the formula I is a potential cannabinoid receptor 2(CB2) agonist and can be used for treating and / or preventing diseases such as inflammation, inflammatory bowel diseases, glaucoma, diabetes, nephropathy, cardiomyopathy and the like. The structural formula is as shown in the specification, wherein R1 is aryl and heteroaryl; and R2 is H, (C1-C6) linear alkyl or branched alkyl.