The present invention provides a
corrosion inhibitor and a preparation method thereof, and relates to the technical field of oilfield additives. The preparation method of the
corrosion inhibitor comprises the following steps: taking p-hydroxybenzaldehyde and dissolving it in a first
solvent, adding 1,2-dibromoethane and an acid binding agent, reacting at 60-80°C for 10-24h, and after the reaction is completed, separating and purifying it to obtain a first
monomer, wherein the
molar amount of 1,2-dibromoethane is greater than the
molar amount of p-hydroxybenzaldehyde; taking the first
monomer and a
tertiary amine, adding them to
ethanol, reacting at 50-80°C for 1-3h, adding a
small molecule ether amine after the reaction is completed, and continuing to react for 2-5h, after the reaction is completed, removing
ethanol to obtain. The
corrosion inhibitor of the present invention has relatively mild preparation conditions, does not involve high
temperature and pressure links, and its preparation method is relatively simple. The prepared
corrosion inhibitor has a good corrosion inhibition effect. Under the conditions of a mineralization degree of 50,000, an equivalent
hydrogen sulfide content of about 0.12 g / L, and a temperature of 90°C, its maximum corrosion inhibition effect can reach more than 95%, and its added dosage is only 200 ppm.