Located in the Kuqa foreland basin, Tarim Basin, the Xinkeshen gas field is a rare ultra-deep and ultra-high-pressure fractured tight sandstone gas reservoir. During the development process, the fluid in the well migrates from the bottom hole to the ground. Due to the huge temperature drop and pressure drop in the wellbore, salting-out and scale-out occur in the well to destroy the oil and gas flow channel, resulting in a decrease in gas production in the well and seriously affecting the normal production of the oil field. Aiming at the problem of wellbore scaling and blockage in the Keshen gas field, this paper takes the wellbore of the Keshen block as the research object. After analyzing the composition of produced water and scale in the wellbore, the solution of ‘fixing scale, clarifying mechanism, early prediction, and fine treatment’ is formulated, and the analysis and evaluation technology of the scale formation process and the prediction model of the gas well model are formed. The wellbore blockage in Keshen block is composed of iron oxide, calcium carbonate crystal, calcite crystal, and wellbore steel falling off due to electrochemical corrosion. It is indicated that the scale attached to the steel sheet causes electrochemical corrosion of the steel sheet, resulting in ‘hydrogen embrittlement’, resulting in the bubbling and falling off of the wellbore steel. Through simulation, it is found that the amount of fouling increases with the increase in wellbore depth, and the amount of fouling is 1.97 kg/d at 6800 m, which is in good agreement with the actual situation. Based on the temperature and pressure curves in the wellbore, the simulation results show that the corrosion rate reaches the highest value of 6.37 mm/yr at the depth of 3400 m. Because of the above problems, a polyaspartic acid scale inhibitor with a scale inhibition rate of 98.9% for wells in Keshen block was synthesized. It has important guidance and reference significance for the accurate treatment of scaling problems in the Keshen gas well.