Formaldehyde gas detection method and system for smart home environment

By constructing a detection error compensation model based on historical data and near-infrared spectroscopy, the method addresses interference and measurement errors in smart home formaldehyde detection, improving accuracy through data adjustment.

CN120314243AActive Publication Date: 2025-07-15DONGGUAN EXCEL IND
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510812307.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-07-15
Estimated Expiration
2045-06-18

AI Technical Summary

Technical Problem

In smart home environments, the existing formaldehyde gas detection methods have an error that cannot be ignored due to near-infrared spectrometer measurement errors and the interference of hydrogen groups in different characteristic gases.

Method used

By constructing a detection error compensation model, a near-infrared spectrometer is used to obtain the hydrogen-containing group information in the sample ambient gas, calculate the predicted content of the characteristic gas, and perform error compensation to reduce detection errors based on historical detection data and the characteristic gas sample content of the sample ambient gas.

Benefits of technology

It effectively reduces the error of the detection result and improves the accuracy of formaldehyde gas detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120314243A_ABST
    Figure CN120314243A_ABST
Patent Text Reader

Abstract

The invention discloses a formaldehyde gas detection method and system for a smart home environment, and relates to the technical field of environment detection.The formaldehyde gas detection method comprises the steps that hydrogen-containing groups of characteristic gas and the proportion of the hydrogen-containing groups in the characteristic gas are determined, and the sample content of the characteristic gas in at least one sample environment gas is preset; calculating to obtain the predicted content of the characteristic gas in the sample environment gas; obtaining a prediction deviation value; constructing a detection error compensation model; calculating to obtain the initial content of the characteristic gas in the real home environment; obtaining the actual content of the characteristic gas; the actual content of the characteristic gas as the formaldehyde gas is matched to the formaldehyde gas. By arranging the sample calculation module, the deviation acquisition module, the model construction module and the data compensation module, the deviation generated by near infrared spectrum analysis can be predicted, so that data compensation is performed according to a prediction result, the deviation can be reasonably reduced, and the detection precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of environmental detection, and particularly to a formaldehyde gas detection method and system for a smart home environment. Background Art

[0002] All kinds of boards used in smart homes will cause pollutants such as formaldehyde in the home environment, and there are various formaldehyde detection methods. Using a near-infrared spectrometer can perform relatively accurate detection.

[0003] However, during detection, mainly through the detection of hydrogen-containing groups and the distribution of hydrogen-containing groups in characteristic gases, a corresponding mathematical model is constructed, so as to generate a prediction result of the content of characteristic gases according to the detection result of the near-infrared spectrum. However, since different characteristic gases may contain the same hydrogen-containing groups, during calculation, the same hydrogen-containing groups will have a certain interference on the results of the mathematical models used for calculating the contents of different characteristic gases. At the same time, there are also certain errors in the measurement of the near-infrared spectrum itself. The combination of the two will cause an error that cannot be ignored in the detection result. Summary of the Invention

[0004] To solve the above technical problems, a formaldehyde gas detection method and system for a smart home environment are provided, and the technical solution solves the problems raised in the above background art.

[0005] To achieve the above purpose, the technical solution adopted by the present invention is as follows: A formaldehyde gas detection method for a smart home environment, comprising: Based on historical detection data, obtain at least one characteristic gas existing in the home environment, one of the characteristic gases is formaldehyde gas, and the characteristic gas is a gas containing a hydrogen-containing group; Determine the hydrogen-containing group of the characteristic gas and the proportion of the hydrogen-containing group in the characteristic gas, and preset the sample content of the characteristic gas in at least one sample environmental gas; Analyze through a near-infrared spectrometer to obtain the sample content of the hydrogen-containing group in the sample environmental gas, and based on the sample content of the hydrogen-containing group, calculate the predicted content of the characteristic gas in the sample environmental gas; Subtract the predicted content of the characteristic gas in the sample environmental gas from the sample content to obtain a prediction deviation value; Construct a detection error compensation model; Obtain the actual content of the hydrogen-containing group in the real home environment through a near-infrared spectrometer, and based on the actual content of the hydrogen-containing group, calculate the preliminary content of the characteristic gas in the real home environment; Based on the detection error compensation model, compensate the preliminary content of the characteristic gas to obtain the actual content of the characteristic gas; Match the actual content of the characteristic gas, which is formaldehyde gas, to the formaldehyde gas.

[0006] Preferably, the step of determining the hydrogen-containing group of the characteristic gas and the proportion of the hydrogen-containing group in the characteristic gas includes the following steps: Obtain a nutrient sample containing a single characteristic gas, use a near-infrared spectrometer to measure the hydrogen-containing groups present in the nutrient sample, and obtain at least one hydrogen-containing group of the characteristic gas; Expand the number of hydrogen-containing groups to make the number of all characteristic gases after expansion consistent with the number of all hydrogen-containing groups; Use a near-infrared spectrometer to measure the mass of the hydrogen-containing group of the characteristic gas, and divide the mass of the hydrogen-containing group of the characteristic gas by the mass of the characteristic gas to obtain the proportion of the hydrogen-containing group in the characteristic gas. When the hydrogen-containing group does not exist in the characteristic gas, the proportion of the hydrogen-containing group in the characteristic gas is 0.

[0007] Preferably, the step of presetting the sample content of the characteristic gas in at least one sample ambient gas includes the following steps: Obtain the content value range of the characteristic gas in the home environment, and the content value range includes the values of outliers and normal values; Equally spaced divide the content value range of the characteristic gas to obtain at least one identification point; The sample content of the characteristic gas is the value of a randomly selected one of the corresponding at least one identification point, and each value situation of the sample content of all the characteristic gases is used as a parameter setting of a sample ambient gas.

[0008] Preferably, the step of calculating the predicted content of the characteristic gas in the sample ambient gas based on the sample content of the hydrogen-containing group includes the following steps: Sort one of all the characteristic gases as the first sort, and sort one of all the hydrogen-containing groups as the second sort; Arrange the predicted content of the characteristic gas in the sample ambient gas according to the first sort to form a first sample row matrix, and arrange the sample content of the hydrogen-containing group according to the second sort to form a second sample row matrix; Arrange the proportion of the hydrogen-containing group in the characteristic gas according to the second sort to form a first sample column matrix, and the first sample column matrix corresponds to the characteristic gas; Combine the first sample column matrix according to the first sort to form a sample square matrix, solve for the inverse matrix of the sample square matrix as the characteristic matrix, and multiply the second sample row matrix by the characteristic matrix to obtain a third sample row matrix; Make the first sample row matrix equal to the third sample row matrix to obtain the predicted content of the characteristic gas in the sample ambient gas.

[0009] Preferably, the construction of the detection error compensation model comprises the following steps: The mutual influence coefficient of the errors of the two characteristic gases is calculated, and the measurement error coefficient of the near infrared spectrometer for the characteristic gases is calculated; Number the characteristic gases according to the order of the first sort; An error matrix is formed. The error matrix is an N*N matrix. When i is not equal to j, the elements in row i and column j of the error matrix are filled with the error mutual influence coefficients of the two characteristic gases numbered i and j. When i is equal to j, the elements in row i and column j of the error matrix are filled with the measurement error coefficients of the characteristic gas numbered i. N is the length of the first sorted sequence, and i and j are counting indices. All prediction deviation values are accumulated to obtain a total deviation, the predicted contents of the characteristic gases in all sample ambient gases are accumulated to obtain a total predicted content, and the total deviation is divided by the total predicted content to obtain an error estimation ratio; The error matrix and error estimation ratio are used as the detection error compensation model.

[0010] Preferably, the calculation of the error mutual influence coefficient of the two characteristic gases comprises the following steps: The two characteristic gases are respectively recorded as the first characteristic gas and the second characteristic gas; The hydrogen-containing groups that appear simultaneously in the two characteristic gases are regarded as target hydrogen-containing groups; The proportion of the target hydrogen-containing group in the first characteristic gas is divided by the proportion of the target hydrogen-containing group in the second characteristic gas to obtain a first proportion of the target hydrogen-containing group. When the proportion of the target hydrogen-containing group in the second characteristic gas is 0, the first proportion of the target hydrogen-containing group is 0; Accumulate the first ratios of all target hydrogen-containing groups in the two characteristic gases to obtain a first coefficient; The proportion of the target hydrogen-containing group in the second characteristic gas is divided by the proportion of the target hydrogen-containing group in the first characteristic gas to obtain a second proportion of the target hydrogen-containing group. When the proportion of the target hydrogen-containing group in the first characteristic gas is 0, the second proportion of the target hydrogen-containing group is 0; Accumulate the second proportions of all target hydrogen-containing groups in the two characteristic gases to obtain a second coefficient; The first coefficient and the second coefficient are superimposed to obtain the preliminary coefficients of two characteristic gases; The preliminary coefficients of all two characteristic gases are added up to obtain the comprehensive coefficient, and the preliminary coefficients of the two characteristic gases are divided by the comprehensive coefficient to obtain the error mutual influence coefficient of the two characteristic gases.

[0011] Preferably, the calculation of the measurement error coefficient of the near infrared spectrometer for the characteristic gas comprises the following steps: The sample content of the characteristic gas in the sample ambient gas is divided by the corresponding predicted deviation value to obtain the adaptation coefficient of the characteristic gas; The adaptation coefficients of all the characteristic gases in all the sample ambient gases are accumulated to obtain the total system coefficient; The adaptation coefficients of the same characteristic gas in all the sample ambient gases are accumulated to obtain the integration coefficient of the characteristic gas; The integration coefficient of the characteristic gas is divided by the total system coefficient to obtain the measurement error coefficient of the characteristic gas.

[0012] Preferably, calculating the preliminary content of the characteristic gas in the real home environment based on the actual content of the hydrogen-containing group includes the following steps: The preliminary content of the characteristic gas in the real home environment is arranged in a first order to form a first actual row matrix, and the actual content of the hydrogen-containing group is arranged in a second order to form a second actual row matrix; The second actual row matrix is multiplied by the characteristic matrix to obtain a third actual row matrix; The first actual row matrix is made equal to the third actual row matrix to obtain the preliminary content of the characteristic gas in the real home environment.

[0013] Preferably, compensating the preliminary content of the characteristic gas to obtain the actual content of the characteristic gas includes the following steps: The first actual row matrix is multiplied by the error matrix and the error estimation ratio to obtain a fourth actual row matrix, and the elements in the fourth actual row matrix are used as the compensation content of the characteristic gas in the first order in turn; The difference between the preliminary content of the characteristic gas and the compensation content of the characteristic gas is obtained to obtain the actual content of the characteristic gas.

[0014] A formaldehyde gas detection system for a smart home environment, which is used to implement the above-mentioned formaldehyde gas detection method for a smart home environment, includes: A substance determination module, which obtains at least one characteristic gas existing in the home environment based on historical detection data. One of the characteristic gases is formaldehyde gas, and the characteristic gas is a gas containing a hydrogen-containing group; A content determination module, which determines the hydrogen-containing group of the characteristic gas and the proportion of the hydrogen-containing group in the characteristic gas, and pre-sets the sample content of the characteristic gas in at least one sample ambient gas; A sample calculation module, which analyzes the sample content of the hydrogen-containing group in the sample ambient gas through a near-infrared spectrometer, and calculates the predicted content of the characteristic gas in the sample ambient gas based on the sample content of the hydrogen-containing group; A deviation acquisition module, which subtracts the predicted content of the characteristic gas in the sample ambient gas from the sample content to obtain a predicted deviation value; A model construction module that constructs a detection error compensation model. An actual calculation module that obtains the actual content of hydrogen-containing groups in the real home environment through a near-infrared spectrometer, and calculates the preliminary content of characteristic gases in the real home environment based on the actual content of hydrogen-containing groups. A data compensation module that compensates the preliminary content of characteristic gases based on the detection error compensation model to obtain the actual content of characteristic gases. A data determination module that matches the actual content of the characteristic gas, which is formaldehyde gas, to formaldehyde gas.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: By setting a sample calculation module, a deviation acquisition module, a model construction module, and a data compensation module, it is possible to obtain the prediction deviation of the near-infrared spectrum according to the set sample data, and estimate the contribution of the same hydrogen-containing group among different characteristic gases to the interference of the calculation based on the sample content of the characteristic gas in the sample environment gas and the proportion of the hydrogen-containing group in the characteristic gas, so as to generate a model construction module. Using the model construction module, it is possible to predict the deviation generated by the near-infrared spectrum analysis, and thus compensate the data according to the prediction result, and further reasonably reduce the deviation and improve the detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a schematic flowchart of a formaldehyde gas detection method and system for a smart home environment according to the present invention; Figure 2 It is a schematic flowchart of determining the hydrogen-containing group of the characteristic gas and the proportion of the hydrogen-containing group in the characteristic gas according to the present invention; Figure 3 It is a schematic flowchart of presetting the sample content of the characteristic gas in at least one sample environment gas according to the present invention; Figure 4 It is a schematic flowchart of calculating the predicted content of the characteristic gas in the sample environment gas based on the sample content of the hydrogen-containing group according to the present invention; Figure 5 It is a schematic flowchart of constructing a detection error compensation model according to the present invention; Figure 6 It is a schematic flowchart of calculating the error interaction coefficient between two characteristic gases according to the present invention; Figure 7 It is a schematic flowchart of calculating the measurement error coefficient of the near-infrared spectrometer for the characteristic gas according to the present invention; Figure 8Schematic flow chart for calculating the preliminary content of characteristic gases in the real home environment based on the actual content of hydrogen-containing groups in the present invention; Figure 9 Schematic flow chart for compensating the preliminary content of characteristic gases to obtain the actual content of characteristic gases in the present invention. Detailed implementation manners

[0017] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments in the following description are only examples, and other obvious variations can be thought of by those skilled in the art.

[0018] Referring to Figure 1 As shown, a formaldehyde gas detection method for a smart home environment includes: Based on historical detection data, obtain at least one characteristic gas present in the home environment. One of the characteristic gases is formaldehyde gas, and the characteristic gas is a gas containing a hydrogen-containing group; Determine the hydrogen-containing group of the characteristic gas and the proportion of the hydrogen-containing group in the characteristic gas, and preset the sample content of the characteristic gas in at least one sample environmental gas; Analyze through a near-infrared spectrometer to obtain the sample content of the hydrogen-containing group in the sample environmental gas, and calculate the predicted content of the characteristic gas in the sample environmental gas based on the sample content of the hydrogen-containing group; Subtract the predicted content of the characteristic gas in the sample environmental gas from the sample content to obtain a predicted deviation value; Construct a detection error compensation model; Obtain the actual content of the hydrogen-containing group in the real home environment through a near-infrared spectrometer, and calculate the preliminary content of the characteristic gas in the real home environment based on the actual content of the hydrogen-containing group; Based on the detection error compensation model, compensate the preliminary content of the characteristic gas to obtain the actual content of the characteristic gas; Match the actual content of the characteristic gas that is formaldehyde gas to the formaldehyde gas.

[0019] Here, the sample environmental gas is a sample, mainly to obtain the predicted deviation value, so as to construct a detection error compensation model. The sample content of the characteristic gas in the sample environmental gas is known; Near-infrared spectrometers can estimate the content of characteristic gases based on the measured data according to corresponding mathematical models. Near-infrared spectrometers mainly measure the hydrogen-containing groups, but the hydrogen-containing groups of different characteristic gases may overlap. Although near-infrared spectrometers can reduce the influence of overlap to a certain extent, they cannot completely eliminate it. Therefore, the uncertainty factors caused by the overlapping part will affect the final result. At the same time, there are certain deviations in the measurement of near-infrared spectrometers. Therefore, it is necessary to eliminate these two types of deviations. In this solution, the errors are eliminated by constructing a detection error compensation model, and the construction of the model mainly depends on the detection and analysis of the sample ambient gas.

[0020] Referring to Figure 2 As shown, determining the hydrogen-containing groups of the characteristic gas and the proportion of the hydrogen-containing groups in the characteristic gas includes the following steps: Obtain a nutrient sample containing a single characteristic gas, and use a near-infrared spectrometer to measure the hydrogen-containing groups present in the nutrient sample to obtain at least one hydrogen-containing group of the characteristic gas; Expand the number of hydrogen-containing groups to make the number of all characteristic gases after expansion consistent with the number of all hydrogen-containing groups; Use a near-infrared spectrometer to measure the mass of the hydrogen-containing groups of the characteristic gas, and divide the mass of the hydrogen-containing groups of the characteristic gas by the mass of the characteristic gas to obtain the proportion of the hydrogen-containing groups in the characteristic gas. When the hydrogen-containing group does not exist in the characteristic gas, the proportion of the hydrogen-containing group in the characteristic gas is 0.

[0021] In actual measurement, there are many characteristic gases, but for hydrogen-containing groups, usually C-H, O-H, and N-H groups are detected. According to the actual situation, it will be increased accordingly, but the increase is limited. The content of the characteristic gas can be determined by detecting a few groups. Therefore, its quantity is usually less than the number of characteristic gases. However, in the follow-up, since the inverse matrix of the sample matrix needs to be generated for various data calculations, the number of rows and columns of the sample matrix are determined by the number of characteristic gases and hydrogen-containing groups respectively. Since only a square matrix has an inverse matrix, in order to ensure that it is a square matrix, it is necessary to ensure that the number of characteristic gases and hydrogen-containing groups is consistent. Therefore, the number of hydrogen-containing groups is increased. The added hydrogen-containing groups themselves also exist in some characteristic gases, but in the usual detection, they are not obtained as target data.

[0022] Referring to Figure 3 As shown, presetting the sample content of the characteristic gas in at least one sample ambient gas includes the following steps: Obtain the content value range of the characteristic gas in the home environment, and the content value range includes the value ranges of abnormal values and normal values; Equally divide the content value range of the characteristic gas at equal intervals to obtain at least one identification point; The sample content of the characteristic gas is the value of any one of the corresponding at least one identification point, and each value-taking situation of the sample content of all the characteristic gases is used as a parameter setting of the sample ambient gas.

[0023] The setting of the sample content of the characteristic gas in the sample ambient gas is to ensure the diversity of the sample data so that there will be no complete repetition.

[0024] Refer to Figure 4 As shown, based on the sample content of the hydrogen-containing group, calculating the predicted content of the characteristic gas in the sample ambient gas includes the following steps: Sort one of all the characteristic gases as the first sort, and sort one of all the hydrogen-containing groups as the second sort; Arrange the predicted content of the characteristic gas in the sample ambient gas in the first sort to form a first sample row matrix, and arrange the sample content of the hydrogen-containing group in the second sort to form a second sample row matrix; Arrange the proportion of the hydrogen-containing group in the characteristic gas in the second sort to form a first sample column matrix, and the first sample column matrix corresponds to the characteristic gas; Combine the first sample column matrix in the first sort to form a sample square matrix, solve for the inverse matrix of the sample square matrix as the characteristic matrix, and multiply the second sample row matrix by the characteristic matrix to obtain a third sample row matrix; Make the first sample row matrix equal to the third sample row matrix to obtain the predicted content of the characteristic gas in the sample ambient gas.

[0025] Here, a calculation of the result is set based on a matrix operation model. Taking the predicted content of the characteristic gas in the sample ambient gas as an unknown, a first sample row matrix is formed, and by making the first sample row matrix equal to the third sample row matrix, the predicted content of the characteristic gas in the sample ambient gas is obtained. Here, the second sample row matrix and the characteristic matrix are both known quantities. Therefore, the third sample row matrix is also a known quantity, and according to the settings of the second sample row matrix and the sample square matrix, the sorting of the corresponding characteristic gases is the same, and the characteristic matrix is the inverse matrix of the sample square matrix. Therefore, the sorting of the characteristic gases in the third sample row matrix obtained therefrom is the same as that in the first sample row matrix. Therefore, they can be made equal to obtain the predicted content of the characteristic gas in the sample ambient gas.

[0026] Refer to Figure 5 As shown, constructing a detection error compensation model includes the following steps: Calculate the error interaction coefficient between two characteristic gases, and calculate the measurement error coefficient of the near-infrared spectrometer for the characteristic gas; Number the characteristic gases in the order of the first sort; A deviation matrix is formed. The deviation matrix is an N×N matrix. When i is not equal to j, in the deviation matrix, the element at the i-th row and j-th column is filled with the mutual influence coefficient of the deviations of the two characteristic gases numbered i and j. When i is equal to j, in the deviation matrix, the element at the i-th row and j-th column is filled with the measurement error coefficient of the characteristic gas numbered i. N is the length of the first sorted sequence, and i and j are counting indicators; Accumulate all the predicted deviation values to obtain the total deviation. Accumulate the predicted contents of the characteristic gases in all the sample ambient gases to obtain the total predicted content. Divide the total deviation by the total predicted content to obtain the error estimation ratio; Use the deviation matrix and the error estimation ratio as the detection error compensation model.

[0027] The error is mainly caused by two parts. One is the error in the measurement itself, because it is impossible to measure different groups completely accurately. The other is due to the fact that two characteristic gases contain the same hydrogen-containing group. The same hydrogen-containing group will interfere with the measurement and calculation because it is impossible to determine which characteristic gas the same hydrogen-containing group belongs to. Although there are certain means to reduce the proportion of uncertain attribution, it cannot be completely eliminated. Therefore, it is necessary to determine the mutual influence coefficient of the errors of the two characteristic gases, which is the coefficient for allocating the error, so as to construct the deviation matrix. On the other hand, it is necessary to estimate the proportion of the error in the calculated result, that is, the error estimation ratio, so as to obtain the error data, and then use the deviation matrix to allocate the error and use the allocated error for compensation and elimination.

[0028] Refer to Figure 6 As shown, calculating the mutual influence coefficient of the errors of the two characteristic gases includes the following steps: Denote the two characteristic gases as the first characteristic gas and the second characteristic gas respectively; Regard the hydrogen-containing groups that appear in both characteristic gases as the target hydrogen-containing groups; Divide the proportion of the target hydrogen-containing group in the first characteristic gas by the proportion of the target hydrogen-containing group in the second characteristic gas to obtain the first ratio of the target hydrogen-containing group. When the proportion of the target hydrogen-containing group in the second characteristic gas is 0, the first ratio of the target hydrogen-containing group is 0; Accumulate the first ratios of all the target hydrogen-containing groups in the two characteristic gases to obtain the first coefficient; Divide the proportion of the target hydrogen-containing group in the second characteristic gas by the proportion of the target hydrogen-containing group in the first characteristic gas to obtain the second ratio of the target hydrogen-containing group. When the proportion of the target hydrogen-containing group in the first characteristic gas is 0, the second ratio of the target hydrogen-containing group is 0; Accumulate the second ratios of all the target hydrogen-containing groups in the two characteristic gases to obtain the second coefficient; The first coefficient and the second coefficient are superimposed to obtain the preliminary coefficients of the two characteristic gases; Sum up all the preliminary coefficients of the two characteristic gases to obtain the comprehensive coefficient. Divide the preliminary coefficients of the two characteristic gases by the comprehensive coefficient to obtain the error interaction coefficients of the two characteristic gases.

[0029] When the denominator is 0, the division is meaningless. Therefore, an additional regulation for the second ratio of the target hydrogen-containing group in this case is required. Since the proportion of the target hydrogen-containing group in the second characteristic gas is 0, it has no contribution to the error. Therefore, set the first ratio of the target hydrogen-containing group to 0. Similarly, in a similar case, the second ratio of the target hydrogen-containing group can also be set to 0; Since there are multiple target hydrogen-containing groups in the two characteristic gases, it is necessary to superimpose the data corresponding to all the target hydrogen-containing groups to obtain more comprehensive data. Since the error interaction coefficient is a coefficient for distributing errors, it is actually a proportion less than 1, but the preliminary coefficient may exceed 1. Therefore, it is necessary to process the preliminary coefficient so that it is less than 1 after being processed. Thus, divide it by the comprehensive coefficient to obtain the error interaction coefficient.

[0030] Refer to Figure 7 As shown, the steps for calculating the measurement error coefficient of the near-infrared spectrometer for the characteristic gas include the following: Divide the sample content of the characteristic gas in the sample ambient gas by the corresponding predicted deviation value to obtain the adaptation coefficient of the characteristic gas; Sum up the adaptation coefficients of all the characteristic gases in all the sample ambient gases to obtain the total system coefficient; Sum up the adaptation coefficients of the same characteristic gas in all the sample ambient gases to obtain the integrated coefficient of the characteristic gas; Divide the integrated coefficient of the characteristic gas by the total system coefficient to obtain the measurement error coefficient of the characteristic gas.

[0031] Refer to Figure 8 As shown, based on the actual content of the hydrogen-containing group, the steps for calculating the preliminary content of the characteristic gas in the real home environment include the following: Arrange the preliminary content of the characteristic gas in the real home environment in the first order to form the first actual row matrix, and arrange the actual content of the hydrogen-containing group in the second order to form the second actual row matrix; Multiply the second actual row matrix by the characteristic matrix to obtain the third actual row matrix; Make the first actual row matrix equal to the third actual row matrix to obtain the preliminary content of the characteristic gas in the real home environment.

[0032] Refer to Figure 9As shown, compensating the preliminary content of the characteristic gas to obtain the actual content of the characteristic gas includes the following steps: Multiply the first actual row matrix by the error matrix and the error estimation ratio to obtain the fourth actual row matrix, and use the elements in the fourth actual row matrix as the compensation content of the characteristic gas in the first sorting in sequence; Subtract the compensation content of the characteristic gas from the preliminary content of the characteristic gas to obtain the actual content of the characteristic gas.

[0033] Multiply the first actual row matrix by the error estimation ratio to obtain the actual error term. Multiplying the actual error term by the error matrix is to allocate the actual error term, so that the compensation content of each characteristic gas can be obtained, and then the error can be eliminated.

[0034] A formaldehyde gas detection system for a smart home environment, used to implement the above-mentioned formaldehyde gas detection method for a smart home environment, includes: A substance determination module, which, based on historical detection data, obtains at least one characteristic gas existing in the home environment. One of the characteristic gases is formaldehyde gas, and the characteristic gas is a gas containing a hydrogen-containing group; A content determination module, which determines the hydrogen-containing group of the characteristic gas and the proportion of the hydrogen-containing group in the characteristic gas, and pre-sets the sample content of the characteristic gas in at least one sample environmental gas; A sample calculation module, which analyzes the sample content of the hydrogen-containing group in the sample environmental gas through a near-infrared spectrometer, and calculates the predicted content of the characteristic gas in the sample environmental gas based on the sample content of the hydrogen-containing group; A deviation acquisition module, which subtracts the predicted content of the characteristic gas in the sample environmental gas from the sample content to obtain a predicted deviation value; A model construction module, which constructs a detection error compensation model; An actual calculation module, which obtains the actual content of the hydrogen-containing group in the real home environment through a near-infrared spectrometer, and calculates the preliminary content of the characteristic gas in the real home environment based on the actual content of the hydrogen-containing group; A data compensation module, which compensates the preliminary content of the characteristic gas based on the detection error compensation model to obtain the actual content of the characteristic gas; A data determination module, which matches the actual content of the characteristic gas as formaldehyde gas to the formaldehyde gas.

[0035] Furthermore, this solution also proposes a storage medium, on which a computer-readable program is stored. When the computer-readable program is called, it executes the above-mentioned formaldehyde gas detection method for a smart home environment.

[0036] It can be understood that the storage medium can be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; an optical medium, such as a DVD; or a semiconductor medium, such as a solid-state disk (SSD).

[0037] In summary, the advantages of the present invention are as follows: By setting a sample calculation module, a deviation acquisition module, a model construction module, and a data compensation module, it is possible to obtain the prediction deviation of the near-infrared spectrum based on the set sample data, and estimate the contribution of the interference of the same hydrogen-containing group between different characteristic gases to the calculation according to the sample content of the characteristic gas in the sample environmental gas and the proportion of the hydrogen-containing group in the characteristic gas, so as to generate a model construction module. Using the model construction module, it is possible to predict the deviation generated by the near-infrared spectrum analysis, and thus compensate the data according to the prediction result, thereby reasonably reducing the deviation and improving the detection accuracy.

[0038] The above shows and describes the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. What is described in the above embodiments and the specification is only the principle of the present invention. Without departing from the spirit and scope of the present invention, the present invention will have various changes and improvements, and these changes and improvements all fall within the scope of the present invention claimed. The scope of protection claimed by the present invention is defined by the appended claims and their equivalents.

Claims

1. A formaldehyde gas detection method for a smart home environment, characterized in that Including: Based on historical detection data, at least one characteristic gas present in the home environment is obtained. One of the characteristic gases is formaldehyde gas, and the characteristic gas is a gas containing a hydrogen-containing group. Determine the hydrogen-containing group of the characteristic gas and the proportion of the hydrogen-containing group in the characteristic gas, and preset the sample content of the characteristic gas in at least one sample environmental gas. Analyze through a near-infrared spectrometer to obtain the sample content of the hydrogen-containing group in the sample environmental gas, and calculate the predicted content of the characteristic gas in the sample environmental gas based on the sample content of the hydrogen-containing group. Subtract the predicted content of the characteristic gas in the sample environmental gas from the sample content to obtain a prediction deviation value. Construct a detection error compensation model. Obtain the actual content of the hydrogen-containing group in the real home environment through a near-infrared spectrometer, and calculate the preliminary content of the characteristic gas in the real home environment based on the actual content of the hydrogen-containing group. Based on the detection error compensation model, compensate the preliminary content of the characteristic gas to obtain the actual content of the characteristic gas. Match the actual content of the characteristic gas as formaldehyde gas to the formaldehyde gas.

2. The formaldehyde gas detection method for a smart home environment according to claim 1, wherein The determination of the hydrogen-containing group of the characteristic gas and the proportion of the hydrogen-containing group in the characteristic gas includes the following steps: Obtain a nutrient sample containing a single characteristic gas, and use a near-infrared spectrometer to measure the hydrogen-containing groups present in the nutrient sample to obtain at least one hydrogen-containing group of the characteristic gas. Expand the number of hydrogen-containing groups to satisfy that the number of all characteristic gases after expansion is consistent with the number of all hydrogen-containing groups. Use a near-infrared spectrometer to measure the mass of the hydrogen-containing group of the characteristic gas, and divide the mass of the hydrogen-containing group of the characteristic gas by the mass of the characteristic gas to obtain the proportion of the hydrogen-containing group in the characteristic gas. When the hydrogen-containing group does not exist in the characteristic gas, the proportion of the hydrogen-containing group in the characteristic gas is 0.

3. A formaldehyde gas detection method for a smart home environment according to claim 2, characterized in that, The presetting of the sample content of the characteristic gas in at least one sample environmental gas includes the following steps: Obtain the content value range of the characteristic gas in the home environment, and the content value range includes the value ranges of abnormal values and normal values. Equally spaced divide the content value range of the characteristic gas to obtain at least one identification point. The sample content of the characteristic gas is the value of a randomly selected one of the corresponding at least one identification point, and each value situation of the sample content of all the characteristic gases is used as a parameter setting of a sample environmental gas.

4. The formaldehyde gas detection method for a smart home environment according to claim 3, wherein, The calculation of the predicted content of the characteristic gas in the sample environmental gas based on the sample content of the hydrogen-containing group includes the following steps: Sort one of all the characteristic gases as the first sort, and sort one of all the hydrogen-containing groups as the second sort. Arrange the predicted content of the characteristic gas in the sample environmental gas according to the first sort to form a first sample row matrix, and arrange the sample content of the hydrogen-containing group according to the second sort to form a second sample row matrix. Arrange the proportion of the hydrogen-containing group in the characteristic gas according to the second sort to form a first sample column matrix, and the first sample column matrix corresponds to the characteristic gas. The first sample column matrices are combined in accordance with the first sorting to form a sample square matrix, and the inverse matrix of the sample square matrix is obtained by solving and used as the feature matrix. The second sample row matrix is multiplied by the feature matrix to obtain the third sample row matrix; The first sample row matrix is made equal to the third sample row matrix to obtain the predicted content of the characteristic gas in the sample ambient gas.

5. A formaldehyde gas detection method for a smart home environment according to claim 4, characterized in that, The construction of the detection error compensation model includes the following steps: The error interaction coefficient between two characteristic gases is calculated, and the measurement error coefficient of the near-infrared spectrometer for the characteristic gas is calculated; The characteristic gases are numbered in the order of the first sorting; An error matrix is formed. The error matrix is an N×N matrix. When i is not equal to j, in the error matrix, the element in the i-th row and j-th column is filled with the error interaction coefficient of the two characteristic gases numbered i and j. When i is equal to j, in the error matrix, the element in the i-th row and j-th column is filled with the measurement error coefficient of the characteristic gas numbered i. N is the sequence length of the first sorting, and i and j are counting indicators; All the predicted deviation values are accumulated to obtain the total deviation. All the predicted contents of the characteristic gases in the sample ambient gas are accumulated to obtain the total predicted content. The total deviation is divided by the total predicted content to obtain the error estimation ratio; The error matrix and the error estimation ratio are used as the detection error compensation model.

6. The formaldehyde gas detection method for a smart home environment according to claim 5, wherein, The calculation of the error interaction coefficient between two characteristic gases includes the following steps: The two characteristic gases are respectively denoted as the first characteristic gas and the second characteristic gas; The hydrogen-containing groups that appear in both characteristic gases are used as the target hydrogen-containing groups; The proportion of the target hydrogen-containing group in the first characteristic gas is divided by the proportion of the target hydrogen-containing group in the second characteristic gas to obtain the first ratio of the target hydrogen-containing group. When the proportion of the target hydrogen-containing group in the second characteristic gas is 0, the first ratio of the target hydrogen-containing group is 0; All the first ratios of the target hydrogen-containing groups in the two characteristic gases are accumulated to obtain the first coefficient; The proportion of the target hydrogen-containing group in the second characteristic gas is divided by the proportion of the target hydrogen-containing group in the first characteristic gas to obtain the second ratio of the target hydrogen-containing group. When the proportion of the target hydrogen-containing group in the first characteristic gas is 0, the second ratio of the target hydrogen-containing group is 0; All the second ratios of the target hydrogen-containing groups in the two characteristic gases are accumulated to obtain the second coefficient; The first coefficient and the second coefficient are superimposed to obtain the preliminary coefficient of the two characteristic gases; All the preliminary coefficients of the two characteristic gases are accumulated to obtain the comprehensive coefficient. The preliminary coefficient of the two characteristic gases is divided by the comprehensive coefficient to obtain the error interaction coefficient between the two characteristic gases.

7. A formaldehyde gas detection method for a smart home environment according to claim 6, characterized in that, The calculation of the measurement error coefficient of the near-infrared spectrometer for the characteristic gas includes the following steps: The sample content of the characteristic gas in the sample ambient gas is compared with the corresponding predicted deviation value to obtain the adaptation coefficient of the characteristic gas; All the adaptation coefficients of all the characteristic gases in the sample ambient gas are accumulated to obtain the total system coefficient; All the adaptation coefficients of the same characteristic gas in the sample ambient gas are accumulated to obtain the integrated coefficient of the characteristic gas; The integrated coefficient of the characteristic gas is divided by the total system coefficient to obtain the measurement error coefficient of the characteristic gas.

8. A formaldehyde gas detection method for a smart home environment according to claim 7, characterized in that, Calculating the preliminary content of characteristic gases in the real home environment based on the actual content of hydrogen-containing groups includes the following steps: Arrange the preliminary content of characteristic gases in the real home environment in the first order to form a first actual row matrix, and arrange the actual content of hydrogen-containing groups in the second order to form a second actual row matrix; Multiply the second actual row matrix by the characteristic matrix to obtain a third actual row matrix; Make the first actual row matrix equal to the third actual row matrix to obtain the preliminary content of characteristic gases in the real home environment.

9. The formaldehyde gas detection method for a smart home environment according to claim 8, characterized in that, Compensating the preliminary content of characteristic gases to obtain the actual content of characteristic gases includes the following steps: Multiply the first actual row matrix by the error matrix and the error estimation ratio to obtain a fourth actual row matrix, and use the elements in the fourth actual row matrix as the compensation content of characteristic gases in the first order in sequence; Subtract the compensation content of characteristic gases from the preliminary content of characteristic gases to obtain the actual content of characteristic gases.

10. A formaldehyde gas detection system for a smart home environment, which is used to implement the formaldehyde gas detection method for a smart home environment as described in any one of claims 1-9, characterized in that, Including: A substance determination module, which based on historical detection data, obtains at least one characteristic gas present in the home environment. One of the characteristic gases is formaldehyde gas, and the characteristic gas is a gas containing a hydrogen-containing group; A content determination module, which determines the hydrogen-containing group of the characteristic gas and the proportion of the hydrogen-containing group in the characteristic gas, and pre-sets the sample content of the characteristic gas in at least one sample environmental gas; A sample calculation module, which analyzes through a near-infrared spectrometer to obtain the sample content of the hydrogen-containing group in the sample environmental gas, and based on the sample content of the hydrogen-containing group, calculates the predicted content of the characteristic gas in the sample environmental gas; A deviation acquisition module, which subtracts the predicted content of the characteristic gas in the sample environmental gas from the sample content to obtain a predicted deviation value; A model construction module, which constructs a detection error compensation model; An actual calculation module, which obtains the actual content of the hydrogen-containing group in the real home environment through a near-infrared spectrometer, and based on the actual content of the hydrogen-containing group, calculates the preliminary content of the characteristic gas in the real home environment; A data compensation module, which based on the detection error compensation model, compensates the preliminary content of the characteristic gas to obtain the actual content of the characteristic gas; A data determination module, which matches the actual content of the characteristic gas as formaldehyde gas to the formaldehyde gas.

Citation Information

Patent Citations

  • Online monitoring system of mixture gas near-infrared laser

    CN107831139A

  • Formaldehyde detection system with prediction function and method thereof

    CN111323539A

  • Data processing method

    CN112185470A

  • Multi-chemical index prediction method based on similar spectrum fitting

    CN113971990A

  • Quality monitoring and analyzing system and method for near infrared spectrum analyzer

    CN115993344A