The invention belongs to the technical field of marine corrosion and protection, and relates to a deep and shallow sea alternating corrosion environment simulator. Periodic changes of parameters such as pressure, temperature, dissolved oxygen and pH value are controlled to simulate alternating corrosion environment of sea water at different depths, and realize material performance test in the environment, so as to evaluate various performances of the material in deep and shallow sea alternating corrosion environment. The simulator comprises a pressure alternating system, a salinity regulating system, a pH value regulating system, a temperature control system, a dissolved oxygen regulating system, an auxiliary regulating system, a counterbalance valve, a central control board and a host computer. Medium temperature, medium dissolved oxygen and pH value are adjusted to simulate environmental parameters of deep sea or high pressure; and then a pressure alternating system is employed to conduct pressure change according to a set pressure curve, so as to simulate deep sea alternating environment and evaluate material properties. The simulator has simple structure principle, reliable usage and operation, real stimulating effects, good effects of deep and shallow sea alternating experiments, and strong practicability.