Portable breath test device, method and electronic device
By integrating modular design and coordinating airflow control, the portability and detection stability issues of portable breath detection devices have been resolved, achieving efficient and accurate breath detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2026-03-31
AI Technical Summary
Portable breathalyzers suffer from insufficient integration, large size, and difficulty in achieving portable applications. Furthermore, they lack precise airflow control structures, resulting in unstable test results, especially with large fluctuations when testing low concentrations.
It adopts a highly integrated modular design, including flow guides, drive components, and detection components. The flow guides enable changes in the gas channel under different working modes. Combined with precise solenoid valves and dual-pump gas path coordinated control, it realizes automated gas flow and self-cleaning functions, ensuring the accuracy of detection results.
The device's portability has been improved, ensuring the accuracy and stability of test results, simplifying the operation process, and making it suitable for long-term monitoring and early screening of chronic diseases.
Smart Images

Figure CN121040890B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of gas analysis technology, and in particular to a portable breath detection device, method and electronic device. Background Technology
[0002] In related technologies, portable breath testing devices still have many technical shortcomings. First, the integration of the devices is insufficient. Most devices adopt separate structural designs for different working modes, resulting in a large size and making it difficult to achieve truly portable applications. Second, the detection stability is poor. Due to the lack of precise airflow control devices, turbulence and adsorption effects easily occur during gas transmission, leading to large fluctuations in detection results. This problem is particularly prominent when detecting low concentrations (<1ppm) and urgently needs improvement. Summary of the Invention
[0003] This application provides a portable breath testing device, method, and electronic device to solve the technical problems in related technologies where the structure of different working modes adopts a separate design, resulting in a large size that makes it difficult to achieve portable applications, and the lack of a precise airflow control structure that affects the test results.
[0004] A first aspect of this application provides a portable breathalyzer detection device, comprising: a collection element for collecting exhaled gas from a user; a flow guide element connected to the collection element for switching a corresponding gas channel based on the operating mode of the portable breathalyzer detection device, thereby controlling the flow pattern of the gas or air introduced from the external environment based on the gas channel; a drive element for driving the gas or air based on the operating mode, causing the gas or air to flow along the gas channel according to the flow pattern until the gas or air is discharged into the external environment; and a detection element for detecting the gas flowing in through the gas channel, obtaining a corresponding raw sensor signal, and analyzing the raw sensor signal to obtain an analytical value between the gas and a preset sample gas.
[0005] Optionally, in one embodiment of this application, the flow guide includes: a one-way valve for switching a switch state based on the operating mode; an air bag for storing the gas or the air based on the operating mode; a switching valve for connecting the collecting device and the air bag, so that when the switching valve is open, the gas collected by the collecting device flows to the air bag, and closes after the gas flows to the air bag; and a three-way solenoid valve for connecting the air bag, the detection device, and the one-way valve, and determining the flow channel between the air bag, the detection device, and the one-way valve based on the operating mode.
[0006] Optionally, in one embodiment of this application, the flow guide is further configured to, in the preset cleaning mode, close the switch valve, open the one-way valve, control the three-way solenoid valve to connect the flow channel between the air bag and the detection element, and after air from the external environment flows into the air bag sequentially through the detection element and the three-way solenoid valve, control the three-way solenoid valve to close the flow channel between the air bag and the detection element, and connect the flow channel between the air bag and the one-way valve; in the preset analysis mode, open the switch valve, close the one-way valve, control the three-way solenoid valve to connect the flow channel between the air bag and the detection element, and close the switch valve after the gas flows into the air bag.
[0007] Optionally, in one embodiment of this application, the driving component includes: a first air pump connected to the one-way valve, used to drive the air in the air bag to pass sequentially through the three-way solenoid valve and the one-way valve in the preset cleaning mode, and then discharge it to the external environment; and a second air pump connected to the detection component, used to drive the air in the external environment to pass sequentially through the detection component and the three-way solenoid valve in the preset cleaning mode, and then flow into the air bag.
[0008] Optionally, in one embodiment of this application, the second air pump is further configured to, in the preset analysis mode, drive the gas in the air bag to pass sequentially through the three-way solenoid valve and the detection element, and then discharge it into the external environment.
[0009] Optionally, in one embodiment of this application, the detection element includes: a gas chamber for storing the gas exhaled by the user to be analyzed; a sensor array module for detecting the gas in the gas chamber, obtaining at least one target component in the gas, and generating a corresponding raw sensor signal based on the at least one target component; and a data processing module for analyzing the raw sensor signal to obtain an analytical value between the gas and the preset sample gas.
[0010] Optionally, in one embodiment of this application, the data processing module includes: a first acquisition unit, configured to acquire sample data containing the preset sample gas; a construction unit, configured to extract voltage features from the sample data, and construct a sample training dataset and a sample test dataset based on the voltage features and a preset positive and negative sample ratio; and a training unit, configured to train an initial prediction model using the sample dataset to obtain the prediction model, and input the original sensor signal into the prediction model to obtain the analysis value.
[0011] Optionally, in one embodiment of this application, the data processing module further includes: a second acquisition unit, configured to acquire multiple candidate models; a testing unit, configured to train each candidate model with the sample dataset and test each trained candidate model with the sample test dataset to obtain the classification accuracy of each trained candidate model; and a filtering unit, configured to obtain the prediction model that meets the preset accuracy condition from each trained candidate model based on the classification accuracy.
[0012] A second aspect of this application provides a breath detection method, comprising the following steps: acquiring the operating mode of the portable breath detection device; collecting the user's exhaled gas or air from the external environment based on the operating mode; analyzing the gas to obtain an analytical value between the gas and a preset sample gas, or expelling the air into the external environment.
[0013] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the breath detection method as described in the above embodiments.
[0014] A fourth aspect of this application provides a computer-readable storage medium storing computer instructions for causing the computer to perform the breath detection method as described in the above embodiments.
[0015] A fifth aspect of this application provides a computer program product, including a computer program, which, when executed, is used to implement the above-described breath detection method.
[0016] This application utilizes a flow guide to change the gas channel in different operating modes. Through a highly integrated structural design, it improves the portability of the device while accurately guiding the gas flow direction, ensuring the accuracy of the detection results. By combining the acquisition unit, flow guide, drive unit, and detection unit, it achieves an automated detection process, thereby improving detection efficiency. This solves the technical problems in related technologies where the structure for different operating modes is separately designed, resulting in a large size that hinders portable applications, and the lack of a precise airflow control structure, which affects the detection results.
[0017] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0018] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0019] Figure 1 This is a schematic diagram of a portable breath detection device provided according to an embodiment of this application;
[0020] Figure 2 This is a schematic diagram of the response recovery curve of a gas sensor provided according to an embodiment of this application;
[0021] Figure 3 This is a schematic diagram of the sample distribution before and after SMOTETomek balancing according to an embodiment of this application;
[0022] Figure 4 This is a schematic diagram of the structure of a portable breath detection device according to an embodiment of this application;
[0023] Figure 5 This is a flowchart illustrating the detection process of a portable breathalyzer according to an embodiment of this application.
[0024] Figure 6 This is a flowchart illustrating the algorithm model of a portable breath detection device according to an embodiment of this application.
[0025] Figure 7 For comparison of ROC curves of various models provided according to one embodiment of this application;
[0026] Figure 8 The classification result of the XGBoost model provided according to one embodiment of this application;
[0027] Figure 9 This is a flowchart of a breath detection method provided according to an embodiment of this application;
[0028] Figure 10 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application. Detailed Implementation
[0029] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0030] The portable breath detection device, method, and electronic device of this application are described below with reference to the accompanying drawings. Addressing the technical problems mentioned in the background art, where the structure for different operating modes is separately designed, resulting in large size, difficulty in achieving portable applications, and a lack of precise airflow control structure affecting the detection results, this application provides a breath detection method. In this device, the gas channel can be changed in different operating modes through a flow guide component. Through a highly integrated structural design, the portability of the device is improved while accurately guiding the gas flow direction, ensuring the accuracy of the detection results. Combining the collection component, flow guide component, driving component, and detection component, an automated detection process is achieved to improve detection efficiency. Thus, the technical problems of the related art, where the structure for different operating modes is separately designed, resulting in large size, difficulty in achieving portable applications, and a lack of precise airflow control structure affecting the detection results, are solved.
[0031] It is understandable that human exhaled air contains more than 1,000 volatile organic compounds (VOCs), and the concentration changes of these substances are closely related to specific physical conditions. For example, the concentration of acetone in the exhaled breath of diabetic patients can be 3-5 times higher than that of healthy individuals, and the concentration of ammonia in the exhaled breath of patients with chronic kidney disease can be 2-3 times higher. Furthermore, certain cancer patients exhibit characteristic changes in the combination patterns of specific VOCs in their exhaled breath. Breath testing can detect the concentration of specific components exhaled by the human body. Compared with traditional blood tests, this breath-based testing method has significant advantages: it is non-invasive, repeatable, and easy to operate, making it particularly suitable for long-term monitoring and early screening of chronic diseases.
[0032] However, breath testing devices in related technologies still have many technical shortcomings. First, the integration of the devices is insufficient. Most devices adopt a separate design for the gas path control module and the cleaning module, resulting in a large size and making it difficult to achieve truly portable applications. Second, the detection stability is poor. Due to the lack of a precise airflow control device, turbulence and adsorption effects easily occur during gas transmission, leading to large fluctuations in the detection results. This problem is particularly prominent when detecting low concentrations (<1ppm). Third, the self-cleaning function is lacking. Most devices use disposable consumables or simple rinsing designs, which cannot avoid cross-contamination (the residual gas concentration reaches 10-20% of the initial value).
[0033] The embodiments of this application overcome the shortcomings of related technologies, such as bulky equipment, rough air path control, poor cleaning effect, insufficient sensitivity, and complex operation, through highly integrated modular design, precise solenoid valve + dual air pump air path coordinated control, self-cleaning function, high-sensitivity detection module, and automated operation process.
[0034] Specifically, Figure 1 This is a schematic diagram of the structure of a portable breath detection device provided in an embodiment of this application.
[0035] like Figure 1 As shown, the portable breath detection device 10 includes: a collection element 100, a flow guide 200, a drive element 300, and a detection element 400.
[0036] Specifically, the collection device 100 is used to collect the gas exhaled by the user.
[0037] In actual implementation, the collection device 100 in this application embodiment can be a mouthpiece. The user can blow air into the portable exhalation detection device 10 through the mouthpiece, and the gas can enter the air bag through the mouthpiece to complete the gas collection.
[0038] The flow guide 200 is used to connect to the collection device and switch the corresponding gas channel based on the working mode of the portable exhalation detection device 10, so as to control the flow mode of gas or air introduced from the external environment based on the gas channel.
[0039] The flow guide 200 can switch the gas flow channel inside the portable breath detection device 10 according to different working modes of the portable breath detection device 10, so as to form a gas channel in different working modes.
[0040] For example, when the working mode is analysis mode, the collected exhaled gas needs to be guided into the detection element 400 for gas analysis and detection. When the working mode is cleaning mode, the air in the external environment needs to be guided into the portable exhalation detection device 10 to complete air circulation in order to clean the device.
[0041] Optionally, in one embodiment of this application, the flow guide 200 includes: a one-way valve, an air bag, a switching valve, and a three-way solenoid valve.
[0042] Among them, the one-way valve is used to switch the switch state based on the working mode.
[0043] Gas bags are used to store gases or air based on operating modes.
[0044] A switching valve is used to connect the sampling device and the gas bag, so that when the switching valve is opened, the gas collected by the sampling device flows to the gas bag, and the valve is closed after the gas flows to the gas bag.
[0045] A three-way solenoid valve is used to connect an air bag, a detection element, and a check valve, and determines the flow path between the air bag, the detection element, and the check valve based on the operating mode.
[0046] Among them, the one-way valve can ensure that air can only flow in one direction, prevent gas backflow, and ensure the one-wayness of the air flow process. The one-way valve can switch between open and closed states according to the working mode, so as to prohibit or allow air to pass through depending on the working mode.
[0047] The gas bag can be used to store collected gas or air. The gas bag has a dual-channel function that allows for bidirectional gas / air filling or venting. For example, it can fill or vent air in cleaning mode and store gas blown in or vented by the user in analysis mode.
[0048] The switch valve is closed by default to prevent gas leakage; it opens when collecting the user's exhaled gas to allow gas to enter the gas bag from the mouthpiece, and closes after collection is complete.
[0049] The three-way solenoid valve can control the direction of the gas passage within the device 10 to determine the flow direction of gas or air according to different operating modes. Regarding the self-cleaning function, embodiments of this application can also use a rotary four-way valve or a combination of dual solenoid valves instead of the three-way solenoid valve to achieve multi-path switching; for cleaning methods, inert gas flushing can replace air cleaning. The rotary valve improves electromagnetic interference resistance; inert gas flushing avoids cross-contamination of the detected gas.
[0050] Optionally, in one embodiment of this application, the flow guide 200 is further configured to, in the preset cleaning mode, close the switch valve, open the check valve, control the three-way solenoid valve to connect the flow channel between the air bag and the detection element 400, and after air from the external environment flows into the air bag through the detection element 400 and the three-way solenoid valve in sequence, control the three-way solenoid valve to close the flow channel between the air bag and the detection element, and connect the flow channel between the air bag and the check valve. In the preset analysis mode, open the switch valve, close the check valve, control the three-way solenoid valve to connect the flow channel between the air bag and the detection element 400, and close the switch valve after the gas flows into the air bag.
[0051] Specifically, in the cleaning mode, the embodiments of this application can close the switching valve to prevent the acquisition of gas or air through the collection device 100, open the one-way valve, and then include two stages: an air introduction stage and an air exhaust stage.
[0052] During the air introduction stage, the embodiments of this application can adjust the opening and closing channels of the three-way solenoid valve to open the flow channel between the air bag and the detection element 400 and close the flow channel between the air bag and the one-way valve, so that air from the external environment can flow into the air bag through the detection element and the three-way solenoid valve.
[0053] During the air discharge stage, the embodiments of this application can adjust the opening and closing channels of the three-way solenoid valve, opening the channel between the three-way solenoid valve and the air bag and the one-way valve, and closing the channel between the three-way solenoid valve and the detection element 400, so that the air bag, the three-way solenoid valve and the one-way valve are in a state where air can flow, so that the air in the air bag can flow to the external environment in sequence through the three-way solenoid valve and the one-way valve.
[0054] In the working mode, this embodiment of the application can open the switching valve, allowing the user's exhaled gas collected by the collection device 100 to enter the air bag. After the gas enters the air bag, the switching valve is closed, and the opening and closing channels of the three-way solenoid valve are adjusted. This opens the channel between the three-way solenoid valve and the air bag and the detection device 400, and closes the channel between the three-way solenoid valve and the one-way valve, so that gas can flow between the air bag, the three-way solenoid valve, and the detection device 400, allowing the gas in the air bag to flow to the external environment sequentially through the three-way solenoid valve and the detection device 400.
[0055] The drive unit 300 is used to drive gas or air based on the working mode, so that the gas or air flows along the gas channel according to the flow pattern until the gas or air is discharged into the external environment.
[0056] The drive unit 300 can provide the power for the flow of gas or air inside the device 10 to drive the gas or air to flow in the gas channel in different working modes until the gas or air is discharged to the external environment.
[0057] Optionally, in one embodiment of this application, the drive unit 300 includes: a first air pump and a second air pump.
[0058] The first air pump, connected to the one-way valve, is used to drive the air in the air bag through the three-way solenoid valve and the one-way valve in a preset cleaning mode and then discharge it into the external environment.
[0059] A second air pump connected to the detection element 400 is used to drive air from the external environment into the air bag in a preset cleaning mode, passing sequentially through the detection element 400 and the three-way solenoid valve. The second air pump is further used to drive gas in the air bag into the external environment in a preset analysis mode, passing sequentially through the three-way solenoid valve and the detection element.
[0060] As one possible implementation method, embodiments of this application can achieve both cleaning and analysis processes using two air pumps.
[0061] In cleaning mode, the channel of the three-way solenoid valve can be adjusted first to connect the gas channel between the detection element 400 and the air bag, and the second air pump can be driven to introduce air from the external environment. The air can then pass through the detection element 400 and the three-way solenoid valve in sequence and flow into the air bag. After that, the second air pump can be stopped, the channel of the three-way solenoid valve can be adjusted to connect the gas channel between the air bag and the one-way valve, and the first air pump can be activated to extract air from the air bag and discharge the air to the external environment.
[0062] In analysis mode, the three-way solenoid valve channel can be adjusted to connect the gas channel between the detection element 400 and the gas bag, driving the second air pump to draw gas from the gas bag and allow the gas to flow into the detection element 400 for analysis. After analysis, the gas is discharged to the external environment through the second air pump.
[0063] In addition, the embodiments of this application can also use a PID closed-loop algorithm to replace PWM open-loop control, or directly use a mass flow controller to replace the air pump + valve combination to achieve more stable flow regulation. The accuracy of the mass flow controller can reach ±1%.
[0064] The detection element 400 is used to detect the gas flowing in through the gas channel, obtain the corresponding raw sensor signal, and analyze the raw sensor signal to obtain the analytical value between the gas and the preset sample gas.
[0065] The detector 400 can analyze the gas to obtain the concentration of the target component, that is, the analytical value between the gas and the preset sample gas, so as to monitor the user's physical condition.
[0066] Optionally, in one embodiment of this application, the detection element 400 includes: an air chamber, a sensor array module, and a data processing module.
[0067] The air chamber is used to store the gas exhaled by the user to be analyzed.
[0068] The sensor array module is used to detect the gas in the gas chamber, obtain at least one target component in the gas, and generate the corresponding raw sensor signal based on the at least one target component.
[0069] The data processing module is used to analyze the raw sensor signals and obtain the analytical values between the gas and the preset sample gas.
[0070] The detection unit 400 may include a sensor array module, a data processing module, and a gas chamber. The sensor array module incorporates multiple commercial gas sensors to detect the gas in the gas chamber, obtaining the target gas composition and generating corresponding raw sensor signals for analysis by the data processing module. The data processing module receives the raw sensor signals from the sensor array module, performs analog-to-digital conversion and signal conditioning to convert the physical quantity into a digital signal, calculates the concentration of the target component based on a preset algorithm (such as a calibration curve), and finally outputs the processed data to devices for display, storage, or control, providing accurate data for subsequent analysis and decision-making. The gas chamber stores the gas to be analyzed, providing a stable gas environment for the detection unit 400 and ensuring analytical accuracy.
[0071] The gas chamber can be placed over the sensor array module. The sensor array module and the data processing module can be connected via a board-to-board connector, allowing the gas in the gas chamber to be detected by the sensor array module, analyzed by the data processing module, and finally discharged to the external environment by a second air pump.
[0072] Optionally, in one embodiment of this application, the data processing module includes: a first acquisition unit, a construction unit, and a training unit.
[0073] The first acquisition unit is used to acquire sample data containing a preset sample gas.
[0074] The building unit is used to extract voltage features from the sample data and build sample training datasets and sample test datasets based on the voltage features and a preset positive and negative sample ratio.
[0075] The training unit is used to train an initial prediction model using a sample dataset to obtain a prediction model. The original sensor signals are then input into the prediction model to obtain analysis values.
[0076] Understandably, because sensors are susceptible to environmental temperature and humidity, electromagnetic interference, or baseline drift, the raw acquired signals contain high-frequency noise or low-frequency drift, which would degrade model performance if used directly for modeling. Data preprocessing removes high-frequency noise and baseline drift through filtering (moving average). StandardScaler is used to standardize the sensor data to eliminate the influence of dimensions.
[0077] In actual implementation, based on different target components, embodiments of this application can select sample gas data containing different components for model training, so that the trained model can be used to detect the concentration of the target component in the user's exhaled gas. For example, embodiments of this application can obtain the exhaled gas of lung cancer patients as sample data, and the sample gas in the exhaled gas of lung cancer patients that is different from that in the exhaled gas of healthy people is used as the preset sample gas, i.e. the target component, to train the model, so that the trained prediction model can analyze the user's exhaled gas to determine the concentration of the target component in the user's exhaled gas in order to monitor the user's status.
[0078] In the experiment, the Savitzky-Golay technique used in this application embodiment can be employed to filter sample data containing a preset sample gas. Based on the principle of least squares polynomial fitting, it performs polynomial regression on data points within a local window, effectively smoothing noise while preserving signal trends. Its core idea is to locally approximate the data using low-order polynomial fitting within a sliding window, optimize the fitting curve using weighted least squares to minimize error, effectively suppressing noise interference while preserving the true characteristics of the signal to the greatest extent. Finally, efficient sliding weighted averaging is achieved through pre-calculated convolution coefficients, thus balancing computational efficiency and feature fidelity during signal smoothing. Given a window width (2m+1) and a polynomial order (k), SG filtering can be expressed as:
[0079]
[0080] in, These are the SG coefficients, determined by polynomial least squares fitting.
[0081] The standardization method used is Z-score standardization, a data standardization method based on the statistical principle of normal distribution. Its core idea is to transform the original data linearly so that the mean is 0 and the standard deviation is 1, thus converting the data into a standard normal distribution (or close to a standard normal distribution). This method improves the convergence speed and model performance of machine learning algorithms by eliminating the influence of dimensions between features, ensuring that different features have the same numerical scale.
[0082] Given feature vectors Standardization is achieved through the following formula:
[0083]
[0084] in, The mean (mathematical expectation) of the feature data:
[0085]
[0086] The standard deviation of the feature data:
[0087]
[0088] Furthermore, embodiments of this application can perform voltage feature extraction. Feature extraction is a process of identifying and extracting key information from raw data. Its function is to reduce data dimensionality, remove redundant information, and highlight effective features, thereby improving the efficiency and performance of subsequent data processing or model training. Figure 2As shown, in the experiment, the ratio of the sensor response stationary value to the baseline stationary value was selected as the feature value for feature extraction of the sensor data, where the baseline reference gas was ambient air.
[0089] Furthermore, the embodiments of this application can perform data augmentation on the sample data to solve the class imbalance problem. The class imbalance data processing method based on SMOTE-Tomek mixed sampling can perform mixed sampling to address the severe imbalance problem in the original dataset where the ratio of cancer patients to healthy people is 27:292.
[0090] SMOTE-Tomek is a hybrid sampling method that combines the Synthetic Minority Over-sampling Technique (SMOTE) and Tomek Links to address class imbalance. Its core idea is to generate minority class samples using SMOTE to balance the data distribution, and then use Tomek Links to remove noise or overlapping samples near the boundaries, thereby improving the classifier's performance.
[0091] SMOTE generates new samples by linear interpolation within the neighborhood of minority class samples. The specific steps are as follows:
[0092] Step 1: Select minority class samples.
[0093] Let the minority class sample set be ,in It is an eigenvector.
[0094] Step 2: Determine the nearest neighbor.
[0095] For each sample Calculate its in The k nearest neighbors (usually Euclidean distance) are calculated using the following formula:
[0096] ,
[0097] Where M is the feature dimension.
[0098] Step 3: Generate synthetic samples.
[0099] Randomly select the nearest neighbor and in and Interpolation on the connection line generates new samples :
[0100] ,
[0101] Where λ∈[0,1] is a random number that controls the interpolation ratio.
[0102] Subsequently, a Tomek Links boundary cleaning mechanism was introduced. Its core principle is to eliminate noise and blurred boundary points by identifying and removing nearest-neighbor pairs of samples from different classes (i.e., Tomek Links) on the classification boundary. Specifically, for minority class samples... and majority class samples If the samples are nearest neighbors, they form a Tomek Link, and the majority class sample is usually removed. This method effectively reduces class overlap and makes the decision boundary clearer. Its definition is as follows:
[0103] Two samples ( , The samples belong to different categories and are each other's nearest neighbors (i.e., there are no other samples in each other's categories). (closer than them), where D is the entire dataset, then we have:
[0104]
[0105] like Figure 3 As shown, in the experiment, the sampling strategy was set to sampling_strategy=0.8 (positive and negative sample ratio), which effectively solved the imbalance problem between healthy samples (0) and lung cancer samples (1) in the original data.
[0106] Optionally, in one embodiment of this application, the data processing module further includes: a second acquisition unit, a testing unit, and a filtering unit.
[0107] The second acquisition unit is used to acquire multiple candidate models.
[0108] The test unit is used to train each candidate model with the sample dataset and test each trained candidate model with the sample test dataset to obtain the classification accuracy of each trained candidate model.
[0109] The filtering unit is used to select a prediction model that meets the preset accuracy conditions from each trained candidate model based on the classification accuracy.
[0110] As one possible approach, embodiments of this application can construct a comparative research framework for various machine learning models, optimize hyperparameters through grid search, and employ five-fold hierarchical cross-validation to ensure evaluation reliability. All models are implemented using Python 3.9 and Scikit-learn 1.0.2.
[0111] Logistic Regression uses the sigmoid function to map linear combinations of n-dimensional sensor data to probability values in the (0,1) interval. A dual-optimizer strategy is employed: the liblinear solver (supporting sparse solutions) is used for L1 regularization, while the lbfgs optimizer (suitable for convergence on small datasets) is used for L2 regularization. The regularization strength coefficient C is used for grid search within the range [0.01, 10], with a fixed maximum of 100 iterations to prevent overfitting. Specifically, the class weights are automatically adjusted using the class_weight='balanced' parameter, effectively mitigating the data imbalance problem.
[0112] Decision trees can employ the CART algorithm, utilizing a dynamic feature selection mechanism: at each split, from... Candidate features are randomly selected from the dataset. Key parameter grids include: maximum depth [3,5,7,10,None], minimum number of split samples [2,5,10,15], and minimum number of leaf nodes [1,2,4,8]. Splitting quality is evaluated using a dual criterion of Gini coefficient and information gain ratio, and cost complexity pruning (ccp_alpha=0.01) is introduced to prevent overfitting. Experiments show that the model achieves optimal bias-variance balance when max_depth=7 and min_samples_leaf=1.
[0113] Random forests can include: (1) double randomness: the bootstrap sampled training set (n_samples=500) and each node randomly selected √n features; (2) dynamic tree depth control: max_depth∈[5,10,None] adaptively adjusted; (3) class balancing voting mechanism. The optimal forest size is determined by setting n_estimators∈[50,100,200] and using early stopping. Experiments show that the model achieves the highest accuracy on the test set when n_estimators=50.
[0114] Support Vector Machine (SVM) based on an improved SVM scheme using the RBF kernel can construct a multi-dimensional parameter space: regularization coefficient C∈[0.1,100], kernel coefficient γ∈['scale','auto',0.1,1,10], and polynomial kernel degree∈[2,3,4]. Data is preprocessed using standard scaling (μ=0,σ=1), and a class weight balancing strategy is introduced. The kernel function calculation process is specifically optimized, and a caching mechanism (cache_size=500MB) is used to accelerate large-scale matrix operations. Cross-validation shows that the model achieves optimal generalization performance when C=10 and γ=0.1.
[0115] The K-Nearest Neighbors algorithm, also known as the adaptive KNN algorithm, has the following characteristics: (1) Dynamic K value selection: k∈[3,5,7,9,11] is determined by leave-one-out cross-validation; (2) Hybrid distance metrics: Euclidean distance (p=2), Manhattan distance (p=1), and Minkowski distance are supported; (3) Weight optimization: Inverse distance weighting (weights='distance') is used to improve the classification accuracy of boundary samples. After Z-score standardization, the model performs best when k=3 and metric='manhattan'.
[0116] A multilayer perceptron, wherein the constructed neural network adopts a dual hidden layer structure (30-20 neurons): (1) a hybrid activation function: a combination of ReLU (hidden layer) and Sigmoid (output layer); (2) an adaptive learning rate: the initial value ∈ [0.001, 0.0005] is dynamically adjusted with epoch; (3) an early stopping mechanism (patience=10). The Adam optimizer ( =0.9, The model was trained for 2000 epochs with a batch size of 32 (=0.999). Experiments showed that the model converged fastest when using the L-BFGS optimizer and hidden_layer_sizes=(30,20).
[0117] Extreme Gradient Boosting (XGBoost) improves the XGBoost model by: (1) second-order Taylor expansion: accurately approximating the loss function; (2) regularization term: γ∈[0,0.2] controls tree complexity; (3) row and column sampling: subsample=0.8, colsample_bytree=0.8 prevents overfitting; (4) custom evaluation metric (logloss). Key parameters: learning_rate∈[0.01,0.2], max_depth∈[3,7], n_estimators=200. Experiments show that when learning_rate=0.1 and gamma=0.2, the model AUC reaches 0.94.
[0118] The embodiments of this application can use a test set to test the above model in order to select the optimal model as the prediction model and obtain more accurate analysis results.
[0119] Furthermore, the data processing in this embodiment can employ neural network algorithms to dynamically compensate for sensor characteristics, replacing traditional calibration curves; in terms of hardware, FPGA can be used for high-speed signal processing, or cloud computing can be achieved through an IoT module. Neural network algorithms can adapt to sensor aging; FPGA processing speed is more than 10 times faster than MCU, while cloud computing significantly reduces local hardware requirements and facilitates remote monitoring and maintenance.
[0120] Combination Figures 4-8 As shown, the working principle of the portable breath detection device 10 of this application is explained in detail with reference to one embodiment.
[0121] like Figure 4 As shown, the portable exhalation detection device 10 of this application embodiment may include: a collection element 100, a switching valve 201, an air bag 202, a three-way solenoid valve 203, a one-way valve 204, a first air pump 301, a second air pump 302, a detection element 400, and a housing 500.
[0122] Among them, the user blows air into the device through the nozzle of the collection device 100, and the gas enters the air bag 202 through the nozzle to complete the gas collection.
[0123] The switch valve 201 is closed by default to prevent gas leakage; it is opened during the gas collection phase in analysis mode to allow gas to enter the gas bag from the nozzle of the collection element 100, and is closed after collection is completed.
[0124] The gas bag 202 is used to store the collected gas or air. It is filled or emptied of air in cleaning mode, stores the gas blown in by the user in analysis mode, and delivers the gas into the gas chamber during the analysis phase.
[0125] The three-way solenoid valve 203 controls the direction of the gas passage. When power is off, valves 1 and 3 are open, and valve 2 is closed; when power is on, valves 1 and 2 are open, and valve 3 is closed.
[0126] The one-way valve 204 ensures that gas can only flow in one direction, prevents gas backflow, and guarantees the unidirectionality of the gas collection and analysis process.
[0127] The drive unit 300 includes a first air pump 301 and a second air pump 302, which actively draws in the gas sample or air to be tested and delivers the gas to the sensor array through the air extraction mechanism to ensure that the gas is efficiently collected and processed or used for device cleaning.
[0128] The detection unit 400 includes a sensor array module, a data processing module, and a gas chamber. The sensor array module incorporates multiple commercial gas sensors to analyze the gas in the gas chamber, detecting the composition or concentration of the target gas. The data processing module receives the raw sensor signals from the sensor array module, performs analog-to-digital conversion and signal conditioning to convert the physical quantity into a digital signal, then calculates the concentration of the target gas based on a preset algorithm (such as a calibration curve), and finally outputs the processed data to a display, storage, or control device, providing accurate data for subsequent analysis and decision-making. The gas chamber stores the gas to be analyzed, providing a stable gas environment for the detection unit 400 and ensuring analytical accuracy.
[0129] The outer casing 500 protects the internal components, provides structural support, and ensures the safety and stability of the device 10.
[0130] Furthermore, such as Figure 5 As shown, embodiments of this application may include the following steps:
[0131] Step S501: Run the cleaning mode. The cleaning mode may include two stages: an inflation stage and a deflation stage.
[0132] Inflation stage: Drive the second air pump 302, turn on the power of the three-way solenoid valve 203, valves 1 and 2 are open, valve 3 is blocked, and air enters the air bag 202 from the external environment through the second air pump 302, then through the detection element 400 and the three-way solenoid valve 203.
[0133] Exhaust phase: The second air pump 302 is turned off, and the first air pump 301 is started. Air is discharged from the air bag 202 through the three-way solenoid valve 203 and the first air pump 301 to the external environment. The inflation and exhaust phases together achieve the process of cleaning the air bag and the air chamber of the detection component 400.
[0134] Step S502: Run the analysis mode. Open the switch valve 201, and the user blows air through the nozzle of the collection device 100. The gas enters the gas bag 202. Close the switch valve 201 to complete the gas collection process.
[0135] Step S503, gas analysis. Turn off the power to the three-way solenoid valve 203, so that valves 1 and 2 are open and valve 3 is closed. Driven by the second air pump 302, the gas exhaled by the user is sequentially guided into the detection element 400, and after analysis, it is discharged to the external environment through the second air pump 302.
[0136] Step S504, Data Processing and Output. First, the analog signal output from the gas sensor is converted into a digital signal by the ADC. After filtering and amplification conditioning, the raw data is compensated and transformed using baseline correction and a preset calibration curve (such as linear fitting) to calculate the actual gas concentration value. Then, real-time analysis is performed to determine whether the concentration exceeds the standard, and the results are output through the display screen or communication interface. At the same time, the detection data is stored for subsequent query. The entire process is controlled by the MCU to ensure the accuracy and reliability of the measurement results.
[0137] In summary, the portable breath detection device 10 of this application embodiment can achieve an automated gas detection process through the coordinated operation of the flow guide 200 and the drive unit 300: after power-on, it enters a standby state (valve 1 and 3 of the three-way solenoid valve 203 are closed, and the drive unit 300 is closed); in the cleaning mode, air is first pumped into the air bag 202 by the second air pump 302, and then discharged by the first air pump 301, thus circulating and cleaning the air path; in the analysis mode, the switch valve 201 is opened, the user blows air into the air bag 202, the three-way solenoid valve 203 switches to 1 and 2, and the first air pump 301 introduces the gas into the air chamber of the detection unit 400, where the sensor detects and calculates the concentration; finally, it is cleaned again in preparation for the next use. The entire process is controlled by the MCU to control the solenoid valve status, the start and stop of the air pump, and the PWM speed adjustment, in conjunction with sensor data acquisition and processing, to achieve a fully automatic cycle of cleaning-acquisition-analysis.
[0138] like Figure 6 As shown, gas analysis may include the following steps:
[0139] Step S601, run cleaning mode. Input: Start signal. Execution: Perform the "inflate-de-explode" cycle according to the preset or intelligently adjusted number of cycles to remove residue from the previous sample. Output: Clean and ready portable exhalation detection device 10.
[0140] Step S602, run analysis mode. Input: Clean and ready portable breath detection device 10 ready signal. Execution: Open switch valve 201, prompt the user to blow air, and close switch valve 201 after the gas is stored in the air bag 202. Output: The collected breath sample is stored in the air bag 202.
[0141] Step S603, Gas Analysis. Input: Stored exhaled breath sample. Execution: Switch the three-way solenoid valve 203, start the second air pump 302, and smoothly deliver the gas from the air bag 202 to the air chamber. The gas sensor array begins acquiring voltage signals (Vs), and the environmental sensors simultaneously acquire temperature and humidity data. Output: Raw, time-series sensor voltage signals Vs and real-time environmental data (Temperature, Humidity).
[0142] Step S604, Intelligent Algorithm Analysis. Input: Raw sensor signal Vs, environmental data Temperature, Humidity. Execution: Data preprocessing: Filter Vs (e.g., Savitzky-Golay) to remove noise, and use environmental data for compensation calibration to obtain the clean signal Vs_cleaned. Feature extraction: Calculate the ratio feature R = Vs (Vs is the stable value) / V0 (V0 is the baseline value) of the stable response of each sensor, forming a feature vector.
[0143] Step S605, Model Prediction. Input the feature vector into the machine learning model pre-integrated in the MCU for real-time inference.
[0144] Step S606: Output the result.
[0145] In this embodiment of the application, the test set is used to perform cross-validation and grid search on multiple models, and the following performance comparison can be obtained.
[0146] The model performance comparison is shown in Table 1, which displays the classification accuracy of each model. The ROC curves of each model can be compared as follows: Figure 7 As shown.
[0147] Table 1
[0148]
[0149] In terms of classification accuracy, XGBoost still performs best (90.72%), further validating its reliability as a strong classifier. Multilayer Perceptron (MLP) ranks second with an accuracy of 90.27%, very close to XGBoost, but with higher computational cost. Random Forest (89.70%) and Decision Tree (88.66%) outperform traditional linear models (logistic regression and SVM both 82.47%), indicating that tree models are better at capturing non-linear patterns in the data. The K-Nearest Neighbors algorithm has the lowest accuracy (80.41%), possibly due to greater influence from imbalanced samples or noisy data. Overall, XGBoost significantly outperforms other models in both accuracy and generalization ability, making it the optimal choice for lung cancer prediction tasks.
[0150] The ROC curve comparison shows that the XGBoost model has the highest AUC value (0.94), indicating that it has the best overall performance in distinguishing healthy samples from lung cancer samples, effectively balancing the true positive rate (TPR) and the false positive rate (FPR). The Multilayer Perceptron (MLP) follows closely behind (AUC=0.92), demonstrating the advantage of neural networks in learning complex features. Random Forest, Support Vector Machine, and K-Nearest Neighbors all have an AUC of 0.85, showing moderate performance, but outperforming Logistic Regression (AUC=0.82) and Decision Tree (AUC=0.78).
[0151] Based on the above experiments, the optimal implementation is to use the XGBoost model, which exhibits the highest accuracy and AUC value on the test set. Figure 8As shown, confusion matrix analysis revealed a specificity of 92.05% (correct identification rate for healthy samples), a sensitivity of 97.22% (lung cancer detection rate), and an overall accuracy of 94.38%. The area under the ROC curve (AUC=0.92) confirmed the model's excellent discriminative ability, achieving a high true positive rate while maintaining a low false positive rate (7.95%), significantly outperforming related detection methods.
[0152] This application's embodiments compare the performance of various machine learning algorithms in a user status monitoring task related to lung cancer. The results show that the XGBoost model performs best in both ROC curve (AUC=0.94) and classification accuracy (90.72%), demonstrating excellent generalization ability and diagnostic precision. The Multilayer Perceptron (MLP) model follows closely behind (AUC=0.92, accuracy 90.27%), validating the powerful representational ability of neural networks in complex medical data. The final optimized XGBoost model maintains a stable accuracy of 90.7% on independent test sets, providing an efficient and reliable technical solution for user status screening.
[0153] In summary, the embodiments of this application achieve automatic cleaning of the portable breathalyzer test device through the coordinated control of a three-way solenoid valve and dual air pumps (inflation pump + degassing pump), including its control logic (such as the number of cleaning cycles and PWM speed regulation strategy) and hardware connection method (the linkage between the solenoid valve and the air pump). The cleaning stage employs a programmable inflation-deflation cycle (PWM speed regulation control) to ensure that residual gas in the air bag and air chamber is thoroughly removed. This design directly integrates the cleaning function into the main air circuit, eliminating the need for an additional cleaning module. Through a highly integrated modular design, core components such as the air bag, air pump, solenoid valve, and sensor are compactly arranged, significantly reducing the device's size and weight, achieving true portability, meeting flexible testing needs, and significantly reducing device complexity. It also supports adjusting the number of cleaning cycles according to the contamination level, effectively avoiding cross-contamination issues.
[0154] This embodiment employs a three-way solenoid valve with multi-state switching (1, 2-way / 1, 3-way) combined with air pump PWM speed control technology to achieve precise control of gas flow direction and flow rate. The MCU dynamically adjusts the air pump speed based on sensor feedback (e.g., low-speed pumping during analysis) to ensure the stability and efficiency of gas transmission. The closed-loop control logic of this device optimizes airflow management at key nodes (e.g., air bag inflation, air chamber exhaust), reducing gas mixing interference.
[0155] This application's embodiments achieve high-precision gas detection through multi-sensor data fusion (such as temperature compensation) and real-time concentration calculation based on calibration curves (supporting nonlinear correction) (including signal conditioning algorithms (such as filtering and amplification), concentration calculation models (such as calibration curve fitting), and anomaly detection and alarm logic). The embedded data processing module integrates signal acquisition, filtering, calibration, and output functions, completing an integrated "detection-calculation-output" process, with detection errors controllable within ±2%.
[0156] The embodiments of this application can adopt a modular design, connecting solenoid valves, air pumps, sensors, and MCUs through a unified interface (such as GPIO / UART), and defining the hardware action sequence for each stage (cleaning / acquisition / analysis) based on a state machine programming model. This architecture supports rapid replacement of hardware modules and functional expansion (such as adding gas type detection), significantly reducing research and development and maintenance costs.
[0157] The intelligent gas analysis and prediction algorithm integrated into the hardware device in this application embodiment includes a preprocessing method based on environmental compensation, a feature extraction method based on sensor response ratio, and a trained machine learning model and a method for real-time prediction using the model. Through preprocessing, feature extraction, and machine learning model, automatic analysis of exhaled gas data and judgment of disease risk are achieved.
[0158] The portable breathalyzer device proposed in this application can change the gas channel in different working modes through a flow guide. This highly integrated structural design improves the device's portability while accurately guiding the gas flow direction, ensuring the accuracy of the test results. By combining the collection element, flow guide, drive element, and detection element, an automated testing process is achieved, improving testing efficiency. This solves the technical problems in related technologies where the structure for different working modes is separately designed, resulting in a large size that hinders portable applications, and the lack of a precise airflow control structure that affects the test results.
[0159] Next, the exhalation detection method proposed according to the embodiments of this application is described with reference to the accompanying drawings.
[0160] Figure 9 This is a flowchart of the exhalation detection method according to an embodiment of this application.
[0161] like Figure 9 As shown, the breath test method includes the following steps:
[0162] In step S901, the operating mode of the portable breath detection device is obtained.
[0163] In step S902, the user's exhaled gas or air from the external environment is collected based on the working mode.
[0164] In step S903, the gas is analyzed to obtain the analytical value between the gas and the preset sample gas, or the air is discharged to the external environment.
[0165] It should be noted that the foregoing explanation of the portable breath detection device embodiment also applies to the breath detection method of this embodiment, and will not be repeated here.
[0166] The breath detection method proposed in this application can achieve gas channel changes in different working modes through a flow guide. This highly integrated structural design improves the portability of the device while accurately guiding the gas flow direction, ensuring the accuracy of the detection results. By combining the collection element, flow guide, drive element, and detection element, an automated detection process is achieved, improving detection efficiency. This solves the technical problems in related technologies where the structure for different working modes is separately designed, resulting in a large size that hinders portable applications, and the lack of a precise airflow control structure that affects the detection results.
[0167] Figure 10 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include:
[0168] The memory 1001, the processor 1002, and the computer program stored on the memory 1001 and capable of running on the processor 1002.
[0169] When the processor 1002 executes the program, it implements the exhalation detection method provided in the above embodiments.
[0170] Furthermore, electronic devices also include:
[0171] Communication interface 1003 is used for communication between memory 1001 and processor 1002.
[0172] The memory 1001 is used to store computer programs that can run on the processor 1002.
[0173] The memory 1001 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0174] If the memory 1001, processor 1002, and communication interface 1003 are implemented independently, then the communication interface 1003, memory 1001, and processor 1002 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized into address buses, data buses, control buses, etc. For ease of representation, Figure 10 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0175] Optionally, in a specific implementation, if the memory 1001, processor 1002, and communication interface 1003 are integrated on a single chip, then the memory 1001, processor 1002, and communication interface 1003 can communicate with each other through an internal interface.
[0176] The processor 1002 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0177] This embodiment also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described breath detection method.
[0178] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the breath detection method provided in this embodiment of the invention.
[0179] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0180] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0181] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0182] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution means, apparatus, or device (such as a computer-based device, a processor-included device, or other means that can fetch and execute instructions from, or in conjunction with, an instruction execution means, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution means, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0183] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution device. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0184] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0185] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0186] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A portable breath test device, characterized in that, The portable breath detection device comprises: a collecting component configured to collect exhaled gas of a user; a flow guiding component connected to the collecting component, configured to switch a corresponding gas passage based on an operation mode of the portable breath detection device, so as to control a flow mode of the gas or air introduced from an external environment based on the gas passage; a driving component configured to drive the gas or the air based on the operation mode, so that the gas or the air flows along the gas passage based on the flow mode until the gas or the air is discharged into the external environment; a detecting component configured to detect the gas flowing through the gas passage, obtain a corresponding original sensor signal, and analyze the original sensor signal to obtain an analysis value between the gas and a preset sample gas. The flow guiding component comprises: a one-way valve configured to switch a switching state based on the operation mode; a gas bag configured to store the gas or the air based on the operation mode; a switch valve configured to connect the collecting component and the gas bag, so that the gas collected by the collecting component flows to the gas bag when the switch valve is opened, and the switch valve is closed after the gas flows to the gas bag; and a three-way electromagnetic valve configured to connect the gas bag, the detecting component and the one-way valve, and determine a flow passage between the gas bag, the detecting component and the one-way valve based on the operation mode.
2. The apparatus of claim 1, wherein, The flow guiding component is further configured to: when the operation mode is a preset cleaning mode, close the switch valve, open the one-way valve, control the three-way electromagnetic valve to connect the flow passage between the gas bag and the detecting component, and after the air in the external environment flows into the gas bag through the detecting component and the three-way electromagnetic valve in sequence, control the three-way electromagnetic valve to close the flow passage between the gas bag and the detecting component, and connect the flow passage between the gas bag and the one-way valve; when the operation mode is a preset analysis mode, open the switch valve, close the one-way valve, control the three-way electromagnetic valve to connect the flow passage between the gas bag and the detecting component, and close the switch valve after the gas flows to the gas bag.
3. The apparatus of claim 2, wherein, The driving component comprises: a first air pump connected to the one-way valve, configured to drive the air in the gas bag to be discharged into the external environment through the three-way electromagnetic valve and the one-way valve in sequence when the preset cleaning mode is used; a second air pump connected to the detecting component, configured to drive the air in the external environment to flow into the gas bag through the detecting component and the three-way electromagnetic valve in sequence when the preset cleaning mode is used.
4. The apparatus of claim 3, wherein, The second air pump is further configured to: drive the gas in the gas bag to be discharged into the external environment through the three-way electromagnetic valve and the detecting component in sequence when the preset analysis mode is used.
5. The apparatus of claim 1, wherein, The detecting component comprises: a gas chamber configured to store the exhaled gas of the user to be analyzed; a sensor array module configured to detect the gas in the gas chamber to obtain at least one target component in the gas, and generate a corresponding original sensor signal based on the at least one target component; a data processing module configured to analyze the original sensor signal to obtain the analysis value between the gas and the preset sample gas.
6. The apparatus of claim 5, wherein, The data processing module comprises: a first acquisition unit configured to acquire sample data containing the preset sample gas; a construction unit configured to extract a voltage feature in the sample data, and construct a sample training data set and a sample test data set based on the voltage feature and a preset positive-negative sample ratio; a training unit configured to train an initial prediction model using the sample data set to obtain the prediction model, and input the original sensor signal into the prediction model to obtain the analysis value.
7. The apparatus of claim 6, wherein, The data processing module further comprises: a second acquisition unit configured to acquire a plurality of alternative models; a test unit configured to train each alternative model using the sample data set, and test each trained alternative model using the sample test data set to obtain a classification accuracy of each trained alternative model; a screening unit configured to obtain the prediction model from the each trained alternative model based on the classification accuracy and a preset accuracy condition.
8. A breath detection method, characterized by, Use the portable breath detection device according to any one of claims 1-7, wherein the method comprises the following steps: acquiring a working mode of the portable breath detection device; collecting gas exhaled by a user or air in an external environment based on the working mode; analyzing the gas to obtain an analysis value between the gas and a preset sample gas, or discharging the air to the external environment.
9. An electronic device, comprising: comprise: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the breath detection method according to claim 8.
Citation Information
Patent Citations
Detection equipment and detection method for expiration analysis
CN116298230A