Ventilator adaptive control method and apparatus
Patent Information
- Application Number
- CN202611400470.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-10-30
AI Technical Summary
[0006]本发明的目的在于提供一种呼吸机自适应控制方法和装置,在不增加额外生理传感器成本的前提下,以缓解呼吸机无法感知并适应患者呼吸特征状态的动态变化的技术问题
[0017]本发明实施例带来了一种呼吸机自适应控制方法和装置,首先,在治疗过程中实时提取表征患者呼吸特征状态的特征向量,将客观的生理信号转化为可量化的统计特征,解决了现有技术无法感知患者呼吸模式宏观变化的问题;其次,将提取的特征向量与预存的多组状态模板进行比较,通过模式匹配的方式确定当前呼吸机应进入的目标运行状态,实现了从连续特征空间到离散控制状态的决策映射;最后,一旦目标状态确定,立即加载与该状态相对应的控制参数集,以控制呼吸机的压力输出,从而达成因时制宜的个性化治疗。其核心效果在于,通过上述三个步骤的有机组合,取代了现有技术中一成不变的固定控制律,使得呼吸机能够自动、动态地调整其控制风格,以适应患者整夜睡眠过程中不断变化的呼吸特征,为提升治疗舒适性和有效性奠定了技术基础。
Smart Images

Figure CN122998537A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of home ventilator application technology, and in particular to a ventilator adaptive control method and device. Background Technology
[0002] Home-use ventilators, especially CPAP / APAP devices, maintain upper airway patency by applying continuous positive pressure or automatically adjusting pressure to the patient's airway, and are the main means of treating obstructive sleep apnea.
[0003] Existing devices typically employ a uniform hardware control law throughout the night, meaning that pressure closed-loop parameters (such as pressure rise / fall rate, pressure upper and lower limits, and expiratory pressure relief amplitude) are factory-fixed values that do not change with the patient's condition throughout the night's treatment. Pressure regulation only responds passively after detecting events such as apnea or hypoventilation.
[0004] However, a patient's breathing characteristics will naturally drift with their physiological state throughout the night, and uniform control parameters throughout the night will cause discomfort to the patient.
[0005] Therefore, how to enable ventilators to sense and adapt to the dynamic changes in the patient's respiratory characteristics without increasing the cost of additional physiological sensors has become a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0006] The purpose of this invention is to provide a ventilator adaptive control method and device, which alleviates the technical problem that the ventilator cannot sense and adapt to the dynamic changes in the patient's respiratory characteristics without increasing the cost of additional physiological sensors.
[0007] In a first aspect, the present invention provides a ventilator adaptive control method, comprising: During treatment, feature vectors representing the patient's respiratory state are extracted; The feature vector is compared with multiple pre-stored state templates to determine the target state; In response to the determination of the target state, a set of control parameters corresponding to the target state is loaded to control the output of the ventilator.
[0008] In an optional implementation, the step of extracting feature vectors characterizing the patient's respiratory state includes: Within a preset time window, feature vectors are extracted from the respiratory flow signals collected by the flow sensor; the feature vectors include at least the coefficient of variation of respiratory rate, coefficient of variation of tidal volume, coefficient of variation of inspiratory-expiratory ratio, density of apnea / hypopnea events, respiratory baseline artifact rate, and mean respiratory rate.
[0009] In an optional implementation, the step of comparing the feature vector with multiple pre-stored state templates to determine the target state includes: Calculate the weighted Euclidean distance between the feature vector and each set of state templates; The ventilator operating state corresponding to the set of state templates with the smallest weighted Euclidean distance is determined as the target state of the ventilator.
[0010] In an optional implementation, the step of comparing the feature vector with multiple pre-stored state templates to determine the target state includes: Obtain the duration of treatment initiation and determine the time-series weights corresponding to each operating state of the ventilator under the stated treatment initiation duration; The comparison result between the feature vector and the state template is combined with the temporal weight to determine the target state of the ventilator.
[0011] In an optional implementation, the method further includes: After determining the target state, start the dwell timer; Before the dwell time reaches the preset minimum dwell time, the ventilator is controlled to maintain the current state and the control parameter set corresponding to the current state is applied.
[0012] In an optional implementation, the step of loading the control parameter set corresponding to the target state includes: Based on the target state, read the corresponding pressure change rate limit value, pressure clamping set value, and expiratory pressure relief bias value. Wherein, when the target state is the first operating state, the pressure change rate limit value read is lower than the pressure change rate limit value read when the target state is the second operating state; The first operating state corresponds to the case where the respiratory variability represented by the feature vector is higher than a preset threshold, and the second operating state corresponds to the case where the respiratory variability represented by the feature vector is lower than the preset threshold.
[0013] In an optional implementation, the method further includes: After the treatment is completed, the pre-stored multiple sets of state templates are updated based on the feature vectors extracted during the treatment and the target states corresponding to the feature vectors.
[0014] In a second aspect, the present invention provides a ventilator adaptive control device, comprising: The extraction module extracts feature vectors that characterize the patient's respiratory state during the treatment process. The determination module compares the feature vector with multiple pre-stored state templates to determine the target state. The control module, in response to the determination of the target state, loads a set of control parameters corresponding to the target state to control the output of the ventilator.
[0015] Thirdly, the present invention provides an electronic device including a memory, a processor, and a program stored in the memory and capable of running on the processor, wherein the processor executes the program to implement the method as described in any of the foregoing embodiments.
[0016] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, which, when executed, implements the method described in any of the foregoing embodiments.
[0017] This invention provides an adaptive control method and device for a ventilator. First, during treatment, feature vectors representing the patient's respiratory state are extracted in real time, transforming objective physiological signals into quantifiable statistical features. This solves the problem of existing technologies being unable to perceive macroscopic changes in the patient's breathing pattern. Second, the extracted feature vectors are compared with multiple pre-stored state templates. Pattern matching is used to determine the target operating state the ventilator should enter, achieving a decision mapping from a continuous feature space to a discrete control state. Finally, once the target state is determined, the corresponding set of control parameters is immediately loaded to control the ventilator's pressure output, thereby achieving personalized treatment tailored to the specific situation. Its core effect lies in replacing the fixed control law in existing technologies through the organic combination of these three steps. This allows the ventilator to automatically and dynamically adjust its control style to adapt to the constantly changing respiratory characteristics of the patient throughout the night, laying a technical foundation for improving treatment comfort and effectiveness.
[0018] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained through the structures particularly pointed out in the description and the drawings.
[0019] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0020] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0021] Figure 1 A flowchart of an adaptive control method for a ventilator provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the functional modules of a ventilator adaptive control device provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the hardware architecture of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] Research has found that during current ventilator therapy, a patient's breathing characteristics naturally drift throughout the night depending on their physiological state. For example, breathing is highly variable during the sleep onset stage, highly regular during deep sleep, and significantly irregular during REM sleep. Uniform control parameters throughout the night struggle to accommodate the varying comfort and treatment pressure needs at different stages, especially during respiratory-sensitive periods. Rapid pressure changes can easily induce awakenings, while a fixed and high expiratory pressure relief amplitude may cause discomfort during periods of irregular breathing.
[0024] Based on this, the ventilator adaptive control method and device provided in this embodiment of the invention can achieve dynamic adaptive tuning of the hardware control parameters of the ventilator according to the patient's respiratory characteristic state without increasing the cost of additional physiological sensors by constructing a multi-dimensional respiratory feature vector extraction, comparison and state machine driven parameter set switching mechanism. This provides matching pressure regulation rate and protection boundary under different respiratory characteristic states, significantly improving human-machine synchronization, comfort and safety during treatment.
[0025] To facilitate understanding of this embodiment, a ventilator adaptive control method disclosed in this embodiment of the invention will first be described in detail.
[0026] Figure 1 This is a flowchart of an adaptive control method for a ventilator provided in an embodiment of the present invention.
[0027] Reference Figure 1 The method may include the following steps: Step S102: During the treatment process, extract the feature vector that represents the patient's respiratory state.
[0028] Here, after the ventilator is started, the main controller (such as an MCU) uses the respiratory flow signal collected by the device's existing flow sensor (such as a differential pressure flow sensor) to perform statistical calculations within a specific time window (such as a 3-minute sliding window) according to a preset period (such as 30 seconds), extracting a set of multi-dimensional vectors that reflect the macroscopic characteristics of the patient's current respiratory pattern. This vector is not the instantaneous value of a single breath, but a set of statistical characteristics of respiratory signals over a period of time, such as the degree of variation in respiratory rate, the degree of variation in tidal volume, and the density of respiratory events, thereby making the patient's implicit physiological state differences explicit into quantifiable data. This solves the problem in existing technologies where ventilators are unaware of the patient's macroscopic respiratory pattern. By establishing a respiratory feature evaluation channel on the existing flow sensor, continuous physiological signals are transformed into structured feature vectors, providing a data foundation for subsequent intelligent decision-making, and completely eliminating the need for additional physiological sensors such as EEG and EEG, resulting in low cost and high feasibility.
[0029] The respiratory characteristic state here does not refer to a specific clinical sleep stage, but rather to the ventilator operating mode identified by the controller through analysis of the statistical characteristics (such as variability and regularity) of respiratory signals, which is used to drive the switching of control parameters. It reflects the overall characteristics of the patient's respiratory pattern over a period of time, such as a stable and regular breathing pattern or a state with large respiratory fluctuations.
[0030] Step S104: Compare the feature vector with multiple pre-stored state templates to determine the target state.
[0031] Here, the real-time feature vectors extracted in the previous step are compared one by one with multiple sets of state templates pre-stored in memory (such as SPI Flash). Each set of state templates corresponds to a preset operating state within the ventilator, and the template defines the typical values or distribution range of each dimension of the feature vectors in that state. By calculating the distance or similarity between the real-time vectors and each template, and selecting the most matching one, the target state to which the ventilator should switch is determined. This solves the problem in existing technologies that cannot make forward-looking decisions based on respiratory characteristics. By performing pattern matching between the real-time sensed feature vectors and preset templates, a leap from continuous sensing to discrete decision-making is achieved, enabling the ventilator to proactively and intelligently determine which operating mode it should be in, providing a basis for subsequent differentiated control.
[0032] The state template is a set of baseline data pre-stored in the ventilator's memory through engineering calibration or data learning. It defines the reference values or statistical distributions of multidimensional feature vectors corresponding to a specific ventilator operating state (such as stable period or sensitive period), serving as the benchmark for state comparison. The target state refers to the operating state that the system determines the ventilator should enter after comparison. It is a state variable within the controller, used to index the set of control parameters to be loaded subsequently.
[0033] In step S106, in response to the determination of the target state, a set of control parameters corresponding to the target state is loaded to control the output of the ventilator.
[0034] Here, once the target state is determined, the main controller immediately reads a pre-set set of control parameters uniquely corresponding to that target state from memory. This parameter set contains a series of key parameters that directly affect the ventilator's hardware execution unit, such as the rate limit of pressure change, the safety clamping boundary of pressure, and the bias value of expiratory decompression. Subsequently, these parameters are injected into the pressure control loop in real time, directly configuring hardware such as fan drive and valve control, so that the ventilator's output pressure waveform can reflect characteristics matching the target state in terms of rate of change, pressure boundary, and expiratory comfort. This solves the problem in existing technologies where fixed parameters overnight cannot meet the comfort needs of different physiological states. Through dynamic loading of the state-driven parameter set, the ventilator's pressure output characteristics can adaptively change in a time-sharing and state-based manner. For example, it can automatically reduce the rate of pressure change during respiratory sensitive periods to reduce arousal induction, thereby ultimately transforming state perception into precise control and realizing a complete technical closed loop from perception to execution.
[0035] The control parameter set is a pre-calibrated set of control parameters stored in the ventilator hardware, corresponding one-to-one with a specific ventilator operating state. It does not change the basic treatment mode, but rather finely adjusts the control law under that mode, just like switching different driving mode parameters for different road conditions (states).
[0036] In some embodiments, the method further includes: during treatment, acquiring the actual pressure signal fed back by the pressure sensor of the ventilator; and, based on the deviation between the actual pressure signal and the preset desired pressure waveform, fine-tuning in real time the pressure change rate limit value in the loaded control parameter set to compensate for pressure control deviations caused by fluctuations in the patient's breathing effort or mask leakage.
[0037] By introducing a fine-tuning mechanism based on real-time pressure feedback on the basis of the state parameter set, the problem of decreased control accuracy of the preset parameter set caused by instantaneous events such as sudden coughing, body movement, or accidental air leakage of the mask is solved. Microscopic dynamic compensation is achieved on the basis of macroscopic state adaptation, which further improves the smoothness of pressure control and human-machine synchronization.
[0038] In practical applications, patients wear a nasal or oronasal mask while sleeping, and the ventilator body is connected to the mask via tubing to provide therapeutic airflow. During the 6-8 hour treatment process throughout the night, the patient's respiratory characteristics will naturally drift with their physiological state. The hardware platform upon which this invention is based includes a main control chip (MCU), a fan, a digital valve, a differential pressure flow sensor, a pressure sensor, an RTC real-time clock, and an SPI Flash memory. The flow sensor is connected to the MCU's PC9 / PA8 pin via an I2C interface to collect the patient's respiratory flow signal; the pressure sensor is connected to the MCU via the ADC3 CH14 channel to provide real-time feedback of tubing pressure; the RTC real-time clock provides the MCU with the precise time elapsed since treatment initiation; and the SPI Flash memory is divided into an independent state vector baseline area and a parameter set storage area, used to store state templates and corresponding control parameter sets, respectively. The MCU, as the control core, drives the fan via the TIM8 PWM signal and controls the stepping of the digital valve, jointly achieving precise output of therapeutic pressure.
[0039] The hardware structure is clearly divided into three parts: a sensing channel, a control computation channel, and an execution channel. In the sensing channel, a flow sensor continuously collects flow signals at a sampling rate of 100Hz and efficiently transmits them to the MCU's SRAM via DMA double buffering, forming a 3-minute sliding window ring buffer. A pressure sensor monitors pipeline pressure in real time at a sampling rate of 1kHz. The control computation core is an STM32F407 MCU, which internally integrates core algorithm modules such as a 6-dimensional feature extractor, a feature vector comparator, a state machine with minimum dwell constraints, and a parameter set loader. The execution channel includes a fan driven by a TIM8PWM, a pressure rate limiter and a pressure clamper directly driven by the parameter set, and a digital valve supporting three-level bias control (-1 / 0 / +1). This architecture, without adding additional sensor hardware, constructs a complete adaptive control hardware foundation solely through software upgrades and SPI Flash storage partitioning.
[0040] In a preferred embodiment of the practical application, firstly, in response to the treatment initiation command, the MCU performs an initialization operation, loading the default K1 basic treatment parameter set from the parameter set storage area of the SPI Flash, and configuring the initial control parameters of the TIM8PWM fan drive, pressure clamper, and digital valve accordingly, so that the ventilator starts working in basic mode. This step corresponds to the preparation stage before step S102. Secondly, in the main treatment cycle, the MCU executes the core control logic every 30 seconds. The MCU extracts and calculates a 6-dimensional respiratory feature vector X(t) from the 3-minute flow data sliding window annular buffer in SRAM. This vector includes the coefficient of variation of respiratory rate, coefficient of variation of tidal volume, coefficient of variation of inspiratory-expiratory ratio, density of apnea / hypopnea events, respiratory baseline artifact rate, and mean respiratory rate. This extraction process completes step S102. Then, the MCU compares the calculated feature vector X(t) with the 4 sets of state templates pre-stored in the SPI Flash state vector baseline area. Perform weighted Euclidean distance calculation to obtain the preliminary distance with each state template. Meanwhile, the MCU, based on the treatment initiation time t provided by the RTC, obtains the temporal weights of each state at the current moment using a lookup table method. The initial distance is multiplied by the reciprocal of the timing weight to obtain the final score. The system selects the candidate state with the smallest score and, in conjunction with the state dwell counter in SRAM, determines whether it meets the minimum dwell constraint. If it does, the candidate state is determined as the current target state; otherwise, the current state remains unchanged. This process is the specific implementation of step S104. Furthermore, once the target state is determined, the MCU immediately loads the control parameter set uniquely corresponding to that target state from the parameter set storage area of the SPIFlash. This parameter set includes the pressure change rate limit. Pressure clamping set value and expiratory pressure bias These are key parameters. Finally, the MCU injects these parameters into the hardware control loop: Applied to pressure rate limiters, it limits the pressure commands output by the APAP algorithm to generate smooth control commands. ;Will The setting value is applied to the pressure clamp, for Perform safety boundary clamping and generate final control commands. The output is sent to the TIM8PWM generator to drive the fan; at the same time, The digital valve is directly driven, and a bias is superimposed on the user-defined baseline expiratory pressure to adjust the comfort of the expiratory phase. This completes step S106, ending a full adaptive control cycle. This cycle continues until the treatment ends.
[0041] In some embodiments, step S102, which involves extracting a feature vector characterizing the patient's respiratory state, includes: Step 2.1: Extract feature vectors from the respiratory flow signals collected by the flow sensor within a sliding window of a preset duration; The feature vector includes at least the coefficient of variation of respiratory rate, coefficient of variation of tidal volume, coefficient of variation of inspiratory-expiratory ratio, density of apnea / hypopnea events, baseline artifact rate of respiratory rate, and mean respiratory rate.
[0042] Here, this step further defines step S102, clarifying the specific implementation method of feature extraction. First, it specifies that the data source is the respiratory flow signal collected by a flow sensor and introduces a sliding window mechanism of preset duration, such as analyzing the data within a continuously updated 3-minute time window. Second, it specifically lists at least six key dimensions constituting the feature vector: coefficient of variation of respiratory rate (CV_RR), coefficient of variation of tidal volume (CV_TV), coefficient of variation of inspiratory-expiratory ratio (CV_IE), apnea / hypopnea event density (AHD), baseline artifact rate (BMI), and mean respiratory rate (RR_avg). These dimensions comprehensively characterize the respiratory pattern from multiple perspectives, including frequency, amplitude, timing, events, and stability. By defining the sliding window mechanism and the specific six-dimensional feature vector, the problem of how to stably and comprehensively extract features that effectively distinguish different respiratory characteristic states from continuous flow signals is solved. The sliding window mechanism ensures the statistical stability of feature extraction and avoids the influence of accidental fluctuations in a single breath on the judgment; while the multi-dimensional feature design captures changes in breathing patterns from multiple angles, which can more accurately and robustly reflect the patient's overall respiratory characteristics than a single indicator (such as respiratory rate alone), laying a solid foundation for subsequent accurate condition determination.
[0043] Building upon this, step S102 may further include: monitoring the data distribution changes of the feature vector over multiple treatment cycles; when a long-term drift exceeding a preset threshold is detected in the data distribution center of a certain dimension of the feature vector, and this drift is not correlated with the improvement trend of the apnea / hypopnea index, automatically removing that dimension from the feature vector or reducing its weight when comparing it with the state template, and activating another alternative feature dimension to be added to the feature vector. This addresses the problem of decreased discriminative power of the original feature dimensions due to non-pathological changes in the patient's respiratory baseline after long-term use (such as aging or weight changes). By dynamically monitoring and adjusting the composition of the feature vector, the long-term effectiveness and adaptability of the feature extraction process are ensured, avoiding model inaccuracies caused by drift in the patient's physiological baseline.
[0044] In practical applications, the MCU first maintains a 3-minute flow data sliding window circular buffer, which is continuously filled by the flow sensor via DMA double buffering and contains 18,000 sampling points. Every 30-second calculation cycle, the MCU processes the data within this sliding window.
[0045] For the coefficient of variation of respiratory rate ( The MCU identifies each breath by detecting the zero-crossing point of the flow signal and calculates a series of respiratory frequency values. Then, calculate the ratio of its standard deviation to its mean, i.e.: ; For the coefficient of variation of tidal volume ( The MCU obtains the tidal volume sequence by integrating the flow rate during each inhalation phase. Then calculate its coefficient of variation, that is:
[0046] For the coefficient of variation of the inspiratory-to-expiratory ratio ( The MCU calculates the ratio of inhalation time to exhalation time for each breath. And calculate the coefficient of variation of the sequence, i.e.:
[0047] Apnea / hypoventilation event density (AHD) is provided by the existing event detection module, which shows the total number of events within the sliding window. Divide by the duration of the sliding window (Obtained in 3 minutes). The respiratory baseline artifact rate (BMI) is determined by detecting the number of sample segments with large non-respiratory fluctuations within the sliding window. Divide by the total number of respiratory cycles Obtained. Mean respiratory rate ( Then directly from The mean of the sequence is obtained. Finally, these six features are combined into a six-dimensional vector representing the current respiratory characteristic state. The data is stored in SRAM (Static Random Access Memory) for use in the next state comparison.
[0048] In some embodiments, step S104 may be implemented by the following steps: Step 3.1: Calculate the weighted Euclidean distance between the feature vector and each set of state templates.
[0049] Here, this step is the specific implementation of the state comparison, which involves extracting the 6-dimensional feature vector in real time. With the 4 sets of state templates pre-stored in SPIFlash Mathematical operations are performed one by one. Specifically, the weighted Euclidean distance formula is used, and its mathematical expression is:
[0050] Where k corresponds to the k-th state template, and i corresponds to the i-th feature dimension. It is the engineering weight of this dimension of features. and These are the mean and standard deviation of the i-th feature in the k-th state template, respectively. Dividing by the standard deviation... This serves as a normalization mechanism, making feature dimensions of different scales and degrees of variation comparable; multiplied by weights This reflects the difference in importance of different feature dimensions in distinguishing states; It is a real-time feature vector With the The weighted Euclidean distance of each state template; the smaller the value, the higher the matching degree. It is the feature dimension number, with a value range of 1 to 6, corresponding to the six-dimensional breathing feature; It is the first feature vector extracted in real time. eigenvalues of dimension; It is the first In the state template, the first The calibrated mean of the dimensional feature; It is the first In the state template, the first The standard deviation of the dimension feature is used to normalize features of different dimensions; It is the first The engineering weight of a feature reflects the importance of that feature in state determination.
[0051] By introducing weighted Euclidean distance, the problem of how to quantitatively compare the similarity between the current breathing pattern and various state templates within a unified mathematical framework, comprehensively considering multiple feature dimensions with different scales and varying importance, is solved. The weighting mechanism allows features with strong state-discriminating capabilities (such as CV_RR) to contribute more, while normalization ensures the balance of features across dimensions in distance calculation, thereby improving the accuracy and robustness of state determination.
[0052] Step 3.2: Determine the ventilator operating state corresponding to the set of state templates with the smallest weighted Euclidean distance as the target state of the ventilator.
[0053] Here, the distances to all four sets of state templates are calculated. Subsequently, the controller uses a simple comparator to select the one with the smallest distance value, thus considering the current patient's respiratory feature vector to be most similar to this template. The ventilator's internal operating state (S1, S2, S3, or S4) corresponding to the template is then initially determined as a candidate target state. This method achieves a simple, efficient, and computationally inexpensive mapping from continuous similarity distance values to the final discrete state decision, providing a clear index for subsequently loading the corresponding control parameter set.
[0054] Based on this, step S104 further includes: when calculating the weighted Euclidean distance between the feature vector and each group of state templates, a covariance matrix is introduced to calculate the Mahalanobis distance between the feature vector and each group of state templates; when the target state determined by the weighted Euclidean distance and the Mahalanobis distance is inconsistent, the current apnea / hypopnea event density is obtained; if the event density is higher than a preset threshold, the determination result based on the Mahalanobis distance is used as the final target state to eliminate the influence of the correlation changes between the dimensions of the feature vector on the determination result.
[0055] This approach addresses the issue that during periods of high respiratory event incidence, disrupted breathing patterns lead to drastic changes in the correlation between different dimensions of feature vectors, causing inaccurate judgments based on the assumption of independent dimensions using weighted Euclidean distance. By introducing Mahalanobis distance and implementing conditional selection, this scheme provides robust judgments that better reflect the true multidimensional feature distribution even under highly unstable breathing patterns, enhancing the reliability of decisions in extreme situations.
[0056] In practical applications, step S104 is specifically expanded as follows: First, the MCU executes step 3.1, which extracts the current 6-dimensional feature vector. Weighted Euclidean distances are calculated one by one between the four sets of state templates stored in the baseline region of the SPI Flash state vector. Each template consists of the mean of 6-dimensional features. and standard deviation Composition. During calculation, the MCU will call a set of factory-calibrated engineering weights. These weights are stored in the SPI Flash, with default values such as [0.25, 0.20, 0.15, 0.15, 0.10, 0.15], corresponding to CV_RR, CV_TV, CV_IE, AHD, BMI, and RR_avg, respectively. After calculation, four distance values are obtained. Then, according to step 3.2, the MCU will initially select the state with the smallest distance as a candidate. For example, in the later stages of treatment, if the patient's breathing becomes irregular, its CV_RR, CV_TV, and other values will increase, and the distance to the S3 or S4 template will be smaller. The system will then select S3 or S4 as a candidate state. This preliminary determination based on distance is the foundation of the entire decision chain.
[0057] As another optional embodiment, step S104 further includes: Step 4.1: Obtain the duration of treatment initiation and determine the timing weights corresponding to each operating state of the ventilator under the treatment initiation duration.
[0058] Here, this step introduces prior knowledge of the time dimension into the decision-making process. First, it obtains the precise time elapsed since the start of treatment using the RTC real-time clock. (Usually measured in minutes). Then, utilize this duration. As an index, a time-series weight table pre-stored in the SPI Flash is retrieved. This table divides the entire overnight treatment process into several time periods (e.g., 0-30 minutes, 30-120 minutes, 120-300 minutes, and more than 300 minutes), and pre-assigns a time-series weight to each state (S1-S4) within each time period. For example, in the initial treatment phase (0-30 minutes), the weight of S3 (corresponding to REM sleep) is set very low (e.g., 0.3), while the weights of S1 (basal) and S4 (sensitive phase) are higher. This reflects the physiological pattern that patients are unlikely to immediately enter REM sleep in the early stages of sleep onset. This addresses the potential for misjudgment of state based solely on the distance of the current feature vector, particularly avoiding misjudging a state as a physiologically rare pattern due to short-term respiratory fluctuations. By introducing temporal weights based on treatment duration, and utilizing the physiological pattern that the probability of different respiratory characteristic states occurring throughout the night is temporal, the foresight and stability of state determination are enhanced, effectively adding a time-dimensional filter to the decision-maker.
[0059] Step 4.2: Combine the comparison results of the feature vector and the state template with the temporal weights to determine the target state of the ventilator.
[0060] Here, this step is the fusion point between temporal constraints and real-time feature analysis. A specific fusion method is to use the weighted Euclidean distance calculated in step 3.1... Multiplied by time series weight The reciprocal of is used to obtain the final state score, which is expressed as:
[0061] Thus, the weight of the physiologically more likely state to occur in the current time period is... big, The smaller the value of a state, the smaller its final score (distance), making it easier to win in the competition. Ultimately, the system selects the state with the smallest final score as the candidate target state. It is the first The final comprehensive score of each state is used to determine the target state, and the state with the lowest score is identified as the target state. The first is calculated using weighted Euclidean distance. Feature matching distance for each state; The treatment start time is At that time, the first The time-series weights corresponding to each running state are such that the larger the value, the higher the probability of that state occurring in the current time period. By multiplying and fusing feature distance with temporal weights, the organic unity of real-time features and prior knowledge is achieved, constructing a robust decision-making mechanism that responds to real-time physiological changes and conforms to macroscopic physiological laws, effectively preventing unreasonable state jumps in a short period of time.
[0062] In some embodiments, the method provided by the present invention further includes: recording the actual time distribution of each state during each treatment process; after the treatment is completed, calculating the actual probability density function of each state in the treatment process based on historical data from multiple treatments; comparing the actual probability density function with a preset time-series weight table, and updating and optimizing the time-series weight table accordingly, so that the time-series weights can adapt to the patient's personalized sleep structure.
[0063] This addresses the issue that factory-preset fixed time-series weight tables cannot adapt to the individual sleep patterns of patients (such as night owls or early risers). By introducing unsupervised learning from individual patient historical data, the time-series weights can evolve from group priors to individual priors, thereby further improving the accuracy and personalization of state determination.
[0064] In practical applications, after completing the initial distance calculation and candidate state screening in steps 3.1 and 3.2, the MCU immediately executes steps 4.1 and 4.2, introducing temporal weights for comprehensive decision-making. The MCU first reads the time elapsed since treatment initiation from the RTC. For example, if the current treatment has only been underway for 15 minutes, then The timeframe is between 0 and 30 minutes. The MCU then looks up the time weights of each state for that time period in a table. , possibly Then, the MCU will use the previously calculated distances. The final score is obtained by multiplying each score by the reciprocal of its corresponding time-series weight. Under this mechanism, even if the patient's respiratory feature vector happens to be at a distance from the S3 (airway collapse vulnerable period) template... Smaller, but due to its weight Only 0.3, its reciprocal This would significantly amplify the final score, making it less competitive than S1 or S4. This hardware coupling effectively avoids occasional irregular breathing caused by the patient not being asleep or in a light sleep state at the beginning of treatment, which could be misjudged as S3 state, thus ensuring the stability and comfort of the application in the early stages of treatment.
[0065] In some embodiments, the method provided in this application further includes: Step 5.1: After determining the target state, start the dwell timer.
[0066] Here, this step is triggered when a state transition occurs. Once the MCU determines a new target state different from the current operating state through comprehensive judgment and completes the transition, it immediately starts (or resets) a dedicated counter for state dwell in SRAM. This counter increments in a preset time unit (such as seconds or a 30-second cycle). This establishes a quantifiable and monitorable timing benchmark for the stabilization period after the state transition, providing a timing basis for subsequent forced state maintenance.
[0067] Step 5.2: Before the dwell time reaches the preset minimum dwell time, control the ventilator to maintain the current state and apply the control parameter set corresponding to the current state.
[0068] Here, this step is the core constraint for suppressing frequent state switching. During each control cycle (e.g., 30 seconds), when determining the state, the MCU first checks the dwell time counter in SRAM. If the dwell time of the current state has not reached the preset minimum dwell time for that state (e.g., 5 minutes for S2 / S3, 3 minutes for S1 / S4), then even if the optimal candidate state calculated based on feature comparison and timing weights differs from the current state, the system will forcibly suppress this state switch, maintain the current state, and continue applying the control parameter set corresponding to the current state. Only when the dwell time meets the condition will the system open the state switching logic. This addresses the problem of frequent, non-physiological switching of the state machine due to transient fluctuations in respiratory signals, leading to unstable pressure output and causing drive stress. By introducing a minimum dwell time constraint, it is equivalent to adding a hysteresis or dead-zone logic to the state machine, forcing changes in respiratory characteristics to last for a sufficiently long time before triggering a change in control mode, thus ensuring the smoothness of control parameter switching and avoiding discomfort to the patient caused by frequent parameter set switching.
[0069] Based on the aforementioned embodiments, the method further includes: continuously monitoring the comparison results between the feature vector and multiple pre-stored state templates during the process of controlling the ventilator to maintain its current state; if the weighted Euclidean distance between the feature vector and the current state template exceeds a preset abnormal threshold for multiple consecutive cycles, it is determined that there is a severe mismatch between the current state template and the patient's actual respiratory characteristics; at this time, the minimum residence constraint is forcibly released, and the state determination and target state determination are immediately re-performed. This addresses the problem of delayed control response that may be caused by the minimum residence constraint when a patient experiences a sudden severe physiological event (such as prolonged central respiratory arrest). By introducing an emergency release mechanism based on the real-time degree of mismatch, the stability of daily operation is ensured while maintaining response speed and safety in extreme or sudden situations, achieving a balance between stability and sensitivity.
[0070] As a practical application example, after selecting a candidate target state through comprehensive scoring in step 4.2, the MCU does not immediately execute the switch. Instead, it proceeds to the minimum dwell time constraint determination step described in steps 5.1 and 5.2. First, the MCU checks the dwell time counter maintained in the SRAM for the current state. Assuming the current state is S2 (stable period), its preset minimum dwell time is 5 minutes. If the system has just switched from S1 to S2 and the dwell timer has only counted for 2 minutes, then even if the candidate target state is S3, the MCU will execute step 5.2, i.e., suppress the current switch request, force the ventilator to continue to maintain the S2 state, and continue to apply the control parameter set K2 corresponding to S2. Only when the dwell timer reaches 5 minutes will the MCU allow the state to switch to S3 in the next determination cycle. This mechanism ensures that after the ventilator enters a stable state, it can maintain that state for a sufficiently long time, avoiding frequent jitter between S2 and S3 due to instantaneous signal fluctuations, thereby greatly improving the smoothness of the control output and the patient's treatment experience.
[0071] In some embodiments, step S106 may include: Step 6.1: Based on the target state, read the corresponding pressure change rate limit, pressure clamping setpoint, and expiratory pressure relief bias value; Specifically, when the target state is the first operating state, the pressure change rate limit value read is lower than the pressure change rate limit value read when the target state is the second operating state; the first operating state corresponds to the case where the respiratory variability represented by the feature vector is higher than the preset threshold, and the second operating state corresponds to the case where the respiratory variability represented by the feature vector is lower than the preset threshold.
[0072] Here, this step concretizes the execution process, clarifying the core content of the control parameter set and the logic of its differentiated applications. First, it specifies that the parameter set must include at least three key hardware parameters affecting the ventilator's output characteristics: the pressure change rate limit (…). ), pressure clamping set value ( ) and expiratory pressure offset ( Secondly, it reveals the essential mapping relationship between parameter values and states: when the target state is determined to be the first operating state (i.e., the sensitive period of highly unstable and variable breathing), the system will read a lower pressure change rate limit value, such as 0.3 cmH2O / min; while when the target state is the second operating state (i.e., the period of stable and regular breathing), the read rate limit value is higher, such as 1.0 cmH2O / min. This mapping relationship directly reflects the core control concept of using gentler and slower pressure regulation during the patient's sensitive period.
[0073] This approach addresses the core contradiction in existing technologies where fixed overnight control parameters fail to balance therapeutic efficacy and comfort. By establishing a clear and differentiated mapping between respiratory characteristics and hardware control parameters, the ventilator achieves time-division multimodal pressure output characteristics. During respiratory-sensitive periods, reducing the rate of pressure change effectively minimizes arousal induced by drastic pressure fluctuations; during respiratory stability periods, a faster adjustment rate can be restored to ensure treatment efficiency. This differentiated control strategy maximizes therapeutic efficacy while improving comfort.
[0074] Based on this, the method further includes: after loading the control parameter set, monitoring the actual pressure waveform fed back by the ventilator's pressure sensor; performing smoothness analysis on the actual pressure waveform; if a small fluctuation or overshoot exceeding the preset frequency is detected during pressure regulation, it is determined that the pressure change rate limit or pressure clamping set value of the current control parameter set needs to be optimized; in the next control cycle, automatically adjusting the pressure change rate limit or pressure clamping set value by a small step, and observing whether the smoothness of the adjusted pressure waveform is improved, thus forming a closed-loop self-optimization.
[0075] This addresses the issue that factory-preset parameter sets may not perfectly adapt to the respiratory mechanics characteristics of all hardware platforms or individual patients. By introducing real-time evaluation and closed-loop fine-tuning of the performance, the control parameter set evolves from a static preset to a dynamic self-optimizing one, enabling millisecond-level real-time optimization of the smoothness of pressure output and further approaching optimal treatment comfort.
[0076] For example, after the MCU determines the target state (e.g., the S4 sensitive period) in step S104 or S106, it executes step 6.1. First, the MCU reads the corresponding parameter set K4 from the parameter set storage area of the SPI Flash according to state S4. This parameter set contains three core parameters: , No additional clamping, Then, the MCU begins to use these parameters to drive the hardware execution unit.
[0077] Furthermore, the following example illustrates how the parameters in step S106 are injected into the hardware control loop, including: First, for pressure rate control, the MCU will read... The value is applied to a pressure rate limiter. The core algorithm of APAP calculates a target pressure command based on the current event detection result. The rate limiter is based on the formula:
[0078] right Smoothing is performed to ensure that the final output control commands are smoothed. The rate of change will not exceed .
[0079] in, It is a pressure control command that is output to the fan drive after being rate-limited; It is the actual pipeline pressure fed back by the pressure sensor at the current moment; It is the target pressure command output by the APAP core algorithm; It is a sign function used to determine the direction of pressure adjustment. It is a function that takes the minimum value to ensure that the pressure change within a single cycle does not exceed the rate limit; This is the pressure change rate limit value corresponding to the current state, in units of... ; This is the update cycle for pressure commands, with a default value of 10ms.
[0080] For example, in S4 state, even though the APAP algorithm requires rapid voltage boost, because... At only 0.3 cmH2O / min, the pressure will rise at a very slow rate, thus avoiding inducing arousal.
[0081] Secondly, for pressure clamping control, the MCU will read the The setting value is applied to the pressure clamp. The clamp is based on the formula:
[0082] Ensure the final output commands to the TIM8PWM generator Always within a safe and appropriate range.
[0083] in, The final fan drive command after clamping processing; Clamping functions force input values to be confined between upper and lower boundaries; : Intermediate pressure command after rate limiting; , The minimum and maximum safe limits for treatment pressure set by the doctor's orders; , : The pressure clamping bias value corresponding to the current operating state, used to narrow or widen the pressure regulation range.
[0084] For example, in state S3, via Applying a bias of +1.5 cmH2O increases the upper pressure limit to address the risk of airway collapse.
[0085] In addition, for expiratory decompression control, the MCU will Directly drive the digital valve, adding a bias to the user-defined settings. For example, in S3 state, This means actively reducing the expiratory pressure relief amplitude to increase positive end-expiratory pressure and prevent airway collapse. Through this series of refined hardware parameter injections, the system achieves a closed loop from state awareness to precise execution.
[0086] In some embodiments, the method of this application further includes: Step 7.1: After the treatment is completed, update the pre-stored multiple sets of state templates based on the feature vectors extracted during the treatment and the target states corresponding to the feature vectors.
[0087] Here, this is performed after the treatment is completed. All feature vectors recorded throughout the entire treatment process are sliced and grouped according to the target states (S1-S4) they were determined to during the treatment. Then, for each state k, the observed mean of all feature vectors in that state for the night is calculated. and standard deviation Before updating, the MCU performs a reasonableness check, and only updates the observed values if the deviation from the old baseline in the SPI Flash is within a reasonable range (e.g., meets the following conditions). A weighted moving average update is performed only when the condition is met, and the update formula is as follows:
[0088]
[0089] Finally, the updated new baseline and Write back to the SPI Flash state vector baseline area, overwriting the old value.
[0090] in, , After the update, the first memory write-back... The new mean and new standard deviation of each state template; , Before the update, the number stored in memory was... The old mean and old standard deviation of each state template; , The number calculated based on the data from this treatment process. The observed mean and observed standard deviation of each state; : Sliding window weight, a small value between 0 and 1 (e.g., 0.05), used to control the rate of template updates and ensure smooth baseline drift.
[0091] This addresses the issue that prolonged ventilator use can cause a slow drift in a patient's respiratory baseline (e.g., due to weight changes, improvements in cardiopulmonary function), leading to a gradual mismatch between the factory-preset status template and the patient's actual characteristics. By performing slow, self-learning updates with safety boundaries after each treatment, the status template can follow the patient's individualized long-term changes, ensuring the long-term effectiveness and accuracy of the status determination threshold. This achieves self-maintenance and optimization of system performance without manual intervention.
[0092] Based on this, it also includes: after the treatment is completed, obtaining the apnea / hypopnea index recorded and calculated by the ventilator during the treatment; before updating the multiple pre-stored state templates based on the feature vectors extracted during the treatment and the target states corresponding to the feature vectors, determining whether the apnea / hypopnea index is lower than a preset effective treatment threshold; if it is lower than the effective treatment threshold, then performing the update operation; if it is higher than the effective treatment threshold, then determining that the treatment is ineffective and abandoning the update of the state template to avoid learning abnormal respiratory features during ineffective treatment into the template.
[0093] To address the issue of the system incorrectly learning abnormal breathing characteristics from invalid data into the state template when treatment is ineffective due to significant air leakage, frequent mask removal by the patient, or other abnormal events, this approach introduces treatment effectiveness-oriented update preconditions. This ensures the quality and reliability of the self-learning data and prevents the state template from being contaminated and drifting in the wrong direction.
[0094] In practical applications, one example of step 7.1 involves the following: after the overnight treatment concludes, the MCU does not immediately shut down but instead enters an offline processing phase. First, the MCU iterates through all feature vectors recorded in the SRAM for the entire night. Based on the target state label determined by the system when each vector is generated, they are divided into four groups: S1, S2, S3, and S4. Then, for each state k, the MCU calculates the observed mean of all feature vectors within that group. and observed standard deviation Next, the MCU reads the old baseline corresponding to this state from the SPI Flash. and And perform a difference reasonableness check to determine whether it meets the requirements. If the conditions are met, then the update is performed according to the weighted update formula described above, where... Using a value of 0.05 means that only 5% of the components in the new baseline come from the current night's data, while 95% come from historical accumulation. This ensures that the baseline update is an extremely slow and stable process, not easily disturbed by a single anomaly. Finally, the MCU will calculate the new baseline. and Write back to the state vector baseline region of the SPI Flash to complete the update. This mechanism allows the state determination threshold to slowly adapt to changes in the user's long-term breathing characteristics, achieving a personalized control effect that becomes more accurate with use.
[0095] In some embodiments, such as Figure 2 As shown, an embodiment of the present invention provides a ventilator adaptive control device, comprising: The extraction module extracts feature vectors that characterize the patient's respiratory state during the treatment process. The determination module compares the feature vector with multiple pre-stored state templates to determine the target state. The control module, in response to the determination of the target state, loads a set of control parameters corresponding to the target state to control the output of the ventilator.
[0096] The present invention provides an embodiment for implementing an electronic device. In this embodiment, the electronic device may be, but is not limited to, a personal computer (PC), a laptop computer, a monitoring device, a server, or other computer device with analysis and processing capabilities.
[0097] As an exemplary embodiment, see [link to example]. Figure 3 The electronic device 110 includes a communication interface 111, a processor 112, a memory 113, and a bus 114. The processor 112, the communication interface 111, and the memory 113 are connected via the bus 114. The memory 113 is used to store a computer program that supports the processor 112 in executing the above-described method. The processor 112 is configured to execute the program stored in the memory 113.
[0098] The machine-readable storage medium mentioned in this article can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, etc. For example, machine-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.
[0099] Non-volatile media can be non-volatile memory, flash memory, storage drives (such as hard disk drives), any type of storage disk (such as optical discs, DVDs, etc.), or similar non-volatile storage media, or combinations thereof.
[0100] It is understood that the specific operation methods of each functional module in this embodiment can be referred to the detailed description of the corresponding steps in the above method embodiment, and will not be repeated here.
[0101] The computer-readable storage medium provided in the embodiments of the present invention stores a computer program. When the computer program code is executed, it can implement the method of any of the above embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0102] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0103] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms installation, connection, and linking should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0104] In the description of this invention, it should be noted that the terms center, up, down, left, right, vertical, horizontal, inner, and outer, indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms first, second, and third are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0105] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the scope of the technology disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention.
Claims
1. A ventilator adaptive control method, characterized in that, include: During treatment, feature vectors representing the patient's respiratory state are extracted; The feature vector is compared with multiple pre-stored state templates to determine the target state; In response to the determination of the target state, a set of control parameters corresponding to the target state is loaded to control the output of the ventilator.
2. The method according to claim 1, characterized in that, The steps for extracting feature vectors representing the patient's respiratory state include: Within a preset time window, feature vectors are extracted from the respiratory flow signals collected by the flow sensor; the feature vectors include at least the coefficient of variation of respiratory rate, coefficient of variation of tidal volume, coefficient of variation of inspiratory-expiratory ratio, density of apnea / hypopnea events, respiratory baseline artifact rate, and mean respiratory rate.
3. The method according to claim 1, characterized in that, The step of comparing the feature vector with multiple pre-stored state templates to determine the target state includes: Calculate the weighted Euclidean distance between the feature vector and each set of state templates; The ventilator operating state corresponding to the set of state templates with the smallest weighted Euclidean distance is determined as the target state of the ventilator.
4. The method according to claim 1 or 3, characterized in that, The step of comparing the feature vector with multiple pre-stored state templates to determine the target state includes: Obtain the duration of treatment initiation and determine the time-series weights corresponding to each operating state of the ventilator under the stated treatment initiation duration; The comparison result between the feature vector and the state template is combined with the temporal weight to determine the target state of the ventilator.
5. The method according to claim 1, characterized in that, The method further includes: After determining the target state, start the dwell timer; Before the dwell time reaches the preset minimum dwell time, the ventilator is controlled to maintain the current state and the control parameter set corresponding to the current state is applied.
6. The method according to claim 1, characterized in that, The step of loading the control parameter set corresponding to the target state includes: Based on the target state, read the corresponding pressure change rate limit value, pressure clamping set value, and expiratory pressure relief bias value. Wherein, when the target state is the first operating state, the pressure change rate limit value read is lower than the pressure change rate limit value read when the target state is the second operating state; The first operating state corresponds to the case where the respiratory variability represented by the feature vector is higher than a preset threshold, and the second operating state corresponds to the case where the respiratory variability represented by the feature vector is lower than the preset threshold.
7. The method according to claim 1, characterized in that, The method further includes: After the treatment is completed, the pre-stored multiple sets of state templates are updated based on the feature vectors extracted during the treatment and the target states corresponding to the feature vectors.
8. A ventilator adaptive control device, characterized in that, include: The extraction module extracts feature vectors that characterize the patient's respiratory state during the treatment process. The determination module compares the feature vector with multiple pre-stored state templates to determine the target state. The control module, in response to the determination of the target state, loads a set of control parameters corresponding to the target state to control the output of the ventilator.
9. An electronic device, characterized in that, It includes a memory, a processor, and a program stored in the memory and capable of running on the processor, wherein the processor executes the program to implement the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed, implements the method described in any one of claims 1-7.
