A home ventilator mask type self-identification parameter intelligent adaptation method and system

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

Patent Information

Application Number
CN202610919809.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-24
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0004]针对现有技术中家用呼吸机依赖用户手动设置面罩类型,面罩更换后设置遗忘导致故意漏气基线偏差和死腔补偿失配的不足,本申请提供了一种家用呼吸机面罩类型自识别参数智能适配方法及系统

Benefits of technology

[0014]The method and system provided in this application have the following beneficial effects: By embedding multi-dimensional aerodynamic characteristic testing during the normal pressurization phase of the equipment, a basis for distinguishing mask types is constructed using characteristic data from three dimensions: mask exhaust port flow characteristics, dead space volume, and aerodynamic resistance. This allows for automatic identification of mask types without the user's awareness. Based on the identification results, a baseline for intentional leakage matching the mask type is precisely set, freeing the calculation of unintentional leakage from dependence on manual user settings and eliminating systematic biases in leakage estimation caused by mask type mismatch. Simultaneously, a minimum pressure safety limit is automatically set according to the mask's dead space volume, ensuring sufficient CO2 flushing for different mask types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122912267A_ABST
    Figure CN122912267A_ABST
Patent Text Reader

Abstract

The application discloses a household respirator mask type self-identification parameter intelligent adaptation method and system, and belongs to the technical field of intelligent control of medical devices. The method comprises the following steps: performing multi-dimensional pneumatic characteristic testing on the mask in the device boosting stage to obtain exhaust hole flow characteristic parameters, dead cavity volume parameters and pneumatic resistance parameters; constructing a mask feature vector based on three-dimensional features and matching the mask feature vector with a preset template to determine the mask type; establishing an exhaust hole flow model according to the mask type and the exhaust hole flow characteristic parameters and setting an intentional air leakage baseline to separate unintentional air leakage from total air leakage; and determining a dead cavity compensation amount according to the deviation of the dead cavity volume corresponding to the mask type from a preset reference value and setting a minimum treatment pressure safety limit. The application embeds a silent test in the normal boosting stage, realizes automatic identification of the mask type by using multi-dimensional feature fusion, eliminates intentional air leakage baseline deviation and dead cavity compensation mismatch caused by user manual setting forgetfulness, and guarantees CO2 flushing sufficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent control technology for medical devices, and in particular to a method and system for intelligent adaptation of self-identification parameters for home ventilator mask types. Background Technology

[0002] Home ventilators use three types of masks: nasal masks, oronasal masks, and nasal pillows. The dead space volume, exhaust port design, and aerodynamic resistance characteristics of different types of masks vary significantly, which directly affect many key parameters of the treatment algorithm.

[0003] Current home ventilators typically handle mask type selection in two ways: requiring users to manually select the currently used mask type in the device menu, or using a default mode without differentiating mask types. However, most patients are unaware of the technical significance of mask type classification and often forget to update the mask type setting in the device when changing masks after initial setup. When the mask type setting does not match the actual mask used, the device's baseline estimation of intentional leakage will be inaccurate, leading to distortion in the calculation of unintentional leakage. Simultaneously, the device cannot correctly set the minimum treatment pressure based on differences in mask dead space volume, posing a safety hazard of CO2 re-inhalation. Summary of the Invention

[0004] To address the shortcomings of existing home ventilators that rely on manual mask type settings by users, and the resulting intentional leakage baseline deviation and dead space compensation mismatch due to forgotten settings after mask replacement, this application provides a method and system for intelligent adaptation of mask type self-identification parameters for home ventilators. This method automatically performs multi-dimensional aerodynamic characteristic testing during the device's pressurization phase to obtain and classify the three-dimensional features of the mask. It can automatically adapt the intentional leakage baseline and treatment pressure parameters without user intervention, eliminating systematic parameter deviations caused by incorrect mask type settings. Specifically, this application provides the following technical solutions: Firstly, this application provides a method for intelligent adaptation of self-identification parameters for home ventilator mask types, including: During the equipment pressurization phase, perform multi-dimensional aerodynamic characteristic tests on the currently connected mask to obtain the mask's exhaust port flow characteristic parameters, dead space volume parameters, and aerodynamic resistance parameters. Based on the exhaust port flow characteristic parameters, the dead space volume parameters, and the aerodynamic resistance parameters, a mask feature vector is constructed. The mask feature vector is then classified and matched with a preset mask type feature template to determine the current mask type. Based on the determined mask type and the exhaust port flow characteristic parameters, a corresponding exhaust port flow model is established and an intentional leakage baseline is set. Based on the intentional leakage baseline, the unintentional leakage amount is separated from the total leakage amount. Based on the deviation between the dead space volume parameter corresponding to the determined mask type and the preset reference dead space volume, the dead space compensation amount is determined and the minimum treatment pressure safety limit is set.

[0005] Optionally, obtaining the exhaust port flow characteristic parameters of the mask includes: measuring the steady-state leakage flow rate at multiple preset pressure points during the low-pressure stabilization phase; and fitting a power-law relationship model between the exhaust port flow rate and pressure based on the steady-state leakage flow rate corresponding to the multiple preset pressure points to obtain the exhaust port flow rate coefficient and pressure index.

[0006] Optionally, obtaining the dead space volume parameters of the mask includes: detecting the inflection point of the slope change of the flow rate curve in the initial stage of exhalation to determine the time when the dead space gas flushing is completed; integrating the flow rate signal from the start of exhalation to the time when the dead space gas flushing is completed to obtain an estimated value of the dead space volume.

[0007] Optionally, the step of classifying and matching the mask feature vector with preset mask type feature templates to determine the current mask type includes: normalizing each dimension of the mask feature vector, calculating the distance between the normalized mask feature vector and each mask type feature template; selecting the type corresponding to the mask type feature template with the smallest distance as the recognition result, and determining the recognition confidence based on the nearest distance and the second nearest distance; performing hierarchical decision-making based on the recognition confidence: automatically applying the parameters corresponding to the recognition result when the confidence is higher than a first threshold, applying the parameters and prompting the user for confirmation when the confidence is between the first threshold and a second threshold, and maintaining the existing settings when the confidence is lower than the second threshold.

[0008] Optionally, the method further includes: adjusting the respiratory event detection sensitivity in conjunction with the deviation between the dead space volume and the preset reference dead space volume, wherein the low ventilation detection sensitivity is increased when the dead space volume is greater than the reference dead space volume.

[0009] Optionally, the method further includes: determining whether to enable oral leakage detection based on the mask type; enabling oral leakage detection when the mask type is a nasal mask or nasal pillow, and disabling oral leakage detection when the mask type is an oronasal mask; when oral leakage detection is enabled, identifying oral leakage events by monitoring the abrupt change characteristics of expiratory leakage volume, and adjusting the humidification compensation volume and expiratory pressure relief parameters in conjunction with the detection of oral leakage events.

[0010] Optionally, the method further includes: determining the mask pressure drop compensation amount based on the aerodynamic resistance parameters and the average peak intake flow rate, and increasing the device output pressure by the mask pressure drop compensation amount; comparing the currently identified mask type with the previously stored identification result, and determining a mask replacement event when the two are inconsistent, and resetting the leakage baseline and mask status tracking baseline; and performing long-term tracking of the exhaust port flow coefficient, and generating a mask maintenance prompt when the change in the exhaust port flow coefficient relative to the initial baseline exceeds a preset aging threshold.

[0011] Secondly, this application provides a smart adaptation system for self-identifying parameters of home ventilator mask types, including: The mask aerodynamic characteristics acquisition module is used to perform multi-dimensional aerodynamic characteristic tests on the currently connected mask during the equipment pressurization phase to obtain the mask's exhaust port flow characteristic parameters, dead space volume parameters, and aerodynamic resistance parameters. The mask type identification module is used to construct a mask feature vector based on the exhaust port flow characteristic parameters, the dead space volume parameters, and the aerodynamic resistance parameters, and to classify and match the mask feature vector with a preset mask type feature template to determine the current mask type. The leakage baseline adaptation module is used to establish a corresponding exhaust port flow model and set an intentional leakage baseline based on the determined mask type and the exhaust port flow characteristic parameters, and to separate the unintentional leakage amount from the total leakage amount based on the intentional leakage baseline. The treatment parameter adaptation module is used to determine the dead space compensation amount and set the minimum treatment pressure safety limit based on the deviation between the dead space volume parameter corresponding to the determined mask type and the preset reference dead space volume.

[0012] Optionally, the system further includes an oral leakage management module, which is used to determine whether to enable oral leakage detection based on the mask type, enable oral leakage detection when the mask type is a nasal mask or nasal pillow, and adjust the humidification compensation amount and exhalation pressure relief parameters in conjunction when an oral leakage event is detected.

[0013] Optionally, the system further includes a mask status management module, which is used to determine the mask pressure drop compensation amount based on the aerodynamic resistance parameters to compensate for the pressure loss caused by the mask resistance, and to detect mask replacement events and track mask aging status by comparing the mask type identification results of adjacent start-up cycles.

[0014] The method and system provided in this application have the following beneficial effects: By embedding multi-dimensional aerodynamic characteristic testing during the normal pressurization phase of the equipment, a basis for distinguishing mask types is constructed using characteristic data from three dimensions: mask exhaust port flow characteristics, dead space volume, and aerodynamic resistance. This allows for automatic identification of mask types without the user's awareness. Based on the identification results, a baseline for intentional leakage matching the mask type is precisely set, freeing the calculation of unintentional leakage from dependence on manual user settings and eliminating systematic biases in leakage estimation caused by mask type mismatch. Simultaneously, a minimum pressure safety limit is automatically set according to the mask's dead space volume, ensuring sufficient CO2 flushing for different mask types. Attached Figure Description

[0015] Figure 1 This is a schematic diagram of the overall process of the intelligent adaptation method for self-identification parameters of home ventilator mask type provided in the embodiments of this application.

[0016] Figure 2 This is a schematic diagram of the standard feature vector distribution provided for an embodiment of this application.

[0017] Figure 3 This is a schematic diagram of the module architecture of the intelligent adaptation system for self-identification parameters of home ventilator mask type provided in the embodiments of this application. Detailed Implementation

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

[0022] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0023] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0024] In one specific implementation, this application provides a method for intelligent parameter adaptation of self-identified mask types for home ventilators. This method embeds a mask aerodynamic characteristic test sequence during the device's power-on pressurization phase, collecting feature data in three dimensions: mask exhaust port flow characteristics, dead space volume, and aerodynamic resistance. The mask type is determined based on the distance between the feature vector and a preset template. Based on the identification results, an intentional leakage baseline and a minimum treatment pressure safety limit matching the mask type are automatically set. This method solves the problems of intentional leakage baseline deviation and CO2 re-inhalation risk caused by users forgetting or incorrectly setting the mask type in existing technologies. It achieves the beneficial effect of completing mask type identification and eliminating systematic errors of parameter mismatch without the user's awareness.

[0025] The hardware platform in this embodiment is built on an STM32F407 main controller with a main frequency of 168MHz. It is equipped with an SDP810 differential pressure flow sensor (soft I2C interface, sampling rate of 100Hz) to provide accurate flow data. The pressure sensor connected to the ADC3 injection channel CH14 provides pipeline pressure data. The BLDC brushless DC fan driven by TIM8 PWM performs pressure excitation. The SPI Flash stores the feature templates and recognition results of each mask type.

[0026] like Figure 1 As shown, this method includes the following steps: S100 performs multi-dimensional aerodynamic characteristic tests on the currently connected mask during the equipment pressurization phase, obtaining the mask's exhaust port flow characteristic parameters, dead space volume parameters, and aerodynamic resistance parameters.

[0027] This phase is performed silently during the initial low-pressure period of the ramp-up process after the device is powered on. The entire test is embedded in the normal ramp-up procedure, and the user does not experience any additional sensation. The test is triggered when the device detects a stable breathing signal—that is, the user has correctly worn the mask and is producing regular flow fluctuations for at least three consecutive breathing cycles. The mask aerodynamic characteristics test includes three sub-test items, each extracting the physical characteristics of the mask from different dimensions. Specifically: S110 measures the steady-state leakage flow rate at multiple preset pressure points during the low-pressure stabilization phase at the end of exhalation resting period, and obtains the exhaust port flow rate coefficient and pressure index by fitting a power-law relationship model between exhaust port flow rate and pressure.

[0028] Vent holes are intentionally designed openings on a mask to expel CO2-enriched gas during patient exhalation. Different types of masks vary in the area, number, and location of vent holes, resulting in significant differences in gas flow rate through the vent holes at the same pressure. This sub-step utilizes this physical difference as the first dimension characteristic of mask type.

[0029] Tests in 4 to 6 The system operates during the low-pressure stable phase. Within this pressure range, the fan output pressure is sufficient to maintain positive pressure in the tubing but has not yet reached the treatment pressure level, and the patient is in a state of natural breathing. The system operates at 3 discrete pressure points—4 5 and 6 Traffic collection is performed at each location.

[0030] At each pressure point, the system waits for the end-expiratory resting phase. The end-expiratory resting phase is defined as the short pause between the end of expiration and the start of the next inspiration, during which the patient's airflow is close to zero. The flow sensor continuously collects flow data for 200 ms at a sampling rate of 100 Hz during this period, and the average value is taken as the steady-state leakage flow rate at that pressure point. The flow rate measured at this point is essentially equal to the intentional leakage through the mask exhaust port, because the patient's respiratory flow is negligible during the resting phase.

[0031] For example, under pressure 4 The steady-state leakage flow rate was measured to be 7.2 L / min at 5°C. The following is 9.1 L / min, at 6 The speed is 10.8 L / min.

[0032] Based on measurement data from three pressure points, the system fits a flow-pressure power-law relationship model for the mask's exhaust vent:

[0033] in This refers to the air leakage flow rate from the vent, in units of... ; Pipeline pressure, unit: ; The vent flow coefficient reflects the equivalent area of ​​the vent, and its dimensions are: ; The pressure index reflects the flow characteristics within the exhaust port. It is approximately 0.5 for laminar flow and approximately 1.0 for turbulent flow. The pressure index for the mask exhaust port is typically between 0.5 and 0.7.

[0034] The fitting process employs a logarithmic linearization method: taking the natural logarithm of both sides of the above power-law model yields... After substituting the three measurement points, the least squares method was used to fit the result. and The value is obtained by fitting the data from the three pressure points mentioned above. , .

[0035] Exhaust port flow coefficients of different mask types Significant differences exist: nasal pillow The typical value ranges from 3.0 to 6.0 because of the small cross-section of the nasal bolus exhaust port; nasal mask... The typical value ranges from 6.0 to 12.0; the mouth and nose mask, due to its large exhaust port area or dual exhaust design, has... The typical value ranges from 10.0 to 18.0. This difference in physical characteristics constitutes the strongest feature dimension for distinguishing mask types.

[0036] The parameter calibration process for the exhaust port flow model was completed during the product development phase. Calibration tests were conducted in a constant temperature and humidity laboratory environment (temperature 25±1 degrees Celsius, relative humidity 50±5%, atmospheric pressure 101.3 kPa), using a standard air source and a high-precision mass flow meter (range 0 to 100 L / min, accuracy ±0.5% of full scale) as reference standards. For each mask type, samples from no fewer than 10 mainstream commercially available brands were selected, with each sample tested for 4 to 20 [units of measurement missing]. Within the range of 1 Flow measurements were performed at 17 pressure points in a stepwise manner, with data acquired after each pressure point had stabilized for 5 seconds. All measurement data were stored in CSV format, and power-law fitting was performed independently for each sample using data analysis software to evaluate the goodness of fit. (value), remove After identifying abnormal samples, calculate by grouping them according to mask type. and The mean and standard deviation are used as template parameters and written into the feature template storage area of ​​SPIFlash.

[0037] In actual use, the S110 test only collected data at 3 pressure points (4, 5, 6). This simplified design is based on the following considerations: while more pressure points can improve fitting accuracy, they will increase testing time and affect user experience; in the range of 4 to 6... The power-law relationship exhibits good linearity within the low-pressure range (in logarithmic space). Three points are sufficient to determine the two parameters; the test time is controlled within three respiratory cycles (approximately 12 to 15 seconds), which has no significant impact on the ramp-up process. The normalized root mean square error (NRMSE) is used to evaluate the fit residuals. When the NRMSE exceeds 15%, the fit is considered unreliable, and the template standard value is used instead.

[0038] S120, detect the inflection point of the slope change of the flow curve in the initial stage of exhalation to determine the time when the dead space gas flushing is completed, and integrate the flow signal from the start of exhalation to the time when the dead space gas flushing is completed to obtain the estimated value of the dead space volume.

[0039] The dead space of a face mask refers to the enclosed space formed by the mask and the face. At the start of exhalation, the dead space contains residual fresh air from the previous inhalation (low CO2 concentration), which is expelled before the alveolar gas. The alveolar gas has a CO2 concentration of approximately 5%, and there is a difference in density and viscosity between it and the fresh air in the dead space. This difference is reflected in the dynamic characteristics of the expiratory flow rate curve—a detectable inflection point exists in the flow-pressure relationship between the dead space gas flushing phase and the alveolar gas expulsion phase.

[0040] The system at the start of exhalation Start monitoring the rate of change of the flow signal.

[0041] The first derivative of the flow rate curve shows a distinct inflection point at the moment when the dead space gas flushing is complete. This inflection point is defined as... The specific detection method is as follows: calculate the flow differential sequence of continuous sampling points. When an inflection point appears in the differential sequence, indicating a change from a gradual decrease to a rapid decrease or vice versa (i.e., the second derivative crosses zero), that moment is marked as the inflection point. To improve robustness, the system continuously monitors the inflection point positions for 5 respiratory cycles and takes the median value.

[0042] The dead space volume is calculated by time integration of the flow signal before the inflection point:

[0043] in, This is the expiratory flow rate signal, in units of... The integration result needs to be converted to a unit (divided by 60) to obtain the volume value in mL.

[0044] For example, let the exhalation start time be... ms, the turning point was detected. ms, the average expiratory flow rate during this time period is approximately 50 L / min, then the integral is obtained mL. Typical dead space volumes for the three mask types are: 30 to 60 mL for nasal occiput mask, 100 to 180 mL for nasal mask, and 180 to 350 mL for oronasal mask.

[0045] The signal processing steps for dead space volume estimation include the following key steps: The raw flow signal is processed by a fourth-order Butterworth low-pass filter (cutoff frequency 10Hz) to remove high-frequency disturbances caused by respiratory turbulence and sensor electrical noise. The filtered flow signal is then numerically differentiated at 10ms intervals (100Hz sampling rate) to calculate the first derivative sequence, and then the first derivative sequence is differentiated again to obtain the second derivative sequence. Inflection point detection is based on the zero-crossing criterion of the second derivative: when a zero-crossing occurs in the second derivative sequence (corresponding to an inflection point where the flow curve changes from concave to convex), and the absolute value difference of the first derivative before and after the inflection point exceeds a threshold (set as 20% of the average flow rate in the resting period), the moment is confirmed as the completion of dead space gas flushing.

[0046] To improve the robustness of the estimation, the system independently calculates the dead space volume for each of the five consecutive respiratory cycles and applies median filtering to the five estimates. Median filtering is more robust to abnormal fluctuations in a single respiratory cycle (such as coughing or swallowing) compared to the arithmetic mean. The final output dead space volume estimate is the median of the five cycles. If the standard deviation of the five estimates exceeds 30% of the mean, the system determines that the current measurement conditions are unstable (possibly due to a loose mask or the patient not having entered steady-state breathing), and re-executes S120 after a three-breathing-cycle delay.

[0047] S130 measures the relationship between pipeline pressure drop and inhalation flow rate during the inhalation phase to obtain the mask's aerodynamic resistance parameters.

[0048] Different types of face masks generate varying degrees of airflow resistance due to differences in airflow cross-sectional area, curvature, and connector design. This sub-step utilizes the pressure-flow rate relationship during the intake phase to measure the equivalent aerodynamic drag of the face mask.

[0049] During inhalation, airflow enters the patient's airway from the fan through the tubing and mask. Due to the aerodynamic resistance of the mask itself, the actual pressure received by the patient is lower than the output pressure at the fan. A pressure sensor is installed at the fan end to measure the pressure at the tubing inlet. At the peak of inspiration, when the flow rate in the tubing is at its maximum, the pressure drop caused by the mask's aerodynamic resistance is most significant.

[0050] The system records the tubing pressure at the peak of inspiration during each of five consecutive respiratory cycles. and the corresponding peak inspiratory flow rate The resistance of the face mask is characterized by the ratio of pressure drop to flow rate.

[0051] in, The difference between the equipment set pressure and the actual pipeline pressure at the peak suction time, expressed in units of... ; Peak inspiratory flow rate, in units of ; The aerodynamic drag of the mask is expressed in units of... Take 5 cycles. The mean value is used as the final aerodynamic drag parameter.

[0052] For example, let the set pressure be 5. The measured pressure in the pipeline at the peak of the inhalation was 4.7. If the peak inspiratory flow rate is 30 L / min, then The nasal pillow has the smallest airway cross-section and a sharp bend, resulting in the highest resistance (typically 0.015 to 0.025); the oronasal mask has the largest airway cross-section and a straight-through design, resulting in the lowest resistance (typically 0.005 to 0.010); the nasal mask falls in between (typically 0.008 to 0.015).

[0053] The accuracy of aerodynamic drag measurement is affected by the combined measurement uncertainty of the flow sensor and pressure sensor. The SDP810 flow sensor has a measurement accuracy of ±3% of the reading plus a zero-point offset of ±0.1 L / min, while the pressure sensor has an accuracy of ±0.1 L / min. At a typical peak inspiratory flow rate of 30 L / min and a pressure drop of 0.3... Under the conditions, The relative uncertainty is approximately The accuracy of a single measurement is relatively low. By averaging over five respiratory cycles, and based on the central limit theorem, the uncertainty of the mean is reduced to... Although the absolute measurement accuracy of aerodynamic drag is limited, its relative differences among the three mask types remain significant (nose pillow vs. mouth-nose mask). The ratio is approximately 2 to 4 times, and it still makes an effective contribution to differentiation as an auxiliary classification dimension.

[0054] The total execution time of the three sub-tests in phase S100 is controlled within 5 to 8 respiratory cycles (approximately 20 to 40 seconds). The multi-pressure point test in phase S110 requires 3 respiratory cycles (1 cycle per pressure point). The dead space volume measurement in phase S120 is the median of 5 cycles (the first 3 cycles can be executed in parallel with S110, because while measuring flow rate at 3 different pressure points in S110, the system simultaneously acquires the flow rate curve of the initial expiratory phase for dead space volume calculation in S120). The aerodynamic resistance measurement in phase S130 is the average of 5 cycles (completely in parallel with S120). Through the time-series interleaving of S110-S120-S130, the entire mask aerodynamic characteristics test is completed within the first 20 to 40 seconds of the ramp-up phase, without significantly affecting the standard 30-minute ramp-up process.

[0055] S200: Construct a mask feature vector based on the exhaust port flow characteristic parameters, dead space volume parameters, and aerodynamic resistance parameters; classify and match the mask feature vector with a preset mask type feature template to determine the current mask type.

[0056] After completing the three-dimensional aerodynamic characteristic testing in the S100 stage, the system enters the comprehensive classification and decision-making stage for mask type. This stage integrates the measurement data from the three dimensions into a structured feature vector, and automatically determines the mask type by comparing its distance with pre-trained mask type feature templates. Specifically: S210: Based on the exhaust port flow coefficient, dead space volume, and aerodynamic drag obtained in stage S100, a three-dimensional mask feature vector is constructed.

[0057] The mask feature vector is defined as an ordered combination of three feature dimensions:

[0058] in, The exhaust port flow coefficient (obtained from S110). This is an estimated value for the dead space volume (obtained from S120, in mL). The aerodynamic drag of the mask (obtained from S130).

[0059] Before performing classification matching, the feature vectors need to be normalized to eliminate the impact of differences in dimensions on distance calculation. Normalization uses a min-max scaling method:

[0060] in These are the original eigenvalues. and This represents the minimum and maximum values ​​of this dimension across all mask types. For example, the exhaust port flow coefficient... The normalized range for the value is [3.0, 18.0], the normalized range for the dead space volume is [30, 350] mL, and the normalized range for the aerodynamic drag is [0.005, 0.025]. .

[0061] The mask type feature template is stored in SPI Flash and contains standard feature vectors for three mask types. The template data is derived from statistical analysis of measured data from mainstream mask products on the market during the product development phase. For each type, at least 10 mask samples from different brands and models were selected and subjected to the complete S100 test procedure under standard test conditions (temperature 25 degrees Celsius, relative humidity 50%, altitude 0m, standard atmospheric pressure). The arithmetic mean of the measured values ​​for each dimension was taken as the standard template vector for that type. For example... Figure 2 As shown, nose pillow template After normalization, it becomes ; Nose mask template After normalization, it becomes Mouth and nose mask template After normalization, it becomes .

[0062] The design process for the feature template follows this logic: During the product development phase, mainstream face mask products with a market coverage exceeding 80% (including ResMed AirFit series, Philips DreamWear series, Fisher & Paykel Simples series, etc.) are collected, with no fewer than 10 different models for each type. A complete S100 test procedure is performed on each face mask sample on a standard test bench (using a lung simulator to generate standard respiratory waveforms: tidal volume 500 mL, respiratory rate 15 breaths / min, IPR ratio 1:2). The test results are then grouped by face mask type, and the mean vector of each dimension is calculated as the template center. Simultaneously, the standard deviation of each dimension is calculated to determine the normalization range. The upper and lower limits of the normalization range are taken as the minimum and maximum values ​​among all measured values ​​of the samples, with a 10% extension at both ends as a safety margin to cover face mask models not yet in the inventory.

[0063] The classification effectiveness of the template was evaluated using leave-one-out cross-validation: each sample was sequentially treated as a mask to be tested, and the classification algorithm was executed to check whether the identification result matched its true type. On a validation set of 30 samples (10 per class), the classification accuracy was 96.7% (only one nasal mask sample was misclassified as a mouth-nose mask due to abnormally large exhaust holes), validating the discriminative effectiveness of the 3D feature template. The template parameters are stored as a constant array in the product firmware and can be updated via OTA firmware upgrades to avoid insufficient coverage of existing templates when new mask designs appear on the market.

[0064] S220: Calculate the Euclidean distance between the normalized mask feature vector and the feature templates of each mask type, select the template with the smallest distance as the recognition result, and determine the recognition confidence based on the nearest and second nearest distances.

[0065] The classification matching uses the nearest neighbor method to calculate the Euclidean distance from the current mask's normalized feature vector to the three type templates:

[0066] in For mask type index, For the first Type of template in the first The normalized value of the dimension. The system selects the type with the smallest distance as the recognition result: .

[0067] For example, suppose the normalized feature vector measured by the current mask is Calculate the distances to the three templates: distance to the nasal pillow template. Distance to the nose mask template Distance to the mouth and nose mask template The minimum distance is The identification result is a nose mask.

[0068] Confidence level is determined by nearest distance and the second closest distance Relationship established:

[0069] In the example above, , , A higher confidence level indicates a more significant difference between the current mask features and the best-matching template, resulting in a more reliable recognition result.

[0070] The choice of the nearest neighbor classifier over more complex machine learning models (such as support vector machines or neural networks) is based on the following engineering considerations: First, there are only 3 types of masks, and the feature space has a dimension of 3. The problem itself is a simple classification task with low dimensions and low categories, and the nearest neighbor method already has sufficient discriminative power. Second, the 168MHz main frequency and 192KBSRAM of the STM32F407 have strict constraints on computational complexity. The nearest neighbor algorithm only requires 3 distance calculations (6 floating-point subtractions, 3 multiplications, and 1 square root operation each time), totaling about 50 floating-point operations, with an execution time of less than 1 microsecond. Third, the decision boundary of the nearest neighbor method is the perpendicular bisector hyperplane between templates, which has clear geometric interpretation and facilitates the analysis of the reasons for recognition failure (the direction and distance of the feature vector deviating from the template directly reflect which specific dimension is abnormal).

[0071] The reason for choosing Euclidean distance instead of Manhattan or Mahalanobis distance is that the three feature dimensions are uniform in size and have similar variances after normalization (the normalized values ​​of the nasal pillow and the oral-nasal mask in each dimension are in the range of [0, 0.3] and [0.6, 1.0] respectively, with good separation), so there is no need for additional correction through the covariance matrix. Euclidean distance can fully reflect the true distance relationship in the feature space.

[0072] S230, performs hierarchical decision-making based on recognition confidence level to determine parameter application strategy.

[0073] The system sets two confidence thresholds to divide the decision space into three intervals: the first threshold... Second threshold These two thresholds were determined based on ROC curve analysis during the product validation phase. The false recognition rate is less than 2%. The false negative rate is less than 5%.

[0074] when At that point, it is determined to be a high-confidence recognition. The system automatically loads the mask type parameters corresponding to the recognition result into each functional module, including the intentional leakage baseline parameters, dead space compensation parameters, oral leakage detection start / stop flags, and mask resistance compensation values, without user intervention throughout the entire process. In the example above... That is, entering this branch.

[0075] when At that point, the system is assessed as having a medium confidence level. The system still applies the parameters corresponding to the recognition result to ensure basic treatment functions start normally, but simultaneously sends a prompt message to the accompanying app via Bluetooth, requesting the user to confirm the mask type is correct at their convenience. If the user confirms or changes the mask type via the app within 72 hours, the system updates the locally stored mask type and uses the user's selection as the standard.

[0076] when If the confidence level is low, the 3D feature data may be affected by interference factors such as improper mask wearing or loose tubing connections, making the recognition result unreliable. The system retains the mask type setting from the last recognition (read from SPIFlash). If it is the first use and there is no historical record, the factory default value (nose mask) is retained, and the user is prompted to manually set it via the APP.

[0077] After identification is completed, the current mask type identification result and the original three-dimensional feature data are written to the SPI Flash storage as the benchmark data for subsequent mask replacement detection and aging monitoring.

[0078] S300: Based on the determined mask type and exhaust port flow characteristic parameters, establish a corresponding exhaust port flow model and set an intentional leakage baseline. Based on the intentional leakage baseline, separate the unintentional leakage from the total leakage.

[0079] After mask type identification is complete, the system enters the automatic adaptation phase for the intentional leakage baseline. The intentional leakage refers to the designed venting from the mask's exhaust port; its flow rate varies with tubing pressure and is a core baseline parameter for the ventilator leakage management algorithm. When the intentional leakage baseline is set accurately, the device can correctly separate the unintentional leakage component from the total leakage flow rate, thus providing a reliable basis for leakage alarms, pressure compensation, and treatment effectiveness evaluation. Specifically: S310: Based on the mask type identification result, call the corresponding type of exhaust port flow model parameters from the feature template library to establish a functional relationship between intentional air leakage flow and pressure.

[0080] After the mask type is determined in the S200 stage, the system reads the standard exhaust port flow rate model parameters for that type of mask from the feature template library stored in the SPI Flash. These model parameters include the exhaust port flow rate coefficient. and stress index The data was obtained from statistical analysis of mask sample test data during the product development phase. The standard model parameters for the three mask types are as follows: nose pillow... , ; nose mask , Mouth and nose mask , .

[0081] Considering the individual differences that still exist between different brands and models of the same type of face mask, in order to improve baseline accuracy, the system prioritizes using the actual measurements obtained from the S110 stage for the current face mask. and The value replaces the standard value in the template library. The standard value in the template library will only be used if the uncertainty of the S110 measurement is too high (determined by the fitting residuals of the three pressure points during the measurement process; a residual greater than 15% is considered too high).

[0082] The model parameter priority strategy is designed based on the following: The measured S110 value reflects the actual vent characteristics of the current individual face mask (including the combined effects of factors such as the mask's age, cleanliness, and ambient temperature and humidity), and its accuracy is better than the template standard value obtained based on statistics from new face masks. The typical deviation range between the measured value and the template value is [insert range here]. 15%, the intentional leakage baseline error corresponding to this deviation is approximately 5 L / min (at 10 Under therapeutic pressure, if no correction is made using measured values, this error will be fully propagated to the unintentional leakage calculation results. The residual threshold of 15% is based on Monte Carlo simulation analysis: (Regarding flow sensor accuracy) 0.5 L / min, pressure sensor accuracy 0.1 Under the given conditions, 1000 simulations with noise were performed on the 3-point power-law fitting. Under normal circumstances, the 99th percentile of NRMSE is 12.3%. Therefore, the 15% threshold can effectively distinguish between normal fitting errors caused by sensor noise and systematic deviations caused by abnormal mask wearing.

[0083] The functional relationship between intentional air leakage flow rate and pipeline pressure is as follows:

[0084] in, and Use the measured value of S110 or the template standard value. This function relationship serves as the intentional leakage baseline and is continuously called in the leakage separation calculation for each subsequent respiratory cycle.

[0085] For example, if the mask is identified as a nose mask and S110 is measured , Then, in treating stress 10 Below, the baseline for intentional air leakage is L / min.

[0086] S320: During the treatment process, the total leakage flow rate is measured in real time, and the unintentional leakage rate is separated from the total leakage rate based on the intentional leakage baseline.

[0087] During normal treatment operation, the flow sensor continuously measures the gas flow rate in the tubing at a sampling rate of 100Hz. Total leakage. The following method is used to obtain the total air leakage at the end of exhalation (consistent with the measurement period definition of S110). The airflow in the tubing consists mainly of two parts: leakage from the exhaust port and leakage from the mask seal gap. The flow rate measured at this time is the total leakage under the current pressure.

[0088] Unintentional leakage is obtained by subtracting the intentional leakage baseline from the total leakage:

[0089] in For the current pressure The total leakage flow rate measured below (in L / min). The intentional leakage baseline established for S310 at pressure The calculated value below. This represents the amount of unintentional air leakage, reflecting the actual air leakage caused by poor mask sealing.

[0090] For example, in treating stress 10 Below, if the total leakage measurement value L / min, intentional leak baseline L / min, which represents the amount of unintentional air leakage. L / min.

[0091] Leakage separation calculation is performed on a respiratory cycle basis: During each respiratory cycle, the system continuously collects flow rate data during the end-expiratory resting phase (approximately 200 to 500 ms), and takes the average of the middle 60% of the data segment as the total leakage measurement for that cycle (discarding the first and last 20% to avoid unstable data during the respiratory transition phase). Pressure values ​​are simultaneously read from ADC3 and averaged synchronously. The average pressure is substituted into S310 to calculate the theoretical intentional leakage, and subtracted from the measured total leakage to obtain the unintentional leakage. This calculation is performed once per respiratory cycle, at a frequency of approximately 12 to 20 times / minute (varying with the patient's respiratory rate). Each calculation involves a first exponentiation operation (implemented through table lookup and linear interpolation to avoid the high computational overhead of floating-point power functions) and a subtraction, placing no significant load on the MCU.

[0092] When the mask type is incorrectly identified, the intentional leakage baseline deviation has a systematic impact on the calculation of unintentional leakage. For example, if a user actually uses a nose mask but the device misidentifies it as a mouth-nose mask, the intentional leakage baseline will be higher. (The L / min is much greater than the actual 35.5 L / min), resulting in If the calculated value is negative, the system assumes there is no leak. The actual, unintentional leak of 6.8 L / min goes completely undetected, posing a risk to the patient that their mask may be loose without any alarm response. This systematic error can be effectively eliminated by obtaining accurate mask type and measured exhaust flow parameters through the active identification test of the S100-S200.

[0093] S330 triggers the corresponding leak management strategy based on the amount of unintentional leaks.

[0094] The system according to The size of the leak is subject to tiered leakage management. When When the flow rate is L / min, it is considered a normal sealing condition, and no intervention is performed. When When the pressure is L / min, it is considered a minor leak. The system records the leak event and marks it in the treatment report, and the pressure compensation is appropriately increased to maintain effective treatment pressure. When the air pressure drops to L / min, it is determined to be a serious leak. The system will emit a short warning sound via buzzer and simultaneously push a leak alarm to the accompanying APP via Bluetooth, prompting the user to adjust the mask wearing position.

[0095] In addition, the system Perform sliding window statistics (window length is 30 respiratory cycles) to calculate the mean and trend of unintentional air leakage. If the mean continues to rise at a rate exceeding 3 L / min / h, it indicates that the mask seal is gradually deteriorating (possibly due to changes in user posture or loosening of the mask straps). The system records this trend in the app for physician review.

[0096] For minor leaks (5 to 24 L / min), a feedforward compensation method is used for pressure compensation. Estimate effective airway pressure loss based on unintentional air leakage. (in The equivalent air resistance of the pipeline is typically approximately 0.05. Increase the output pressure of the equipment. To maintain the target therapeutic pressure in the patient's airway. For example, in At L / min The equipment output pressure is from the set value of 10. Adjusted to 10.6 The compensation amount also has a maximum limit of 2. Leakage exceeding this limit is considered a serious leak and triggers an alarm, rather than continuing to increase pressure for compensation.

[0097] One important aspect of leakage separation calculations is the handling of boundary conditions: when When the calculation result is negative (i.e., the actual total leakage is less than the intentional leakage baseline), the system does not consider it an error but instead... The cutoff value is 0. Physical causes of negative values ​​may include: temporary blockage of the mask vent (e.g., the patient's face pressing against the vent), resulting in an intentional leak below baseline; or the current respiratory cycle being in a special phase at the end of deep inspiration, causing the actual vent pressure to be lower than the nominal tubing pressure. The system records any consecutive negative values ​​exceeding 5 cycles as a vent blockage event and prompts the user via the app to check mask fit.

[0098] S400 determines the dead space compensation amount and sets the minimum treatment pressure safety limit based on the deviation between the dead space volume parameter corresponding to the determined mask type and the preset reference dead space volume.

[0099] The dead space volume of a face mask directly affects the risk of CO2 re-inhalation. A larger dead space results in more CO2 accumulating in the mask during exhalation, which the patient will then re-inhale during the next inhalation. To ensure adequate flushing and dilution of CO2 in the mask's dead space, the ventilator needs to maintain a minimum treatment pressure that matches the dead space volume. Specifically: S410: Obtain the corresponding dead space volume value based on the mask type identification result, and determine the dead space compensation amount based on the deviation between the dead space volume and the reference benchmark.

[0100] The system acquires the measured dead space volume value of the current mask during phase S120. The calculation of the dead space compensation amount is based on the deviation from the reference dead space volume:

[0101] in, This is the dead space compensation coefficient, with a default value of 0.01. This coefficient is determined based on a hydrodynamic model of CO2 flushing—approximately 0.01 additional [unit] mL is needed for every 1 mL increase in dead space volume. Pressure increments are used to maintain sufficient flushing flow; For reference, the dead space volume is set to 100 mL, with the corresponding nasal mask as the baseline mask type; This is the dead space compensation amount, in units of .

[0102] For example, if the mask is identified as a mouth and nose mask, the measured dead space volume is... mL, then dead space compensation amount If the mask is identified as a nose pillow, the actual dead space volume is measured. mL, then (A negative value indicates that the minimum pressure can be appropriately reduced).

[0103] Dead space compensation coefficient The design is based on a physical model derived from CO2 steady-state equilibrium. During a respiratory cycle, the steady-state concentration of CO2 in the dead space of the mask depends on the balance between the amount of CO2 expelled into the dead space (from alveolar gas) and the amount of CO2 diluted by flushing (from exhaust ports). Let the upper limit of the CO2 concentration in the mask at the end of expiration be... (Exceeding this concentration may cause headaches and decreased sleep quality in patients), alveolar CO2 concentration is Under standard ventilation conditions (tidal volume) mL, respiratory rate (breaths / minute, I-E ratio 1:2) The relationship between CO2 flushing ventilation and mask pressure is as follows: higher pressure produces a larger exhaust flow rate, thus flushing more of the mask dead space volume during the expiratory interval. When the dead space volume increases, a larger volume needs to be flushed in the same amount of time, therefore a higher minimum pressure is required to ensure the exhaust flow rate.

[0104] S420 sets the minimum safe limit for treatment pressure based on the dead space compensation amount.

[0105] Minimum therapeutic pressure safety limit It is obtained by superimposing the basic minimum pressure and the dead space compensation:

[0106] in, The base minimum pressure, with a default value of 4. This value is the lower limit of the minimum treatment pressure for CPAP / APAP devices as specified in ISO 80601-2-70 standard. As a mandatory safety baseline, the device must not fall below this limit in any operating mode (including the expiratory phase pressure in EPR mode, the automatic pressure reduction in APAP mode, and the pressure value manually set by the user).

[0107] The minimum treatment pressure safety limit for each type of mask is: (for mouth and nose masks) (mL) ; Nose mask ( (mL) ; Nose pillow ( (mL) Considering safety margins, the system has limitations on the nose pillow. A lower limit is set, and the actual value is no lower than 3.5. .

[0108] Once the setting is complete, the system writes this value to the parameter register of the pressure control module. During subsequent treatment, regardless of how much the APAP algorithm reduces the pressure, the hardware limiting logic of the pressure control module ensures that the actual output pressure never falls below a certain level. .

[0109] in, The application of safety limits differs across treatment modalities. In fixed-pressure CPAP mode, if the physician prescribes a pressure lower than... (e.g., prescription pressure 4) But users of mouth and nose masks The system automatically increases the actual output pressure to [the specified value]. The system will notify users and doctors via the app that "due to the safety requirements of the mask's dead space, the actual treatment pressure has been automatically increased to the safe lower limit." In automatic pressure adjustment APAP mode, As a hard lower bound of the APAP algorithm's search space, that is, the pressure reduction logic of the APAP algorithm reaches the output pressure. Immediately stop further pressure reduction to ensure that even if the patient has no respiratory events and the algorithm determines that pressure reduction is possible, the actual pressure will not fall below the safety requirements for CO2 flushing. In expiratory decompression (EPR) mode, the EPR function reduces the pressure by 1 to 3 times from the inspiratory pressure during the expiratory phase. To improve comfort, but the lower limit of expiratory phase pressure is also affected. Constraints. If the current inhalation pressure is 7... With EPR set to 3, the theoretical expiratory pressure is 4. ,but At that time, the actual expiratory pressure was limited to 5.5. (Equivalent EPR reduced to 1.5).

[0110] The minimum pressure safety limit setting also takes altitude into account. In high-altitude areas (e.g., above 2000m), the reduced atmospheric pressure results in lower absolute pressure at the same pipeline gauge pressure, further decreasing CO2 flushing efficiency. If the equipment is equipped with a pressure sensor or the user has set altitude information in the equipment, the system will adjust accordingly. Perform altitude correction: ,in The current ambient atmospheric pressure (kPa). At an altitude of 2000m ( kPa), mouth and nose mask Revised from 5.5 to This revision ensures that users at high altitudes also receive adequate CO2 flushing protection.

[0111] S430 adjusts the sensitivity parameters for respiratory event detection based on the dead space volume.

[0112] Dead space volume affects not only CO2 flushing but also the effectiveness of respiratory event detection algorithms. With masks featuring large dead spaces, a portion of the air inhaled by the patient each time comes from dead space residue (containing higher CO2 concentrations), leading to a decrease in equivalent ventilation efficiency. Apnea or hypoventilation events of equal severity have a greater actual impact on patients when using masks with large dead spaces because the baseline effective ventilation volume is already reduced due to the dead space effect.

[0113] The system adjusts the detection threshold for hypoventilation events based on the dead space volume. Hypoventilation is defined as a decrease in ventilation exceeding 30% of baseline (AASM standard), but this 30% threshold is based on the assumption of an ideal, dead space-free environment. When significant dead space is present, the system adjusts the detection sensitivity as follows:

[0114] in, The patient's average tidal volume (measured in real time by a flow sensor, in mL). This represents the current dead space volume of the mask. This correction lowers the low ventilation detection threshold for users of masks with large dead space, making it more sensitive to detecting inadequate ventilation events.

[0115] For example, let the patient's average tidal volume be... mL, using a mouth and nose mask ( (mL), then the adjusted low ventilation detection threshold is: A 15% decrease in ventilation volume triggers a hypoventilation assessment. Use a nasal pillow ( When the threshold is mL), It is close to the standard threshold.

[0116] This coordinated adjustment ensures that users with different mask types receive equivalent respiratory event monitoring quality, preventing the slight ventilatory insufficiency of users with large dead space masks from being missed.

[0117] The coordinated adjustment of respiratory event detection sensitivity is of significant clinical importance. According to the AASM (American Academy of Sleep Medicine) scoring system, a hypoventilation event is defined as a decrease in ventilation ≥30% accompanied by a decrease in blood oxygen saturation ≥3% or minimal arousal. When using a large dead space mask, the patient's effective alveolar ventilation equals the total tidal volume minus the dead space ventilation, i.e. .when At mL, the effective ventilation volume is only mL is 50% of the ideal value under no dead space conditions. At this baseline level, the absolute ventilation corresponding to the same 30% decrease (down to 175 mL) is much lower than that of a 30% decrease (down to 322 mL) in users with small dead space masks, and has a greater impact on the patient's risk of hypoxia. By lowering the detection threshold, the system can intervene with pressure adjustment earlier in response to hypoventilation events in users with large dead space masks, effectively reducing residual AHI (apnea-hypopnea index).

[0118] The sensitivity adjustment value is also constrained by the pressure control algorithm: too low a detection threshold may lead to frequent pressure rise events that disrupt the patient's sleep. The system sets the lower limit of sensitivity adjustment to 10% (even with a very large dead space volume, the low ventilation detection threshold is not lower than 10%) to avoid unnecessary pressure adjustments triggered by false positive events due to sensor noise.

[0119] The S500 selectively enables oral leakage detection based on the mask type, and adjusts treatment parameters accordingly when an oral leakage event is detected.

[0120] Nasal masks and nasal pillows only cover or insert into the nasal cavity. During sleep, patients may open their mouths, causing therapeutic air to leak out through the oral cavity – a phenomenon known as oral leakage. Oral leakage leads to a decrease in effective therapeutic pressure and a significant loss of humidified air from the airway. Oral-nasal masks cover both the mouth and nose, eliminating the oral leakage problem. Enabling oral leakage detection logic for oral-nasal mask users might misinterpret normal airflow from the mask's vents as an oral leakage event. Specifically: S510 determines whether to enable the oral leakage detection function based on the mask type determined in stage S200.

[0121] The system reads the mask type identification result written to the SPI Flash in stage S200 and performs the following logic judgment: when the mask type is a nose mask or nose pillow, the mouth leakage detection function flag is enabled (enable_mouth_leak = 1); when the mask type is a mouth and nose mask, the mouth leakage detection function flag is disabled (enable_mouth_leak = 0), and the subsequent processing logic of S520 and S530 is skipped.

[0122] This judgment logic eliminates two types of errors caused by the lack of distinction between mask types: missing the detection of oral leakage for nasal mask / nose pillow users (the detection function is incorrectly disabled when the mask type is set to oral-nose mask), and generating false alarms for oral leakage for oral-nose mask users (normal exhaust from the vent is mistakenly judged as oral leakage when the mask type is set to nasal mask).

[0123] S520 performs oral leakage event detection for users of nasal masks or nasal pillows.

[0124] Oral leakage detection is based on the abrupt change characteristics of expiratory leakage. During normal exhalation, leakage mainly consists of intentional leakage from the exhaust port, which exhibits a smooth and continuous power-law relationship with pressure changes. When the mouth is open, an additional leakage pathway is established, resulting in a sudden increase in the total expiratory leakage, and the magnitude of this increase deviates significantly from the predicted value of the exhaust port flow model.

[0125] The detection criterion is defined as: the difference between the measured leakage volume and the intentional leakage baseline (S310 setting) during a continuous expiratory phase. Exceeding the threshold for three consecutive respiratory cycles When this occurs, it is determined to be an air leakage event. Threshold Set at 25% of the baseline for intentional air leakage under current treatment pressure:

[0126] For example, in treating stress 12 Below, the intentional leakage baseline of the nose mask is L / min, then the oral leakage detection threshold L / min. When the measured air leakage during the expiratory phase exceeds the intentional leakage baseline by more than 10.2 L / min within 3 consecutive respiratory cycles, the system determines that an oral air leakage event has occurred.

[0127] To reduce false triggers, the system also verifies the following auxiliary conditions: additional air leakage caused by oral leakage is mainly concentrated in the second half of the expiratory phase (positive intraoral pressure during inspiration suppresses oral leakage), therefore the detection algorithm only calculates the flow rate data in the second half of the expiratory phase. The flow characteristics of oral leakage manifest in the time domain as increased asymmetry in the expiratory flow curve: a normal expiratory flow curve is approximately symmetrical and bell-shaped; after oral leakage occurs, the rate of flow decay slows down in the latter half of the expiratory phase (due to continuous oral air expulsion maintaining a higher total flow), causing the skewness coefficient of the flow curve to increase from the normal 0.1 to 0.3 to over 0.5. The system calculates the skewness coefficient of the expiratory flow curve as an auxiliary criterion; when the skewness coefficient is greater than 0.4 and... Simultaneously, an air leak event is confirmed only when the threshold is exceeded. This dual-criteria design effectively reduces the false alarm rate caused by momentary air leaks due to mask loosening.

[0128] The severity of air leakage incidents is categorized by... The size is divided into three levels: mild oral leakage ( ), moderate oral leakage ( ) and severe oral leakage ( The intensity of the linkage response varies depending on the severity level. Mild oral leakage only records the event without intervening in treatment parameters. Moderate oral leakage implements humidification compensation and reduces EPR. Severe oral leakage, in addition to the moderate response, issues an audible and visual alert and pushes an emergency notification to the APP.

[0129] When the S530 detects an air leakage event, it will adjust the humidification compensation amount and expiratory pressure relief parameters in conjunction with the system.

[0130] Once the air leak incident is confirmed, the system will perform three coordinated adjustments.

[0131] First, instruct the humidification system to increase its humidification output. Air leakage from the mouth carries away a significant amount of air humidified by the humidifier, causing a decrease in the humidity of the air inhaled by the patient, which may lead to discomfort such as dry mouth and sore throat. The humidification system should increase its output temperature by 2 degrees Celsius or raise the humidity level by one level to compensate for the humidity loss.

[0132] Second, appropriately reduce the expiratory pressure relief (EPR) amplitude. The EPR function reduces tubing pressure during the expiratory phase to improve patient expiratory comfort, but this pressure reduction can exacerbate oral leakage (increased pressure difference between the inside and outside of the mouth). The system reduces the EPR amplitude from the user-set value by 1. (e.g., reducing EPR=3 to EPR=2) to achieve a balance between comfort and mouth leakage control.

[0133] Third, the system pushes oral leakage alerts to the accompanying app via Bluetooth, suggesting users use a chin strap to stabilize their jaw and reduce the frequency of mouth opening during sleep, or recommending they consider switching to a mouth-nose mask to fundamentally eliminate the oral leakage problem. The system also records the time, duration, and severity of oral leakage events in the treatment report (in words). The peak value is used to assess the treatment effect by clinicians during follow-up visits.

[0134] When the air leakage stops (after 10 consecutive breathing cycles) After that, the humidification compensation and EPR adjustment automatically return to the initial settings. The recovery process adopts a gradual strategy rather than a step-like switch: the humidification temperature decreases by 0.5 degrees Celsius per minute until it returns to the original value, and the EPR amplitude is delayed for 5 minutes after the oral leakage disappears before it returns to normal (to avoid the positive feedback loop of exacerbating oral leakage due to a sudden increase in EPR when the patient reopens their mouth).

[0135] Statistics on oral leakage events are recorded in the form of the Mouth Leak Index (MLI), defined as the percentage of cumulative oral leakage events within an hour relative to the total treatment time. MLI data is stored in the SPIFlash treatment record area, storing the most recent 90 days of data nightly. The app supports plotting oral leakage trend charts for physicians to assess treatment adherence and mask fit. When the MLI exceeds 30% for 7 consecutive days, the system determines that the current mask type is unsuitable for the patient (possibly a nasal mask for patients with severe mouth breathing habits) and automatically suggests switching to an oronasal mask via the app.

[0136] The S600 performs mask resistance compensation based on the mask's aerodynamic resistance parameters and performs mask replacement detection and aging monitoring by comparing the identification results of adjacent start-up cycles.

[0137] This step utilizes historical data from the aerodynamic drag parameters of the face mask measured in the S100 phase and the face mask type identification results to achieve full lifecycle management of the face mask. Specifically: S610 determines the mask pressure drop compensation based on the mask's aerodynamic resistance parameters and average peak intake flow rate, and adjusts the equipment's output pressure accordingly.

[0138] Different types of face masks exhibit varying aerodynamic resistance due to differences in their airway structure, resulting in the effective pressure at the patient's airway being lower than the device's output pressure. Nasal pillows have the highest aerodynamic resistance due to their thin silicone tubes and sharp bends; oral-nasal masks have the lowest resistance due to their larger airway cross-section and large-diameter straight-through connection. Without resistance compensation, the actual treatment pressure received by nasal pillow users may be significantly lower than the device's set value.

[0139] The mask pressure drop compensation is based on the mask aerodynamic drag measured by S130. and average peak inspiratory flow rate during operation calculate:

[0140] in, The aerodynamic drag of the mask is expressed in units of... ; The average peak inspiratory flow rate over the most recent 100 respiratory cycles, expressed in L / min; This is the pressure drop compensation amount for the face mask, in units of... .

[0141] The actual output pressure of the equipment is increased by a compensation amount on top of the original set value. For example, nose pillow users ( If the average peak inspiratory flow rate is 35 L / min, then the compensation amount is... Set the pressure to 10. At that time, the actual output of the device was 10.7. Ensure that the effective pressure in the patient's airway is close to 10. The compensation amount has an upper limit cutoff value of 2. This is to prevent abnormal resistance values ​​from causing excessive pressure.

[0142] The mask resistance compensation adopts a dynamic update strategy: Updated in real time using an exponentially weighted moving average (EWMA) with a decay factor. ,Right now This design allows the compensation volume to track slow changes in the patient's breathing pattern (such as decreased respiratory flow as they transition from wakefulness to deep sleep) while smoothly suppressing sudden changes in flow within a single respiratory cycle (such as instantaneous surges caused by sighs or changes in body position). In APAP mode, the treatment pressure may range from 4 to 20. The system dynamically adjusts within a certain range, and the mask resistance compensation also updates dynamically with changes in treatment pressure—because higher treatment pressures typically correspond to larger inspiratory flow rates (increased ventilation due to reduced airway resistance), requiring greater resistance compensation. The system recalculates once per respiratory cycle. And update the pressure control target value.

[0143] The S620 compares the mask type identification result of the current power-on cycle with the previously stored result to detect mask replacement events.

[0144] Each time the device powers on and executes steps S100-S200 to complete mask recognition, the system reads the recognition result from the previous power-on cycle stored in the SPI Flash for comparison. The comparison logic is as follows: When the type of mask identified this time is different from the last time (e.g., the last time it was a nose mask, and this time it is a mouth-nose mask), the system determines that a mask replacement event has occurred. After the mask is replaced, the system automatically performs the following reset operations: updates the intentional leakage baseline to the parameters corresponding to the new mask type (S310 is re-executed); resets the initial baseline value for mask aging tracking (sets the current exhaust port flow coefficient). Store as a new benchmark ); Reset the air leak detection parameters (enable or disable depending on the new mask type); Update the minimum pressure safety limit (S420 re-execute).

[0145] When the type of mask identified this time is the same as the last time, but there is a large deviation in the three-dimensional feature data (the deviation in any dimension exceeds 30%), the system marks it as a "same type mask replacement" event (the user may have replaced the mask with the same type but a different brand / model), and the baseline reset is also performed.

[0146] The results of the mask replacement event and the comparison of the characteristic data of the old and new masks are sent to the accompanying APP via Bluetooth for user confirmation.

[0147] The S630 tracks the exhaust port flow coefficient over a long period and generates a mask maintenance reminder when the change exceeds a preset aging threshold.

[0148] Over long-term use, factors such as silicone material aging, grease or dust accumulation in the vents, and headband loosening causing deformation of the sealing surface can alter the aerodynamic characteristics of the face mask. The system monitors the vent flow coefficient over a long period. The changing trend is monitored to assess the aging status of the face mask.

[0149] Aging monitoring was performed on the first measurement after the face mask was replaced. Value as a benchmark Each time the machine is turned on, a new measurement is obtained. After setting the value, calculate its rate of change relative to the benchmark:

[0150] when This indicates an increase in vent flow, which may be caused by wear and enlargement of the vent or deformation of the silicone sealant leading to an increased opening area. The system generates a maintenance prompt: "Ventilation vents on the face mask are worn; replacement of the face mask is recommended."

[0151] when This indicates a decrease in airflow through the vents, which may be caused by grease or dust clogging the vents. The system generates a maintenance message: "Face mask vents are clogged; cleaning the face mask is recommended."

[0152] when At that time, the face mask was in normal working order. The system was also tracking... The trend of change (the slope of the linear fit of the data of the most recent 30 days) is used to predict that the face mask will reach the replacement threshold within 2 to 4 weeks. Preventive maintenance suggestions will be sent to users in advance.

[0153] Maintenance prompts are pushed to the app via Bluetooth and simultaneously displayed as icons on the device's LCD screen (green mask icon indicates normal operation, yellow indicates nearing replacement threshold, and red indicates replacement recommended). Aging tracking data is stored daily in the SPI Flash, with each record including a date and timestamp, and the measurement taken upon first power-on that day. value, Rate of change and slope of linear trend. The SPI Flash allocates 4KB of storage space for the mask's lifecycle data, which can store 256 days of historical data based on 16 bytes per record. A circular overwrite strategy is used to ensure that storage does not overflow.

[0154] Another function of mask aging monitoring is to provide physicians with an assessment of mask usage compliance. Some patients continue to use their masks even after they have become severely aged, leading to deviations in the exhaust port flow characteristics from standard values ​​and a decrease in the accuracy of the intentional leakage baseline. When the mask usage exceeds 25%, the system will not only issue a replacement prompt but also mark a "mask expired" warning in the treatment report. This allows physicians to assess the impact of the mask's condition on the reliability of treatment data during follow-up visits. The mask health page on the app displays the number of days the mask has been used and its current status. Expected remaining usage days (based on trend extrapolation) and historical Value change curve.

[0155] In another embodiment, this application also provides a smart adaptation system for self-identifying parameters of home ventilator mask types. For example... Figure 3 As shown, the system includes the following modules: The mask aerodynamic characteristics acquisition module runs on the STM32F407 main controller and is automatically activated during the ramp-up phase after the device is powered on. This module coordinates the data acquisition timing of the SDP810 flow sensor and the ADC3 pressure sensor, controls the BLDC fan to output stably at a preset pressure point, and executes a complete test sequence including exhaust port flow rate test (S110), dead space volume estimation (S120), and aerodynamic resistance measurement (S130). The test results are stored in a structured data format in a RAM buffer, awaiting reading by the mask type recognition module.

[0156] Face mask type recognition module: This module receives 3D feature data output from the face mask aerodynamic characteristic acquisition module, constructs a normalized feature vector, reads standard feature templates for three face mask types from the SPI Flash, executes the nearest neighbor distance classification algorithm to determine the face mask type, and calculates the recognition confidence score to perform a three-level hierarchical decision. The recognition result and confidence score information are written to persistent storage in the SPI Flash, and simultaneously notified to downstream adapter modules through an inter-module message queue.

[0157] Leakage baseline adaptation module: This module is activated after receiving the mask type identification result, reads the exhaust port flow model parameters of the corresponding mask type (preferably using measured values, with alternative template standard values), establishes the intentional leakage baseline function, and performs leakage separation calculation in real time at the end-expiratory resting segment of each subsequent respiratory cycle, outputting the unintentional leakage amount to the leakage management strategy module to trigger a graded response.

[0158] Treatment parameter adaptation module: This module calculates the dead space compensation amount based on the dead space volume corresponding to the mask type, sets a minimum treatment pressure safety limit and writes it into the parameter register of the pressure control module, and adjusts the hypoventilation judgment threshold of the respiratory event detection algorithm according to the dead space volume. The output value of this module has the highest safety priority, and the hardware limiting logic of the pressure control module ensures that the actual output pressure does not fall below a certain level in any mode. .

[0159] Oral leakage management module: This module determines whether to activate based on the start / stop flag of the mask type identification result. After activation, the module calculates the deviation between the measured leakage volume and the intentional leakage baseline in the second half of each exhalation phase, detects oral leakage events based on a threshold criterion for three consecutive cycles, and, upon confirmation of the event, triggers the humidification module to increase humidification output, notifies the pressure control module to reduce the EPR amplitude, and pushes a notification message to the APP via Bluetooth.

[0160] Face mask status management module: This module performs face mask pressure drop compensation (... This module includes functions such as overlaying the device output pressure setpoint, mask replacement detection (comparing mask type and characteristic data from adjacent startup cycles), and mask aging monitoring (long-term tracking of the rate of change of the exhaust port flow coefficient relative to a baseline). It manages the mask lifecycle data storage area in the SPI Flash and supports reading the mask health time series from the APP.

[0161] Each of the above modules is implemented as a software functional unit within the STM32F407 main controller. The processor core in the main controller executes the corresponding program instructions in memory to complete the functions of each module. The modules interact with each other through a shared memory area and an inter-module message queue, following a unidirectional data flow architecture of "test-identification-adaptation".

[0162] The system's runtime sequence is divided into two stages.

[0163] Startup Phase: After the device is powered on, the mask aerodynamic characteristic acquisition module performs the S100 test during the ramp-up phase (approximately 15 seconds). After the test, the mask type identification module completes the S200 classification decision within 50ms, and then notifies the leakage baseline adaptation module, treatment parameter adaptation module, oral leakage management module, and mask status management module in parallel via message queue to load the new parameters. All parameter loading is completed within 200ms, and the entire identification and adaptation process during the startup phase is transparent to the user.

[0164] Treatment Phase: Each adapter module enters a periodic operation state—the leak baseline adapter module performs a leak separation calculation once per respiratory cycle, the oral leak management module performs an oral leak detection once per expiratory phase, and the mask status management module updates the resistance compensation value once per respiratory cycle. Mask replacement detection and aging monitoring are only performed once per power-on.

[0165] The system employs a priority-based preemptive task scheduling: pressure control tasks (1ms cycle) have the highest priority to ensure stable pressure output, flow acquisition tasks (10ms cycle) have the second highest priority, and mask recognition and parameter adaptation tasks are low-priority background tasks. This scheduling architecture ensures that the mask recognition process does not affect basic pressure control and ventilation safety.

[0166] The SPI Flash storage area is divided as follows: Feature Template Area (1KB, storing standard feature vectors and normalized parameters for three mask types), Current Status Area (256 bytes, storing the most recent mask recognition result, confidence level, raw 3D feature data, and current parameter values ​​for each module), Aging Tracking Area (4KB, storing daily variation records of the exhaust port flow coefficient), and Treatment Record Area (16KB, storing the port leakage index, leakage event statistics, and mask replacement history). The Feature Template Area supports updates via OTA firmware upgrades—when a new mask design appears on the market that renders the existing three types of templates incompatible, a firmware patch containing the new template data can be sent via the APP to update the feature template library within the device. During the update process, the system maintains normal treatment functionality without interruption, and the new template takes effect upon the next power-on.

[0167] This system also provides a face mask compatibility verification function: when a user registers a newly purchased face mask model through the APP, the system will automatically compare the measured 3D feature data with the cloud-based face mask database (maintained by the device manufacturer) upon the next system startup to verify whether the face mask model is in the verified compatibility list. If the face mask model is not in the list but the classification result has a high confidence level, the system will continue to use it normally and anonymously upload the face mask's feature data to the cloud to expand the coverage of the face mask database.

[0168] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware.

[0169] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for intelligent adaptation of parameters for self-identification of home ventilator mask type, characterized in that, include: During the equipment pressurization phase, perform multi-dimensional aerodynamic characteristic tests on the currently connected mask to obtain the mask's exhaust port flow characteristic parameters, dead space volume parameters, and aerodynamic resistance parameters. Based on the exhaust port flow characteristic parameters, the dead space volume parameters, and the aerodynamic resistance parameters, a mask feature vector is constructed. The mask feature vector is then classified and matched with a preset mask type feature template to determine the current mask type. Based on the determined mask type and the exhaust port flow characteristic parameters, a corresponding exhaust port flow model is established and an intentional leakage baseline is set. Based on the intentional leakage baseline, the unintentional leakage amount is separated from the total leakage amount. Based on the deviation between the dead space volume parameter corresponding to the determined mask type and the preset reference dead space volume, the dead space compensation amount is determined and the minimum treatment pressure safety limit is set.

2. The method according to claim 1, characterized in that, The parameters for obtaining the exhaust port flow characteristics of the face mask include: Steady-state leakage flow rate at the end-expiratory resting phase was measured at multiple preset pressure points during the low-pressure stabilization phase. Based on the steady-state leakage flow rate corresponding to the multiple preset pressure points, a power-law relationship model between the exhaust port flow rate and pressure is fitted to obtain the exhaust port flow rate coefficient and pressure index.

3. The method according to claim 1, characterized in that, The method for obtaining the dead space volume parameters of the mask includes: The inflection point of the slope change of the flow rate curve in the initial stage of exhalation is detected to determine the time when the dead space gas flushing is completed; The flow rate signal from the start of exhalation to the completion of the dead space gas flushing is integrated to obtain an estimated value of the dead space volume.

4. The method according to claim 1, characterized in that, The step of classifying and matching the mask feature vector with a preset mask type feature template to determine the current mask type includes: Normalize each dimension of the mask feature vector, and calculate the distance between the normalized mask feature vector and the feature template of each mask type; The type corresponding to the mask type feature template with the smallest distance is selected as the recognition result, and the recognition confidence is determined based on the nearest and second-nearest distances. A tiered decision is made based on the recognition confidence level. When the confidence level is higher than the first threshold, the parameters corresponding to the recognition result are automatically applied. When the confidence level is between the first threshold and the second threshold, the parameters are applied and the user is prompted for confirmation. When the confidence level is lower than the second threshold, the existing settings are maintained.

5. The method according to claim 1, characterized in that, After determining the dead space compensation amount based on the dead space volume corresponding to the determined mask type and setting the minimum treatment pressure safety limit, the method further includes: The sensitivity of respiratory event detection is adjusted in conjunction with the deviation between the dead space volume and the preset reference dead space volume, wherein the sensitivity of low ventilation detection is increased when the dead space volume is greater than the reference dead space volume.

6. The method according to claim 1, characterized in that, After determining the current mask type, the process also includes: Determine whether to enable mouth leakage detection based on the mask type. When the mask type is a nose mask or nose pillow, mouth leakage detection is enabled. When the mask type is a mouth and nose mask, mouth leakage detection is disabled. When oral leakage detection is enabled, oral leakage events are identified by monitoring the abrupt changes in the amount of air leakage during the expiratory phase, and the humidification compensation amount and expiratory pressure relief parameters are adjusted accordingly when an oral leakage event is detected.

7. The method according to claim 2, characterized in that, After determining the current mask type, the process also includes: The mask pressure drop compensation amount is determined based on the aerodynamic resistance parameters and the average peak intake flow rate, and the device output pressure is increased by the mask pressure drop compensation amount. The currently identified mask type is compared with the previously stored identification result. If the two are inconsistent, it is determined to be a mask replacement event, and the leakage baseline and mask status tracking baseline are reset. The flow coefficient of the exhaust port is tracked over a long period of time. When the change in the flow coefficient of the exhaust port relative to the initial reference exceeds a preset aging threshold, a mask maintenance prompt is generated.

8. A home-use ventilator mask type self-identification parameter intelligent adaptation system, characterized in that, include: The mask aerodynamic characteristics acquisition module is used to perform multi-dimensional aerodynamic characteristic tests on the currently connected mask during the equipment pressurization phase to obtain the mask's exhaust port flow characteristic parameters, dead space volume parameters, and aerodynamic resistance parameters. The mask type identification module is used to construct a mask feature vector based on the exhaust port flow characteristic parameters, the dead space volume parameters, and the aerodynamic resistance parameters, and to classify and match the mask feature vector with a preset mask type feature template to determine the current mask type. The leakage baseline adaptation module is used to establish a corresponding exhaust port flow model and set an intentional leakage baseline based on the determined mask type and the exhaust port flow characteristic parameters, and to separate the unintentional leakage amount from the total leakage amount based on the intentional leakage baseline. The treatment parameter adaptation module is used to determine the dead space compensation amount and set the minimum treatment pressure safety limit based on the deviation between the dead space volume parameter corresponding to the determined mask type and the preset reference dead space volume.

9. The system according to claim 8, characterized in that, Also includes: The oral leakage management module is used to determine whether to enable oral leakage detection based on the mask type. When the mask type is a nasal mask or nasal pillow, oral leakage detection is enabled, and when an oral leakage event is detected, the humidification compensation amount and exhalation pressure relief parameters are adjusted accordingly.

10. The system according to claim 8, characterized in that, Also includes: The mask status management module is used to determine the mask pressure drop compensation amount based on the aerodynamic resistance parameters to compensate for the pressure loss caused by the mask resistance, and to detect mask replacement events and track mask aging status by comparing the mask type identification results of adjacent start-up cycles.