A preparation method for a compound represented by formula, comprising the following steps: a) reducing a substance represented by formula to obtain a substance represented by formula using a reduction reagent, wherein, in the formula, R 1 represents a hydroxyl protecting group, and R 2 represents a straight or branched, saturated alkyl group, wherein R 1 in the formula has the same meaning as in the formula, then, oxidizing the substance represented by formula to form a substance represented by formula using an oxidation reagent under basic condition, wherein R 1 in the formula has the same meaning as in the formula, the reduction reagent is selected from the group consisting of dimethyl sulfide borane, dimethyl sulfide borane/sodium borohydride, sodium borohydride/aluminum trichloride, sodium borohydride/iodine, sodium borohydride/trimethylchlorosilane and sodium borohydride; b) acylating n-octanoic acid to obtain n-octanoyl chloride using thionyl dichloride, and then condensing the obtained n-octanoyl chloride with 2-mercaptopyridine under basic condition to form a substance represented by formula, then, the substance represented by formula is converted to a substance represented by formula under basic condition: wherein R 1 in the formula has the same meaning as in the formula; c) reacting the substance obtained in the step a) with the substance obtained in the step b) under catalytic condition of Lewis acid to form a substance represented by formula, wherein, R 1 in the formula has the same meaning as in the formula, then, reacting with an acid to obtain the compound represented by formula; wherein, the sequence of the step a) and the step b) is alterable. a) reducing a substance represented by formula to obtain a substance represented by formula using a reduction reagent, wherein, in the formula, R 1 represents a hydroxyl protecting group, and R 2 represents a straight or branched, saturated alkyl group, wherein R 1 in the formula has the same meaning as in the formula, then, oxidizing the substance represented by formula to form a substance represented by formula using an oxidation reagent under basic condition, wherein R 1 in the formula has the same meaning as in the formula, the reduction reagent is selected from the group consisting of dimethyl sulfide borane, dimethyl sulfide borane/sodium borohydride, sodium borohydride/aluminum trichloride, sodium borohydride/iodine, sodium borohydride/trimethylchlorosilane and sodium borohydride; b) acylating n-octanoic acid to obtain n-octanoyl chloride using thionyl dichloride, and then condensing the obtained n-octanoyl chloride with 2-mercaptopyridine under basic condition to form a substance represented by formula, then, the substance represented by formula is converted to a substance represented by formula under basic condition: wherein R 1 in the formula has the same meaning as in the formula; c) reacting the substance obtained in the step a) with the substance obtained in the step b) under catalytic condition of Lewis acid to form a substance represented by formula, wherein, R 1 in the formula has the same meaning as in the formula, then, reacting with an acid to obtain the compound represented by formula; wherein, the sequence of the step a) and the step b) is alterable.