Herein, we take an underground natural gas storage in the Ordos Basin as an example to explore the influence of temperature, CO2 flow rate, CO2 partial pressure, and chloride ion concentration on the corrosion rate of N80 and P110 steels in CaCl2 brine type. Meanwhile, in order to reduce the amount of chemical corrosion inhibitors and improve performance, a novel corrosion inhibitor with a quinoline quaternary ammonium structure named YS-QB was synthesized from 1-methyl-1,2,3,4-tetrahydroisoquinoline, epichlorohydrin, and oleic acid amide propyl dimethylamine. Under normal and high-pressure environments, YS-QB exhibits a superior corrosion inhibition effect to the market product of CX-1. In order to further reduce the amount of corrosion inhibitor and improve the corrosion inhibition effect, orthogonal experiments were conducted to optimize the formula system, and the optimal composite system was finally obtained by forming YS-QB, propargyl alcohol, hexamethylenetetramine, and isopropanol in a mass ratio of 12:1:1:2. At 80 °C, a dosage of 30 mg/L can suppress the CO2 corrosion rate below 0.076 mm/a, while a dosage of 60 mg/L can suppress the CO2 corrosion rate below 0.076 mm/a at a high-pressure environment of 120 °C. Combining weightlessness and electrochemical experiments, it is found that the composite corrosion inhibitor performs best when the dosage reached 100 mg/L, and a further increase in the dosage weakens the corrosion inhibition capacity. Based on the polarization curve changes with the dosage of the composite corrosion inhibitor, it can be determined that the final obtained composite corrosion inhibitor system was a cathodic corrosion inhibitor.