Individuals who rapidly exposed to high-altitude environments are at risk of developing acute mountain sickness, which can inhibit the respiratory center or cause upper airway obstruction, leading to sleep apnea (SA). SA reduces oxygen saturation (SPO2) during sleep, which not only impairs sleep quality but affects cognitive and memory function. Positive airway pressure ventilation helps alleviate SA, but existing devices are prone to failure at high altitudes and are unable to realize real-time intervention based on user's physiological parameters. In this paper, we propose a respiratory ventilation system which addresses the issue of equipment failure at high altitudes through the implementation of an atmospheric pressure compensation algorithm. Additionally, we have developed a closed-loop algorithm that adjusts the inhalation and exhalation pressure based on the user's SPO2 during sleep. Experimental evaluations were conducted at an altitude of 3650 m, where participants were randomly assigned to receive closed-loop respiratory intervention, bi-level positive airway pressure (Bi-PAP) ventilation, and sham stimulation on three days. Heart rate (HR), SPO2, tidal volume (VT), respiratory rate (Rf) and sleep papameters were collected, and sleep quality was assessed. Experimental results showed that participants experienced an 26.3% elevate in ventilation (p=0.004, 0.002, 0.003, respectively), an 8% increase in SPO2 (p $< $ 0.001 on three days), reduction in apnea events and an enhancement in deep sleep duration and sleep stability. These findings demonstrate that the incorporation of the closed-loop algorithm has significantly enhanced the system's effectiveness, offering a novel solution for addressing sleep apnea in high-altitude environments.