Home ventilator control method, system and home ventilator

CN122998538APending Publication Date: 2026-10-30HUNAN BIYANG MEDICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611423590.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-14
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]本申请提供了一种家用呼吸机控制方法、系统及家用呼吸机,用以解决现有家用呼吸机的自动佩戴检测不精准,导致自动开关机控制存在误触发的问题,本申请提供的技术方案如下:

Benefits of technology

(1)在佩戴检测方面:通过“流量RMS初筛+呼吸节律三条件确认”的两级判定机制,并辅以管路阻抗阶跃快速通道,在硬件层面实现了对真实呼吸与各类环境干扰的精准区分,使得佩戴检测延迟被有效压缩,同时将误触发率抑制在极低水平。其原理在于:第一级利用低采样率下的流量幅值统计进行粗筛以控制有效数据窗口,第二级对高采样率数据执行自相关周期性、正负双向比例平衡性和峰值幅值合理性的复合逻辑与多周期一致性验证,从根本上过滤掉了管路抖动、外部接触、宠物呼吸等非人呼吸信号。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122998538A_ABST
    Figure CN122998538A_ABST
Patent Text Reader

Abstract

The application discloses a kind of domestic breathing machine control method, system and domestic breathing machine, applied to domestic breathing machine technical field.It includes: in standby state with first sampling frequency acquisition airflow, when airflow exceeds flow threshold, switch to the second sampling frequency higher than first sampling frequency to collect airflow;When the airflow based on the second sampling frequency meets the human respiratory rhythm, control the fan from the lowest duty cycle in standby state gradually to the target duty cycle corresponding to target therapy pressure to gradually enter the treatment state.By two-level identification mechanism, high sensitivity identification and low false trigger confirmation are realized under very low standby power consumption, which significantly speeds up the response speed of domestic breathing machine start.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of home ventilator technology, and in particular to a home ventilator control method, system and home ventilator. Background Technology

[0002] The current start-stop control schemes for home ventilators are typically as follows: manual button start / stop; some high-end models support automatic start, that is, when the home ventilator is in standby mode, the fan runs at a very low power to maintain a slight positive pressure (such as 0.5~1cmH2O) in the airflow tubing between the ventilator body and the mask, and determines whether the mask is being worn by detecting whether the tubing pressure / flow reaches a set threshold; when a breathing signal is detected, treatment starts automatically, and when no breathing signal is detected, treatment stops automatically.

[0003] This single threshold-based power-on / shutdown control scheme has a hardware contradiction regarding sensitivity and false triggering: if the threshold is too low, things like air blowing on the tubing, bed partner turning over and pressing on the tubing, or pets touching the mask may trigger power-on; if the threshold is too high, it takes a long time (e.g., 10-30 seconds) to be recognized after wearing the mask, affecting the user's treatment experience. Summary of the Invention

[0004] This application provides a home ventilator control method, system, and home ventilator to solve the problem of inaccurate automatic wear detection in existing home ventilators, which leads to false triggering of automatic on / off control. The technical solution provided by this application is as follows: On one hand, this application provides a home ventilator control method, including: when it is detected that the airflow rate in the airflow tube collected by the flow sensor at a first sampling frequency in the standby state is greater than the flow threshold, controlling the flow sensor to collect the airflow rate in the airflow tube at a second sampling frequency; wherein, the second sampling frequency is higher than the first sampling frequency; when it is detected that the airflow rate in the airflow tube collected by the flow sensor at the second sampling frequency conforms to the human respiratory rhythm, controlling the fan to gradually increase from the lowest duty cycle in the standby state to the target duty cycle corresponding to the target treatment pressure so as to gradually enter the treatment state.

[0005] The above scheme uses a two-level recognition mechanism. In standby mode, it performs initial screening with a low sampling rate and low power consumption. Only when a possible human-computer interaction is detected will it dynamically switch to a high sampling rate for accurate confirmation of breathing rhythm. This achieves a balance between extremely low standby power consumption and high detection accuracy, significantly reducing the false trigger rate and speeding up the wear recognition process.

[0006] Optionally, monitoring that the airflow rate in the airflow duct, collected by the flow sensor at a second sampling frequency, conforms to the human respiratory rhythm includes: detecting whether the airflow rate in the airflow duct has periodic characteristics within the set respiratory cycle based on whether there is an autocorrelation peak in the autocorrelation function values ​​of each airflow rate within the set respiratory cycle; detecting whether the airflow rate in the airflow duct has bidirectional characteristics within the set respiratory cycle based on whether the proportion of positive airflow rate in each airflow rate within the set respiratory cycle is within a reasonable proportion range; detecting whether the airflow rate in the airflow duct has reasonable peak characteristics within the set respiratory cycle based on whether the peak value of each airflow rate within the set respiratory cycle is within a reasonable peak value range; if the airflow rate in the airflow duct is detected to simultaneously possess periodic characteristics, bidirectional characteristics, and reasonable peak characteristics within a first number of set respiratory cycles, then it is determined that the airflow rate in the airflow duct conforms to the human respiratory rhythm.

[0007] The above solution uses a composite logic to determine the airflow under high sampling rate in three dimensions: periodicity, bidirectionality, and amplitude rationality, and takes multi-period consistency as a necessary condition. This allows it to accurately distinguish between real human breathing and non-human breathing interference such as tube vibration, external contact, and pet breathing at the hardware level, thus significantly improving the reliability of wearing confirmation.

[0008] Optionally, after controlling the flow sensor to collect the airflow rate in the airflow duct at a second sampling frequency, the method further includes: determining the equivalent impedance of the airflow duct based on the airflow rate in the airflow duct collected by the flow sensor at the second sampling frequency and the airflow pressure in the airflow duct collected by the pressure sensor at a third sampling frequency; detecting whether the equivalent impedance of the airflow duct has a step characteristic based on whether the instantaneous change multiple of the equivalent impedance relative to the reference equivalent impedance is greater than a multiple threshold; if a step characteristic of the equivalent impedance of the airflow duct is detected in all of the second number of respiratory cycles, then it is determined that the mask wearing is complete.

[0009] The above solution increases the fast channel for identifying the equivalent impedance step of the pipeline. It utilizes the impedance change caused by the change from open to partially sealed at the end of the pipeline when the mask is put on, and realizes the rapid confirmation of the wearing event. This effectively reduces the delay time of wearing detection from the usual tens of seconds to a few seconds, improving the real-time response experience of the device.

[0010] Optionally, after controlling the fan to gradually increase from the lowest duty cycle in standby mode to the target duty cycle corresponding to the target treatment pressure, the method further includes: in the treatment state, monitoring whether an interruption event occurs based on the airflow rate in the airflow duct collected by the flow sensor at a second sampling frequency and the airflow pressure in the airflow duct collected by the pressure sensor at a third sampling frequency; if an interruption event is detected, executing the interruption response strategy corresponding to the interruption event.

[0011] The above scheme enables the system to identify and classify different interruption events when it detects abnormalities such as the disappearance of respiratory signals, providing a decision entry point for subsequent scenario-based differentiated responses.

[0012] Optionally, interruption events include large air leakage events, suspected detachment events, and intentional removal events; based on the airflow rate in the airflow tube collected by the flow sensor at a second sampling frequency and the airflow pressure in the airflow tube collected by the pressure sensor at a third sampling frequency, the system monitors whether an interruption event has occurred, including: if the airflow rate in the airflow tube collected by the flow sensor at the second sampling frequency does not conform to the human respiratory rhythm, and the airflow pressure in the airflow tube collected by the pressure sensor at the third sampling frequency drops below a first pressure threshold, and the current time is within the sleep time interval, then a suspected detachment event is determined to have occurred; if the flow sensor... If the airflow rate in the airflow tube, sampled at the second sampling frequency, does not conform to the human respiratory rhythm, and the airflow pressure in the airflow tube, sampled at the third sampling frequency, drops below the first pressure threshold, and the current time is within the non-sleep time interval, then an intentional removal event is determined to have occurred. If the airflow rate in the airflow tube, sampled at the second sampling frequency, by the flow sensor does not conform to the human respiratory rhythm, and the airflow pressure in the airflow tube, sampled at the third sampling frequency, by the pressure sensor drops to a level not lower than the second pressure threshold and exhibits periodic characteristics, then a major air leak event is determined to have occurred. Wherein, the second pressure threshold is greater than the first pressure threshold.

[0013] The above scheme classifies suspected detachment events by introducing a time factor, using sudden drops in pipeline pressure and abrupt changes in flow characteristics as common criteria for judgment. It also combines different living habits at night and in the morning to intelligently distinguish between nighttime detachment during sleep and active removal after waking up, providing accurate decision input for subsequent implementation of differentiated waiting and recovery strategies.

[0014] Optionally, the interrupt response strategy corresponding to the interruption event is executed, including: if the interruption event is a large air leakage event, the target duty cycle of the fan is dynamically adjusted using a closed-loop control strategy, and the air leakage compensation operation is performed simultaneously, and the user is prompted to check the mask sealing status; if the interruption event is a suspected detachment event or an intentional removal event, the fan is controlled to reduce from the target duty cycle to the minimum duty cycle, and the flow sensor is controlled to reduce from the second sampling frequency to the first sampling frequency.

[0015] The above solution avoids misjudging large air leaks as detachment and interrupting treatment by using scenario-based differentiated responses. At the same time, it immediately performs energy-saving and safety actions such as reducing duty cycle and sampling rate after confirming detachment or removal, thus taking into account treatment continuity, patient safety and system power consumption.

[0016] Optionally, after the flow sensor reduces its sampling frequency from the second sampling frequency to the first sampling frequency, the method further includes: within an interrupt waiting window, monitoring whether a re-wearing event has occurred based on the airflow rate in the airflow duct collected by the flow sensor at the first sampling frequency and the airflow pressure in the airflow duct collected by the pressure sensor at the third sampling frequency; when a re-wearing event is detected, using a first-order exponential recovery algorithm to dynamically calculate the target treatment pressure, and based on the dynamically calculated target treatment pressure, gradually adjusting the target duty cycle of the fan until the dynamically calculated target treatment pressure reaches the target treatment pressure before the suspected detachment event or intentional removal event occurs, and then entering the treatment state.

[0017] The above solution sets an interruption waiting window and defines a first-order exponential recovery algorithm for rapid recovery, enabling patients to smoothly return to the treatment pressure level before the interruption in a very short time after getting out of bed briefly and putting on the mask again. This avoids the discomfort caused by going through a long pressure increase process again, and ensures the continuity and comfort of treatment.

[0018] Optionally, the home ventilator control method provided in this application further includes: when no re-wearing event is detected, returning to standby mode; when the duration of standby mode is detected to be not less than a duration threshold, controlling the MCU to switch to shutdown mode; wherein, in shutdown mode, the master clock and I2C clock are turned off, the fan and flow sensor stop running, and the ADC is retained to periodically wake up the pressure sensor to collect the airflow pressure in the airflow tube; when the airflow pressure in the airflow tube jumps to a value greater than the human respiratory pressure threshold, the MCU is woken up and the flow sensor is controlled to collect the airflow flow rate in the airflow tube at a second sampling frequency; when the airflow flow rate in the airflow tube collected by the flow sensor at the second sampling frequency is detected to conform to the human respiratory rhythm, the fan is controlled to gradually increase from the lowest duty cycle in standby mode to the target duty cycle corresponding to the target treatment pressure to gradually enter the treatment state.

[0019] The above solution constructs a low-power wake-up logic with pressure detection as its core. In the long-term non-wearing state, the main controller enters an ultra-low power mode and shuts down the fan, only periodically capturing the tiny pressure fluctuations at the end of the pipeline at an ultra-low frequency, thus achieving a significant reduction in standby power consumption. Once a pressure jump caused by breathing is detected, the system is immediately woken up to run at full speed and uses a high sampling rate to confirm wearing, thus balancing ultra-long standby capability with the real-time performance of wearing detection.

[0020] In addition, this application also provides a home ventilator control system, including: a standby monitoring unit, used to monitor that when the airflow rate in the airflow duct collected by the flow sensor at a first sampling frequency in the standby state is greater than the flow threshold, control the flow sensor to collect the airflow rate in the airflow duct at a second sampling frequency; wherein the second sampling frequency is higher than the first sampling frequency; and a fan boosting unit, used to monitor that when the airflow rate in the airflow duct collected by the flow sensor at the second sampling frequency conforms to the human respiratory rhythm, control the fan to gradually increase from the lowest duty cycle in the standby state to the target duty cycle corresponding to the target treatment pressure so as to gradually enter the treatment state.

[0021] On the other hand, this application provides a home ventilator, including a sensing channel, an execution channel, a memory, and a control arithmetic unit connected to the sensing channel and the execution channel respectively; the memory stores a computer program that can run on the control arithmetic unit, and the control arithmetic unit implements the above-mentioned home ventilator control method when executing the computer program.

[0022] The beneficial effects of this application are as follows: (1) In terms of wear detection: Through a two-level judgment mechanism of "flow RMS initial screening + respiratory rhythm three-condition confirmation", and supplemented by a rapid channel for tubing impedance step, the hardware level achieves accurate differentiation between real breathing and various environmental interferences, which effectively compresses the wear detection delay and suppresses the false trigger rate to an extremely low level. The principle is as follows: the first level uses flow amplitude statistics at a low sampling rate for coarse screening to control the effective data window, and the second level performs a composite logic and multi-cycle consistency verification of autocorrelation periodicity, positive and negative bidirectional proportional balance and peak amplitude rationality on high sampling rate data, which fundamentally filters out non-human breathing signals such as tubing vibration, external contact, and pet breathing.

[0023] (2) Regarding the detachment response: By constructing a three-scenario identification decision tree based on "pressure zeroing degree + RTC time factor + flow characteristic mutation", the system distinguishes three clinical conditions—large air leakage, accidental detachment, and intentional removal—at the hardware level for the first time, and performs differentiated actions such as leak compensation maintenance, short-term energy-saving waiting and rapid recovery, or direct termination of the session, respectively. This ensures that treatment is no longer interrupted by air leakage due to turning over or getting up at night, nor is it ineffective due to morning removal, accurately matching the patient's true behavioral intentions.

[0024] (3) Regarding nighttime recovery: By setting a waiting window for brief interruptions and using a first-order exponential recovery algorithm with a specific time constant, patients can smoothly recover to the treatment pressure before the interruption in a very short time after getting up and returning to bed at night. This avoids the delay and discomfort caused by restarting the complete pressure increase procedure, and significantly improves the continuity and comfort of treatment.

[0025] (4) In terms of system energy efficiency: By introducing the STOP low power mode and the ADC intermittent wake-up mechanism based on pressure jump, and with the complete shutdown or minimum speed maintenance of the fan in non-treatment state, the standby power consumption is reduced to a level significantly lower than that of the existing micro positive pressure maintenance scheme, while not sacrificing the ability to perceive the patient's wearing behavior in real time, providing a guarantee for all-night application in battery-powered scenarios.

[0026] (5) In terms of data management: By dynamically maintaining the "nighttime conversation area" in non-volatile memory and meticulously recording the timestamps of various interruption events, the treatment data for the whole night can be accurately segmented and merged according to clinical compliance standards. Even if multiple brief nighttime interruptions occur, the final generated conversation reports and treatment statistics can truly reflect the patient's actual usage.

[0027] Other features and advantages of this application will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0028] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a schematic diagram of the overall structure of the home ventilator in the embodiments of this application; Figure 2 This is a schematic diagram of the five-level wearing state machine framework in the embodiments of this application; Figure 3 This is a schematic flowchart illustrating the home ventilator control method in the embodiments of this application; Figure 4 This is a schematic diagram of the two-stage mask wearing determination process in an embodiment of this application; Figure 5 This is a schematic diagram of the three interruption scenario identification and response mechanisms in the embodiments of this application; Figure 6 This is a schematic diagram of the brief interruption power-saving waiting and seamless recovery mechanism in the embodiments of this application; Figure 7 This is a schematic diagram of the ultra-low power standby mechanism in the embodiments of this application; Figure 8 This is a schematic diagram of the data maintenance mechanism based on session continuity management in the embodiments of this application; Figure 9 This is a schematic diagram of the composition structure of the home ventilator control system in an embodiment of this application; Figure 10 This is a schematic diagram of the hardware structure of a home ventilator in an embodiment of this application. Detailed Implementation

[0029] To make the objectives, technical solutions, and beneficial effects of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0030] Currently, the start / stop control scheme for home ventilators (such as CPAP / APAP ventilators) mainly relies on manual button start / stop. Some high-end models support automatic start / stop—when the device is in standby mode, the fan operates at extremely low power to maintain a slight positive pressure (0.5~1cmH2O) in the airflow tubing between the ventilator and the mask. Changes in tubing pressure / flow rate are detected to determine if the mask is being worn. Treatment automatically begins when a respiratory signal is detected and automatically stops when no respiratory signal is detected. This automatic start / stop control uses a single threshold filter, which has the following drawbacks: (1) There is a hardware contradiction between the sensitivity of single threshold filtering and false triggering: if the threshold is too low, the device may be activated by the air blowing on the tubing, the bed partner turning over and pressing the tubing, or the pet touching the mask; if the threshold is too high, it will take 10 to 30 seconds to be recognized after wearing the mask, which affects the user's treatment experience. (2) Lack of ability to identify mask removal and large air leaks: When turning over and experiencing a large air leak, the pressure drops and the breathing signal disappears, which is similar to the signal characteristics of mask removal, and may lead to interruption of sleep therapy; (3) Lack of intent recognition capability: It cannot distinguish between three scenarios: temporary removal at night, intentional removal and accidental detachment. Either the system stops and loses session continuity, or it continues to run at high speed and wastes power. (4) Impact on battery life: Maintaining a slight positive pressure in the pipeline during standby mode results in the fan running at approximately 2-5W, which has a significant impact on battery-powered scenarios.

[0031] Based on this, this application makes the following improvements to the existing hardware platform of home ventilators: (i) A dynamic sampling rate switch (10Hz / 100Hz) is added between the differential pressure flow sensor (e.g., SDP810) and the MCU, controlled by a state machine; (ii) The MCU (e.g., STM32F407) enables STOP mode + ADC wake-up channel, and the main clock stops in standby mode; (iii) The BLDC fan (e.g., TIM8) supports four duty cycle modes (0 / minimum maintenance / Ramp / treatment), directly driven by the state machine; (iv) The SPI Flash is divided into a session area to store treatment parameters, interrupt events, dropout timestamps, etc. See also Figure 1 As shown in the figure, the overall structure of the home ventilator in this application consists of three parts: a sensing channel, a control calculation channel, and an execution channel. (a) Sensing channels: SDP810 differential pressure flow sensor (I2C, 10Hz / 100Hz dynamic switching); ADC3 CH14 pressure sensor (1kHz); RTC real-time clock (provides early morning / morning time factor); BLDC Hall feedback (for assisting in pipeline impedance estimation).

[0032] (b) Control operation: STM32F407 main control MCU (168MHz, in STOP mode in standby state), carrying flow cycle analyzer (zero crossing / bidirectional / amplitude detection), pipeline impedance estimator (based on pressure / flow step response), 5-level wearing state machine, and three-scenario detachment detector.

[0033] (c) Execution channels: TIM8 PWM 4-level duty cycle; LCD / UI prompts; buzzer (GPIO); Bluetooth / 4G wake-up control (GPIO enable).

[0034] This application achieves high-sensitivity, low-false-trigger wear detection and differentiated drop response by modifying the standby fan drive law, flow analysis and pressure step identification, five-level wear state machine, three-scene discriminator, low-power wake-up circuit, and session continuity management hardware-level, without adding additional hardware such as infrared proximity / capacitive touch / accelerometer sensors. It drives the five-level wear state machine solely based on the airflow of SDP810 and ADC pressure signal, distinguishes between three scenarios: large air leakage, accidental drop, and intentional removal, and executes differentiated responses at the hardware level. At the same time, it can reduce standby power consumption to <0.1W to adapt to battery-powered scenarios.

[0035] After introducing the application scenarios and design concepts of this application, the technical solutions provided by this application will be described in detail below.

[0036] Example 1 This embodiment provides a five-level wearing state machine framework for home ventilators. The five-level wearing state machine defines the transition logic between five states: S0 (standby), S1 (suspected wearing), S2 (confirmed wearing / Ramp increase), S3 (treatment in progress), and S4 (suspected dislodgement / removal). Each state corresponds to a different hardware control logic semantic, as shown in Table 1. Table 1

[0037] Specifically, see Figure 2 As shown, in the S0 standby state, the fan runs at the lowest duty cycle to maintain a weak positive pressure in the airflow duct to establish a detectable pressure baseline. The flow sensor performs low-power sampling at the first sampling frequency (e.g., 10Hz), and the MCU can be in normal working mode. When the airflow in the airflow duct collected by the flow sensor at the first sampling frequency in the S0 standby state is detected to be greater than the flow threshold, the system enters the S1 suspected wearing state. In the S1 suspected wearing state, the flow sensor is controlled to switch from the first sampling frequency to the second sampling frequency (e.g., 100Hz) to collect the airflow in the airflow duct. The second sampling frequency is higher than the first sampling frequency. The flow threshold can be calibrated based on the baseline level of the flow noise in the standby state. That is, the core hardware action in the S1 suspected wearing state is to switch the flow sensor to a high sampling rate, the MCU synchronously resumes full-speed operation, and the fan maintains operation at the lowest duty cycle. When the airflow in the airflow duct collected by the flow sensor at the second sampling frequency is detected to be consistent with the human breathing rhythm, the state enters the S2 confirmed wearing state. In the S2 confirmed wearing state, the control fan is gradually increased from the lowest duty cycle to the target duty cycle corresponding to the target treatment pressure to gradually enter the S3 treatment state. The process of gradually increasing the fan from the lowest duty cycle to the target duty cycle is the Ramp pressurization process. During the S3 treatment state, a closed-loop control strategy is used to adjust the target duty cycle of the fan. At the same time, if an abnormal respiratory signal is detected (i.e., it does not conform to the human respiratory rhythm), the state of suspected detachment / removal is entered. In the S4 suspected detachment / removal state, a three-scenario identification and differentiated response mechanism is implemented: Upon identification of a large air leak event, air leak compensation is performed while maintaining the closed-loop control strategy in the S3 treatment state; upon identification of a suspected detachment event, the system enters the first interruption waiting window and switches the fan to the lowest duty cycle. If mask re-wearing is detected within the first interruption waiting window, the fan is quickly restored from the lowest duty cycle to the target duty cycle before the suspected detachment event, and the system returns to the S3 treatment state; otherwise, it enters standby mode. When the duration of the standby mode is not less than a duration threshold, the system proceeds... Entering ultra-low power mode; when an intentional removal event is detected, entering the second interrupt waiting window and switching the fan to the lowest duty cycle operation; when the mask is detected to be put back on within the second interrupt waiting window, the fan is quickly restored from the lowest duty cycle to the target duty cycle before the suspected removal event, and then entering the S3 treatment state; otherwise, entering the standby state; when the duration of the standby state is not less than the duration threshold, entering ultra-low power mode; the second interrupt waiting window is much smaller than the first interrupt waiting window, for example, the first interrupt waiting window is 10-15 minutes, and the second interrupt waiting window is 30 seconds.

[0038] Specifically, in ultra-low power mode, the MCU enters a shutdown mode, the main clock and I2C clock are turned off, the fan and flow sensor stop running, and only the ADC periodically wakes up the pressure sensor to collect the air pressure in the airflow duct. When the air pressure in the airflow duct jumps to a value greater than the human breathing pressure threshold, the MCU is woken up, the main clock and I2C clock are restored, the fan runs at the lowest duty cycle, and the flow sensor collects the airflow in the airflow duct at the second sampling frequency (e.g., 100Hz), which is when the S1 suspected wearing state is entered.

[0039] Example 2 This embodiment provides a home ventilator control method. The core of this method lies in establishing a two-level identification mechanism, dividing the mask-wearing identification process into two stages: initial flow screening and respiratory rhythm confirmation, thereby achieving a balance between low power consumption and high detection accuracy. See also... Figure 3 As shown, the general flow of the home ventilator control method provided in this embodiment is as follows: Step S301: When it is detected that the airflow rate in the airflow pipeline collected by the flow sensor at the first sampling frequency in the standby state is greater than the flow threshold, the flow sensor is controlled to collect the airflow rate in the airflow pipeline at the second sampling frequency; wherein, the second sampling frequency is higher than the first sampling frequency.

[0040] This step constitutes the first stage of the two-stage identification mechanism. In standby mode, the system continuously monitors flow changes in the airflow duct at a low initial sampling frequency, designed to control standby power consumption. Specifically, when the flow sensor operates at a low sampling frequency, the MCU can maintain a low computational load and does not need to activate all peripheral resources required for high-frequency data acquisition, thus reducing overall power consumption in standby mode. Flow changes are the most sensitive signal for sensing human-computer interaction. When a patient picks up the mask to put it on, or when airflow disturbances occur at the mask opening due to the patient's breathing or hand approaching, the flow sensor can capture weak airflow signals. The flow threshold in this embodiment is used to distinguish such effective disturbances from the noise baseline in standby mode. This flow threshold can be set based on the baseline level of flow noise in standby mode, for example, by taking a multiple of the noise baseline, so that interference such as duct jitter or ambient airflow fluctuations below this multiple are unlikely to trigger switching, while the flow amplitude can reliably exceed this threshold when the patient actually touches or approaches the mask.

[0041] When the flow rate exceeds the threshold, the system does not immediately determine that the device is fully worn, but instead enters a monitoring state. In this state, the flow sensor is switched to a higher second sampling frequency. The high-resolution flow data acquired at the second sampling frequency provides a sufficient data foundation for subsequent refined respiratory signal analysis and interference elimination. In other words, the first-level triggering only acts as a "coarse screen"—detecting potential human-computer interaction with minimal power consumption; the second-level refined confirmation is handled by subsequent steps.

[0042] In step S302, when the flow rate in the airflow pipeline collected by the flow sensor at the second sampling frequency is found to be in line with the human respiratory rhythm, the fan is controlled to gradually increase from the lowest duty cycle in the standby state to the target duty cycle corresponding to the target treatment pressure in order to gradually enter the treatment state.

[0043] This step constitutes the second level of the two-level identification mechanism. After switching to a high sampling rate in step S100, the system confirms whether the airflow in the pipeline conforms to a human breathing rhythm based on the obtained high-resolution flow data. In this embodiment, "conforming to a human breathing rhythm" is a higher-level outcome constraint, intended to distinguish between genuine human breathing actions and various non-respiratory disturbances—such as pipeline swaying, external contact with the mask, or pet breathing. This embodiment does not limit the specific determination of whether it conforms to a human breathing rhythm to a single algorithm, but rather reserves flexibility for refined solutions in subsequent embodiments. In subsequent embodiments, a detailed description will be provided of how this outcome constraint is implemented through a composite judgment logic involving multiple dimensions such as periodicity, bidirectionality, and amplitude reasonableness, giving it a clear technical judgment standard at the hardware level.

[0044] Once the airflow rate is confirmed to match the human respiratory rhythm, the fan is gradually increased from its lowest duty cycle in standby mode. The lowest duty cycle refers to the low operating speed used by the fan to maintain a slight positive pressure in the tubing during standby. Its power consumption is far lower than the fan power required during treatment, while still sufficient to establish a detectable weak pressure baseline within the tubing. This gradual increase in fan speed from the lowest duty cycle to the target duty cycle corresponding to the target treatment pressure is the ramp-up process during treatment initiation. This process allows the treatment pressure to slowly climb from its lowest level to the target treatment pressure along a preset time curve, rather than switching abruptly. Its technical significance lies in the fact that patients' breathing comfort in the early stages of sleep is highly sensitive to sudden pressure changes. The slow ramp-up process allows patients to gradually adapt to positive airway pressure during light sleep, significantly reducing the risk of suffocation or awakening caused by sudden pressure increases, effectively improving treatment adherence. The duration of the ramp process can be set within a range of several minutes according to the individual needs of the patient, for example, it can be selected between 5 minutes and 15 minutes to match the sleep habits of different patients.

[0045] This embodiment employs a two-level identification mechanism. In standby mode, the system performs initial flow screening at a low sampling rate. Only when potential human-computer interaction is detected does it conditionally enter a high sampling state for precise confirmation of respiratory rhythm. This achieves a balance between extremely low standby power consumption and high-precision wear recognition, significantly reducing the false trigger rate. At the same time, the smooth ramp-up process ensures comfort during the treatment initiation phase.

[0046] Example 3 This embodiment further elaborates on the two-level identification mechanism based on flow screening and respiratory rhythm confirmation. The first level of identification is that the airflow in the airflow pipeline collected by the flow sensor at a first sampling frequency is greater than the flow threshold. The second level of identification is that the airflow in the airflow pipeline collected by the flow sensor at a second sampling frequency conforms to the human respiratory rhythm. That is, the airflow under high sampling rate is verified in multiple dimensions through the composite logic of three conditions: periodicity, bidirectionality and reasonable peak value, so as to accurately distinguish real human breathing from various non-respiratory interferences at the hardware level.

[0047] Specifically, see Figure 4 As shown, the two-level judgment process based on initial flow screening and respiratory rhythm confirmation is as follows: In step S401, in the S0 standby state, the fan operates at the lowest duty cycle to maintain a slight positive pressure in the airflow duct, and the flow sensor performs low-power sampling at the first sampling frequency (e.g., 10Hz).

[0048] Step S402: Monitor in real time whether the airflow rate in the airflow duct collected by the flow sensor at the first sampling frequency is greater than the flow rate threshold; if so, enter the suspected wearing state in S1 and execute step S403; otherwise, return to step S401. The airflow rate in the airflow duct can be the effective value of the airflow rate within a set time window (e.g., 0.5 seconds). This effective value can be calculated by squaring, averaging, and then taking the square root of the instantaneous airflow rate within the set time window. This square root value reflects the overall energy intensity of the airflow within the current airflow duct and is independent of direction (both positive and negative breathing airflow will be squared to positive). The flow threshold is the product of the first trigger factor and the standby flow noise baseline. The standby flow noise baseline is defined without any external disturbances. In a quiet environment (patient not wearing a mask, tubing stationary, no wind), the measured background noise value is a factory calibration value, ranging from 0.5 to 1.0 L / min. It represents the inherent errors of the flow sensor itself, weak disturbances in the ambient airflow, etc. The first trigger factor is an empirically determined signal-to-noise ratio coefficient, ensuring that the initial screening is triggered only when the airflow intensity is significantly higher than the background noise value (i.e., signal-to-noise ratio > 3), avoiding misjudging noise as effective flow. It can be adjusted at the factory according to different models or usage environments, such as a first trigger factor of 3.

[0049] Specifically, If the condition is met, enter the suspected wearing state (S1) and execute step S403; otherwise, return to step S401. This indicates the effective value of airflow rate within a set time window (e.g., within 0.5 seconds); This indicates the first [time] within a set time window (e.g., within 0.5 seconds). The square of the instantaneous airflow rate at each sampling point; This represents the average of the squared values ​​of the instantaneous airflow rate at all sampling points within a set time window (e.g., 0.5 seconds). This represents the square root of the mean, also known as the root mean square value. Indicates the first trigger multiplier; This represents the standby flow noise baseline.

[0050] Step S403: Control the flow sensor to collect the airflow rate in the airflow pipeline at a second sampling frequency (e.g., 100Hz); wherein the second sampling frequency is higher than the first sampling frequency.

[0051] Step S404: Real-time monitoring of whether the airflow in the airflow pipeline collected by the flow sensor at the second sampling frequency has periodic characteristics; if yes, proceed to step S405; otherwise, return to step S401; specifically, based on whether there is an autocorrelation peak in the autocorrelation function value of each airflow in the set respiratory cycle, detect whether the airflow in the airflow pipeline has periodic characteristics in the set respiratory cycle.

[0052] Human respiratory airflow exhibits stable periodic characteristics. The respiratory cycle T of an adult at rest typically ranges from 2 to 6 seconds, while interference signals such as tubing vibration, external contact, or pet breathing lack this stable periodicity. This embodiment utilizes an autocorrelation function to quantify the periodic characteristics of airflow rate. The autocorrelation function measures the relationship between airflow rate and its own velocity over different time delays. The degree of similarity is determined for a length N airflow sequence sampled within a given respiratory cycle. Its autocorrelation function R(τ) is defined as , The autocorrelation function value at time delay τ, whose physical meaning is the nth airflow rate. In delay The degree of relevance between it and itself, that is, its relevance to the first airflow rate The degree of correlation. Within a set respiratory cycle, for example, within 2 to 6 seconds, calculate the flow rate of each airflow during the delay. If an autocorrelation function value exceeding the peak threshold is detected within the set respiratory cycle, i.e., an autocorrelation peak is detected within the set respiratory cycle, then the airflow rate is determined to have periodic characteristics within the set respiratory cycle; conversely, if no autocorrelation peak is detected within the set respiratory cycle, then the airflow rate is determined to not have periodic characteristics matching human respiration within the set respiratory cycle, and the possibility of it being caused by human respiration can be directly ruled out.

[0053] Wherein, the peak threshold is the product of the second triggering multiple and the time-delay-free autocorrelation value; the time-delay-free autocorrelation value is the autocorrelation function value of the airflow when it has no time delay (i.e., perfectly aligned), that is, the autocorrelation function value at time delay τ=0; the second triggering multiple is an empirically determined decision threshold, representing a certain delay If the value of the autocorrelation function exceeds a set multiple of the value of the autocorrelation function when it is perfectly aligned, the period is considered to be valid. For example, the second trigger multiple is 0.5, which ensures sufficient tolerance (the waveform of the breathing signal is not a perfect sine wave and there are variations) while eliminating random noise (the autocorrelation of noise will rapidly decay to close to 0 at τ≠0).

[0054] Specifically, R(τ) > 100000 within a given respiratory cycle. When R(0), it is determined that the airflow rate in the airflow pipeline has periodic characteristics within the set breathing cycle, and step S405 is executed; otherwise, return to step S401; where R(τ) represents the autocorrelation function value at time delay τ. R(0) represents the second trigger factor, which can be 0.5; R(0) represents the autocorrelation function value at time delay τ=0, i.e., the autocorrelation value without time delay.

[0055] Step S405: Real-time monitoring of whether the airflow in the airflow pipeline collected by the flow sensor at the second sampling frequency has bidirectional characteristics; if yes, proceed to step S406; otherwise, return to step S401; specifically, based on whether the proportion of positive airflow in each airflow within the set respiratory cycle is within a reasonable proportion range, detect whether the airflow in the airflow pipeline has bidirectional characteristics within the set respiratory cycle.

[0056] Human respiratory airflow exhibits a stable bidirectional characteristic, meaning that a complete respiratory cycle includes a forward flow rate during the inspiratory phase and a reverse flow rate during the expiratory phase, with both roughly equal in amplitude. This embodiment quantifies this bidirectionality by calculating the proportion of the forward airflow rate to the absolute value of the total flow rate within a given respiratory cycle. The specific formula is as follows:

[0057] in, This indicates the proportion of forward airflow. This represents the positive portion of the airflow (e.g., the intake phase flow rate). Indicates instantaneous airflow rate. This represents the sum of the absolute values ​​of all flow rate samples within the set respiratory cycle. For normal human respiration, the flow rate amplitudes during the inspiratory and expiratory phases are relatively balanced, and the proportion of forward airflow is usually within a reasonable range, such as 0.4 to 0.6. If this ratio is too low, for example below 0.3, it indicates that the airflow is mainly reverse-flowing, which does not conform to the bidirectional characteristics of normal respiration; if this ratio is too high, for example above 0.7, the airflow is mainly unidirectional, such as when the tubing is continuously blown or the fan output directly impacts the sensor, which also does not conform to the rhythm requirements of human respiration. In this embodiment, the reasonable proportion range is preset to 0.4 to 0.6, and the judgment is made... Whether the signal falls within this range is used to detect bidirectional characteristics. This range is based on clear physiological principles, corresponding to the approximate range of the ratio of inspiratory to expiratory time and flow rate during quiet breathing, and can effectively filter out unidirectional non-respiratory interference signals.

[0058] Step S406: Real-time monitoring of whether the airflow in the airflow pipeline collected by the flow sensor at the second sampling frequency has reasonable peak characteristics; if yes, proceed to step S407; otherwise, return to step S401; specifically, based on whether the peak airflow in each airflow within the set respiratory cycle is within a reasonable peak range, detect whether the airflow in the airflow pipeline has reasonable peak characteristics within the set respiratory cycle.

[0059] The peak airflow amplitude of human respiration is neither an infinitely small noise level signal nor an infinitely large forced ventilation signal. For example, in adults, the peak inspiratory flow rate at rest is generally between ten and thirty liters per minute. While small pets like cats and dogs have high respiratory rates, their absolute peak flow rate is usually below 3 liters per minute. However, instantaneous flow rate spikes caused by tubing movement or contact often exceed 40 liters per minute and are unpredictable. This embodiment sets a reasonable peak range, for example, by setting the absolute value of the peak flow rate... The airflow rate is limited to between 3 liters per minute and 40 liters per minute. The system extracts the maximum absolute value of the airflow rate within a set respiratory cycle as the peak airflow rate and determines whether this peak falls within the range of 3 liters per minute to 40 liters per minute. If the peak is below the lower limit, it may be noise or pet breathing; if the peak is above the upper limit, it may be an abnormal tubing opening or a shock event. Through this constraint, the system further eliminates non-human signals whose amplitude does not match human breathing characteristics.

[0060] Step S407: Determine whether the first set number of respiratory cycles has been reached; if yes, proceed to step S408; otherwise, increment the respiratory cycle count by 1 and return to step S404. That is, if the airflow rate in the airflow tube is detected to have periodic characteristics, bidirectional characteristics, and reasonable peak characteristics within the first set number of respiratory cycles, proceed to step S408; otherwise, return to step S404.

[0061] The initial number can be selected based on clinical experience and equipment sensitivity requirements, for example, set to 3 consecutive respiratory cycles. Assuming an average adult respiratory cycle of approximately 4 seconds, 3 cycles correspond to an observation time of about 12 seconds. This means the system needs to consistently detect the three characteristics of periodicity, bidirectionality, and reasonable peak values ​​in each cycle within a continuous 12-second time window before making a final confirmation that it "conforms to the human respiratory rhythm." This multi-cycle consistency constraint is designed to avoid misjudgments caused by transient, accidental respiratory waveforms. For example, blowing air through a tubing may briefly produce a seemingly periodic fluctuation, but it's difficult to simultaneously meet the strict constraints of all three dimensions over multiple consecutive cycles; while a pet's breathing may occasionally fall within a reasonable amplitude range, its respiratory cycle is typically shorter than 2 seconds, making it impossible to pass the periodic detection test for autocorrelation peak values ​​within the 2-6 second range; external force touching the tubing may exhibit bidirectionality in a single cycle, but it cannot present a stable respiratory cycle structure over multiple consecutive cycles.

[0062] Step S408: Determine that the airflow rate in the airflow tube matches the human breathing rhythm, and proceed to S2 to confirm the wearing status.

[0063] This embodiment constructs a highly reliable wearing confirmation mechanism at the hardware execution level by superimposing a three-condition composite logic with multi-cycle consistency verification. It filters out four typical interference scenarios from the root, namely, wind blowing through the tube (not satisfying the bidirectional characteristic), touching the mask (not satisfying the periodic characteristic), pet breathing (not satisfying the periodic characteristic, period <2s), and tube shaking (not satisfying the periodic characteristic, period is irregular). This suppresses the false trigger rate to an extremely low level and achieves a sensitive response to real wearing events within ten seconds.

[0064] Example 4 After step S100 controls the flow sensor to collect the airflow rate in the airflow pipeline at the second sampling frequency, this embodiment provides a rapid confirmation channel for mask wearing. This rapid channel achieves rapid confirmation of the wearing event by detecting the equivalent impedance step that occurs in the airflow pipeline at the moment of mask wearing. When the patient's breathing is extremely weak or the breathing pattern is irregular, causing the mask wearing confirmation channel based on human respiratory rhythm to require a longer continuous period to accumulate confidence, the impedance step identification of this embodiment can still sensitively and quickly lock the moment when the mask wearing is completed. Even in the face of non-human interference that affects the detection of human respiratory rhythm, as long as the mask is actually fastened to the face and causes a change in the physical state of the pipeline end, this rapid channel can make an independent decision, thereby significantly reducing the overall delay time of wearing detection and further enhancing the integrity and reliability of the solution.

[0065] Specifically, after the flow sensor is controlled to collect the airflow rate in the airflow duct at a second sampling frequency, the processing flow for the mask-wearing rapid channel is as follows: First, the equivalent impedance of the airflow duct is determined based on the airflow rate collected by the flow sensor at the second sampling frequency and the airflow pressure collected by the pressure sensor at the third sampling frequency. When the system enters the S1 suspected wearing state, the flow sensor and pressure sensor are already operating at high sampling rates (e.g., 100Hz) and the third sampling frequency (e.g., 1kHz), respectively, providing sufficient data density for real-time and accurate calculation of the duct equivalent impedance. In this embodiment, the duct equivalent impedance can be understood as a physical quantity characterizing the degree of obstruction to gas flow at the end of the airflow duct, and its value is dominated by the fit between the mask and the patient's face. When the mask is in an open state, the end of the duct is directly connected to the atmosphere, and the gas flow is almost unobstructed, maintaining a low baseline level for the equivalent impedance. However, when the patient fastens the mask to their face, the contact interface formed between the mask and the facial skin significantly throttles the airflow, causing a sudden increase in the duct outlet resistance, and the equivalent impedance subsequently shows a significant step increase within a very short time.

[0066] In this embodiment, the real-time calculation of equivalent impedance can be achieved in various ways. As an example, the equivalent impedance at the current moment can be obtained based on the ratio of the average airflow pressure collected by the pressure sensor to the average absolute value of the airflow rate collected by the flow sensor. Let the pressure value collected by the pressure sensor within a set time window at the third sampling frequency be denoted as... The absolute value of the flow rate collected by the flow sensor within the same time window at the second sampling frequency is Then the equivalent impedance can be expressed as the ratio of the average pressure value to the average absolute flow rate value, i.e. The larger this ratio, the higher the driving pressure required for the same flow rate, meaning a stronger obstruction to airflow at the end of the pipe. In the suspected wearing state (S1), the fan maintains its minimum duty cycle in standby mode, and the pressure at the pipe inlet is primarily determined by this slightly positive pressure background. Therefore, the change in equivalent impedance mainly reflects the change in the physical boundary conditions at the end of the pipe, rather than fluctuations in the fan's output capacity. Furthermore, those skilled in the art will understand that the calculation of equivalent impedance is not limited to the aforementioned ratio form. In other embodiments, methods such as transfer function estimation of pressure disturbance and flow response, least-squares system identification, or Kalman filtering can be used to track the dynamic changes in equivalent impedance in real time, as long as the impedance abrupt change at the moment of wearing can be sensitively captured.

[0067] Secondly, based on whether the instantaneous change factor of the equivalent impedance relative to the reference equivalent impedance is greater than a multiple threshold, the presence of a step characteristic in the equivalent impedance of the airflow pipeline is detected. Reference equivalent impedance This refers to the reference impedance value corresponding to the pipeline in a known open or unworn state. The reference equivalent impedance can be determined in different ways. For example, during the system's factory calibration phase, a nominal reference impedance value can be calculated and stored using the method described above, under the condition that the face mask is clearly in an open, unworn state. This value reflects the inherent impedance level of a specific piping assembly and mask type under standard atmospheric conditions. Alternatively, the system can use the statistical mean or moving average of the equivalent impedance calculated over the most recent period as the reference value after each time it enters standby mode and has undergone a sufficiently long settling period. This enables dynamic updating and adaptive calibration of the reference impedance, eliminating slow drift caused by factors such as ambient temperature, altitude, and pipeline aging.

[0068] When the patient wears a mask Compared to Sudden changes can occur. This embodiment compares the instantaneous change factor. The magnitude of the multiplier threshold is used to determine whether a step-like characteristic occurs. In one implementation, the multiplier threshold can be set to 1.8. This value is based on the analysis of the magnitude of the physical change in impedance before and after wearing the mask: when the mask changes from a completely open state to a face-fitting state, the end of the tube changes from a free opening with a large cross-sectional area and low resistance to a restricted channel formed by the narrow gap between the mask and the skin and the internal cavity of the mask, and the outlet resistance usually increases several times. Through actual measurement and statistical analysis of different mask types and wearing methods, the equivalent impedance change factor at the moment of wearing is more than twice in most cases, while the impedance change caused by local bending of the tube or slight displacement of the mask position due to the patient turning over in bed is usually no more than 1.5 times. Therefore, setting the multiplier threshold to 1.8 can reliably trigger the judgment when the wearing event occurs, and can exclude the slow impedance drift caused by changes in body position in the non-wearing state from the step judgment. In other implementations, the multiplier threshold can also be adjusted to a value between 1.5 and 2.5 based on the specific piping structure, mask model, and fan characteristics to suit different system configurations.

[0069] Finally, if a step-like characteristic is detected in the equivalent impedance of the airflow tubing within a second number of respiratory cycles, the mask wearing is confirmed to be complete. This second number can be the same as or different from the first number, typically ranging from one to three respiratory cycles. Once the mask fastens and causes a step in equivalent impedance, as long as the patient maintains the mask-wearing state for several subsequent respiratory cycles, the tubing end will maintain a consistently high impedance level. Therefore, continuous detection of the step-like characteristic within the second number of respiratory cycles eliminates transient pseudo-step events such as the mask being touched and then detached momentarily. Since the impedance step caused by mask wearing occurs on a timescale of seconds or even sub-seconds, this rapid channel can confirm complete wearing after detecting the impedance step and verifying its continuity within a few respiratory cycles. The entire process is extremely short, typically within a few seconds. Compared to the more than ten seconds of detection time relying solely on the three conditions of respiratory rhythm, this significantly reduces the detection delay, allowing the system to almost simultaneously sense and initiate the subsequent ramp-up process as soon as the patient puts on the mask, greatly improving the immediate user experience.

[0070] It should be noted that this impedance step rapid channel and the mask wearing confirmation channel based on human respiratory rhythm can operate in parallel. In practical applications, when entering the S1 suspected wearing state, both channels can simultaneously receive high-sampling-rate flow and pressure data and perform their own independent decision calculations: impedance step channel monitoring... The system analyzes the periodic, bidirectional, and peak characteristics of airflow through the respiratory rhythm channel. Once either channel first meets its confirmation condition and outputs a wearing completion signal, the system enters the S2 confirmation wearing state and initiates the fan pressurization process. This dual-channel parallel redundancy design allows the other channel to continue providing identification capability when the sensitivity of a single channel is insufficient due to extreme operating conditions, thus giving the overall solution robustness under a wider range of operating conditions.

[0071] Example 5 In step S200, after controlling the fan to gradually increase its duty cycle from the lowest level in standby mode to the target duty cycle corresponding to the target treatment pressure and gradually enter the treatment state, this embodiment further explains how the system maintains and regulates the pressure in the treatment state. In S2, during the confirmed wearing state, the fan gradually increases its duty cycle from the lowest level in standby mode to the target duty cycle corresponding to the target treatment pressure. This process is the confirmation of wearing to the ramp-up process. During this process, the fan control is in open-loop mode, meaning the duty cycle climbs according to a predetermined time curve to a preset initial target treatment pressure corresponding to the target duty cycle, and then enters the treatment state. Once in the treatment state, the fan control strategy transitions to closed-loop control mode to ensure that the output pressure can accurately match the patient's constantly changing physiological needs in real time throughout the entire nighttime treatment process.

[0072] Specifically, during treatment, a closed-loop control strategy is used to dynamically adjust the target duty cycle of the fan; the closed-loop control strategy includes the following steps: First, the target treatment pressure is dynamically updated based on the airflow rate in the airflow tubing collected by the flow sensor at a second sampling frequency and the airflow pressure in the airflow tubing collected by the pressure sensor at a third sampling frequency. This target treatment pressure is not a fixed value set at the start of treatment and then remains unchanged, but rather a dynamic target value that is continuously adjusted in real-time by the ventilator's built-in algorithm based on continuous monitoring of the patient's respiratory status. During treatment, both the pressure and flow sensors maintain high sampling rates, providing a high-resolution data foundation for dynamic pressure adjustment.

[0073] The triggering conditions for dynamically updating the target treatment pressure include, but are not limited to, the detection of various respiratory events. In this embodiment, respiratory events refer to abnormal respiratory events such as apnea, hypopnea, and snoring that occur during sleep. The airflow rate collected by the flow sensor at a second sampling frequency can sensitively reflect the waveform characteristics of a single breath, such as the flattening of the inspiratory flow rate curve and the attenuation trend of instantaneous peak values. When a characteristic pattern corresponding to apnea or hypopnea is detected from the continuous flow waveform, a corresponding respiratory event is determined, and an instruction to adjust the target treatment pressure upwards is generated to provide higher positive airway pressure to open the collapsed upper airway. Conversely, if no respiratory event is detected for a continuous period and the respiratory waveform remains stable and regular, the target treatment pressure can be gradually adjusted downwards to reduce the average pressure experienced by the patient while ensuring airway patency, thereby improving treatment comfort. Furthermore, pressure oscillations at specific frequencies in the airflow rate caused by snoring, and instantaneous flow rate changes caused by coughing or body movement, can also serve as auxiliary criteria for dynamically adjusting the treatment pressure, making the pressure regulation strategy more diverse and personalized. It should be understood that the aforementioned respiratory event detection algorithm based on flow waveform can be implemented in various ways, such as time-domain criteria based on thresholds, pattern recognition based on fuzzy logic, or classifiers based on machine learning, as long as it can generate pressure regulation commands that conform to clinical logic based on changes in the patient's respiratory state. The pressure signal collected by the pressure sensor serves two purposes: firstly, as feedback for calculating the actual output pressure and participating in pressure closed-loop control; and secondly, as an aid in identifying pressure anomalies caused by tubing bends, changes in mask fit, etc., thereby further correcting the dynamic update direction of the target treatment pressure.

[0074] Secondly, based on the dynamically updated target treatment pressure, the target duty cycle of the blower is dynamically adjusted. In the closed-loop treatment strategy, the target duty cycle is no longer determined by a fixed time curve, but rather serves as a follower of the dynamically updated target treatment pressure. A definite mapping relationship exists between the blower speed duty cycle and the pipeline output pressure. This relationship can be described by a pre-calibrated pressure-duty cycle curve, or it can be solved online by a PID controller or other real-time feedback control algorithms. When the target treatment pressure is corrected upwards due to the aforementioned respiratory event detection, the target duty cycle of the blower is immediately increased, driving the BLDC blower to output greater flow and pressure at a higher speed, allowing the actual pressure in the pipeline to quickly and smoothly track the new target treatment pressure. Conversely, when the target treatment pressure is corrected downwards, the target duty cycle also decreases accordingly, and the blower's operating power consumption and noise are reduced accordingly. This dynamic tracking of the treatment pressure by the duty cycle achieves "on-demand supply" of pressure output, making the treatment process no longer a rigid open-loop output, but a closed-loop control with intelligent sensing and adaptive capabilities.

[0075] It is particularly important to note that throughout the entire execution of the aforementioned closed-loop control strategy, the flow sensor and pressure sensor maintain high sampling rate operation modes at the second and third sampling frequencies, respectively, without reducing data acquisition density despite entering the treatment phase. This design aims to provide millisecond-level real-time response capabilities for the accurate determination of respiratory events and closed-loop pressure regulation, and also lays a solid data foundation for the anomaly monitoring—such as real-time identification of large air leaks, accidental dislodgement, and intentional removal events—described in detail in subsequent embodiments. Through this embodiment, the system constructs a complete logical closed loop from "open-loop pressure boost" upon confirmation of wear to "closed-loop treatment" after treatment begins. This ensures that the entire ventilator control process is rapid and smooth during startup, intelligent and precise during maintenance, and maintains high sensitivity to changes in tubing status throughout the entire process.

[0076] Example 6 This embodiment provides a mechanism for identifying and responding to three interruption scenarios during S3 treatment. Specifically, when the closed-loop control strategy is operating normally during treatment, the system continuously monitors for interruption events based on the airflow rate in the airflow duct collected by the flow sensor at a second sampling frequency and the airflow pressure in the airflow duct collected by the pressure sensor at a third sampling frequency. Upon detecting an interruption event, the system executes the corresponding interruption response strategy. Within this general anomaly monitoring framework, a three-scenario identification logic is further constructed, specifically subdividing interruption events into large air leakage events, suspected detachment events, and intentional removal events, and implementing differentiated response strategies for each scenario. See also... Figure 5As shown, the identification and response mechanism for the three interruption scenarios in the S3 treatment state includes the following steps: In step S501, during the treatment state in S3, the flow rate in the airflow tube collected by the flow sensor at the second sampling frequency is monitored in real time to see if it conforms to the human respiratory rhythm; if so, the human respiratory signal is determined to be normal and step S501 is maintained; if not, the human respiratory signal is determined to be abnormal and step S502 is executed.

[0077] Step S502: Detect whether the air pressure in the airflow pipeline collected by the pressure sensor at the third sampling frequency has dropped to the first pressure threshold (e.g., 0); if yes, proceed to step S503; if no, proceed to step S508.

[0078] Step S503: Obtain the current time of the RTC. If the current time is within the sleep time interval, proceed to step S504. If the current time is within the non-sleep time interval, proceed to step S505.

[0079] Step S504: Determine if a suspected detachment event has occurred, control the fan to reduce its duty cycle from the target to the minimum duty cycle, and control the flow sensor to reduce its sampling frequency from the second to the first sampling frequency, and enter the first interrupt waiting window; wherein, the suspected detachment event covers both accidental detachment events (such as the mask being accidentally knocked off) and nighttime removal events, the determination conditions for the two scenarios are the same, and the response strategies are the same.

[0080] Step S505: Determine that an intentional removal event has occurred, control the fan to reduce its duty cycle from the target duty cycle to the minimum duty cycle, and control the flow sensor to reduce its sampling frequency from the second sampling frequency to the first sampling frequency, and enter the second interrupt waiting window.

[0081] Step S506: If the mask is detected to be re-worn within the first or second interruption waiting window, the fan is quickly restored from the lowest duty cycle to the target duty cycle before the suspected detachment event or intentional removal event, and then the process enters the treatment state in step S3. Otherwise, step S507 is executed. The second interruption waiting window is much smaller than the first interruption waiting window. For example, the first interruption waiting window is 10-15 minutes and the second interruption waiting window is 30 seconds.

[0082] Step S507: Switch to standby mode. When the duration of standby mode is not less than the duration threshold, enter ultra-low power mode.

[0083] In step S508, when the air pressure in the airflow pipeline drops to a level not lower than the second pressure threshold and exhibits periodic characteristics, a major air leakage event is determined to have occurred. The target duty cycle of the fan is dynamically adjusted using a closed-loop control strategy, and a leakage compensation operation is performed simultaneously. The user is then prompted to check the mask sealing status.

[0084] Specifically, the identification and response mechanisms for the three interruption scenarios in S3 treatment include the following three situations: The first scenario: If the airflow rate in the airflow pipeline collected by the flow sensor at the second sampling frequency does not conform to the human respiratory rhythm, and the airflow pressure in the airflow pipeline collected by the pressure sensor at the third sampling frequency drops below the first pressure threshold, and the current time is within the sleep time interval, then a suspected detachment event is determined to have occurred.

[0085] The second scenario: If the airflow rate in the airflow pipeline collected by the flow sensor at the second sampling frequency does not conform to the human respiratory rhythm, and the airflow pressure in the airflow pipeline collected by the pressure sensor at the third sampling frequency drops below the first pressure threshold, and the current time is within the non-sleep time interval, then it is determined that an intentional removal event has occurred.

[0086] The first pressure threshold is set more stringently than the second pressure threshold, meaning the second pressure threshold is greater than the first. The first pressure threshold can be approximately 0.1 times the target treatment pressure or an absolute pressure value close to zero. When the tubing pressure suddenly drops below the first pressure threshold, it indicates that the mask has been completely removed from the face, and the tubing end has essentially returned to a state of direct connection with the atmosphere. Simultaneously, the airflow will undergo a characteristic abrupt change, instantly transforming from a periodic bidirectional respiratory waveform during treatment to a continuous high-flow unidirectional pulse or a stable high-flow output, i.e., an open tubing characteristic. The physical reason for this abrupt change is that after the mask is removed, the fan load disappears instantly, the back pressure drops sharply, and the flow rate at the tubing outlet surges dramatically before the fan speed changes significantly. Furthermore, because it is no longer modulated by the patient's breathing movements, the airflow loses its original periodic structure and directional changes.

[0087] After confirming that the flow rate change is characteristic of an open tubing and the pressure is close to zero, the system uses the current time provided by the RTC real-time clock to identify the intent. Mask removal during the early morning hours (e.g., between 0:00 and 5:00) is highly likely due to a brief need to get out of bed for urination or water, rather than a genuine intention to end the night's treatment; therefore, this time period is preset as the sleep time interval. Pressure zeroing and flow rate changes occurring within this interval are prioritized by the system as suspected detachment events. Conversely, if the current time has entered the early morning hours (e.g., after 5:00), mask removal is more likely to indicate that the patient has woken up and decided to end their sleep; therefore, this time period is preset as the non-sleep time interval. The same physical changes occurring within this interval are prioritized by the system as intentional removal events. It should be noted that the specific dividing points between the sleep and non-sleep time intervals can be personalized according to the patient's individual sleep patterns, and are not limited to 5:00 in the example above. For example, for patients who are accustomed to waking up early, it can be earlier, at 4:00; for patients who are accustomed to waking up late, it can be later, at 6:00 or even 7:00.

[0088] Regardless of whether the event is ultimately diagnosed as a suspected detachment or intentional removal, upon determining whether a suspected detachment or intentional removal event has occurred, the system immediately executes energy-saving safety actions: the fan's duty cycle is reduced from the current target duty cycle to the minimum duty cycle in standby mode, and the flow sensor's sampling frequency is reduced from the second sampling frequency to the first sampling frequency. This rapidly lowers the fan's duty cycle to the minimum maintenance level, preventing noise and discomfort caused by high-pressure airflow directly spraying after the mask detaches, and significantly reducing fan power consumption, allowing it to enter a low-power monitoring state rather than completely shutting down. This preserves a weak positive pressure baseline in the pipeline, providing the necessary physical conditions for rapid sensing during subsequent re-wearing. Simultaneously, the flow sensor's sampling rate returns to the first sampling frequency, reducing the MCU's computational load and sensor power consumption simultaneously, entering an energy-saving configuration of interrupt waiting. The subsequent rapid recovery process and ultra-low-power mode will be described in detail in later embodiments.

[0089] The third scenario: If the airflow rate in the airflow pipeline collected by the flow sensor at the second sampling frequency does not conform to the human respiratory rhythm, and the airflow pressure in the airflow pipeline collected by the pressure sensor at the third sampling frequency drops to a level not lower than the second pressure threshold and has a periodic characteristic, then a major air leak event is determined to have occurred.

[0090] The large air leak scenario described here is fundamentally different from a true mask detachment or removal: when the mask shifts laterally across the patient's face, becomes loose but still partially adhered, or a gap appears at the tubing connection, the pressure inside the tubing will decrease due to gas leakage. However, because the mask is not completely removed from the face, the patient's breathing movements can still generate detectable weak periodic pressure fluctuations and airflow signals within the tubing. Therefore, the pressure will not suddenly drop to near zero. The second pressure threshold mentioned in this embodiment is a pressure criterion used to distinguish between a large air leak and complete detachment. Its specific value can be set as a certain proportion of the current target treatment pressure, such as about 0.3 times the target treatment pressure, so that above this threshold, even if the pressure is low, the system can still capture residual respiratory modulation information. The periodic characteristics can be verified by the aforementioned autocorrelation function calculation method. As long as there is still an autocorrelation peak within one or more consecutive respiratory cycles, it can be confirmed that the patient's mask is still partially connected to the airway, and the respiratory airflow can still act on the sensor.

[0091] When a major air leak event is detected, the system does not perform the safety actions of reducing the duty cycle or sampling frequency. Instead, it remains in the S3 treatment state, continuing to execute the closed-loop control strategy to dynamically update the target treatment pressure and target duty cycle. Simultaneously, it activates the leak compensation mechanism, actively increasing the fan output to compensate for the pressure loss in the pipeline caused by the leak, ensuring that the pressure actually felt by the patient is as close as possible to the target treatment pressure. At the same time, the system prompts the user to adjust the mask seal promptly via LCD display, buzzer sound, or Bluetooth notification to the mobile terminal. The technical advantage of this strategy is that air leaks caused by poor mask sealing are common but easily correctable transient events in clinical practice. Treating them the same as genuine mask detachment and directly interrupting treatment would unnecessarily disrupt the patient's sleep and treatment continuity. By combining leak compensation and user prompts, the treatment effect is maintained while avoiding sleep interruptions caused by accidental triggering.

[0092] This embodiment utilizes a three-scenario discrimination decision tree based on "flow characteristics + pressure close to zero + RTC time" to handle abnormal events during treatment. Instead of a blanket delayed shutdown, it accurately distinguishes between three clinically significant scenarios at the hardware level: large air leaks, nighttime dislodgement (including accidental dislodgement and removal upon waking), and intentional removal. In the case of large air leaks, the system maintains treatment and actively compensates to prevent erroneous interruptions due to poor sealing. In the case of nighttime dislodgement, the system slows down, waits, and provides a quick recovery path for re-wearing, avoiding the need to endure a full ramp wait after returning to bed at night, thus maintaining treatment continuity. In the case of intentional removal, the system promptly terminates the session upon confirmation, avoiding unnecessary waiting and energy waste. This refined discrimination logic, using time as a weighted basis for intent, makes the automated control of home ventilators not only responsive but also more closely aligned with the patient's actual physiological rhythm and lifestyle.

[0093] Example 7 In the S3 treatment state, after a suspected dislodgement event (including accidental dislodgement and nighttime removal) or intentional removal event is detected, this embodiment elaborates on the monitoring behavior during the interruption and the recovery strategy when the mask is detected to be put back on. See Figure 6 As shown, the short-term interruption power-saving wait and seamless recovery mechanism includes the following steps: Step S601: In the treatment state of S3, after detecting a suspected detachment event (including accidental detachment event and nighttime removal event) or intentional removal event, the process enters the suspected detachment state of S4.

[0094] Step S602: Control the fan to reduce its duty cycle from the target duty cycle to the minimum duty cycle, and control the flow sensor to reduce its sampling frequency from the second sampling frequency to the first sampling frequency, while simultaneously entering an interruption waiting window with a preset duration. This interruption waiting window is either the first interruption waiting window corresponding to a suspected detachment event, or the second interruption waiting window corresponding to an intentionally removed event; the second interruption waiting window is much smaller than the first interruption waiting window.

[0095] Step S603: Within the interrupt waiting window, monitor whether a re-wearing event has occurred based on the airflow rate in the airflow duct collected by the flow sensor at the first sampling frequency and the airflow pressure in the airflow duct collected by the pressure sensor at the third sampling frequency. If no re-wearing event is detected within the interrupt waiting window, proceed to step S604. If a re-wearing event is detected within the interrupt waiting window, proceed to steps S605-S607.

[0096] Specifically, the blower has been controlled to reduce its duty cycle from the target level to the lowest duty cycle in standby mode. Only a weak positive pressure baseline is maintained within the ductwork as the physical basis for pressure detection, instead of outputting therapeutic-grade high-pressure airflow. This keeps the blower's power consumption and operating noise at extremely low levels. The flow sensor has also been reduced from a second sampling frequency, such as 100Hz, back to a first sampling frequency, such as 10Hz, significantly reducing the MCU's computational load and the polling density of flow data. Meanwhile, the pressure sensor can still operate at a third sampling frequency, for example, at a sampling rate of 1kHz, or its effective sampling period can be appropriately reduced according to energy-saving requirements. This further reduces the overall power consumption of the sensing channel while maintaining sufficient sensitivity to changes in duct pressure. In this "reduced-speed monitoring" configuration, the core task of continuously and lightly processing airflow and pressure is to determine whether the patient has put the mask back on their face. The physical characteristics of re-wearing are similar to those of initial wear: after the mask re-fits the face, the end of the tubing changes from a nearly completely open state to a partially sealed state, resulting in a step-like increase in pressure. The flow rate also gradually recovers from the high flow rate state of the open tubing without modulation characteristics to a bidirectional fluctuation characteristic modulated by respiratory movements. The aforementioned methods for confirming human respiratory rhythm and identifying the step-like change in equivalent impedance can both be used to identify re-wearing events at this stage. However, because the fan maintains its lowest duty cycle and the pressure baseline is low, the relevant thresholds and criteria can be adaptively adjusted according to the current fan speed to ensure accurate detection of the re-wearing signal even under low-pressure conditions.

[0097] Step S604: Return to standby mode, and switch to ultra-low power mode when the duration of standby mode is detected to be not less than the duration threshold.

[0098] Step S605: Read the target treatment pressure prior to the occurrence of the suspected detachment event or intentional removal event from the current session area of ​​the SPI Flash.

[0099] Step S606: The target therapeutic pressure is dynamically calculated using a first-order exponential recovery algorithm.

[0100] Step S607: Based on the target treatment pressure obtained by dynamic calculation, the target duty cycle of the fan is gradually adjusted until the target treatment pressure obtained by dynamic calculation reaches the target treatment pressure before the suspected detachment event or intentional removal event occurs, and then the treatment state in step S3 is entered.

[0101] Specifically, when a re-wearing event is detected, a recovery process (including steps S605-S607) is immediately initiated. This recovery process does not simply reset the target duty cycle of the fan to the target duty cycle corresponding to the target treatment pressure before the interruption. Instead, it uses a first-order exponential recovery algorithm to dynamically calculate the target treatment pressure and, based on the dynamically calculated target treatment pressure, gradually adjusts the target duty cycle of the fan until the dynamically calculated target treatment pressure reaches the target treatment pressure before the suspected detachment event or intentional removal event.

[0102] Among them, the first-order exponential recovery algorithm, as a deterministic and smooth target value generation strategy, defines the transition process of target treatment pressure from the current low level to the pre-interruption level as an asymptotically approximating exponential curve, rather than a step jump.

[0103] In one implementation, the first-order exponential recovery algorithm dynamically calculates the target therapeutic pressure according to the following formula:

[0104] Where t represents the current time; This represents the target therapeutic pressure calculated at time t; This indicates the target treatment pressure prior to a suspected detachment or intentional removal event. This value was recorded in non-volatile memory, such as the current session area maintained by the SPI Flash, prior to the suspected detachment or intentional removal event, and can be read from the current session area maintained by the SPI Flash. This indicates the moment when the re-wearing event is confirmed, i.e., the starting point of the recovery process; This represents the time constant of the first-order exponential recovery algorithm, and its physical meaning is the time constant as the target treatment pressure rises from 0 to... The time required for 63.2% of the pressure recovery determines the rate and smoothness of pressure recovery.

[0105] Specifically, time constant Numerically, it is set to be much shorter than the duration of the Ramp procedure. For example, the Ramp duration at the start of the initial treatment is configured between 5 and 15 minutes to accommodate the patient's gradual adaptation from wakefulness to sleep, with a time constant estimated based on an equivalent first-order response in the range of tens of seconds to several minutes. In this embodiment, however, the time constant... The recovery time constant can be set to 15 seconds or less, such as 10 seconds, 20 seconds, or other user-adjustable values ​​between 5 and 30 seconds. This setting has a clear physiological basis: for patients who experience a short interruption and re-wear the mask, their airway has already been opened and adapted to a certain extent during the treatment process before the interruption, and the patient is usually in a sleep or semi-sleep state at this time, so they do not need to go through a long adaptation process again. The shorter recovery time constant allows the treatment pressure to quickly rise back to the pre-interruption level within tens of seconds, achieving a "seamless recovery" of treatment after an interruption. This makes the patient almost unaware of the discontinuity in treatment pressure, greatly ensuring the continuity and comfort of treatment. At the same time, because the recovery process follows an exponential curve, the pressure increases the fastest in the initial stage and then gradually flattens out. This avoids the instantaneous feeling of suffocation that may be caused by a sudden increase in pressure, achieving an organic unity of speed and smoothness.

[0106] Furthermore, as the dynamically calculated target treatment pressure gradually increases, the target duty cycle of the blower also increases accordingly. The duty cycle adjustment can be performed in an open-loop manner based on a pre-calibrated pressure-duty cycle mapping relationship, or it can use feedback control algorithms such as PID control, with the actual pressure signal as the feedback quantity for closed-loop tracking, ensuring that the actual pressure in the pipeline stably matches the dynamically increasing target treatment pressure curve. When the dynamically calculated target treatment pressure reaches... When the target treatment pressure equals that before the suspected detachment event or intentional removal event, the first-order exponential recovery process ends, and the system re-enters the S3 treatment state under the closed-loop control strategy, restoring the dynamic updating of the target treatment pressure and the closed-loop control of the fan. The entire recovery process is smooth, continuous, and requires no additional human intervention.

[0107] This embodiment uses a combination strategy of energy-saving monitoring and exponential rapid recovery within the interruption waiting window to confine the "interruption-wait-recovery" process within a framework that is extremely short in time, extremely low in power consumption, and extremely smooth in terms of user experience. This makes the brief time spent out of bed appear as a seamless treatment pressure depression at the electrical level, rather than a complete treatment restart.

[0108] Example 8 As mentioned earlier, if no re-wearing event is detected within the interrupt waiting window, the system reverts to standby mode. If the duration of standby is not less than a threshold, it switches to ultra-low power mode. That is, if no re-wearing event is detected within the interrupt waiting window, the system does not shut down directly or permanently, but rather gradually enters deep sleep mode according to a progressively lower power consumption strategy. It retains the ability to be awakened again by the patient's wearing action and resume treatment, thus forming a complete closed-loop chain of "ultra-low power standby - wake-up - retreatment". For details, see [link to relevant documentation]. Figure 7 As shown, the ultra-low power standby mechanism includes the following steps: Step S701: If no re-wearing event is detected within the interrupt waiting window, return to the S0 standby state.

[0109] Step S702: When it is detected that the duration of the S0 standby state is not less than the duration threshold, that is, when the duration of the airflow in the airflow pipeline collected by the flow sensor at the first sampling frequency in the S0 standby state is not greater than the flow threshold, step S703 is executed.

[0110] Step S703: Switch to ultra-low power mode. In ultra-low power mode, the MCU enters stop mode (i.e., STOP mode), the main clock and I2C clock are turned off, the fan and the flow sensor stop running, and only the ADC periodically wakes up the pressure sensor to collect the airflow pressure in the airflow pipeline.

[0111] In step S704, when the airflow pressure in the airflow duct jumps to a level greater than the human breathing pressure threshold, the MCU is woken up, the main clock and I2C clock are restored, and the system enters the S1 suspected wearing state. The flow sensor is then controlled to collect the airflow rate in the airflow duct at the second sampling frequency.

[0112] In step S705, when the flow rate in the airflow pipeline collected by the flow sensor at the second sampling frequency is found to be in line with the human respiratory rhythm, the fan is controlled to gradually increase from the lowest duty cycle in the standby state to the target duty cycle corresponding to the target treatment pressure in order to gradually enter the treatment state in step S3.

[0113] Specifically, during the interruption waiting window, the airflow and air pressure are continuously monitored at a low sampling rate. If no re-wearing event is detected during the interruption waiting window, it means that the patient has most likely left and will not return to continue using the device in the short term. At this time, the system enters the S0 standby state: the fan maintains operation at the lowest duty cycle to provide a micro-positive pressure baseline for the pipeline, the flow sensor continuously collects airflow at the first sampling frequency, and the MCU, I2C communication peripherals, ADC, etc. are all in normal working condition or can be quickly woken up. The power consumption of the whole machine has decreased significantly compared to the treatment phase, but the high-speed clock of the MCU, digital communication interface, etc. are still in operation, and the power consumption is still maintained at the level of several watts.

[0114] Based on this, when the duration of the standby state is detected to be no less than a certain threshold, the system switches to ultra-low power mode. In ultra-low power mode, the MCU enters a stop mode (STOP mode), the main clock and I2C clock are turned off, the fan and flow sensor stop operating, and only the ADC periodically wakes up the pressure sensor to collect the airflow pressure in the airflow duct. This step is crucial for further reducing system power consumption to its limit. Ultra-low power mode refers to the MCU being in a deeper sleep state than normal standby, such as the STOP mode of the STM32 series microcontroller. In this mode, the MCU's internal main clock (high-speed clocks such as PLL and HSE) is turned off, the CPU core stops executing instructions, and all digital communication peripherals that rely on high-speed clocks, such as I2C, stop working; only the RTC real-time clock and some low-power analog circuits continue to operate. The fan no longer maintains a minimum duty cycle but completely stops operating, the slight positive pressure in the duct disappears, and the fan power consumption drops to almost zero. In this deep sleep state, the power consumption of the entire system can be reduced to 0.1 watts or even lower, which is more than 95% lower than the power consumption of the fan required to maintain the micro-positive pressure of the pipeline during standby (about 2 to 5 watts).

[0115] In standby mode, the I2C bus remains active, allowing the MCU to read the digital signal output from the flow sensor at any time. Therefore, flow rate is used as the primary sensing dimension for wear detection—because airflow is extremely sensitive to airflow disturbances caused by the patient touching the mask or breathing, and can be captured in the early stages of the wearing action. However, in ultra-low power mode, the I2C bus becomes completely ineffective due to the high-speed clock stopping, and the MCU cannot actively poll the digital flow sensor data, making airflow-based detection physically impractical. Nevertheless, the MCU's ultra-low power mode is not entirely isolated from the outside world; it still has the ability to be woken up by external events: the analog voltage signal output from the pressure sensor can be continuously compared with a preset reference voltage using an analog comparator or low-power voltage threshold detection circuit independent of the high-speed clock. When the pressure signal jumps and exceeds the preset human respiratory pressure threshold due to the patient picking up the mask, the mask fitting against the face, or the patient breathing into the mask, the comparator output will generate a digital level toggle. This toggle signal can be directly connected to the MCU's EXTI external interrupt pin, triggering the MCU to wake up from STOP mode, restart the high-speed clock, and restore all peripheral functions.

[0116] In ultra-low power mode, the system periodically and briefly wakes up the ADC to collect pressure signals according to a set wake-up interval. This "intermittent listening" mechanism balances power consumption and response speed. The wake-up interval can be set as a trade-off between battery life requirements and response sensitivity requirements; for example, it can be set to wake up once every 2 seconds. During each wake-up, the MCU temporarily activates the ADC to perform one or several high-speed samples of the pressure sensor, reads the current pressure value in the tubing, and compares it with the human respiratory pressure threshold. If no valid change is detected, it immediately re-enters STOP mode. Since the MCU is in a shutdown state most of the time, the working time during the wake-up period is extremely low, so the average power consumption is controlled at a very low level. The human respiratory pressure threshold is used to distinguish between valid wearing behavior and sporadic environmental pressure fluctuations. Because after the mask fits the face, even if the fan stops completely, the patient's own breathing will generate small alternating positive and negative pressure fluctuations in the mask cavity and tubing, with an amplitude usually between a few centimeters and several centimeters of water column. This amplitude is much greater than the slow drift of ambient atmospheric pressure. When a patient picks up the mask and begins to wear it in ultra-low power mode, or has already worn it and is breathing into the mask, the pressure signal will produce a significant jump that exceeds the human breathing pressure threshold, thus reliably indicating the occurrence of a human-computer interaction event.

[0117] When the airflow pressure in the airflow duct is detected to jump to a level exceeding the human respiratory pressure threshold, the flow sensor is controlled to collect the airflow rate in the airflow duct at a second sampling frequency. When the MCU is awakened by the pressure jump, the system does not immediately assume the treatment is complete and restart; instead, it first performs a "frequency upsampling" action: the MCU immediately and completely recovers from STOP mode, restarts the high-speed clock and digital communication peripherals such as I2C, and switches the flow sensor's sampling frequency from the first sampling frequency before shutdown to a higher second sampling frequency to obtain high-resolution flow data. This frequency upsampling step aims to provide a data foundation for subsequent fine-tuning, which is consistent with the logic of the initial flow screening triggering high-speed sampling in step S301. The only difference is that this "coarse screening" trigger signal originates from a pressure jump rather than a flow threshold. The fundamental reason for this is the hardware limitation that the flow sensor is unavailable while the pressure sensor is available in the aforementioned ultra-low power mode.

[0118] When the flow rate in the airflow duct, sampled by the flow sensor at the second sampling frequency, is detected to match the human respiratory rhythm, the fan is controlled to gradually increase from the lowest duty cycle in standby mode to the target duty cycle corresponding to the target treatment pressure, thus gradually entering the S3 treatment state. After the flow sensor frequency is increased, the system's confirmation logic is completely consistent with the aforementioned three-condition composite judgment: periodic characteristics are detected through autocorrelation function, bidirectional characteristics are detected through the proportion of positive airflow, and reasonable peak characteristics are detected through peak amplitude. When all three conditions are met in multiple consecutive respiratory cycles, it is finally confirmed that the airflow in the airflow duct comes from real human respiration rather than environmental noise. After confirmation, the system starts the fan from the lowest duty cycle in standby mode and gradually climbs along the preset Ramp pressure rise curve to the target treatment pressure, smoothly entering the S3 treatment state.

[0119] This embodiment constructs a complete chain of "degraded standby - deep hibernation - pressure wake-up - frequency boost confirmation - voltage boost treatment". When there is no wearing behavior for a long time, the system can compress its own power consumption to a level close to the physical limit. When the patient picks up the mask again to wear it, it can still be woken up within a few seconds and quickly resume treatment, achieving an ideal balance between extremely low standby power consumption and high sensitivity wear detection.

[0120] Example 9 In step S302, after the fan gradually increases from the lowest duty cycle in standby mode to the target duty cycle corresponding to the target treatment pressure to enter the treatment state (S3), this embodiment further introduces a data maintenance mechanism for session continuity management. By structurally recording events throughout the treatment process, it provides a complete technical implementation path from raw data to a full report for the important medical indicator of clinical "compliance assessment." See also... Figure 8 As shown, the data maintenance mechanism based on session continuity management includes the following steps: Step S801, S3: Initiation of treatment status.

[0121] Step S802: Create the current session area and record the session start time.

[0122] Step S803: Periodically write various treatment parameters, various respiratory events and their durations, and various interruption events and their durations into the current session area maintained by the SPI Flash according to the set recording time interval (e.g., every minute); among them, respiratory events include sleep apnea events, snoring events, hypopnea events, etc.; interruption events include large air leakage events, suspected dislodgement events, re-wearing events, and intentional removal events.

[0123] Step S804: The system detects that the device has entered the suspected detachment / removal state (S4).

[0124] Step S805: When a suspected detachment event (including accidental detachment event and nighttime removal event) is detected, and a re-wearing event is detected within the first interruption waiting window of the suspected detachment event, mark the duration of the detachment (i.e. the duration of the suspected detachment event) and maintain the current session area.

[0125] Step S806: When an intentional removal event is detected, and no re-wearing event is detected within the second interruption waiting window of the intentional removal event, close the current session area.

[0126] Step S807: Generate a session report for this session area.

[0127] Specifically, as the fan starts and boosts the voltage, the current session area is created, and the session start time is recorded. In this embodiment, the "current session area" refers to a dynamically allocated logical storage area in non-volatile memory, such as SPI Flash, specifically for the current sleep therapy session. This area is independent of system firmware and other historical data, and is dedicated to gathering and storing all key information related to the entire treatment process. The session start time can be taken as the reading of the system's real-time clock at the moment the session area is created, with a timestamp accurate to the second, serving as a reference for the timing of all subsequent events throughout the night. The creation of the session area marks the system's formal transition from the standby and startup phases to the recorded continuous treatment phase.

[0128] Once the treatment phase begins, various treatment parameters, respiratory events and their parameters, and interruption events and their parameters are periodically written to the current session area according to the set recording time interval (e.g., every minute). The recording time interval can be set according to the balance between storage capacity and data accuracy requirements, for example, by recording a complete parameter snapshot every minute.

[0129] Treatment parameters may include, but are not limited to: the actual output pressure at the current moment, the current duty cycle of the blower, the instantaneous flow rate and minute ventilation rate collected by the flow sensor, etc.

[0130] Various respiratory events and respiratory event parameters may include, but are not limited to: apnea events and hypoventilation events identified by respiratory event detection algorithms, including their types, occurrence times, and durations.

[0131] Various interruption events and interruption event parameters may include, but are not limited to: major air leakage events, suspected detachment events, re-wearing events, intentional removal events, and the types, times of occurrence, and durations of these events.

[0132] In this session area, the system not only records the type and timestamp of each event, but also meticulously records the duration of each interruption event. This meticulous recording method is directly related to the technical objective of this embodiment: unlike existing solutions that simply record power on / off events, it structurally labels every clinically significant abnormal segment during treatment—whether it's a large air leak caused by turning over, an accidental dislodgement due to getting up at night, or an intentional removal upon waking in the morning—making the entire treatment process present a clear timeline and event chain at the data level. For example, when the system determines a suspected dislodgement event through a decision tree, an event record of type "accidental dislodgement" is added to the session area, indicating the time it occurred. Upon the end of the interruption event, i.e., after the mask is confirmed to be re-worn, the duration of the interruption segment is recorded. If re-worn does not occur within the interruption waiting window, the status of the interruption event is updated to timeout when the window expires.

[0133] For large air leak events, since they do not cause the patient to exit the S3 treatment state to the S4 suspected detachment / removal state, the system employs a special recording strategy: In the first respiratory cycle where a large air leak is detected, a "Large Air Leak Begins" event is recorded in the session area; after the leak is resolved, a "Large Air Leak Ends" event is recorded, and the total duration is calculated. The advantage of this approach is that the patient's actual effective treatment pressure may be limited due to the leak during the large air leak. Marking this period allows for a more objective assessment of whether the treatment duration was effective based on clinical criteria when generating subsequent compliance reports.

[0134] Furthermore, the system automatically manages the lifecycle of the session area in real time based on the duration of various interruption events. When no re-wearing event is detected within the first interruption waiting window for a suspected dislodgement event, or within the second interruption waiting window for an intentional removal event, the current session area is closed, and a session report is generated. Specifically, when a patient removes their mask at night or when the mask accidentally falls off during the night, the system identifies this as a suspected dislodgement event and starts timing. If no re-wearing event is detected within the first interruption waiting window for a suspected dislodgement event, the treatment is considered complete, the system records the current time as the session end time, archives the current session area, and prohibits subsequent treatment parameters from being written to the current session area. Additionally, when a patient wakes up in the morning and intentionally removes their mask, the system identifies this as an intentional removal event and starts timing. If no re-wearing event is detected within the second interruption waiting window for an intentional removal event, the treatment is considered complete, the system records the current time as the session end time, archives the current session area, and prohibits subsequent treatment parameters from being written to the current session area.

[0135] After the session is archived, all data recorded in the session is automatically traversed, statistical analysis is performed on various treatment parameters, and various respiratory events and / or interruption events are categorized, counted, and their durations are summarized. Finally, a structured session report is generated. This report can be directly displayed or uploaded, and its content can intuitively present the total treatment duration, effective treatment duration, interruption type and number, average treatment pressure, average leakage, and compliance indicators calculated according to industry standards.

[0136] When generating session reports, specific compliance merging processes were implemented for brief interruptions to ensure the continuity and accuracy of adherence calculations. For recoverable brief interruptions, such as accidental dislodgement followed by re-wearing within the first interruption waiting window, or removal during the night followed by re-wearing within the first interruption waiting window, although the mask may have come off and the fan speed may have decreased, the patient's subjective willingness to receive treatment remained uninterrupted, and the overall treatment process still clinically constituted the same treatment segment. Therefore, when generating reports, the system does not fragment the entire night's treatment data into multiple independent sessions due to these brief interruptions. Instead, it adopts a "disruption segment ignored but marked" strategy: the report still accurately records the start and end times and type of the interruption segment, but during adherence statistics, the effective treatment segments before and after the interruption segment are merged into a single continuous segment. Based on publicly available adherence standards, such as counting consecutive use of 4 hours or more as valid adherence days, even if a patient experiences two interruptions of a few minutes each during the night due to nighttime awakenings, as long as the sum of the three combined treatment sessions meets the standard and the duration of each interruption does not exceed a preset merging threshold, the night's treatment is still counted as a complete and valid treatment. This refined session merging logic accurately reflects the patient's subjective usage intention in clinical data analysis, avoiding misjudging lifestyle factors as poor treatment adherence, and providing objective and accurate data for doctors to adjust prescriptions and conduct patient education.

[0137] This embodiment constructs a complete data closed loop from pressure boosting to session end report generation, organically coupling real-time state transitions at the control level with non-volatile data management at the information level. This enables intelligent control of the device to extend not only to real-time pressure regulation but also to the traceability of the entire overnight treatment process and the accuracy of clinical statistics.

[0138] In summary, this application has the following technical advantages compared with the prior art: 1. The two-stage wear detection (flow RMS initial screening + respiratory rhythm three-condition confirmation) + tubing impedance step rapid channel can reduce the wear detection delay from 10~30s in the existing solution to 5~15s, while reducing the false trigger rate to <1%; 2. Three-scenario detachment identification (major air leakage / accidental detachment / intentional removal) + RTC time factor weighting enables home ventilators to make hardware-level differentiated responses in each scenario, replacing the existing "one-size-fits-all" delayed shutdown. 3. Brief interruption energy-saving wait + first-order rapid recovery (τ=15 s) allows the pressure to be restored to the pre-interruption level within 15 seconds after getting up at night and returning to bed, without having to go through the full Ramp again; 4. Ultra-low power standby (MCU STOP + ADC intermittent wake-up, standby <0.1W) reduces power consumption by ≥95% compared to existing solutions for maintaining micro-positive pressure in fans (approximately 2~5W); 5. The SPI Flash session area records the interruption timestamp and type, ensuring the accuracy of the overnight treatment report and compliance calculation, and preventing the recalculation of compliance segments due to brief interruptions; 6. The above hardware control circuit is based only on the existing SDP810, ADC3, TIM8, RTC, and SPI Flash, without the need to add additional sensors such as infrared, capacitive touch, and acceleration.

[0139] Example 10 This embodiment provides a home ventilator control system. This system organizes the processes and control logic described in the foregoing method embodiments into functional units within a unified system architecture, thereby modularly supporting complete functions such as wear detection, treatment control, abnormality identification, interruption recovery, and low-power management. See also... Figure 9 As shown, the home ventilator control system 900 provided in this embodiment includes at least: The standby monitoring unit 901 is used to monitor that when the airflow rate in the airflow duct collected by the flow sensor at a first sampling frequency in the standby state is greater than the flow rate threshold, it controls the flow sensor to collect the airflow rate in the airflow duct at a second sampling frequency; wherein the second sampling frequency is higher than the first sampling frequency. The fan booster unit 902 is used to monitor the airflow in the airflow duct collected by the flow sensor at the second sampling frequency and, when it is found to be in accordance with the human respiratory rhythm, control the fan to gradually increase the duty cycle from the lowest duty cycle in the standby state to the target duty cycle corresponding to the target treatment pressure so as to gradually enter the treatment state.

[0140] In one possible implementation, the fan booster unit 902 is used to detect whether the airflow in the airflow duct has periodic characteristics within the set breathing cycle based on whether there is an autocorrelation peak in the autocorrelation function values ​​of each airflow flow within the set breathing cycle; to detect whether the airflow in the airflow duct has bidirectional characteristics within the set breathing cycle based on whether the proportion of positive airflow in each airflow flow within the set breathing cycle is within a reasonable proportion range; and to detect whether the airflow in the airflow duct has reasonable peak characteristics within the set breathing cycle based on whether the peak value of each airflow flow within the set breathing cycle is within a reasonable peak range. If the airflow in the airflow duct is found to simultaneously possess periodic characteristics, bidirectional characteristics, and reasonable peak characteristics within a first number of set breathing cycles, then it is determined that the airflow in the airflow duct conforms to the human respiratory rhythm.

[0141] In one possible implementation, the home ventilator control system 900 provided in this embodiment further includes: The wearing detection unit 903 is used to determine the equivalent impedance of the airflow duct based on the airflow rate in the airflow duct collected by the flow sensor at a second sampling frequency and the airflow pressure in the airflow duct collected by the pressure sensor at a third sampling frequency; based on whether the instantaneous change multiple of the equivalent impedance relative to the reference equivalent impedance is greater than a multiple threshold, it is detected whether there is a step characteristic in the equivalent impedance of the airflow duct; if a step characteristic in the equivalent impedance of the airflow duct is detected in a second number of breathing cycles, it is determined that the mask wearing is complete.

[0142] In one possible implementation, the home ventilator control system 900 provided in this embodiment further includes: The closed-loop control unit 904 is used to dynamically adjust the target duty cycle of the fan using a closed-loop control strategy during treatment. The closed-loop control strategy includes: dynamically updating the target treatment pressure based on the airflow rate in the airflow duct collected by the flow sensor at a second sampling frequency and the airflow pressure in the airflow duct collected by the pressure sensor at a third sampling frequency; and dynamically adjusting the target duty cycle of the fan based on the dynamically updated target treatment pressure.

[0143] In one possible implementation, the home ventilator control system 900 provided in this embodiment further includes: The interruption monitoring unit 905 is used to monitor whether an interruption event has occurred during treatment, based on the airflow rate in the airflow pipeline collected by the flow sensor at a second sampling frequency and the airflow pressure in the airflow pipeline collected by the pressure sensor at a third sampling frequency; if an interruption event is detected, the interruption response strategy corresponding to the interruption event is executed.

[0144] In one possible implementation, the interruption events include a major air leak event, a suspected detachment event, and an intentional removal event; the interruption monitoring unit 905 is configured to determine a suspected detachment event if it detects that the airflow rate in the airflow tube collected by the flow sensor at a second sampling frequency does not conform to the human respiratory rhythm, the airflow pressure in the airflow tube collected by the pressure sensor at a third sampling frequency drops below a first pressure threshold, and the current time is within the sleep time interval; if it detects that the airflow rate in the airflow tube collected by the flow sensor at a second sampling frequency does not conform to the human respiratory rhythm, the airflow pressure in the airflow tube collected by the pressure sensor at a third sampling frequency drops below the first pressure threshold, and the current time is within the non-sleep time interval; if it detects that the airflow rate in the airflow tube collected by the flow sensor at a second sampling frequency does not conform to the human respiratory rhythm, the airflow pressure in the airflow tube collected by the pressure sensor at a third sampling frequency drops to a level not lower than the second pressure threshold and has a periodic characteristic, then it determines a major air leak event; wherein, the second pressure threshold is greater than the first pressure threshold.

[0145] In one possible implementation, the interruption monitoring unit 905 is configured to, if the interruption event is a large air leak event, maintain the target duty cycle of the fan dynamically adjusted using a closed-loop control strategy, simultaneously perform air leak compensation operations, and prompt the user to check the mask sealing status; if the interruption event is a suspected detachment event or an intentional removal event, control the fan to reduce from the target duty cycle to the minimum duty cycle, and control the flow sensor to reduce from the second sampling frequency to the first sampling frequency.

[0146] In one possible implementation, the interruption monitoring unit 905 is further configured to monitor whether a re-wearing event has occurred within the interruption waiting window, based on the airflow rate in the airflow duct collected by the flow sensor at a first sampling frequency and the airflow pressure in the airflow duct collected by the pressure sensor at a third sampling frequency; when a re-wearing event is detected, the target treatment pressure is dynamically calculated using a first-order exponential recovery algorithm, and the target duty cycle of the fan is gradually adjusted based on the dynamically calculated target treatment pressure until the dynamically calculated target treatment pressure reaches the target treatment pressure before the suspected dislodgement event or intentional removal event occurs, at which point the unit enters the treatment state.

[0147] In one possible implementation, the interrupt monitoring unit 905 is further configured to return to standby mode when no re-wearing event is detected; and control the MCU to switch to shutdown mode when the duration of the standby mode is not less than a duration threshold. In shutdown mode, the master clock and I2C clock are turned off, the fan and flow sensor stop operating, and the ADC is retained to periodically wake up the pressure sensor to collect the airflow pressure in the airflow duct. When the airflow pressure in the airflow duct jumps to a value greater than the human breathing pressure threshold, the MCU is woken up and the flow sensor is controlled to collect the airflow flow rate in the airflow duct at a second sampling frequency. When the airflow flow rate in the airflow duct collected by the flow sensor at the second sampling frequency is found to match the human breathing rhythm, the fan is controlled to gradually increase from the lowest duty cycle in the standby mode to the target duty cycle corresponding to the target treatment pressure to gradually enter the treatment state.

[0148] In one possible implementation, the home ventilator control system 900 provided in this embodiment further includes: The session management unit 906 is used to create the current session area and record the session start time. According to the set recording time interval, it periodically writes various treatment parameters, various interruption events, and the duration of various interruption events into the current session area. Among them, interruption events include large air leakage events, suspected dislodgement events, re-wearing events, and intentional removal events. When no re-wearing event is detected within the interruption waiting window of a suspected dislodgement event or intentional removal event, the current session area is closed and a session report is generated.

[0149] It should be noted that the principle of the home ventilator control system 900 provided in this embodiment to solve the technical problem is similar to that of the aforementioned home ventilator control method. Therefore, the implementation of the home ventilator control system 900 provided in this embodiment can refer to the implementation of the aforementioned home ventilator control method, and the repeated parts will not be described again.

[0150] Example 11 This embodiment provides a home-use ventilator, see [link / reference] Figure 10 As shown, the home ventilator 100 provided in this embodiment includes at least a sensing channel 107, an execution channel 108, a memory 102, and a control arithmetic unit 101 connected to the sensing channel 107 and the execution channel 108 respectively; the memory 102 stores a computer program that can run on the control arithmetic unit 101, and the control arithmetic unit 101 implements the above-mentioned home ventilator control method when executing the computer program.

[0151] In one possible implementation, the control unit 101 is the core processor chip of the home ventilator. For example, the control unit 101 is a microcontroller unit (MCU). The MCU integrates a flow cycle analyzer, a pipeline impedance estimator, a five-state machine, and a detachment scenario discriminator. It is responsible for collecting sensor data (SDP810 flow, ADC pressure), executing state machine logic (5-level wearing state switching), driving actuators (TIM8 PWM controlling BLDC fan), managing power consumption modes (Run / Stop mode switching), reading and writing SPI Flash session data, and controlling peripheral components (LCD, buzzer, Bluetooth / 4G module), etc.

[0152] In one possible implementation, memory 102 may include a readable medium in the form of volatile memory, such as random access memory (RAM) 1021 and / or cache memory 1022, and may further include read-only memory (ROM) 1023; memory 102 may also include a program tool 1025 having a set (at least one) of program modules 1024, including but not limited to: operating subsystem, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0153] In one possible implementation, the home ventilator 100 provided in this embodiment may further include a bus 103 connecting different components (including a control arithmetic unit 101 and a memory 102). The bus 103 represents one or more types of bus structures, including a memory bus, a peripheral bus, a local area bus, etc.

[0154] In one possible implementation, the home ventilator 100 can also communicate with one or more external devices 104, such as devices that enable a user to interact with the home ventilator 100 (e.g., mobile phones, smartwatches, etc.), and / or devices that enable the home ventilator 100 to communicate with one or more other devices (e.g., routers, modems, etc.). This communication can be performed via an input / output (I / O) interface 105. Furthermore, the home ventilator 100 can also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 106. Figure 10 As shown, network adapter 106 communicates with other modules of home ventilator 100 via bus 103.

[0155] It should be understood that, despite Figure 10 As not shown, other hardware and / or software modules can be used in conjunction with the home ventilator 100, including but not limited to microcode, device drivers, redundant processors, external disk drive arrays, Redundant Arrays of Independent Disks (RAID) subsystems, tape drives, and data backup storage subsystems.

[0156] It should be noted that, Figure 10 The home ventilator 100 shown is merely an example and should not impose any limitations on the functionality and scope of use of this embodiment.

[0157] Furthermore, this embodiment also provides a computer-readable storage medium storing computer instructions that, when executed by a control processor, implement the aforementioned home ventilator control method. Specifically, the computer instructions can be built into or installed in the control processor, enabling the control processor to implement the aforementioned home ventilator control method by executing the built-in or installed computer instructions.

[0158] In addition, this embodiment also provides a program product, which includes program code that, when executed by a control arithmetic unit, implements the above-described home ventilator control method.

[0159] In one possible implementation, the program product may employ any combination of one or more readable media, wherein the readable media may be a readable signal medium or a readable storage medium, and the readable storage medium may be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. Specifically, more specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, RAM, ROM, erasable programmable read-only memory (EPROM), optical fibers, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0160] It should be noted that although several units or sub-units of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.

[0161] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0162] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0163] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of the embodiments of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.

Claims

1. A method for controlling a home ventilator, characterized in that, include: When the flow rate in the airflow duct collected by the flow sensor at a first sampling frequency in standby mode is found to be greater than the flow rate threshold, the flow sensor is controlled to collect the airflow rate in the airflow duct at a second sampling frequency; wherein the second sampling frequency is higher than the first sampling frequency. When the flow rate in the airflow pipeline collected by the flow sensor at the second sampling frequency is found to be in line with the human respiratory rhythm, the fan is controlled to gradually increase from the lowest duty cycle in the standby state to the target duty cycle corresponding to the target treatment pressure in order to gradually enter the treatment state.

2. The home ventilator control method as described in claim 1, characterized in that, The monitoring showed that the airflow rate in the airflow pipeline, collected by the flow sensor at the second sampling frequency, conformed to the human respiratory rhythm, including: Based on whether there is an autocorrelation peak in the autocorrelation function value of each airflow rate within a set respiratory cycle, it is detected whether the airflow rate in the airflow pipeline has periodic characteristics within the set respiratory cycle. Based on whether the proportion of positive airflow in each airflow rate within a set respiratory cycle is within a reasonable range, it is detected whether the airflow rate in the airflow pipeline has a bidirectional characteristic within the set respiratory cycle. Based on whether the peak flow rate of each airflow rate within a set respiratory cycle is within a reasonable peak range, the airflow rate in the airflow pipeline is detected to have a reasonable peak characteristic within the set respiratory cycle. If, within a first set number of respiratory cycles, the airflow rate in the airflow pipeline simultaneously exhibits the periodicity, the bidirectionality, and the reasonable peak value, then it is determined that the airflow rate in the airflow pipeline conforms to the human respiratory rhythm.

3. The home ventilator control method as described in claim 1, characterized in that, After controlling the flow sensor to acquire the airflow rate in the airflow duct at a second sampling frequency, the method further includes: The equivalent impedance of the airflow pipeline is determined based on the airflow rate in the airflow pipeline collected by the flow sensor at a second sampling frequency and the airflow pressure in the airflow pipeline collected by the pressure sensor at a third sampling frequency. Based on whether the instantaneous change factor of the equivalent impedance relative to the reference equivalent impedance is greater than a factor threshold, the presence of a step characteristic in the equivalent impedance of the airflow pipeline is detected. If a step-like characteristic is detected in the equivalent impedance of the airflow duct during the second number of breathing cycles, then the mask is determined to be worn successfully.

4. The home ventilator control method as described in claim 1, characterized in that, After controlling the fan to gradually increase its duty cycle from the lowest standby state to the target duty cycle corresponding to the target treatment pressure, the process also includes: During the treatment, the system monitors whether an interruption event occurs based on the airflow rate in the airflow pipeline collected by the flow sensor at a second sampling frequency and the airflow pressure in the airflow pipeline collected by the pressure sensor at a third sampling frequency. If the interruption event is detected, the interruption response strategy corresponding to the interruption event is executed.

5. The home ventilator control method as described in claim 4, characterized in that, The interruption events include major air leaks, suspected detachment events, and intentional removal events; Based on the airflow rate in the airflow pipeline collected by the flow sensor at a second sampling frequency and the airflow pressure in the airflow pipeline collected by the pressure sensor at a third sampling frequency, the system monitors whether an interruption event has occurred, including: If the airflow rate in the airflow pipeline collected by the flow sensor at the second sampling frequency does not conform to the human respiratory rhythm, and the airflow pressure in the airflow pipeline collected by the pressure sensor at the third sampling frequency drops below the first pressure threshold, and the current time is within the sleep time interval, then a suspected detachment event is determined to have occurred. If the airflow rate in the airflow pipeline collected by the flow sensor at the second sampling frequency does not conform to the human respiratory rhythm, and the airflow pressure in the airflow pipeline collected by the pressure sensor at the third sampling frequency drops below the first pressure threshold, and the current time is within the non-sleep time interval, then it is determined that an intentional removal event has occurred. If the airflow rate in the airflow pipeline collected by the flow sensor at the second sampling frequency does not conform to the human respiratory rhythm, and the airflow pressure in the airflow pipeline collected by the pressure sensor at the third sampling frequency drops to a level not lower than the second pressure threshold and has a periodic characteristic, then a major air leak event is determined to have occurred; wherein, the second pressure threshold is greater than the first pressure threshold.

6. The home ventilator control method as described in claim 4, characterized in that, Execute the interrupt response strategy corresponding to the interrupt event, including: If the interruption event is a large air leak event, the target duty cycle of the fan will be dynamically adjusted using a closed-loop control strategy, and the air leak compensation operation will be performed simultaneously, prompting the user to check the mask sealing status. If the interruption event is a suspected detachment event or an intentional removal event, then the fan is controlled to reduce its duty cycle from the target duty cycle to the minimum duty cycle, and the flow sensor is controlled to reduce its sampling frequency from the second sampling frequency to the first sampling frequency.

7. The home ventilator control method as described in claim 6, characterized in that, After controlling the flow sensor to reduce its sampling frequency from the second sampling frequency to the first sampling frequency, the method further includes: During the interruption waiting window, based on the airflow rate in the airflow duct collected by the flow sensor at the first sampling frequency and the airflow pressure in the airflow duct collected by the pressure sensor at the third sampling frequency, it is monitored whether a re-wearing event has occurred. When the re-wearing event is detected, the target treatment pressure is dynamically calculated using a first-order exponential recovery algorithm. Based on the dynamically calculated target treatment pressure, the target duty cycle of the fan is gradually adjusted until the dynamically calculated target treatment pressure reaches the target treatment pressure before the suspected detachment event or intentional removal event occurs, at which point the treatment state is entered.

8. The home ventilator control method as described in claim 7, characterized in that, Also includes: If no re-wearing event is detected, the system will revert to the standby state. When the duration of the standby state is detected to be not less than the duration threshold, the MCU is controlled to switch to the shutdown mode. In the shutdown mode, the main clock and I2C clock are turned off, the fan and the flow sensor stop running, and the ADC is retained to periodically wake up the pressure sensor to collect the airflow pressure in the airflow pipeline. When the airflow pressure in the airflow duct is detected to jump to a level greater than the human breathing pressure threshold, the MCU is activated and the flow sensor is controlled to collect the airflow rate in the airflow duct at the second sampling frequency. When the flow rate in the airflow pipeline collected by the flow sensor at the second sampling frequency is found to be in line with the human respiratory rhythm, the fan is controlled to gradually increase from the lowest duty cycle in the standby state to the target duty cycle corresponding to the target treatment pressure in order to gradually enter the treatment state.

9. A home ventilator control system, characterized in that, include: A standby monitoring unit is used to monitor that when the airflow rate in the airflow duct collected by the flow sensor at a first sampling frequency in the standby state is greater than the flow rate threshold, the flow sensor is controlled to collect the airflow rate in the airflow duct at a second sampling frequency; wherein the second sampling frequency is higher than the first sampling frequency. The fan booster unit is used to monitor the airflow in the airflow pipeline collected by the flow sensor at the second sampling frequency, and when it is found that the airflow rate in the airflow pipeline conforms to the human breathing rhythm, it controls the fan to gradually increase the duty cycle from the lowest duty cycle in the standby state to the target duty cycle corresponding to the target treatment pressure so as to gradually enter the treatment state.

10. A home-use ventilator, characterized in that, The device includes a sensing channel, an execution channel, a memory, and a control arithmetic unit connected to the sensing channel and the execution channel respectively; the memory stores a computer program that can run on the control arithmetic unit, and when the control arithmetic unit executes the computer program, it implements the home ventilator control method as described in any one of claims 1-8.