A method for processing respiratory flow signal based on dynamic calibration and normalization

By using individualized chemotherapy course calibration and environmental adaptive preprocessing, the problems of individual differences and environmental interference in respiratory signal detection are solved, achieving high-precision quantification of respiratory flow signals, which is suitable for VR respiratory interaction.

CN122250973APending Publication Date: 2026-06-23ZHEJIANG CANCER HOSPITAL
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-20
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing respiratory signal detection solutions do not fully consider individual differences in respiratory capacity, environmental interference, and equipment consistency issues, resulting in insufficient quantification accuracy and an inability to accurately reflect the user's true respiratory status.

Method used

A respiratory flow signal processing method based on dynamic calibration and normalization is adopted. The signal is collected by flow sensor and environmental sensor, filtered, zero-point calibrated and temperature and humidity compensated to generate individualized calibration parameters, and then normalized to extract auxiliary feature parameters.

Benefits of technology

It significantly improves the quantization accuracy and cross-device consistency of respiratory flow signals, with an error of less than 5%, providing accurate signal input for VR breathing interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122250973A_ABST
    Figure CN122250973A_ABST
Patent Text Reader

Abstract

The application provides a respiratory flow signal processing method based on dynamic calibration and normalization, individual differences are eliminated through individual treatment course calibration, temperature and humidity interference is eliminated through environment adaptive preprocessing, and zero point calibration precision is improved through adaptive Kalman filtering, so that the quantization precision (error is less than or equal to 5%) and cross-device consistency (error is less than or equal to 3%) of the respiratory flow signal are significantly improved. The method can be widely applied to the respiratory rehabilitation training scenes of children, the elderly and adults, and provides accurate signal input for VR respiratory interaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of respiratory rehabilitation training technology, and in particular to a respiratory flow signal processing method based on dynamic calibration and normalization, as well as a respiratory flow signal processing system, electronic device, and computer-readable storage medium based on dynamic calibration and normalization. Background Technology

[0002] In scenarios such as respiratory rehabilitation training and pulmonary function assessment, the quantification accuracy of respiratory flow signals directly affects the training effect and diagnostic accuracy. Existing respiratory signal detection solutions mostly use fixed thresholds or universal calibration parameters, which do not fully consider individual differences in respiratory capacity (e.g., the maximum inspiratory flow rate of children and adults can differ by 3-5 times), environmental interference (changes in temperature and humidity can cause flow sensor output drift, with errors reaching 10%-20%), and equipment consistency issues (different batches of sensors have large differences in zero-point offset). This results in insufficient quantification accuracy of key indicators such as Qrel (errors often exceed 15%), failing to accurately reflect the user's true respiratory status. Summary of the Invention

[0003] To address the technical problems existing in the prior art, the present invention provides the following technical solution: On the one hand, a respiratory flow signal processing method based on dynamic calibration and normalization is provided. This method is implemented by an electronic device and includes: The respiratory flow signal Q is collected by a flow sensor, and the ambient temperature T and ambient humidity H are collected by an environmental sensor. The respiratory flow signal Q is preprocessed, including filtering, zero-point calibration, and temperature and humidity compensation. Dynamic calibration is performed based on the preprocessed respiratory flow signal to generate individualized calibration parameters, including the zero point. and maximum inspiratory flow rate Qmax; The preprocessed respiratory flow signal Q_comp was normalized to obtain the relative inspiratory index Qrel; Extract auxiliary feature parameters related to respiratory quality.

[0004] Preferably, the preprocessing step includes: An adaptive recursive least squares filter is used to filter the respiratory flow signal Q. Perform zero-point calibration, including static zero-point adjustment and dynamic zero-point tracking; Temperature and humidity compensation is performed on the filtered flow signal based on a polynomial compensation model, wherein the compensation model is as follows: Q compensation = Q filter × [1 + α × (T - ... )+β×(H- )+γ×(T- )×(H- ),in: Q-compensation refers to the compensated flow rate signal, Q-filtering refers to the filtered flow rate signal after Q-filtering, and T represents the ambient temperature. Here, H represents the standard temperature and H represents the ambient humidity. The standard humidity is represented by α, β, and γ, which are weighting coefficients, respectively.

[0005] Preferably, the dynamic calibration step includes: Initial calibration process: Prompt the user to maintain calm breathing, collect samples, and perform calculations. The system prompts the user to take a deep breath to collect peak flow and calculate Qmax. Regular update mechanism: The calibration process is automatically triggered after each preset number of training sessions to update... And the Qmax parameter.

[0006] Preferably, the normalization process includes: When Q compensation < At that time, Qrel=0; when When ≤Q compensation ≤ Qmax, Qrel = (Q compensation - ) / (Qmax- ); When Q compensation > Qmax, Qrel = 1.

[0007] Preferably, the auxiliary feature parameter extraction includes: Inspiratory duration T_in: The time difference between the start and end of inspiratory breathing is calculated using a threshold method. Inspiratory stability S_in: The coefficient of variation of the Q_comp signal during inhalation; Respiratory rate f: Calculates the number of breaths inhaled per unit time.

[0008] Preferably, the zero-point calibration step employs adaptive Kalman filtering to estimate the zero-point offset in real time, including: Establish a state vector to describe the dynamic changes of zero-point offset and the influence of temperature and humidity; By predicting and updating the cyclical fusion of measurement data and system model; The Sage-Husa algorithm is used to adaptively adjust the noise covariance matrix.

[0009] Preferably, the adaptive Kalman filter includes: Initialize the state estimate, error covariance matrix, process noise covariance matrix, and observation noise covariance matrix; Perform the prediction step to obtain the predicted state values ​​and the prediction error covariance matrix; The state estimate is updated based on the observed data, and the zero-point offset is output.

[0010] Preferably, the method further includes a data storage step: Individualized calibration parameters, feature summaries, and training history are stored in a local encrypted database; After user authorization, the anonymized data will be uploaded to cloud storage.

[0011] Preferably, the method is implemented via a WeChat mini-program, and includes: Establish a connection with the BLE module using the wx.createBLEConnection interface; Receive traffic and environmental data in real time; The processed data will be used for VR breathing interaction.

[0012] On the other hand, a respiratory flow signal processing system based on dynamic calibration and normalization is provided, including: The hardware awareness layer includes: The flow sensor module is used to acquire the respiratory flow signal Q; An environmental sensor module is used to collect ambient temperature T and ambient humidity H. The BLE communication module is used to transmit the collected data. The software processing layer, running on the WeChat Mini Program platform, includes: The signal receiving module is used to receive data transmitted by the hardware sensing layer; The preprocessing module is used to filter, zero-point calibrate, and compensate for temperature and humidity in the respiratory flow signal; The dynamic calibration module is used to generate individualized calibration parameters. and Qmax; The normalization module is used to convert the compensated flow signal into a relative intake index Qrel; An auxiliary feature extraction module is used to extract feature parameters related to respiratory quality; The data storage layer includes: A local storage module is used for encrypted storage of individualized parameters and training data; The cloud storage module is used to store anonymized data; The hardware sensing layer communicates with the software processing layer via Bluetooth, and the software processing layer communicates with the data storage layer via a network connection.

[0013] On the other hand, an electronic device is provided, comprising: a processor; and a memory storing computer-readable instructions, which, when executed by the processor, implement any of the above-described methods for processing respiratory flow signals based on dynamic calibration and normalization.

[0014] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, the at least one instruction being loaded and executed by a processor to implement any of the above-described respiratory flow signal processing methods based on dynamic calibration and normalization.

[0015] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: Individual differences are eliminated through individualized chemotherapy course calibration, temperature and humidity interference is eliminated through adaptive environmental preprocessing, and zero-point calibration accuracy is improved through adaptive Kalman filtering. This significantly improves the quantization accuracy (error ≤ 5%) and cross-device consistency (error ≤ 3%) of the respiratory flow signal. This method can be widely applied to respiratory rehabilitation training scenarios for children, the elderly, and adults, providing accurate signal input for VR respiratory interaction. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a block diagram of a respiratory flow signal processing system based on dynamic calibration and normalization provided in an embodiment of the present invention; Figure 2 This is a flowchart of a training phase provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the process mechanism of a zero-point calibration submodule provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0020] The technical solution of the present invention will now be described with reference to the accompanying drawings.

[0021] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.

[0022] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning.

[0023] In this embodiment of the invention, sometimes a subscript such as W1 may be mistakenly written as a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.

[0024] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0025] I. Technical Objectives of the Invention To address the aforementioned issues, this invention proposes a respiratory flow signal processing method based on dynamic calibration and normalization. Through individualized treatment course calibration, environmentally adaptive preprocessing, and a real-time normalization algorithm, it eliminates individual differences and environmental interference, improving signal quantization accuracy and cross-device consistency. This method can be integrated into a WeChat mini-program and used with a BLE peripheral flow sensor, making it suitable for home-based respiratory rehabilitation training scenarios.

[0026] II. System Hardware and Software Components The implementation of this method relies on a three-layer architecture: "hardware perception layer - software processing layer - data storage layer," the specific components of which are as follows: Figure 1 As shown: (a) Hardware perception layer Used to collect respiratory flow signals and environmental parameters, including: Flow sensor module: adopts a venturi differential pressure flow meter (range 0-100L / min, accuracy ±2%FS) or a dual thermistor array flow meter (response time ≤10ms, strong resistance to water accumulation), installed at the breathing mask or mouthpiece, to directly collect the user's inhalation / exhalation flow signal Q (unit: L / min).

[0027] Environmental sensor module: integrated within the flow sensor housing, including: Temperature sensor (DS18B20, range -10~85℃, accuracy ±0.5℃); Humidity sensor (DHT11, range 20%~90%RH, accuracy ±5%RH); Used to collect ambient temperature and humidity data (T, H) to provide input for signal compensation.

[0028] BLE communication module: Employs Nordic RF52832 chip (supports BLE 5.0, transmission rate 2Mbps, latency ≤10ms), packages the flow signal Q and temperature and humidity data (T, H) in a structured format for transmission. For example, it includes a set of data with a flow signal value of 35.2L / min, a temperature value of 25.1℃, and a humidity value of 60.5%RH (where Q represents the respiratory flow signal in L / min; T represents the ambient temperature in ℃; and H represents the ambient humidity in %RH), and transmits it to the terminal device through the service feature value with UUID 0x181A.

[0029] Power module: Uses a 3.7V / 500mAh lithiumpolymer battery, supports continuous operation for 8 hours, and is equipped with a Type-C charging interface.

[0030] (ii) Software processing layer Running on WeChat Mini Programs (supporting iOS / Android systems), it is responsible for signal preprocessing, dynamic calibration, and normalization, and includes the following core modules: Signal receiving module: Establishes a connection with the BLE module through the wx.createBLEConnection interface of the WeChat mini program, subscribes to the notification of the 0x2A7E feature value, and receives traffic and environmental data in real time (sampling rate 10Hz).

[0031] Preprocessing module: Includes three sub-modules: filtering, zero-point calibration, and temperature and humidity compensation, used to eliminate noise and environmental interference. The filtering submodule employs an adaptive recursive least squares (RLS) filter (forgetting factor λ=0.95, order N=4) to filter the flow signal Q. The RLS filter can dynamically adjust the weights to suppress high-frequency noise (such as signals above 10Hz generated by coughing or talking) and baseline drift in the respiratory signal, improving the signal-to-noise ratio (SNR) by more than 20dB compared to traditional FIR filters.

[0032] Zero-point calibration submodule: divided into static zero-point adjustment and dynamic zero-point tracking. Static zero-point adjustment: When the user uses it for the first time, they are required to remain calm for 10 seconds (without breathing), collect 100 samples (10Hz sampling rate), and calculate the average value as the initial zero point Q0_static (e.g., Q0_static=(Q1+Q2+...+Q100) / 100); Dynamic zero-point tracking: During training, a static detection is triggered every 60 seconds (prompting the user to "please pause breathing for 1 second"), collecting 10 samples, and calculating the moving average to update the zero point Q0_dynamic (e.g., Q0_dynamic=0.8*Q0_prev+0.2*Q_current_avg, where Q0_prev is the previous zero-point value and Q_current_avg is the average of the current 10 samples), to compensate for zero-point drift after the sensor has been working for a long time (drift amount ≤0.5L / min / hour).

[0033] Temperature and humidity compensation submodule: Based on sensor calibration data, a polynomial compensation model is established. Compensated flow signal Q_compensated = Filtered flow signal Q_filtered × [1 + α × (Ambient temperature T - Standard temperature)] )+β×(Ambient humidity H-Standard humidity) )+γ×(Ambient temperature T-Standard temperature) )×(Ambient humidity H-Standard humidity) )], The original flow signal is corrected by linear and cross terms of temperature and humidity deviations; sensor output drift caused by temperature and humidity changes is eliminated, thereby improving the environmental adaptability and accuracy of the flow signal.

[0034] in: (T_0=25℃), (H_0=60%RH): Standard environmental parameters for sensor calibration; (α=-0.002 / ℃), (β=-0.001 / %RH), (γ=0.00001 / (℃·%RH)): Compensation coefficients (error ≤1%) obtained through calibration experiments of a standard flow source (such as a TSI4080 flow generator) under different temperatures and humidity.

[0035] Dynamic calibration module: used to generate individualized calibration parameters (Q0, Qmax), divided into initial calibration and periodic updates. Initial calibration process (triggered during the user's first training): Step 1: Prompt the user to "Please maintain calm breathing for 15 seconds", collect 150 samples (10Hz), and calculate the Q-mean of each window using the sliding window method (window size 1 second, step size 0.5 seconds). Take the average of the three smallest window averages as the calm breathing zero point 00 (e.g., Q0=(avg_win1+avg_win2+avg_win3) / 3, where avg_win1 is the smallest window average). Step 2: Prompt the user "Please take a deep breath to the maximum extent and hold for 2 seconds", repeat 2 times, collect the peak flow rate of each inhalation (e.g., Q_peak1 = max(Q1~Q20), Q_peak2 = max(Q21~Q40)), and take the maximum value as the maximum inspiratory flow rate Qmax (Qmax = max(Q_peak1, Q_peak2)); Step 3: Store Q0 and Qmax in the local encrypted database (encrypted using AES-256, with the key generated from the user's WeChat OpenID), as the basic parameters for subsequent normalization.

[0036] Regular update mechanism: After every 5 training sessions, automatically trigger the calibration process (Steps 1-3) to update Q0 and Qmax (e.g., Qmax for child users may increase with growth and development, and Qmax for elderly users may decrease due to declining lung function), ensuring that the parameters are dynamically matched with the individual's breathing ability.

[0037] Normalization module: Convert the compensated real-time flow signal Q_comp to the relative inspiratory index Qrel, with the formula as follows: The calculation rule for the relative inspiratory index Qrel is: When the compensated flow signal Q_comp < the zero point Q0, Qrel = 0; When the zero point Q0 ≤ Q_comp ≤ the maximum inspiratory flow rate Qmax, Qrel = (Q_comp - Q0) ÷ (Qmax - Q0); When Q_comp > Qmax, Qrel = 1.

[0038] Zero point calibrated based on individual chemotherapy And the maximum inspiratory flow rate Qmax, normalize the real-time flow signal; eliminate the differences in breathing ability among different users, making the Qrel index comparable across individuals.

[0039] Among them, the value range of Qrel is [0, 1], which is used to eliminate individual differences (e.g., for adults, Qmax = 80 L / min, for children, Qmax = 40 L / min, when the same Qrel = 0.5, it corresponds to 35 L / min for adults and 20 L / min for children, both representing 50% of the maximum inspiratory ability).

[0040] Auxiliary feature extraction module: Extract features related to breathing quality for subsequent VR interaction and difficulty adjustment: Inspiratory duration T_in: Use the threshold method to detect the start and end moments of inhalation (start threshold: Q_comp > Q0 + 0.1 L / min; end threshold: Q_comp < Q0 + 0.1 L / min), and calculate the time difference (e.g., T_in = t_end - t_start, unit: seconds); Inspiratory stability S_in: Calculate the coefficient of variation (CV) of the Q_comp signal during the inspiratory process. The formula is as follows: Inspiratory stability S_in = (standard deviation of the Q_comp signal in the inspiratory segment ÷ average value of the Q_comp signal in the inspiratory segment) × 100%, The smoothness is reflected by calculating the coefficient of variation of the Q_comp signal during inspiration, quantifying the stability of the user's inspiration, and providing data support for subsequent training difficulty adjustment.

[0041] The smaller S_in is, the more stable the inspiratory flow is (for example, S_in ≤ 10% is excellent, 10% < S_in ≤ 20% is good, > 20% is unstable); Respiratory rate f: Calculate the number of inspirations within 1 minute (such as f = 60 / (t_in + t_out), where t_out is the duration of expiration), which is used to determine whether the user is in a fatigued state (for example, a rest prompt is triggered when f > 20 times / minute).

[0042] (III) Data storage layer Follow the privacy policy of "local first, desensitized upload": Local storage: Use the wx.setStorageSync interface of the WeChat Mini Program to store the following data: Individual calibration parameters (Q0, Qmax): Store them after encryption (the encryption key is generated by combining the user's WeChat OpenID and the device MAC address); Feature summary (including the average value of the relative inspiratory index, the median of the inspiratory duration, and the maximum value of the inspiratory stability): Store it in a structured format. For example, a set of feature summary data is the average value of the relative inspiratory index 0.65, the median of the inspiratory duration 3.2 seconds, and the maximum value of the inspiratory stability 18.5% (where Qrel_avg represents the average value of the relative inspiratory index, T_in_med represents the median of the inspiratory duration, and S_in_max represents the maximum value of the inspiratory stability); Training history (such as the date, duration, and completion rate of each training): Store it in an array form (such as [{"date": "2024-05-01", "duration": 1200, "completion": 85}]).

[0043] Cloud storage: After user authorization, anonymized data (with sensitive information such as user identifiers and device MAC addresses removed) is uploaded to Alibaba Cloud OSS (Object Storage Service) for model optimization (such as updating temperature and humidity compensation coefficients α, β, and γ). Uploaded data includes information such as the average relative inhalation index, ambient temperature, ambient humidity, and user type. For example, an anonymized set of data might have an average relative inhalation index of 0.65, an ambient temperature of 25.1℃, an ambient humidity of 60.5%RH, and a user type of "child" (where Qrel_avg represents the average relative inhalation index, T represents ambient temperature, H represents ambient humidity, and user_type represents the user-selected type: child / elder / adult). III. System Connection Relationships and Hardware / Software Interaction Methods (a) System Connection Relationships Hardware sensing layer → Bluetooth connection → Software processing layer (WeChat Mini Program); Software processing layer → Network connection → Data storage layer (local + cloud). Specifically: After the flow sensor and environmental sensor collect data, it is transmitted to the software processing layer of the WeChat Mini Program via Bluetooth 5.0 through the BLE communication module; the software processing layer stores the processed data in a local encrypted database, and uploads the de-identified data to the cloud storage layer after user authorization.

[0044] (ii) Hardware and software interaction methods 1. Hardware-to-software interaction: The flow sensor and environmental sensor in the hardware perception layer collect Q, T, and H data, which are transmitted to the signal receiving module in the software processing layer in a structured format (including the values ​​and units of Q, T, and H) through the BLE communication module. The signal receiving module subscribes to feature value notifications through the wx.createBLEConnection interface and receives data in real time (sampling rate 10Hz).

[0045] 2. Internal interaction of the software layer: The signal receiving module transmits data to the preprocessing module (filtering, zero-point calibration, temperature and humidity compensation). The preprocessed data enters the dynamic calibration module to generate individualized parameters, and then passes through the normalization module to obtain Qrel. The auxiliary feature extraction module extracts features such as T_in, S_in, and f. The processed data is stored locally / in the cloud and used for subsequent VR interaction and difficulty adjustment (Qrel and feature summary (T_in, S_in, f) are transmitted to the VR interaction module to drive the virtual character's actions (such as the speed at which an elephant drinks water)).

[0046] 3. Software-to-hardware feedback: The software processing layer generates training feedback (such as prompting the user to adjust their breathing rhythm) based on the feature extraction results, which is displayed to the user through the WeChat mini program interface. At the same time, it can drive hardware devices (such as the status indicator light of the BLE module) to display the connection or data transmission status.

[0047] IV. Specific Application Steps Taking home-based respiratory rehabilitation training for children (6-12 years old) as an example, the application process of this method is explained: (a) Preparation stage (first use) Users open the WeChat mini program and click "Start Training". The mini program automatically searches for nearby BLE devices (named "RespiratorySensor-XXXX", where XXXX is the last four digits of the device's MAC address). When the user selects the corresponding device, the mini-program establishes a BLE connection (prompting "Connection successful"). The mini-program prompts "Please wear a breathing mask and remain calm." The user then puts on the mask (the mask is made of food-grade silicone material and is suitable for children's facial contours). Triggering static zero-point adjustment: The mini-program prompts "Please pause breathing for 10 seconds", collects 100 samples, and calculates Q0_static=0.5L / min (the zero point of calm breathing in children is usually slightly higher than that in adults); Triggering initial calibration: Step 1: Prompt "Please maintain calm breathing for 15 seconds", collect 150 samples, and calculate Q0 = 1.2 L / min (the flow rate of calm breathing in children is slightly higher than that in adults). Step 2: The prompt "Please take a deep breath to the maximum extent and hold for 2 seconds" is given. The user performs this action twice, and the measured values ​​are Q_peak1 = 45.2 L / min and Q_peak2 = 47.8 L / min. The calculated value of Qmax is 47.8 L / min. Step 3: The mini-program displays "Calibration complete, your maximum inhalation flow rate is 47.8L / min" and stores Q0=1.2L / min and Qmax=47.8L / min locally.

[0048] (ii) Training phase (real-time processing, such as...) Figure 2 (As shown) When a user clicks "Start Training", the mini-program loads a scene exclusive to children (cartoon style, forest background, virtual character "Little Elephant Dudu"). The flow sensor collects the inspiratory flow rate Q (e.g., 35.2 L / min) in real time, and the BLE module transmits it to the mini-program; Mini Program Preprocessing: Filtering: An RLS filter is used to eliminate high-frequency noise in Q (such as the 15Hz signal generated by the user's cough), resulting in a filtered Q_filter = 34.8 L / min; Zero-point calibration: The dynamic zero-point tracking module is triggered every 60 seconds. The current Q0_dynamic = 1.3 L / min (0.1 L / min higher than the initial Q0_static, due to sensor drift caused by increased ambient temperature). Temperature and humidity compensation: Current ambient temperature T=26.5℃, humidity H=65.0%RH, substituting into the compensation formula, we get: Compensated flow rate Qcompensated = Filtered flow rate Qfiltered (34.8 L / min) × [1 + Temperature compensation coefficient α (-0.002) × (Current temperature T (26.5℃) - Standard temperature T0 (25℃)) + Humidity compensation coefficient β (-0.001) × (Current humidity H (65.0%RH) - Standard humidity] (60%RH) + cross term coefficient γ (0.00001) × (current temperature T - standard temperature T0) × (current humidity H - standard humidity H0)] = 34.8 × 0.995 = 34.6 L / min (compensation factor is calculated by combining temperature and humidity deviation and cross effect to correct the filtered flow rate; eliminate the flow signal drift caused by temperature and humidity changes and improve signal accuracy).

[0049] Mini-program execution normalization: Q_comp = 34.6 L / min, Q0 = 1.2 L / min, Qmax = 47.8 L / min, calculated as follows: Relative inspiratory index Qrel = (compensated flow rate Qcompensation (34.6 L / min) - zero point) (1.2L / min) ÷ (maximum inspiratory flow rate Qmax (47.8L / min) - zero point Q0 (1.2L / min)) = 33.4 ÷ 46.6 ≈ 0.717 (based on the zero point and maximum inspiratory flow rate calibrated for individual chemotherapy courses, the compensated flow rate is normalized; individual differences in respiratory capacity are eliminated, making the Qrel index comparable across individuals).

[0050] Since Q_comp is in the range [Q0, Qmax], Qrel = 0.72 (rounded to two decimal places). Mini-program for extracting auxiliary features: Inhalation duration T_in: Inhalation was detected to begin at t=0.5 seconds and end at t=3.8 seconds using a threshold method, and T_in was calculated to be 3.3 seconds. Inspiratory stability S_in: The standard deviation of inspiratory phase Q_comp σ = 2.1 L / min, and the average value μ = 34.6 L / min are calculated as follows: Inspiratory stability S_in = (Standard deviation of inspiratory Q_comp signal ÷ Average value of inspiratory Q_comp signal) × 100%, Respiratory rate f: The number of breaths in one minute is 18, so f = 18 breaths / minute (normal range). The mini-program transmits Qrel=0.72 and the feature summary (T_in=3.3, S_in=6.07%, f=18) to the VR interaction module to drive the little elephant Dudu's water-absorbing action (water absorption speed v=v0*Qrel, v0=0.5m / s, so v=0.36m / s).

[0051] (III) Conclusion (Data Storage and Feedback) Training ends (duration 10 minutes). The mini-program calculates the feature statistics of this training (e.g., the average value of Qrel = 0.68, the median of T_in = 3.0 seconds, and the maximum value of S_in = 12.5%). Store feature summaries and training history in a local encrypted database; The system prompts the user with "Training complete, your inspiratory stability is excellent!" and displays the Qrel change curve for this training session (e.g., a line graph with the time axis from 0 to 600 seconds and Qrel from 0 to 1). Ask the user "Do you authorize the upload of anonymized data?" After the user agrees, upload the data (such as {"Qrel_avg":0.68,"T":26.5,"H":65.0,"user_type":"child"}) to the cloud.

[0052] V. Intelligent Model / Algorithm Optimization: Zero-Point Calibration Optimization of Adaptive Kalman Filter To further improve the accuracy of zero-point calibration (especially drift compensation in dynamic environments), this method introduces an adaptive Kalman filter (AKF), which fuses the flow signal Q with temperature and humidity data (T, H) to adjust the zero-point offset in real time.

[0053] (I) Algorithm Principle Kalman filtering is a recursive state estimation method that obtains the optimal state estimate by fusing measurement data and the system model through a "prediction-update" loop. Adaptive Kalman filtering, based on traditional Kalman filtering, adds adaptive adjustment of the noise covariance matrix (such as using the Sage-Husa algorithm), solving the accuracy degradation problem caused by a fixed noise covariance matrix in traditional methods.

[0054] (II) System Model Establishment State vector: The state vector describes the dynamic changes of zero offset and the influence of temperature and humidity on the offset; it provides a basis for state estimation of adaptive Kalman filtering and improves the dynamic adaptability of zero calibration.

[0055] State equation: Assuming the state vector changes slowly over time (ignoring abrupt changes), the state equation is: , That is: the state vector at the current time k = the state transition matrix ×The state vector of k-1 at the previous moment +Process noise (in It is a 3×3 identity matrix, and it is assumed that there are no sudden changes in the state; The noise is the process noise, which has a mean of 0 and a covariance matrix of... The Gaussian distribution is used. The current state is recursively predicted based on the state of the previous time step, providing initial predicted values ​​for state estimation.

[0056] Observation equation: Observation vector The filtered flow rate signal Q_filter (unit: L / min) is observed using the following equation: Observation vector =Observation Matrix ×State vector at current time k +Observation noise , in This is the observation matrix, containing 1. the current temperature. Compared with standard temperature Deviation, current humidity Compared with standard humidity Deviation; The observed noise follows a mean of 0 and a covariance matrix of... The Gaussian distribution is used. The state vector is mapped to the observations; a correlation is established between the state and the observed data to update the state estimate.

[0057] in: , The temperature and humidity at time k are respectively, =25℃ =60%RH is the reference temperature and humidity.

[0058] (III) Adaptive Adjustment Strategy The Sage-Husa algorithm is used to update the process noise covariance matrix in real time. Covariance matrix of observation noise The steps are as follows: Calculate the predicted residuals: Predicted residuals =Observation Vector -Observation matrix ×State prediction value xhatk|k-1, Where xhatk|k-1 is the predicted state value at time k, obtained from the estimated state value at time k-1 through the state equation. The difference between the observed and predicted values ​​is calculated; the accuracy of the state prediction is evaluated, providing a basis for subsequent covariance updates.

[0059] Calculate the residual covariance: Residual Covariance =Observation Matrix ×Prediction error covariance matrix × Transpose + Observation Noise Covariance Matrix , in Let be the prediction error covariance matrix at time k, obtained from the error covariance matrix at time k-1 through the state equation. Calculate the covariance of the prediction residuals; this provides the basis for calculating the Kalman gain and optimizes the state update process.

[0060] Update the observation noise covariance matrix : Observation noise covariance matrix × Previous time-time observation noise covariance matrix ×(Predicted Residual) × Transpose-observation matrix ×Prediction error covariance matrix × (transpose), in As a weighting factor, α=0.95 is the forgetting factor, used to balance the weights of historical and current data. The observation noise covariance is adaptively adjusted; the filter's adaptability to changes in observation noise is improved, and the accuracy of state estimation is optimized.

[0061] Update process noise covariance matrix : , The process noise covariance matrix is... Let be the weighting factor ∈ (0,1), and α = 0.95 be the forgetting factor. The noise covariance matrix of the previous time step (from k-2 to k-1), For Kalman gain, To predict residuals, T denotes transpose. Let be the error covariance matrix at the current time. This represents the state transition matrix from k-1 to k. This represents the error covariance matrix at the previous time step; The first term represents the process noise covariance at the previous time step, and the subsequent terms are correction terms based on the current residual and covariance matrix.

[0062] By adaptively adjusting the process noise covariance, the accuracy of state prediction is optimized, and the filter's adaptability to changes in process noise is improved. Simultaneously, the Kalman gain is calculated to optimize the weights for state updates and adjust the error covariance, thereby improving the accuracy and reliability of state estimation.

[0063] (iv) Algorithm application process (e.g.) Figure 3 (As shown) In the zero-point calibration submodule, the zero-point offset (b_k) is estimated in real time using an adaptive Kalman filter. The steps are as follows: Initialization: The initial state estimate is set to a combination of the static zero-point adjustment value Q0_static, the initial value of the influence coefficient of temperature on zero-point offset (0), and the initial value of the influence coefficient of humidity on zero-point offset (0). The initial error covariance matrix is ​​a diagonal matrix, with diagonal elements corresponding to the initial error variances of the zero-point offset (0.1), temperature influence coefficient (0.001), and humidity influence coefficient (0.001), respectively. The initial process noise covariance matrix is ​​also a diagonal matrix, with diagonal elements corresponding to the process noise variance of each state. The initial observation noise covariance matrix is ​​0.1. (Definition: The initial parameters are the starting input values ​​for the adaptive Kalman filter; they provide the initial basis for the filtering algorithm; they ensure that the filtering process starts from a reasonable initial state, improving the accuracy of subsequent state estimations.) Prediction step (time k): The predicted state value at the current time k is equal to the estimated state value at the previous time k-1 (because the state transition matrix is ​​an identity matrix). The predicted state value is the estimated value of the current state based on the state estimate at the previous time; the current state is recursively predicted using the state transition matrix; this provides a basis for the state update step and reduces the dependence on real-time observation data.

[0064] The prediction error covariance matrix at the current time k is equal to the state estimation error covariance matrix at the previous time k-1 plus the process noise covariance matrix (since the state transition matrix is ​​the identity matrix).

[0065] The prediction error covariance matrix is ​​the covariance of the error between the predicted state and the actual state; it is used to calculate the error accumulation during the prediction process; it is used to evaluate the reliability of the state prediction and to provide a basis for calculating the Kalman gain.

[0066] Output zero offset: zero offset The first element of the current k-state estimate; the dynamic zero Q0_dynamic equals the static zero adjustment value Q0_static plus the zero offset. .(definition: Q0_dynamic represents the real-time estimated zero-point offset, and Q0_dynamic represents the compensated real-time zero point; the state-estimated offset is extracted and the zero point is updated; real-time compensation for sensor zero-point drift improves the accuracy of the flow signal. (V) Optimization effect verification Using a standard flow source (TSI4080) to simulate the breathing signals of pediatric users (Q=0-50L / min), the zero-point calibration accuracy was tested under different temperature and humidity conditions (T=20-30℃, H=50-70%RH). Traditional dynamic zero-point tracking (sliding window method): zero-point error is ±0.8L / min; Adaptive Kalman Filter (AKF): Zero-point error is ±0.3L / min; The accuracy has been improved by 62.5%, effectively solving the zero-point drift problem caused by changes in ambient temperature and humidity.

[0067] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention, such as... Figure 4 As shown, electronic device 410 may include a first processor 2001.

[0068] Optionally, the electronic device 410 may also include a memory 2002 and a transceiver 2003.

[0069] The first processor 2001, memory 2002, and transceiver 2003 can be connected via a communication bus.

[0070] The following is combined Figure 4 A detailed description of each component of electronic device 410 is provided below: The first processor 2001 is the control center of the electronic device 410. It can be a single processor or a collective term for multiple processing elements. For example, the first processor 2001 can be one or more central processing units (CPUs), application-specific integrated circuits (ASICs), or one or more integrated circuits configured to implement embodiments of the present invention, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).

[0071] Optionally, the first processor 2001 can perform various functions of the electronic device 410 by running or executing software programs stored in the memory 2002 and calling data stored in the memory 2002.

[0072] In a specific implementation, as one example, the first processor 2001 may include one or more CPUs, for example... Figure 4 CPU0 and CPU1 are shown in the diagram.

[0073] In a specific implementation, as one example, the electronic device 410 may also include multiple processors, for example... Figure 4 The first processor 2001 and the second processor 2004 are shown in the diagram. Each of these processors can be a single-core processor or a multi-core processor. Here, a processor can refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).

[0074] The memory 2002 is used to store the software program that executes the present invention, and is controlled by the first processor 2001 to execute it. The specific implementation method can be referred to the above method embodiment, and will not be repeated here.

[0075] Optionally, the memory 2002 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory 2002 may be integrated with the first processor 2001 or may exist independently and be accessed through the interface circuit of the electronic device 410. Figure 4 (Not shown in the image) is coupled to the first processor 2001, and this embodiment of the invention does not specifically limit this.

[0076] The transceiver 2003 is used to communicate with network devices or with terminal devices.

[0077] Alternatively, transceiver 2003 may include a receiver and a transmitter. Figure 4 (Not shown separately). The receiver is used to implement the receiving function, and the transmitter is used to implement the transmitting function.

[0078] Optionally, the transceiver 2003 can be integrated with the first processor 2001, or it can exist independently and be connected via the interface circuit of the electronic device 410. Figure 4 (Not shown in the image) is coupled to the first processor 2001, and this embodiment of the invention does not specifically limit this.

[0079] It should be noted that, Figure 4 The structure of the electronic device 410 shown does not constitute a limitation on the router. Actual knowledge structure identification devices may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0080] Furthermore, the technical effects of the electronic device 410 can be referred to the technical effects of the respiratory flow signal processing method based on dynamic calibration and normalization described in the above method embodiments, and will not be repeated here.

[0081] It should be understood that the first processor 2001 in this embodiment of the invention may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0082] It should also be understood that the memory in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DRRAM).

[0083] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable system. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0084] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.

[0085] In this invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be a single item or multiple items.

[0086] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0087] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0088] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, systems, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0089] In the embodiments provided by this invention, it should be understood that the disclosed devices, systems, and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between systems or units may be electrical, mechanical, or other forms.

[0090] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0091] In addition, the functional units in the various embodiments of the present invention 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.

[0092] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0093] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for dynamic calibration and normalization of respiratory flow signals, characterized in that, Includes the following steps: The respiratory flow signal Q is collected by a flow sensor, and the ambient temperature T and ambient humidity H are collected by an environmental sensor. The respiratory flow signal Q is preprocessed, including filtering, zero-point calibration, and temperature and humidity compensation. Dynamic calibration is performed based on the preprocessed respiratory flow signal to generate individualized calibration parameters, including the zero point. and maximum inspiratory flow rate Qmax; The preprocessed respiratory flow signal Q_comp was normalized to obtain the relative inspiratory index Qrel; Extract auxiliary feature parameters related to respiratory quality.

2. The method according to claim 1, characterized in that, The preprocessing steps include: An adaptive recursive least squares filter is used to filter the respiratory flow signal Q. Perform zero-point calibration, including static zero-point adjustment and dynamic zero-point tracking; Temperature and humidity compensation is performed on the filtered flow signal based on a polynomial compensation model, wherein the compensation model is as follows: Q compensation = Q filter × [1 + α × (T - ... )+β×(H- )+γ×(T- )×(H- ),in: Q-compensation refers to the compensated flow rate signal, Q-filtering refers to the filtered flow rate signal after Q-filtering, and T represents the ambient temperature. Here, H represents the standard temperature and H represents the ambient humidity. The standard humidity is represented by α, β, and γ, which are weighting coefficients, respectively.

3. The method according to claim 1, characterized in that, The dynamic calibration steps include: Initial calibration process: Prompt the user to maintain calm breathing, collect samples, and perform calculations. The system prompts the user to take a deep breath to collect peak flow and calculate Qmax. Regular update mechanism: The calibration process is automatically triggered after each preset number of training sessions to update... And the Qmax parameter.

4. The method according to claim 1, characterized in that, The normalization process includes: When Q compensation < At that time, Qrel=0; when When ≤Q compensation ≤ Qmax, Qrel = (Q compensation - ) / (Qmax- ); When Q compensation > Qmax, Qrel = 1.

5. The method according to claim 1, characterized in that, The auxiliary feature parameter extraction includes: Inspiratory duration T_in: The time difference between the start and end of inspiratory breathing is calculated using a threshold method. Inspiratory stability S_in: The coefficient of variation of the Q_comp signal during inhalation; Respiratory rate f: Calculates the number of breaths inhaled per unit time.

6. The method according to claim 2, characterized in that, The zero-point calibration step employs an adaptive Kalman filter to estimate the zero-point offset in real time, including: Establish a state vector to describe the dynamic changes of zero-point offset and the influence of temperature and humidity; By predicting and updating the cyclical fusion of measurement data and system model; The Sage-Husa algorithm is used to adaptively adjust the noise covariance matrix.

7. The method according to claim 6, characterized in that, The adaptive Kalman filter includes: Initialize the state estimate, error covariance matrix, process noise covariance matrix, and observation noise covariance matrix; Perform the prediction step to obtain the predicted state values ​​and the prediction error covariance matrix; The state estimate is updated based on the observed data, and the zero-point offset is output.

8. The method according to claim 1, characterized in that, It also includes data storage steps: Individualized calibration parameters, feature summaries, and training history are stored in a local encrypted database; After user authorization, the anonymized data will be uploaded to cloud storage.

9. The method according to claim 1, characterized in that, The method is implemented through a WeChat mini-program and includes: Establish a connection with the BLE module using the wx.createBLEConnection interface; Receive traffic and environmental data in real time; The processed data will be used for VR breathing interaction.

10. A respiratory flow signal processing system based on dynamic calibration and normalization, characterized in that, include: The hardware awareness layer includes: The flow sensor module is used to acquire the respiratory flow signal Q; An environmental sensor module is used to collect ambient temperature T and ambient humidity H. The BLE communication module is used to transmit the collected data. The software processing layer, running on the WeChat Mini Program platform, includes: The signal receiving module is used to receive data transmitted by the hardware sensing layer; The preprocessing module is used to filter, zero-point calibrate, and compensate for temperature and humidity in the respiratory flow signal; The dynamic calibration module is used to generate individualized calibration parameters. and Qmax; The normalization module is used to convert the compensated flow signal into a relative intake index Qrel; An auxiliary feature extraction module is used to extract feature parameters related to respiratory quality; The data storage layer includes: A local storage module is used for encrypted storage of individualized parameters and training data; The cloud storage module is used to store anonymized data; The hardware sensing layer communicates with the software processing layer via Bluetooth, and the software processing layer communicates with the data storage layer via a network connection.