Method for predicting lung function data and related equipment

By collecting expiratory flow rate data and calculating the burst data segment before and after the peak of flow acceleration, a personalized lung function data prediction sub-model is matched, which solves the problem of poor quality control in lung function tests, improves applicability and convenience, and ensures the reliability of test results.

CN121938604APending Publication Date: 2026-04-28SAIKE XIAMEN MEDICAL DEVICES CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SAIKE XIAMEN MEDICAL DEVICES CO LTD
Filing Date
2026-01-19
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

The low rate of quality control compliance in pulmonary function tests in primary healthcare institutions and special populations affects the accuracy of diagnosis and treatment and the efficiency of medical resource utilization. This is mainly due to limitations in patient cooperation and physiological conditions, insufficient professional competence of technicians, and poor quality control caused by the complexity of equipment calibration and environmental adaptation.

Method used

By collecting expiratory flow rate data, calculating the burst data segment before and after the peak of flow acceleration, matching it with a personalized lung function data prediction sub-model, and using LSTM model training and Kalman filter algorithm, lung function data that meets quality control standards is output.

Benefits of technology

It eliminates the need for patients to complete full expiratory flow rate data collection, making it suitable for all types of people. This improves the applicability and convenience of pulmonary function testing, ensures the reliability of test results, and provides accurate evidence for clinical diagnosis and treatment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121938604A_ABST
    Figure CN121938604A_ABST
Patent Text Reader

Abstract

The invention discloses a lung function data prediction method and related equipment. The method comprises the following steps: firstly, acquiring expiratory flow velocity data of a person to be detected, determining the highest point of flow velocity acceleration by calculating the acceleration of each flow velocity sampling point, and intercepting explosion data segments of preset time windows before and after the point; and matching a lung function data prediction sub-model corresponding to the to-be-detected person. The sub-model is obtained by training a plurality of groups of expiratory flow velocity sample data. And finally, inputting the outbreak data segment into the sub-model, and outputting the expiratory flow rate data meeting the quality control standard and predicted lung function data of lung function parameters. The outbreak data segment prediction sub-model is intercepted for prediction, and the to-be-detected person does not need to complete acquisition of complete expiratory flow velocity data meeting the quality control standard.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of lung function data prediction technology, and in particular to a method and related equipment for predicting lung function data. Background Technology

[0002] Pulmonary function testing (PFT) is a core test for assessing respiratory function. In clinical practice, PFT requires the use of specialized equipment to collect flow-time curves during a patient's forced breathing process, and then calculate key parameters such as forced vital capacity (FVC), forced expiratory volume in one second (FEV1), or peak expiratory flow (PEF) to provide quantitative evidence for clinical decision-making.

[0003] However, quality control (QC) of pulmonary function tests remains a key bottleneck restricting the reliability of their results. This is especially true in primary healthcare institutions and for special populations, where the low rate of compliance with quality control standards is more prominent, directly affecting the accuracy of diagnosis and treatment and the efficiency of medical resource utilization.

[0004] During pulmonary function tests, patients are required to strictly adhere to the standard procedure of inhaling deeply to their full lung capacity and then exhaling continuously for at least 6 seconds with maximum speed and force. However, a patient's comprehension, willingness to cooperate, emotional state, and physical discomfort can all directly distort the flow-time curve. Elderly, frail individuals, children, patients with cognitive impairment, or neuromuscular disorders are often unable to complete a sustained exhalation of 6 seconds or more due to physiological limitations, directly leading to invalid or distorted test results, which in turn affects subsequent clinical decisions. Summary of the Invention

[0005] To address the aforementioned issues, this application provides a method and device for predicting lung function data.

[0006] The embodiments of this application disclose the following technical solutions: In a first aspect, embodiments of this application provide a method for predicting lung function data, the method comprising: Collect expiratory flow rate data from the subject of the test; Determine the acceleration of each flow rate sampling point in the expiratory flow rate data, and extract burst data segments before and after the highest flow rate acceleration point within a preset time window; A lung function data prediction sub-model is matched to the subject of the test; the lung function data prediction sub-model is trained based on multiple expiratory flow rate sample data; the expiratory flow rate sample data includes burst sample data segments and complete expiratory flow rate sample data, and the burst sample data segments are extracted from the complete expiratory flow rate sample data; The burst data segment is input into the lung function data prediction sub-model, and the predicted lung function data is output; the lung function data includes expiratory flow rate data and lung function parameters that meet quality control standards.

[0007] In one possible implementation, the method further includes: Obtain the physical characteristics information of the person to be tested; The lung function data prediction sub-model matching the subject to be tested includes: The corresponding lung function data prediction sub-model is determined based on the physical feature information; the physical feature information corresponding to the multiple expiratory flow rate sample data used to train the lung function data prediction sub-model belongs to the same physical feature category as the physical feature information of the subject to be tested.

[0008] In one possible implementation, the method further includes: Acquire multiple lung function sample data that meet quality control standards, as well as the corresponding physical characteristic information for each lung function sample data; the lung function sample data includes expiratory flow rate sample data and lung function sample parameters. By combining the body feature classification conditions and the body feature information corresponding to the multiple lung function sample data, the multiple lung function sample data are classified to obtain multiple lung function training sample data groups. The LSTM sub-model is trained using multiple sets of lung function training sample data to obtain lung function data prediction sub-models corresponding to each set of lung function training sample data.

[0009] In one possible implementation, training the LSTM sub-model using multiple sets of lung function training sample data to obtain lung function data prediction sub-models corresponding to each set of lung function training sample data includes: For each lung function training sample data in the lung function training sample data group, determine the acceleration of each flow velocity sampling point in the expiratory flow velocity sample data, and extract the data segment before and after the highest flow velocity acceleration point as the burst sample data segment; The burst sample data segment is used as the input of the LSTM sub-model to obtain expiratory flow rate prediction data and lung function prediction parameters; Calculate the curve prediction loss between the predicted expiratory flow rate data and the sample expiratory flow rate data, and calculate the parameter prediction loss between the predicted lung function parameters and the sample lung function parameters; Based on the curve prediction loss and the parameter prediction loss, the parameters of the LSTM sub-model are updated, and the training is iterated until the curve prediction loss and the parameter prediction loss converge, thereby obtaining the lung function data prediction sub-model corresponding to the lung function training sample data group.

[0010] In one possible implementation, the formula for calculating the curve prediction loss is: ; in, For the expiratory flow rate prediction data, The expiratory flow rate sample data is N, where N is the total number of sampling points for the expiratory flow rate sample data. The formula for calculating the parameter prediction loss is as follows: ; in, The lung function prediction parameters, Let M be the number of lung function parameters in the lung function sample.

[0011] In one possible implementation, the body characteristic classification criteria include one or more of sex, age range, body mass index range, and maximum expiratory flow rate range.

[0012] In one possible implementation, the method further includes: The ambient temperature and atmospheric pressure parameters of the subject during the lung function test were obtained. The predicted lung function data were corrected using the BTPS correction formula; Corrected expiratory flow rate data and pulmonary function parameters are used as clinically usable pulmonary function test results.

[0013] In one possible implementation, determining the acceleration of each flow velocity sampling point in the expiratory flow velocity data and extracting burst data segments within a preset time window before and after the point of highest flow velocity acceleration includes: Calculate the acceleration of the i-th flow rate sampling point in the expiratory flow rate data; The formula for calculating the acceleration of the i-th velocity sampling point is: ; in, Let be the acceleration at the i-th flow velocity sampling point. Let i be the flow velocity at the (i+1)th flow velocity sampling point. Let i be the flow velocity at the i-th flow velocity sampling point. The sampling time interval; The maximum value among all accelerations is selected, and the flow velocity sampling point corresponding to the maximum value is taken as the highest point of the flow velocity acceleration. Based on the duration of the preset time window, with the highest point of flow acceleration as the center, the flow velocity data corresponding to half the duration of each preset time window before and after the highest point of flow acceleration is extracted to form the burst data segment.

[0014] In one possible implementation, after extracting the burst data segment within a preset time window before and after the peak of the flow velocity acceleration, the method further includes: The Kalman filter algorithm is used to fit and predict the velocity change trend corresponding to the burst data segment to obtain the predicted velocity value at the next moment. Obtain the actual flow velocity value at the next moment, and calculate the deviation between the actual flow velocity value and the predicted flow velocity value; If the deviation value exceeds a preset threshold, it is determined that the subject has terminated effective exhalation, and the flow rate data before the moment when the deviation value exceeds the preset threshold in the burst data segment is extracted as the final burst data segment; wherein, the preset threshold is obtained based on statistical analysis of multiple sets of clinical exhalation data.

[0015] Secondly, embodiments of this application disclose a device for predicting lung function data, the device comprising: The acquisition module is used to collect expiratory flow rate data of the subject being tested; The interception module is used to determine the acceleration of each flow rate sampling point in the expiratory flow rate data and intercept the burst data segment before and after the highest point of flow rate acceleration within a preset time window; A matching module is used to match the lung function data prediction sub-model corresponding to the subject to be tested; the lung function data prediction sub-model is trained based on multiple expiratory flow rate sample data; the expiratory flow rate sample data includes burst sample data segments and complete expiratory flow rate sample data, and the burst sample data segments are extracted from the complete expiratory flow rate sample data. The prediction module is used to input the burst data segment into the lung function data prediction sub-model and output the predicted lung function data; the lung function data includes expiratory flow rate data and lung function parameters that meet quality control standards.

[0016] In one possible implementation, the matching module is specifically used to acquire the physical characteristic information of the subject to be tested; determine the corresponding lung function data prediction sub-model based on the physical characteristic information; and the physical characteristic information corresponding to the multiple expiratory flow rate sample data used to train the lung function data prediction sub-model belongs to the same physical characteristic category as the physical characteristic information of the subject to be tested.

[0017] In one possible implementation, the device further includes a training module; The training module is used to acquire multiple lung function sample data that meet quality control standards and the corresponding body feature information of each lung function sample data; the lung function sample data includes expiratory flow rate sample data and lung function sample parameters; combining the body feature classification conditions and the body feature information corresponding to the multiple lung function sample data, the multiple lung function sample data are classified to obtain multiple lung function training sample data groups; the LSTM sub-model is trained using the multiple lung function training sample data groups respectively to obtain the lung function data prediction sub-model corresponding to each lung function training sample data group.

[0018] In one possible implementation, the training module is specifically used to determine the acceleration of each flow velocity sampling point in the expiratory flow velocity sample data for each expiratory function training sample data in the expiratory function training sample data set, and to extract a data segment before and after a preset time window of the highest flow velocity acceleration point as a burst sample data segment; to use the burst sample data segment as the input of the LSTM sub-model to obtain expiratory flow velocity prediction data and expiratory function prediction parameters; to calculate the curve prediction loss between the expiratory flow velocity prediction data and the expiratory flow velocity sample data, and to calculate the parameter prediction loss between the expiratory function prediction parameters and the expiratory function sample parameters; to update the parameters of the LSTM sub-model based on the curve prediction loss and the parameter prediction loss, and to iteratively train until the curve prediction loss and the parameter prediction loss converge, thereby obtaining the expiratory function data prediction sub-model corresponding to the expiratory function training sample data set.

[0019] In one possible implementation, the formula for calculating the curve prediction loss is: ; in, For the expiratory flow rate prediction data, The expiratory flow rate sample data is N, where N is the total number of sampling points for the expiratory flow rate sample data. The formula for calculating the parameter prediction loss is as follows: ; in, The lung function prediction parameters, Let M be the number of lung function parameters in the lung function sample.

[0020] In one possible implementation, the body characteristic classification criteria include one or more of sex, age range, body mass index range, and maximum expiratory flow rate range.

[0021] In one possible implementation, the device further includes a correction module; The correction module is used to acquire the ambient temperature and atmospheric pressure parameters when the subject undergoes pulmonary function testing; to correct the predicted pulmonary function data using the BTPS correction formula; and to use the corrected expiratory flow rate data and pulmonary function parameters as clinically usable pulmonary function test results.

[0022] In one possible implementation, the interception module 502 is specifically used to calculate the acceleration of the i-th flow velocity sampling point in the expiratory flow velocity data; filter out the maximum value among all accelerations, and take the flow velocity sampling point corresponding to the maximum value as the highest flow velocity acceleration point; Based on the duration of the preset time window, with the highest point of flow acceleration as the center, the flow velocity data corresponding to half the duration of each preset time window before and after the highest point of flow acceleration is extracted to form the burst data segment; The formula for calculating the acceleration of the i-th velocity sampling point is: ; in, Let be the acceleration at the i-th flow velocity sampling point. Let i be the flow velocity at the (i+1)th flow velocity sampling point. Let i be the flow velocity at the i-th flow velocity sampling point. This represents the sampling time interval.

[0023] In one possible implementation, the interception module is further configured to fit and predict the flow rate change trend corresponding to the burst data segment using a Kalman filter algorithm to obtain the predicted flow rate value at the next moment; obtain the actual flow rate value at the next moment, and calculate the deviation value between the actual flow rate value and the predicted flow rate value; if the deviation value exceeds a preset threshold, it is determined that the subject has terminated effective exhalation, and the flow rate data before the moment when the deviation value exceeds the preset threshold in the burst data segment is intercepted as the final burst data segment; wherein, the preset threshold is obtained based on statistical analysis of multiple sets of clinical exhalation data.

[0024] Thirdly, embodiments of this application disclose a pulmonary function testing instrument, which performs the method for predicting pulmonary function data according to any one of the first aspects; or, the pulmonary function testing instrument includes a device for predicting pulmonary function data according to any one of the second aspects.

[0025] In one possible implementation, the pulmonary function testing device further includes a control unit, an input unit, a communication unit, a flow sensor, a diagnostic module, and / or a human-computer interaction module.

[0026] In one possible implementation, the flow sensor, the input module, the communication unit, the diagnostic module, and the human-machine interaction module are all electrically connected to the controller. The flow sensor is used to convert the collected expiratory airflow into a corresponding electrical signal, generate expiratory flow rate data, and transmit it to the controller; The input unit is used for users to input the physical characteristics of the person to be tested and to set the detection parameters; The diagnostic module is used to perform diagnostic processing on the predicted lung function data; The human-computer interaction module is used to show the test subject exhalation operation instructions and test progress prompts, and to display the data during the test and the final lung function test results; The communication unit is used to realize data interaction between the controller and external devices. It can transmit the detection results to the hospital information system or mobile terminal, and can also receive control commands and model update data issued by external devices.

[0027] The communication unit is used to realize data interaction between the controller and external devices. It can transmit the detection results to the hospital information system or mobile terminal, and can also receive control commands and model update data issued by external devices.

[0028] In one possible implementation, the diagnostic module is specifically used to call the built-in diagnostic model, combine it with a preset algorithm to analyze the predicted lung function data, and output a lung function waveform that conforms to clinical standards. or, The diagnostic module is specifically used to upload the predicted lung function data to the cloud diagnostic system through the communication unit, and to receive the diagnostic analysis results and corresponding waveform data returned from the cloud.

[0029] In one possible implementation, the flow sensor includes one or more of a differential pressure sensor, an ultrasonic sensor, and a turbine flow sensor.

[0030] Fourthly, embodiments of this application disclose a control device, including a processor and a memory, wherein the memory is used to store programs, instructions or code, and the processor is used to execute the programs, instructions or code in the memory to perform the lung function data prediction method as described in any of the first aspects.

[0031] Fifthly, embodiments of this application disclose a computer-readable storage medium, characterized in that it stores a computer program, which is loaded by a processor to execute the lung function data prediction method as described in any of the first aspects.

[0032] This application provides a method and related equipment for predicting lung function data. The method first acquires the expiratory flow rate data of the subject, calculates the acceleration at each flow rate sampling point to determine the point of highest flow acceleration, and extracts burst data segments within a preset time window before and after this point. Then, it matches the data with a lung function data prediction sub-model corresponding to the subject. This sub-model is trained from multiple sets of expiratory flow rate sample data, including burst sample data segments extracted from complete expiratory flow rate sample data. Finally, the burst data segments are input into the sub-model, and the output is predicted lung function data containing expiratory flow rate data and lung function parameters that meet quality control standards.

[0033] This application's embodiment extracts burst data segments before and after the peak of expiratory flow acceleration from the subject's expiratory flow velocity data, and combines this with a matched, dedicated pulmonary function data prediction sub-model for prediction. This eliminates the need for the subject to complete a full expiratory flow velocity data collection that meets quality control standards, reducing the requirements on the subject's cooperation and physiological conditions, making it suitable for various populations. Furthermore, the pulmonary function data prediction sub-model, trained based on burst sample data segments and full expiratory flow velocity sample data, can accurately capture the expiratory flow velocity variation patterns of this population, ensuring that the output prediction data meets quality control standards. This improves the applicability and convenience of pulmonary function testing, guarantees the reliability of test results, and provides accurate evidence for clinical diagnosis and treatment. Attached Figure Description

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

[0035] Figure 1 A flowchart illustrating a method for predicting lung function data provided in an embodiment of this application; Figure 2 A schematic diagram illustrating the training process of a lung function data prediction sub-model provided in an embodiment of this application; Figure 3 This is a schematic diagram illustrating the training results using the mean squared error loss function in related technologies. Figure 4 A schematic diagram illustrating the training result using a dual loss function, provided as an embodiment of this application; Figure 5 This is a schematic diagram of a lung function data prediction device provided in an embodiment of this application. Detailed Implementation

[0036] As described earlier, quality control of pulmonary function tests remains a key bottleneck restricting the reliability of their results, especially in primary healthcare institutions and among special populations, where the low rate of quality control compliance is even more prominent, directly affecting diagnostic accuracy and the efficiency of medical resource utilization. The core reasons for this problem can be summarized in the following three aspects: First, the test results are highly dependent on the patient's active cooperation and physiological capabilities. Pulmonary function tests, especially FVC (Frequency Capacity) measurements, require patients to strictly adhere to the standard procedure of deep inhalation to full lung capacity and sustained exhalation for at least 6 seconds at maximum speed and force. Whether the patient accurately understands the technician's instructions, whether they exert maximum effort to complete the procedure, whether they are nervous leading to disordered breathing rhythm, and physical discomfort can all directly distort the flow rate curve. Elderly, frail individuals, children, patients with cognitive impairment, or patients with neuromuscular diseases are often unable to complete a sustained 6-second exhalation due to physiological limitations, or they may experience hesitation, interruption, or air leakage during exhalation, directly leading to invalid or distorted test results.

[0037] Secondly, the examination process places extremely high demands on the technicians' professional skills. High-quality pulmonary function tests require not only skilled equipment operation but also coaching-style guidance. Technicians need to help patients overcome physiological and psychological barriers and achieve optimal breathing capacity through clear verbal guidance, immediate demonstrations, and encouraging communication. Simultaneously, technicians must monitor the patient's procedure in real time, quickly identify common errors such as coughing, glottal closure, and premature termination of exhalation, and immediately guide corrections to ensure at least three tests meeting quality control standards are completed. However, in reality, technicians in primary healthcare institutions often lack systematic professional training, resulting in a superficial understanding and lax implementation of quality control standards, further exacerbating the problem of poor quality control.

[0038] Third, the complexity of equipment calibration and environmental adaptation increases the difficulty of quality control. The measurement accuracy of pulmonary function instruments depends on regular volume and flow calibration. If the calibration cycle is too long or the operation is not standardized, it will directly produce systematic errors. At the same time, changes in ambient temperature, humidity, and atmospheric pressure will significantly affect the gas volume measurement results. However, in practice, some medical institutions often neglect real-time correction of environmental parameters, leading to deviations in results. In addition, from patient preparation before examination and proper positioning during examination to the sequential connection of the testing process, any non-standard operation in any link will reduce the quality of the examination.

[0039] Poor quality control in pulmonary function tests has cascading and severe consequences. On the one hand, it can lead to misdiagnosis and missed diagnosis. False positive results may misdiagnose healthy individuals as having obstructive or restrictive ventilatory dysfunction, causing them to undergo unnecessary drug treatment or subsequent examinations such as high-resolution CT scans. False negative results may overestimate a patient's lung function, leading to missed diagnoses of early-stage COPD, asthma, and other diseases, missing the optimal intervention time, and causing delays in treatment.

[0040] On the other hand, it can lead to clinical decision-making errors and a waste of medical resources. Treatment plans based on inaccurate results are not only ineffective but may also cause side effects. Repeatedly conducting ineffective examinations and unnecessary specialist referrals not only increase the economic burden and psychological stress on patients but also result in a significant waste of medical resources. Furthermore, for patients with chronic diseases who require long-term monitoring of lung function changes, incomparable results due to poor quality control can prevent doctors from accurately assessing disease progression and treatment effectiveness. In clinical drug trials, low-quality lung function data can further interfere with the reliability of research conclusions and affect the progress of new drug development.

[0041] To address the aforementioned technical problems, this application provides a method and related equipment for predicting lung function data. The method first acquires the expiratory flow rate data of the subject, calculates the acceleration at each flow rate sampling point to determine the point of highest flow acceleration, and extracts burst data segments within a preset time window before and after this point. Then, it matches the data with a lung function data prediction sub-model corresponding to the subject. This sub-model is trained using multiple sets of expiratory flow rate sample data, including burst sample data segments extracted from complete expiratory flow rate sample data. Finally, the burst data segments are input into the sub-model, and the output is predicted lung function data containing expiratory flow rate data and lung function parameters that meet quality control standards.

[0042] This application's embodiment extracts burst data segments before and after the peak of expiratory flow acceleration from the subject's expiratory flow velocity data, and combines this with a matched, dedicated pulmonary function data prediction sub-model for prediction. This eliminates the need for the subject to complete a full expiratory flow velocity data collection that meets quality control standards, reducing the requirements on the subject's cooperation and physiological conditions, making it suitable for various populations. Furthermore, the pulmonary function data prediction sub-model, trained based on burst sample data segments and full expiratory flow velocity sample data, can accurately capture the expiratory flow velocity variation patterns of this population, ensuring that the output prediction data meets quality control standards. This improves the applicability and convenience of pulmonary function testing, guarantees the reliability of test results, and provides accurate evidence for clinical diagnosis and treatment.

[0043] The lung function data prediction method provided in this application can be widely applied in respiratory outpatient clinics, inpatient wards, and community health service centers at all levels of medical institutions, and is compatible with portable lung function testing devices or desktop lung function testing equipment. In outpatient settings, doctors can quickly collect patients' expiratory flow rate data using the device, automatically extract burst data segments using the solution, and match them with a dedicated prediction sub-model. This eliminates the need for patients to complete a prolonged standard exhalation, allowing for rapid acquisition of lung function data that meets quality control standards, significantly improving diagnostic efficiency. It is particularly suitable for elderly, children, and frail patients who cannot cooperate with a complete exhalation. In community chronic disease management, portable devices combined with this solution enable home-based lung function monitoring or community screening for patients with COPD, asthma, and other diseases. Patients do not need to go to the hospital; they can complete the test through a simple exhalation procedure. The device transmits the predicted data to the medical system in real time, helping doctors remotely monitor changes in the patient's condition. In health check centers or epidemiological survey sites, this solution can reduce device usage time through rapid batch testing while ensuring data accuracy, meeting the needs of large-scale population lung function screening.

[0044] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0045] See Figure 1 , Figure 1 This is a flowchart illustrating a method for predicting lung function data provided in an embodiment of this application. The method can be executed by a server, desktop computer, or other electronic device capable of computation. The following description uses a computing device as the executing entity, and the method includes: S101: The computing device collects the expiratory flow rate data of the subject being tested.

[0046] Expiratory flow rate data are continuous flow rate time-series data collected by the pulmonary function testing device at a preset sampling frequency during the subject's forced exhalation, reflecting the dynamic change of flow rate over time during exhalation.

[0047] During the expiratory flow rate data acquisition process, the subject, following the instructions of medical staff, must inhale deeply to full lung capacity through the breathing interface of the pulmonary function testing device, and then exhale forcefully at the fastest speed and with the greatest force. The device's built-in flow rate sensor captures changes in expiratory flow rate in real time at a preset sampling frequency. For example, if the preset sampling frequency is 100Hz, a data point is collected every 10ms. The collected flow rate data is transmitted in real time to the storage module of the computing device to form a continuous time-series data string of expiratory flow rate, ensuring data integrity and real-time performance.

[0048] By acquiring subject and expiratory flow rate data through standardized methods, accurate and standardized foundational data support is provided for subsequent burst data segment extraction and sub-model matching, avoiding deviations in subsequent prediction results due to non-standard data collection. Simultaneously, high-frequency flow rate data acquisition can fully capture the flow rate details during exhalation, ensuring the accuracy of subsequent acceleration calculations and burst data segment extraction.

[0049] S102: The computing device determines the acceleration of each flow velocity sampling point in the expiratory flow velocity data and extracts the burst data segment before and after the preset time window of the highest flow velocity acceleration point.

[0050] A flow rate sampling point is a single flow rate data node generated at a preset sampling frequency during the expiratory flow rate data acquisition process. Each sampling point corresponds to the expiratory flow rate value at a specific time point and is the basic unit for calculating acceleration. Flow acceleration is the ratio of the flow rate difference between two adjacent flow rate sampling points to the sampling time interval, and is used to reflect the rate of change of expiratory flow rate.

[0051] The point of highest flow acceleration is the point with the largest value of acceleration among all flow sampling points, corresponding to the moment when the subject's exhalation burst force is strongest.

[0052] The preset time window is a pre-defined time length for capturing burst data segments. For example, the preset time window can be 450ms-650ms. The preset time window is used to limit the range of data captured before and after the peak of the flow velocity acceleration.

[0053] The burst data segment is a data segment formed by extracting flow velocity data corresponding to half the duration of each preset time window before and after the point of highest flow velocity acceleration. It is the core input data for the lung function data prediction sub-model.

[0054] The computing device first retrieves continuous expiratory flow rate data from the storage module, extracts the flow rate values ​​of two adjacent sampling points in the order of the flow rate sampling points, and calculates the acceleration value of each sampling point one by one using the acceleration calculation formula in combination with the preset sampling time interval to form complete acceleration time series data.

[0055] Subsequently, the computing device iterates through and compares all acceleration values, selects the sampling point corresponding to the largest acceleration value, and determines it as the highest point of flow velocity acceleration. Then, according to the preset time window specifications, with this highest point as the center, it extracts the flow velocity sampling point data corresponding to half of each preset time window before and after, integrates them to form the initial burst data segment, and performs format standardization processing on this data segment to ensure that it matches the input format of subsequent sub-models.

[0056] This application's embodiments, by accurately calculating flow acceleration and locating its highest point, can quickly pinpoint the most representative core segment in expiratory flow rate data, providing high-quality input data for subsequent model predictions and avoiding interference from invalid data. Preset multiple time windows can adapt to the expiratory characteristics of different subjects, improving the flexibility of data extraction. Furthermore, the symmetrical extraction method based on the highest acceleration point can retain key information related to expiratory burst force to the greatest extent, laying the foundation for accurate prediction of complete lung function data by the model, while significantly shortening the length of effective data, reducing data processing pressure and model computation costs.

[0057] To further improve the accuracy and standardization of burst data segment extraction and ensure the reliability of subsequent model predictions, this application provides a specific method for determining burst data segments. Through standardized acceleration calculation, peak point screening, and data extraction processes, the core effective information in expiratory flow rate data is accurately captured.

[0058] Specifically, the acceleration at each flow rate sampling point in the expiratory flow rate data is determined, and burst data segments within a preset time window before and after the point of maximum flow rate acceleration are extracted, including: The computing device first retrieves continuous expiratory flow rate data, numbers each flow rate sampling point in chronological order, and calculates the acceleration of the i-th flow rate sampling point in the expiratory flow rate data.

[0059] The formula for calculating the acceleration of the i-th velocity sampling point is: ; in, Let be the acceleration at the i-th flow velocity sampling point. Let i be the flow velocity at the (i+1)th flow velocity sampling point. Let i be the flow velocity at the i-th flow velocity sampling point. The sampling time interval; The computing device calculates the acceleration value of each flow velocity sampling point one by one, then iterates through and compares all acceleration values, selects the maximum value among all accelerations, and takes the flow velocity sampling point corresponding to the maximum value as the point with the highest flow velocity acceleration.

[0060] The computing device, based on the duration of a preset time window, extracts flow velocity data corresponding to half the duration of each preset time window before and after the point of highest flow velocity acceleration, forming burst data segments, with the highest flow velocity acceleration as the center.

[0061] As an example, the sampling frequency of the lung function testing device is 100Hz, that is, the sampling time interval Δt is 10ms. After the subject completes exhalation, the device calculates the continuous expiratory flow rate data and the acceleration value of each flow rate sampling point.

[0062] Taking the fourth sampling point as an example where the flow velocity acceleration is the highest, if the preset time window is 550ms, then the flow velocity data needs to be extracted 275ms before and after the fourth sampling point, corresponding to 27.5 sampling points, which are rounded up to 28 sampling points. Combining the sampling frequency of 100Hz, 275ms corresponds to 27.5 sampling points. In actual operation, 28 sampling points are taken before and after, and finally the flow velocity data from the fourth - 28 = -24 (rounded up to 1) to the fourth + 28 = 32 sampling points are extracted, forming a burst data segment with a length of 55 sampling points (corresponding to 550ms). This data segment will serve as the core data for subsequent model input.

[0063] Considering that the subject may prematurely terminate exhalation due to physiological limitations or improper cooperation, resulting in invalid flow rate data after exhalation termination being mixed into the initially extracted burst data segment, thus interfering with the model's prediction accuracy, this application's embodiment adds a secondary screening process for effective data based on the Kalman filter algorithm after extracting the initial burst data segment. Through dynamic trend prediction and deviation verification, invalid data is accurately removed, further refining the core data quality input to the model.

[0064] In one possible implementation, after extracting burst data segments within a preset time window before and after the peak of the flow velocity acceleration, the method further includes: The Kalman filter algorithm is used to fit and predict the velocity change trend corresponding to the burst data segment, and the predicted velocity value for the next moment is obtained. Obtain the actual flow velocity value at the next moment and calculate the deviation between the actual flow velocity value and the predicted flow velocity value; If the deviation value exceeds the preset threshold, it is determined that the subject has terminated effective exhalation. The flow rate data before the time when the deviation value exceeds the preset threshold in the burst data segment is extracted as the final burst data segment. The preset threshold is obtained based on the statistical analysis of multiple sets of clinical exhalation data.

[0065] After acquiring the initial burst of data, the computing device uses continuous flow velocity sampling points within that data segment as observations. It then fits and models the flow velocity change trend using the state equation and observation equation built into the Kalman filter algorithm. Based on the variation patterns of historical flow velocity data, it automatically learns the expiratory dynamic characteristics of the subject, thereby accurately predicting the theoretical flow velocity value at the next moment, providing a benchmark reference for subsequent deviation verification. Simultaneously, the computing device maintains real-time acquisition of expiratory flow velocity data, synchronously acquiring the actual flow velocity value corresponding to the next moment, avoiding verification errors caused by data delays.

[0066] Subsequently, the computing device calculates the absolute deviation between the actual flow rate and the predicted flow rate using a preset algorithm, obtaining the deviation value, and then compares this deviation value with a preset threshold in real time. The preset threshold is a fixed value determined by statistically analyzing the flow rate deviation distribution at the end of expiration based on clinical expiratory data from multiple groups of different populations and respiratory states, and can adapt to the expiratory characteristics of the vast majority of subjects being tested.

[0067] If the deviation exceeds the preset threshold, it indicates that the subject's actual expiratory state has deviated from the normal trend, and it is determined that effective exhalation has ceased. At this point, the computing device will automatically extract all flow rate data from the initial burst data segment before the deviation exceeds the threshold, forming a final burst data segment free from invalid data interference. If the deviation does not exceed the preset threshold, it is determined that the subject is still in an effective expiratory state, and the initial burst data segment is retained as the final input data to ensure the accuracy and reliability of subsequent model predictions.

[0068] S103: Computational device matches the lung function data prediction sub-model corresponding to the subject to be tested.

[0069] In this embodiment, different lung function data prediction sub-models can be matched to different test subjects. The computing device can call a built-in sub-model index library, which pre-stores all trained lung function data prediction sub-models, and each lung function data prediction sub-model is associated with a corresponding test subject. The computing device accurately matches the test subject with the sub-model labels in the index library, quickly locates and retrieves the lung function data prediction sub-model corresponding to the test subject, ensuring a high degree of fit between the lung function data prediction sub-model and the test subject.

[0070] In one possible implementation, the method further includes: The computing device acquires the physical characteristics information of the person being tested; The lung function data prediction sub-model is matched to the individual being tested, including: The computing device determines the corresponding lung function data prediction sub-model based on the body feature information; the body feature information corresponding to the multiple expiratory flow rate samples used to train the lung function data prediction sub-model belongs to the same body feature category as the body feature information of the subject being tested.

[0071] Body characteristic information refers to basic physiological characteristic data related to the lung function of the person being tested. Body characteristic information includes at least gender, age, and body mass index (BMI). The computing device can acquire body characteristic information in two exemplary ways: First, medical staff can manually enter the gender, age, height, and BMI of the person being tested through the device's built-in input interface. Second, by interfacing with the hospital's information system, relevant physiological characteristic data can be directly retrieved from the person being tested's pre-entered electronic health record, reducing human error.

[0072] The lung function data prediction sub-model is trained on multiple sets of expiratory flow rate samples under specific body characteristic classifications. This sub-model is an LSTM model capable of predicting complete lung function data from burst data segments. Each lung function data prediction sub-model corresponds to a group of people with similar body characteristics.

[0073] The physical characteristic classification groups are population groups categorized based on physical characteristic parameters such as gender, age range, BMI range, and PEF range. Within the same group, people exhibit a high degree of homogeneity in lung function-related physiological characteristics.

[0074] The computing device standardizes the physical characteristic information of the person being tested and determines their physical characteristic category according to preset classification rules. For example, if the person being tested is a 28-year-old male with a BMI of 22.5 and a PEF of 5.8 L / s, the corresponding category is "male, (18.5, 23.9] BMI, (18, 30] age, (3, 6] PEF".

[0075] By accurately matching body feature classification with sub-models, the input burst data segments can be mapped to the most suitable prediction model, avoiding prediction bias caused by "one-size-fits-all" modeling and significantly improving the prediction accuracy of lung function data for different populations. Meanwhile, the pre-defined sub-model index library and rapid matching mechanism shorten model call time, ensuring the efficiency of the entire prediction process. No additional model training or adjustment is required, reducing the computational burden on computing devices and enhancing convenience in clinical applications.

[0076] The lung function data prediction sub-model is a prediction model customized for a specific body characteristic category of the population. Its training is based on multiple expiratory flow rate sample data. These expiratory flow rate sample data all include paired burst sample data segments and complete expiratory flow rate sample data. Furthermore, the body characteristic information corresponding to all expiratory flow rate sample data of a lung function data prediction sub-model belongs to the same body characteristic category as the body characteristic information of the subject being tested, ensuring that the model can accurately adapt to the lung function characteristic patterns of the target population.

[0077] The expiratory flow rate sample data is the labeled data used to train the sub-model. The expiratory flow rate sample data includes burst sample data segments extracted from the complete expiratory flow rate sample data, as well as the complete expiratory flow rate sample data corresponding to the burst sample data segments.

[0078] S104: The computing device inputs the burst data segment into the lung function data prediction sub-model and outputs the predicted lung function data.

[0079] Lung function data includes expiratory flow rate data and lung function parameters that meet quality control standards. These quality control standards are used to measure the validity of the lung function data; for example, the quality control standards for lung function testing are outlined in the "Regulations for the Management of Lung Function Tests".

[0080] The duration of expiratory flow rate data in pulmonary function data is greater than or equal to 6 seconds, and the flow rate change trend conforms to the normal respiratory physiological pattern without obvious abnormal fluctuations or interruptions, thus meeting the basic data requirements for clinical pulmonary function examination.

[0081] After extracting the burst data segments and matching them with the corresponding lung function data prediction sub-models, the computing device can perform format adaptation processing on the burst data segments. According to the input dimension requirements set during the sub-model training phase, the burst data segments are adjusted into fixed-length time-series data vectors to ensure data format compatibility with the model input layer.

[0082] Subsequently, the computing device inputs the formatted burst data segments in batches into the matching pulmonary function data prediction sub-model. The pulmonary function data prediction sub-model uses a built-in LSTM network structure to extract features and perform temporal modeling on the input data. First, it captures the dynamic features of flow rate changes (such as rate of ascent and peak characteristics) within the burst data segments through gating units. Then, based on the mapping pattern between the burst data segments and complete expiratory flow rate data learned during the training phase, it gradually generates a complete expiratory flow rate prediction curve with a duration of at least 6 seconds. Simultaneously, the pulmonary function data prediction sub-model integrates and calculates the extracted features through fully connected layers, directly outputting the corresponding pulmonary function prediction parameters.

[0083] After output, the computing device automatically verifies the compliance of the prediction results, confirming that the expiratory flow rate data duration is within the standard, the curve has no invalid interruptions, and the values ​​of lung function parameters are within the clinically reasonable range, ensuring that the output data meets the quality control standards, and finally forming lung function data.

[0084] This application's embodiment achieves accurate conversion from short burst data to complete and compliant pulmonary function data by inputting purified burst data segments into a dedicated predictive sub-model. This eliminates the need for the test subject to perform a standard prolonged exhalation procedure, effectively addressing the pain point of special populations being unable to cooperate with the complete examination. Simultaneously, the expiratory flow rate data and pulmonary function parameters output by the model meet clinical quality control standards, ensuring the clinical usability of the data. This provides doctors with accurate and reliable quantitative evidence for quickly developing treatment plans, improving the suitability of pulmonary function testing and guaranteeing the professionalism of diagnostic results.

[0085] Considering that ambient temperature and atmospheric pressure can affect gas volume, which in turn can lead to discrepancies between uncorrected lung function data and the actual lung function level under physiological conditions, thus affecting the accuracy of clinical diagnosis, this application embodiment can also perform environmental parameter correction steps based on the BTPS standard after outputting the predicted lung function data, so that the final test results are more in line with the precise needs of clinical diagnosis and treatment.

[0086] In one possible implementation, the method further includes: The ambient temperature and atmospheric pressure parameters of the subjects undergoing pulmonary function testing are obtained; the predicted pulmonary function data are corrected using the BTPS correction formula; and the corrected expiratory flow rate data and pulmonary function parameters are used as clinically usable pulmonary function test results.

[0087] BTPS stands for Body Temperature, Pressure, and Saturated Water Vapor. The BTPS standard is an important standard in gas volume measurement, primarily used to correct for gas volume under different conditions, thereby improving the accuracy and comparability of measurement results.

[0088] The computing device first acquires the ambient temperature parameters (unit: °C) and atmospheric pressure parameters (unit: kPa) in real time during the lung function test by the subject through the built-in environmental sensor or external sensing module, ensuring that the environmental data is synchronized with the testing process and avoiding correction errors caused by data lag.

[0089] Subsequently, the computing device calls the preset BTPS correction formula to specifically correct the predicted lung function data, and uniformly corrects the predicted data to the standard state of "body temperature (37℃), atmospheric pressure (101.325kPa), and saturated water vapor".

[0090] The BTPS correction formula can be: ; in, This is the corrected volume value of the lung function data. The volume value is obtained by integrating the predicted expiratory flow rate data, where T is the ambient temperature and P is the ambient atmospheric pressure.

[0091] Ultimately, the electronic device integrates and outputs the corrected expiratory flow rate data and lung function parameters as clinically usable lung function test results, ensuring that the data is not affected by differences in the testing environment and improving the comparability and accuracy of test results in different scenarios.

[0092] Accurate training of the lung function data prediction sub-model is the core foundation for predicting complete lung function data from short data segments. Below, this application's embodiments, combined with specific implementation methods, detail the complete training process of the lung function data prediction sub-model from three core stages: sample preparation, classification and grouping, and model training. Figure 2 As shown, the training process of the lung function data prediction sub-model includes the following steps: S201: The electronic device acquires multiple lung function sample data that meet quality control standards, as well as the corresponding physical characteristic information of each lung function sample data.

[0093] Electronic devices collect a large amount of raw data from clinical pulmonary function tests, which are then rigorously screened according to ATS / ERS quality control standards to ultimately obtain multiple pulmonary function sample data and corresponding physical characteristic information that meet the quality control standards.

[0094] Lung function sample data includes complete expiratory flow rate sample data and lung function sample parameters. Expiratory flow rate sample data consists of flow-time time series data for continuous exhalation of 6 seconds or more. Lung function sample parameters include key clinical parameters such as forced vital capacity (FVC), forced expiratory volume in one second (FEV1), or peak expiratory flow (PEF). These lung function sample parameters are calculated from complete expiratory flow rate sample data, ensuring data accuracy and relevance.

[0095] At the same time, each lung function sample data is associated with complete physical characteristics information, including gender, age, body mass index (BMI) and PEF value. The physical characteristics information will serve as the core basis for subsequent sample classification.

[0096] After acquiring lung function sample data and physical characteristic information, electronic devices can preprocess the filtered sample data. For example, data with abnormal flow rate fluctuations, missing parameter annotations, or incomplete physical characteristic information can be removed; Z-score standardization can be performed on expiratory flow rate sample data to eliminate dimensional differences; and features such as BMI, age, and PEF values ​​can be interval-labeled to prepare for subsequent classification and grouping.

[0097] S202: The electronic device combines the body feature classification conditions and the body feature information corresponding to multiple lung function sample data to classify multiple lung function sample data and obtain multiple lung function training sample data groups. Based on preset body characteristic classification criteria, the electronic device categorizes all lung function sample data that have passed quality control, forming multiple lung function training sample data sets. These body characteristic classification criteria may include one or more of the following: gender, age range, body mass index range, and maximum expiratory flow rate range. These body characteristic classification criteria can be flexibly combined.

[0098] As an example, this application's embodiment employs a four-dimensional full-combination classification method to ensure the accuracy of grouping: Gender is divided into two categories: male and female; The age range is divided into 6 categories: [0,6) years old, [6,18) years old, (18,30] years old, (30,40] years old, (40,60] years old, and (60,+∞] years old. BMI ranges are divided into four categories: [0, 18.5], (18.5, 23.9], (23.9, 27.9], and (27.9, +∞). The PEF range is divided into 5 categories: (0,3]L / s, (3,6]L / s, (6,9]L / s, (9,12]L / s, and [12,+∞)L / s.

[0099] During classification, the computing device reads the physical characteristics of each sample data point one by one and matches them with the classification conditions mentioned above. For example, sample data of "28-year-old male, BMI 22.3, PEF 5.6 L / s" will be classified into the training sample data group corresponding to "male, (18, 30] years old, (18.5, 23.9] BMI, (3, 6] L / s PEF". Finally, through a combination of 2×6×4×5, 720 lung function training sample data groups can be formed. The population characteristics corresponding to the sample data in each group are highly homogeneous, which provides a guarantee for targeted training.

[0100] S203: The electronic device uses multiple sets of lung function training sample data to train the LSTM sub-model, and obtains the lung function data prediction sub-model corresponding to each set of lung function training sample data.

[0101] The electronic device initiates the training process of the LSTM sub-model separately for each lung function training sample data group to ensure that the model is adapted to the population characteristics of the corresponding group.

[0102] Specifically, step S203 may include: S2031: For each lung function training sample data in the lung function training sample data group, the electronic device determines the acceleration of each flow velocity sampling point in the expiratory flow velocity sample data, and extracts the data segment before and after the highest flow velocity acceleration point as the burst sample data segment.

[0103] For each lung function training sample in the training sample data set, the acceleration of each flow velocity sampling point in the expiratory flow velocity sample data is first calculated, and the flow velocity sampling point corresponding to the maximum acceleration value is selected as the highest flow velocity acceleration point. Then, based on a preset time window, with this highest point as the center, the flow velocity data corresponding to half the time before and after it is extracted to form a burst sample data segment, which is used as the input data for the LSTM sub-model.

[0104] S2032: The electronic device uses the burst sample data segment as input to the LSTM sub-model to obtain expiratory flow rate prediction data and lung function prediction parameters.

[0105] The extracted burst sample data segments are input into the initial LSTM sub-model in batches. The LSTM sub-model learns the mapping relationship between the burst sample data segments and the complete expiratory flow rate sample data, and outputs complete expiratory flow rate prediction data and lung function prediction parameters. The dimensionality of the lung function prediction parameters is consistent with that of the lung function sample parameters.

[0106] S2033: Electronic devices calculate the curve prediction loss between expiratory flow rate prediction data and expiratory flow rate sample data, and calculate the parameter prediction loss between lung function prediction parameters and lung function sample parameters.

[0107] The embodiments of this application employ a dual loss function to calculate the loss between the predicted results and the actual sample data, ensuring that the model balances curve integrity and parameter accuracy.

[0108] In one possible implementation, the curve prediction loss can be calculated using the mean ratio loss function, which can be expressed as: ; in, For expiratory flow rate prediction data, For expiratory flow rate sample data, N is the total number of sampling points for expiratory flow rate sample data.

[0109] In another possible implementation, the parameter prediction loss can be calculated using the mean absolute error loss function, which can be expressed as: ; in, For predicting lung function parameters, Here, M represents the number of lung function parameters.

[0110] In related technologies, the mean squared error (MSE) loss function is typically used for optimization calculations. However, the MSE loss function can lead to the neglect of fitting low-value data. For example, in the first set of data, the predicted value is 4.8, the actual value is 4.4, and the difference between the predicted and actual values ​​is 0.4; in the second set of data, the predicted value is 1.4, the actual value is 1.0, and the difference between the predicted and actual values ​​is also 0.4. Although the difference between the two sets of data is the same, the loss for the lower-value data (the second set) is relatively greater than the loss for the higher-value data (the first set), causing the model to prioritize fitting the higher-value data and neglect the lower-value data. The embodiment of this application uses the mean ratio loss function to balance the contribution of loss of different values, that is, to balance the fitting accuracy of high and low flow rate data, avoid the fitting error of low flow rate data being masked, and thus improve the accuracy of expiratory flow rate data prediction.

[0111] To illustrate the effects achieved by using the mean ratio loss function and the mean absolute error loss function in the embodiments of this application, please refer to Tables 1 and 2 for details. Figure 3 and Figure 4 Table 1 shows the verification results of the main indicators calculated using the mean squared error loss function in related technologies, while Table 2 shows the verification results of the main indicators calculated using the mean ratio loss function and the mean absolute error loss function in the embodiments of this application. Figure 3 This is a schematic diagram illustrating the training results using the mean squared error loss function in related technologies. Figure 4 This is a schematic diagram illustrating a training result using a dual loss function, provided as an embodiment of this application. Wherein, Figure 3 This is a schematic diagram of the training results before optimization. Figure 4 This is a schematic diagram of the optimized training results obtained through the embodiments of this application. Figure 3 and Figure 4 In the diagram, the horizontal axis represents the number of training batches, the vertical axis represents the loss value, the curve trians loss represents the training loss, and the curve val loss represents the validation loss.

[0112] Table 1

[0113] Table 2

[0114] In Tables 1 and 2, FVC, FEV1, FEV1 / FVC, PEF, Forced Expiratory Flow (FEF) at 25 seconds (FEF25), Forced Expiratory Flow (FEF50) at 50 seconds (FEF75), Forced Expiratory Flow (FEF75) at 75 seconds (FEF75), Maximum Mid-Expiratory Flow (MMEF), Severity Consistency Rate, and Consistency Rate of Routine Lung Function Types are indicators for assessing lung function.

[0115] A comparison of Tables 1 and 2 shows that, compared with the lung function data obtained by using the mean squared error loss function in related technologies, the mean absolute error of each indicator in the lung function data obtained by using the mean ratio loss function and the mean absolute error loss function in the embodiments of this application is reduced to varying degrees.

[0116] S2034: The electronic device updates the parameters of the LSTM sub-model based on curve prediction loss and parameter prediction loss, and iterates the training until the curve prediction loss and parameter prediction loss converge, thus obtaining the lung function data prediction sub-model corresponding to the lung function training sample data group.

[0117] Based on the calculated curve prediction loss and parameter prediction loss, a weighted summation method can be used to determine the total loss. The weights can be adjusted according to clinical needs; for example, when prioritizing parameter prediction accuracy, the parameter prediction loss weight is 0.6, and the curve prediction loss weight is 0.4.

[0118] The backpropagation algorithm is used to derive the gradient values ​​of each parameter along the network layers of the LSTM sub-model, with the goal of minimizing the total loss. This includes the weight matrix between the input layer and hidden layers, the recursive weights within the hidden layers, the weights between the hidden layers and fully connected layers, and the bias terms of each layer. During gradient calculation, gradient pruning techniques can be used for the gated units and cell states of the LSTM sub-model to limit the gradient magnitude within a preset threshold, preventing model training instability caused by gradient explosion or vanishing gradients.

[0119] Based on the calculated gradient values, an adaptive optimization algorithm (such as the Adam optimizer) is used to update the model parameters. The optimizer dynamically adjusts the learning rate according to the gradient history of each parameter, making larger adjustments to parameters with large gradients and fine-tuning parameters with small gradients to ensure the accuracy and efficiency of parameter updates. The initial learning rate is set to 0.001 and gradually decreases with each training iteration.

[0120] After completing the parameter update for a single batch, the electronic device loads the next batch of training data and repeats steps S2031-S2034 to enter the next round of iterative training.

[0121] During training, the electronic device monitors the curve prediction loss, parameter prediction loss, and total loss value in real time for each iteration and records them to the training log. When the convergence condition is met, model training for that lung function training sample data group is stopped. The convergence condition is, for example, that in 15 consecutive iterations, the decrease in both curve prediction loss and parameter prediction loss is less than a preset value, and both types of loss values ​​are stable in a low level range (e.g., curve prediction loss ≤ 0.01, parameter prediction loss ≤ 0.05), indicating that the model has fully learned the mapping pattern between the burst sample data segment and the complete lung function data for this group of data and no longer produces effective optimization. At this point, all parameters of the current model (weights, biases, gating unit parameters, etc.) are saved to form a lung function data prediction sub-model specific to this lung function training sample data group.

[0122] Steps S2031-S2034 above describe the process by which an electronic device trains a corresponding lung function data prediction sub-model for a given set of lung function training sample data. After training the lung function data prediction sub-models for all lung function training sample data sets according to the above process, all trained lung function data prediction sub-models are associated with and stored with their corresponding body feature classification labels, forming a sub-model index library to support rapid matching and retrieval during the application phase.

[0123] This application also provides a device for predicting lung function data, such as... Figure 3 As shown, the device includes: The acquisition module 501 is used to collect expiratory flow rate data of the subject being tested; The interception module 502 is used to determine the acceleration of each flow rate sampling point in the expiratory flow rate data and intercept the burst data segment before and after the highest point of flow rate acceleration within a preset time window; The matching module 503 is used to match the lung function data prediction sub-model corresponding to the subject to be tested; the lung function data prediction sub-model is trained based on multiple expiratory flow rate sample data; the expiratory flow rate sample data includes burst sample data segments and complete expiratory flow rate sample data, the burst sample data segments are extracted from the complete expiratory flow rate sample data; the body feature information corresponding to multiple expiratory flow rate sample data belongs to the same body feature category as the body feature information of the subject to be tested; The prediction module 504 is used to input the burst data segment into the lung function data prediction sub-model and output the predicted lung function data; the lung function data includes expiratory flow rate data and lung function parameters that meet quality control standards.

[0124] In one possible implementation, the matching module 503 is specifically used to acquire the body feature information of the subject to be tested; determine the corresponding lung function data prediction sub-model based on the body feature information; and the body feature information corresponding to the multiple expiratory flow rate sample data used to train the lung function data prediction sub-model belongs to the same body feature category as the body feature information of the subject to be tested.

[0125] In one possible implementation, the device further includes a training module; The training module is used to acquire multiple lung function sample data that meet quality control standards and the corresponding body feature information of each lung function sample data; the lung function sample data includes expiratory flow rate sample data and lung function sample parameters; combining the body feature classification conditions and the body feature information corresponding to the multiple lung function sample data, the multiple lung function sample data are classified to obtain multiple lung function training sample data groups; the LSTM sub-model is trained using the multiple lung function training sample data groups respectively to obtain the lung function data prediction sub-model corresponding to each lung function training sample data group.

[0126] In one possible implementation, the training module is specifically used to determine the acceleration of each flow velocity sampling point in the expiratory flow velocity sample data for each expiratory function training sample data in the expiratory function training sample data set, and to extract a data segment before and after a preset time window of the highest flow velocity acceleration point as a burst sample data segment; to use the burst sample data segment as the input of the LSTM sub-model to obtain expiratory flow velocity prediction data and expiratory function prediction parameters; to calculate the curve prediction loss between the expiratory flow velocity prediction data and the expiratory flow velocity sample data, and to calculate the parameter prediction loss between the expiratory function prediction parameters and the expiratory function sample parameters; to update the parameters of the LSTM sub-model based on the curve prediction loss and the parameter prediction loss, and to iteratively train until the curve prediction loss and the parameter prediction loss converge, thereby obtaining the expiratory function data prediction sub-model corresponding to the expiratory function training sample data set.

[0127] In one possible implementation, the formula for calculating the curve prediction loss is: ; in, For the expiratory flow rate prediction data, The expiratory flow rate sample data is N, where N is the total number of sampling points for the expiratory flow rate sample data. The formula for calculating the parameter prediction loss is as follows: ; in, The lung function prediction parameters, Let M be the number of lung function parameters in the lung function sample.

[0128] In one possible implementation, the body characteristic classification criteria include one or more of sex, age range, body mass index range, and maximum expiratory flow rate range.

[0129] In one possible implementation, the device further includes a correction module; The correction module is used to acquire the ambient temperature and atmospheric pressure parameters when the subject undergoes pulmonary function testing; to correct the predicted pulmonary function data using the BTPS correction formula; and to use the corrected expiratory flow rate data and pulmonary function parameters as clinically usable pulmonary function test results.

[0130] In one possible implementation, the interception module 502 is specifically used to calculate the acceleration of the i-th flow velocity sampling point in the expiratory flow velocity data; filter out the maximum value among all accelerations, and take the flow velocity sampling point corresponding to the maximum value as the highest flow velocity acceleration point; Based on the duration of the preset time window, with the highest point of flow acceleration as the center, the flow velocity data corresponding to half the duration of each preset time window before and after the highest point of flow acceleration is extracted to form the burst data segment; The formula for calculating the acceleration of the i-th velocity sampling point is: ; in, Let be the acceleration at the i-th flow velocity sampling point. Let i be the flow velocity at the (i+1)th flow velocity sampling point. Let i be the flow velocity at the i-th flow velocity sampling point. This represents the sampling time interval.

[0131] In one possible implementation, the interception module is further configured to fit and predict the flow rate change trend corresponding to the burst data segment using a Kalman filter algorithm to obtain the predicted flow rate value at the next moment; obtain the actual flow rate value at the next moment, and calculate the deviation value between the actual flow rate value and the predicted flow rate value; if the deviation value exceeds a preset threshold, it is determined that the subject has terminated effective exhalation, and the flow rate data before the moment when the deviation value exceeds the preset threshold in the burst data segment is intercepted as the final burst data segment; wherein, the preset threshold is obtained based on statistical analysis of multiple sets of clinical exhalation data.

[0132] This application also discloses a pulmonary function testing instrument, which performs the method for predicting pulmonary function data according to any one of the first aspects; or, the pulmonary function testing instrument includes a device for predicting pulmonary function data according to any one of the second aspects.

[0133] In one possible implementation, the pulmonary function testing device further includes a control unit, an input unit, a communication unit, a flow sensor, a diagnostic module, and / or a human-computer interaction module.

[0134] In one possible implementation, the flow sensor, the input module, the communication unit, the diagnostic module, and the human-machine interaction module are all electrically connected to the controller. The flow sensor is used to convert the collected expiratory airflow into a corresponding electrical signal, generate expiratory flow rate data, and transmit it to the controller; The input unit is used for users to input the physical characteristics of the person to be tested and to set the detection parameters; The diagnostic module is used to perform diagnostic processing on the predicted lung function data; The human-computer interaction module is used to show the test subject exhalation operation instructions and test progress prompts, and to display the data during the test and the final lung function test results; The communication unit is used to realize data interaction between the controller and external devices. It can transmit the detection results to the hospital information system or mobile terminal, and can also receive control commands and model update data issued by external devices.

[0135] The communication unit is used to realize data interaction between the controller and external devices. It can transmit the detection results to the hospital information system or mobile terminal, and can also receive control commands and model update data issued by external devices.

[0136] In one possible implementation, the diagnostic module is specifically used to call the built-in diagnostic model, combine it with a preset algorithm to analyze the predicted lung function data, and output a lung function waveform that conforms to clinical standards. or, The diagnostic module is specifically used to upload the predicted lung function data to the cloud diagnostic system through the communication unit, and to receive the diagnostic analysis results and corresponding waveform data returned from the cloud.

[0137] In one possible implementation, the flow sensor includes one or more of a differential pressure sensor, an ultrasonic sensor, and a turbine flow sensor.

[0138] This application also provides a control device. The control device may include a memory and a processor. The processor is used to execute the lung function data prediction method described in any of the above embodiments. The memory may be random access memory (RAM), flash memory, read-only memory (ROM), non-volatile read-only memory (EPROM), registers, hard disk, removable disk, etc.

[0139] Memory can store computer instructions, which, when executed by a processor, can be used to implement methods for predicting lung function data. Memory can also store data.

[0140] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, 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., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (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 integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape) or a semiconductor medium (e.g., solid-state disk (SSD)).

[0141] This application also provides a readable storage medium for storing the methods provided in the above embodiments. For example, RAM, flash memory, ROM, EPROM, registers, hard disk, removable disk, or any other form of storage medium in the art.

[0142] In the embodiments of this application, the terms "first" and "second" (if they exist) are used only as name identifiers and do not represent the order of first and second.

[0143] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. Regarding the methods disclosed in the embodiments, since they correspond to the product embodiments disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the description of the product embodiments.

[0144] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for predicting lung function data, characterized in that, The method includes: Collect expiratory flow rate data from the subject of the test; Determine the acceleration of each flow rate sampling point in the expiratory flow rate data, and extract burst data segments before and after the highest flow rate acceleration point within a preset time window; A lung function data prediction sub-model is matched to the subject of the test; the lung function data prediction sub-model is trained based on multiple expiratory flow rate sample data; the expiratory flow rate sample data includes burst sample data segments and complete expiratory flow rate sample data, and the burst sample data segments are extracted from the complete expiratory flow rate sample data; The burst data segment is input into the lung function data prediction sub-model, and the predicted lung function data is output; the lung function data includes expiratory flow rate data and lung function parameters that meet quality control standards.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the physical characteristics information of the person to be tested; The lung function data prediction sub-model matching the subject to be tested includes: The corresponding lung function data prediction sub-model is determined based on the physical feature information; the physical feature information corresponding to the multiple expiratory flow rate sample data used to train the lung function data prediction sub-model belongs to the same physical feature category as the physical feature information of the subject to be tested.

3. The method according to claim 1, characterized in that, The method further includes: Acquire multiple lung function sample data that meet quality control standards, as well as the corresponding physical characteristic information for each lung function sample data; the lung function sample data includes expiratory flow rate sample data and lung function sample parameters. By combining the body feature classification conditions and the body feature information corresponding to the multiple lung function sample data, the multiple lung function sample data are classified to obtain multiple lung function training sample data groups. The LSTM sub-model is trained using multiple sets of lung function training sample data to obtain lung function data prediction sub-models corresponding to each set of lung function training sample data.

4. The method according to claim 3, characterized in that, The step of training the LSTM sub-model using multiple sets of lung function training sample data to obtain lung function data prediction sub-models corresponding to each set of lung function training sample data includes: For each lung function training sample data in the lung function training sample data group, determine the acceleration of each flow velocity sampling point in the expiratory flow velocity sample data, and extract the data segment before and after the highest flow velocity acceleration point as the burst sample data segment; The burst sample data segment is used as the input of the LSTM sub-model to obtain expiratory flow rate prediction data and lung function prediction parameters; Calculate the curve prediction loss between the predicted expiratory flow rate data and the sample expiratory flow rate data, and calculate the parameter prediction loss between the predicted lung function parameters and the sample lung function parameters; Based on the curve prediction loss and the parameter prediction loss, the parameters of the LSTM sub-model are updated, and the training is iterated until the curve prediction loss and the parameter prediction loss converge, thereby obtaining the lung function data prediction sub-model corresponding to the lung function training sample data group.

5. The method according to claim 4, characterized in that, The formula for calculating the curve prediction loss is as follows: ; in, For the expiratory flow rate prediction data, The expiratory flow rate sample data is N, where N is the total number of sampling points for the expiratory flow rate sample data. The formula for calculating the parameter prediction loss is as follows: ; in, The lung function prediction parameters, The parameters of the lung function sample are M, where M is the number of lung function parameters.

6. The method according to any one of claims 2-5, characterized in that, The body characteristic classification criteria include one or more of the following: gender, age range, body mass index range, and maximum expiratory flow rate range.

7. The method according to claim 1, characterized in that, The method further includes: The ambient temperature and atmospheric pressure parameters of the subject during the lung function test were obtained. The predicted lung function data were corrected using the BTPS correction formula; The corrected expiratory flow rate data and pulmonary function parameters are used as available pulmonary function test data.

8. The method according to claim 1, characterized in that, The step of determining the acceleration of each flow velocity sampling point in the expiratory flow velocity data and extracting burst data segments within a preset time window before and after the point of highest flow velocity acceleration includes: Calculate the acceleration of the i-th flow rate sampling point in the expiratory flow rate data; The formula for calculating the acceleration of the i-th velocity sampling point is: ; in, Let be the acceleration at the i-th flow velocity sampling point. Let i be the flow velocity at the (i+1)th flow velocity sampling point. Let i be the flow velocity at the i-th flow velocity sampling point. The sampling time interval; The maximum value among all accelerations is selected, and the flow velocity sampling point corresponding to the maximum value is taken as the highest point of the flow velocity acceleration. Based on the duration of the preset time window, with the highest point of flow acceleration as the center, the flow velocity data corresponding to half the duration of each preset time window before and after the highest point of flow acceleration is extracted to form the burst data segment.

9. The method according to claim 1, characterized in that, After extracting the burst data segment within a preset time window before and after the peak of the flow velocity acceleration, the method further includes: The Kalman filter algorithm is used to fit and predict the velocity change trend corresponding to the burst data segment to obtain the predicted velocity value at the next moment. Obtain the actual flow velocity value at the next moment, and calculate the deviation between the actual flow velocity value and the predicted flow velocity value; If the deviation value exceeds a preset threshold, it is determined that the subject has terminated effective exhalation, and the flow rate data before the moment when the deviation value exceeds the preset threshold in the burst data segment is extracted as the final burst data segment; wherein, the preset threshold is obtained based on statistical analysis of multiple sets of exhalation data.

10. A device for predicting lung function data, characterized in that, The prediction device includes a breath sampling device and a computing device, wherein the signal output terminal of the breath sampling device is connected to the signal input terminal of the computing device; The computing device includes: The acquisition module is used to acquire the expiratory flow rate data of the subject through the expiratory acquisition device; The interception module is used to determine the acceleration of each flow rate sampling point in the expiratory flow rate data and intercept the burst data segment before and after the highest point of flow rate acceleration within a preset time window; A matching module is used to match the lung function data prediction sub-model corresponding to the subject to be tested; the lung function data prediction sub-model is trained based on multiple expiratory flow rate sample data; the expiratory flow rate sample data includes burst sample data segments and complete expiratory flow rate sample data, and the burst sample data segments are extracted from the complete expiratory flow rate sample data. The prediction module is used to input the burst data segment into the lung function data prediction sub-model and output the predicted lung function data; the lung function data includes expiratory flow rate data and lung function parameters that meet quality control standards.

11. The apparatus according to claim 10, characterized in that, The matching module is specifically used to acquire the physical characteristic information of the subject to be tested; determine the corresponding lung function data prediction sub-model based on the physical characteristic information; and ensure that the physical characteristic information corresponding to the multiple expiratory flow rate sample data used to train the lung function data prediction sub-model belongs to the same physical characteristic category as the physical characteristic information of the subject to be tested.

12. The apparatus according to claim 11, characterized in that, The device also includes a training module; The training module is used to acquire multiple lung function sample data that meet quality control standards and the corresponding body feature information of each lung function sample data; the lung function sample data includes expiratory flow rate sample data and lung function sample parameters; combining the body feature classification conditions and the body feature information corresponding to the multiple lung function sample data, the multiple lung function sample data are classified to obtain multiple lung function training sample data groups; the LSTM sub-model is trained using the multiple lung function training sample data groups respectively to obtain the lung function data prediction sub-model corresponding to each lung function training sample data group.

13. The apparatus according to claim 12, characterized in that, The training module is specifically used to determine the acceleration of each flow velocity sampling point in the expiratory flow velocity sample data for each pulmonary function training sample data in the pulmonary function training sample data group, and to extract the data segment before and after the highest flow velocity acceleration point as the burst sample data segment; to use the burst sample data segment as the input of the LSTM sub-model to obtain expiratory flow velocity prediction data and pulmonary function prediction parameters; to calculate the curve prediction loss between the expiratory flow velocity prediction data and the expiratory flow velocity sample data, and to calculate the parameter prediction loss between the pulmonary function prediction parameters and the pulmonary function sample parameters; to update the parameters of the LSTM sub-model based on the curve prediction loss and the parameter prediction loss, and to iteratively train until the curve prediction loss and the parameter prediction loss converge, thereby obtaining the pulmonary function data prediction sub-model corresponding to the pulmonary function training sample data group.

14. The apparatus according to claim 13, characterized in that, The formula for calculating the curve prediction loss is as follows: ; in, For the expiratory flow rate prediction data, The expiratory flow rate sample data is N, where N is the total number of sampling points for the expiratory flow rate sample data. The formula for calculating the parameter prediction loss is as follows: ; in, The lung function prediction parameters, The parameters of the lung function sample are M, where M is the number of lung function parameters.

15. The apparatus according to claim 10, characterized in that, The body characteristic classification criteria include one or more of the following: gender, age range, body mass index range, and maximum expiratory flow rate range.

16. The apparatus according to claim 10, characterized in that, The device also includes a correction module; The correction module is used to acquire the ambient temperature and atmospheric pressure parameters when the subject undergoes pulmonary function testing; to correct the predicted pulmonary function data using the BTPS correction formula; and to use the corrected expiratory flow rate data and pulmonary function parameters as clinically usable pulmonary function test results.

17. The apparatus according to claim 10, characterized in that, The interception module is specifically used to calculate the acceleration of the i-th flow velocity sampling point in the expiratory flow velocity data; filter out the maximum value among all accelerations, and take the flow velocity sampling point corresponding to the maximum value as the highest point of flow velocity acceleration; Based on the duration of the preset time window, with the highest point of flow acceleration as the center, the flow velocity data corresponding to half the duration of each preset time window before and after the highest point of flow acceleration is extracted to form the burst data segment; The formula for calculating the acceleration of the i-th velocity sampling point is: ; in, Let be the acceleration at the i-th flow velocity sampling point. Let i be the flow velocity at the (i+1)th flow velocity sampling point. Let i be the flow velocity at the i-th flow velocity sampling point. This represents the sampling time interval.

18. The apparatus according to claim 10, characterized in that, The interception module is further configured to fit and predict the flow rate change trend corresponding to the burst data segment using a Kalman filter algorithm to obtain the predicted flow rate value at the next moment; obtain the actual flow rate value at the next moment, and calculate the deviation between the actual flow rate value and the predicted flow rate value; if the deviation exceeds a preset threshold, it is determined that the subject has terminated effective exhalation, and the flow rate data before the moment when the deviation exceeds the preset threshold in the burst data segment is intercepted as the final burst data segment; wherein, the preset threshold is obtained based on statistical analysis of multiple sets of clinical exhalation data.

19. A pulmonary function testing device, wherein the pulmonary function testing device performs the method for predicting pulmonary function data according to any one of claims 1-9; or, the pulmonary function testing device includes the device for predicting pulmonary function data according to any one of claims 10-18.

20. The pulmonary function testing device according to claim 19, characterized in that, The lung function testing device also includes a control unit, an input unit, a communication unit, a flow sensor, a diagnostic module, and / or a human-computer interaction module.

21. The pulmonary function testing device according to claim 20, characterized in that, The flow sensor, the input module, the communication unit, the diagnostic module, and the human-machine interaction module are all electrically connected to the controller. The flow sensor is used to convert the collected expiratory airflow into a corresponding electrical signal, generate expiratory flow rate data, and transmit it to the controller; The input unit is used for users to input the physical characteristics of the person to be tested and to set the detection parameters; The diagnostic module is used to perform diagnostic processing on the predicted lung function data; The human-computer interaction module is used to show the test subject exhalation operation instructions and test progress prompts, and to display the data during the test and the final lung function test results; The communication unit is used to realize data interaction between the controller and external devices. It can transmit the detection results to the hospital information system or mobile terminal, and can also receive control commands and model update data issued by external devices. The communication unit is used to realize data interaction between the controller and external devices. It can transmit the detection results to the hospital information system or mobile terminal, and can also receive control commands and model update data issued by external devices.

22. The pulmonary function testing device according to claim 21, characterized in that, The diagnostic module is specifically used to call the built-in diagnostic model, combine it with the preset algorithm to analyze the predicted lung function data, and output a lung function waveform that conforms to clinical standards. or, The diagnostic module is specifically used to upload the predicted lung function data to the cloud diagnostic system through the communication unit, and to receive the diagnostic analysis results and corresponding waveform data returned from the cloud.

23. The pulmonary function testing device according to claim 20 or 21, characterized in that, The flow sensor includes one or more of the following: differential pressure sensor, ultrasonic sensor, and turbine flow sensor.

24. A control device, characterized in that, It includes a processor and a memory, the memory being used to store programs, instructions, or code, and the processor being used to execute the programs, instructions, or code in the memory to perform the method for predicting lung function data as described in any one of claims 1-9.

25. A computer-readable storage medium, characterized in that, The system contains a computer program that is loaded by a processor to execute the method for predicting lung function data as described in any one of claims 1-9.