A formaldehyde gas detection method and system for smart home environment
By constructing a detection error compensation model, using a near-infrared spectrometer to obtain the sample content and proportion of hydrogen-containing groups, calculate the predicted content, the error problem of formaldehyde gas detection in smart home environments is solved and the detection accuracy is improved.
Patent Information
- Application Number
- CN202510812307.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-06-18
AI Technical Summary
In smart home environments, the existing formaldehyde gas detection methods have an error that cannot be ignored due to near-infrared spectrometer measurement error and hydrogen-containing groups interference.
By constructing a detection error compensation model, using a near-infrared spectrometer to obtain the sample content and proportion of hydrogen-containing groups, calculate the predicted content, build an error matrix and error estimation ratio, and perform data compensation to reduce errors.
It effectively reduces deviations in near-infrared spectral analysis and improves the accuracy of formaldehyde gas detection.
Smart Images

Figure CN120314243B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of environmental detection, and in particular to a formaldehyde gas detection method and system for a smart home environment. Background Art
[0002] The various types of panels used in smart homes can cause pollutants such as formaldehyde to be present in the home environment. There are various methods for detecting formaldehyde. Using a near-infrared spectrometer can provide a relatively accurate detection.
[0003] However, during detection, the corresponding mathematical model is mainly constructed through the detection of hydrogen-containing groups and the distribution of hydrogen-containing groups in the characteristic gas, so as to generate a prediction result of the characteristic gas content based on the detection results of the near-infrared spectrum. However, since different characteristic gases may contain the same hydrogen-containing groups, the same hydrogen-containing groups will cause certain interference to the results of the mathematical model used for the content calculation of different characteristic gases during calculation. At the same time, there are certain errors in the measurement of the near-infrared spectrum itself. The combination of the two will produce non-negligible errors in the detection results. Summary of the Invention
[0004] In order to solve the above technical problems, a formaldehyde gas detection method and system for a smart home environment are provided. This technical solution solves the problems raised in the above background technology.
[0005] In order to achieve the above objects, the technical solution adopted by the present invention is:
[0006] A formaldehyde gas detection method for a smart home environment, comprising:
[0007] Based on historical detection data, at least one characteristic gas present in the home environment is obtained, one of the characteristic gases being formaldehyde gas, and the characteristic gas being a gas containing hydrogen groups;
[0008] Determining the hydrogen-containing groups of the characteristic gas and the proportion of the hydrogen-containing groups in the characteristic gas, and presetting the sample content of the characteristic gas in at least one sample ambient gas;
[0009] The sample content of hydrogen-containing groups in the sample ambient gas is obtained by analyzing with a near-infrared spectrometer, and the predicted content of characteristic gases in the sample ambient gas is calculated based on the sample content of hydrogen-containing groups;
[0010] The predicted content of the characteristic gas in the sample ambient gas is subtracted from the sample content to obtain a predicted deviation value;
[0011] Construct a detection error compensation model;
[0012] The actual content of hydrogen-containing groups in the real home environment is obtained by near-infrared spectrometer, and the preliminary content of characteristic gases in the real home environment is calculated based on the actual content of hydrogen-containing groups;
[0013] Based on the detection error compensation model, the preliminary content of the characteristic gas is compensated to obtain the actual content of the characteristic gas;
[0014] The actual content of the characteristic gas as formaldehyde gas is matched to the formaldehyde gas.
[0015] Preferably, determining the hydrogen-containing groups of the characteristic gas and the proportion of the hydrogen-containing groups in the characteristic gas comprises the following steps:
[0016] Obtaining a nutrient sample containing a single characteristic gas, measuring hydrogen-containing groups present in the nutrient sample using a near-infrared spectrometer to obtain at least one hydrogen-containing group of the characteristic gas;
[0017] The number of hydrogen-containing groups is expanded to ensure that the number of all characteristic gases after the expansion is consistent with the number of all hydrogen-containing groups;
[0018] The mass of the hydrogen-containing groups in the characteristic gas is measured using a near-infrared spectrometer. The mass of the hydrogen-containing groups in the characteristic gas is compared with the mass of the characteristic gas to obtain the proportion of the hydrogen-containing groups in the characteristic gas. When the hydrogen-containing groups do not exist in the characteristic gas, the proportion of the hydrogen-containing groups in the characteristic gas is 0.
[0019] Preferably, the step of presetting the sample content of the characteristic gas in at least one sample ambient gas comprises the following steps:
[0020] Obtaining a range of characteristic gas content in a home environment, where the range includes abnormal and normal values;
[0021] Divide the characteristic gas content value range into equal intervals to obtain at least one identification point;
[0022] The sample content of the characteristic gas is a random value of at least one corresponding identification point, and each value of the sample content of all characteristic gases is regarded as a parameter setting of a sample ambient gas.
[0023] Preferably, the step of calculating the predicted content of characteristic gases in the sample ambient gas based on the sample content of hydrogen-containing groups comprises the following steps:
[0024] Sort one of all characteristic gases as the first sort, and sort one of all hydrogen-containing groups as the second sort;
[0025] Arranging the predicted contents of characteristic gases in the sample ambient gas according to a first order to form a first sample row matrix, and arranging the sample contents of hydrogen-containing groups according to a second order to form a second sample row matrix;
[0026] Arranging the proportions of hydrogen-containing groups in the characteristic gas according to the second sorting to form a first sample column matrix, wherein the first sample column matrix corresponds to the characteristic gas;
[0027] According to the first sorting, the first sample column matrix is combined to form a sample square matrix, and the inverse matrix of the sample square matrix is obtained as the characteristic matrix. The second sample row matrix is multiplied by the characteristic matrix to obtain a third sample row matrix;
[0028] The first sample row matrix and the third sample row matrix are made equal to each other to obtain the predicted content of the characteristic gas in the sample ambient gas.
[0029] Preferably, the construction of the detection error compensation model includes the following steps:
[0030] 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;
[0031] Number the characteristic gases according to the order of the first sort;
[0032] 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 coefficient of the characteristic gas numbered i. N is the length of the first sorted sequence, and i and j are counting indices.
[0033] Accumulate all prediction deviation values to obtain the total deviation, accumulate the predicted content of the characteristic gas in all sample ambient gases to obtain the total predicted content, and divide the total deviation by the total predicted content to obtain the error estimation ratio;
[0034] The error matrix and error estimation ratio are used as the detection error compensation model.
[0035] Preferably, the calculation of the error mutual influence coefficient of the two characteristic gases includes the following steps:
[0036] The two characteristic gases are respectively recorded as the first characteristic gas and the second characteristic gas;
[0037] The hydrogen-containing groups that appear simultaneously in the two characteristic gases are regarded as target hydrogen-containing groups;
[0038] 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 a 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;
[0039] Accumulate the first ratios of all target hydrogen-containing groups in the two characteristic gases to obtain a first coefficient;
[0040] 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 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.
[0041] Accumulate the second ratios of all target hydrogen-containing groups in the two characteristic gases to obtain a second coefficient;
[0042] The first coefficient and the second coefficient are superimposed to obtain the preliminary coefficients of the two characteristic gases;
[0043] The preliminary coefficients of all two characteristic gases are accumulated 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.
[0044] Preferably, the calculating of the measurement error coefficient of the near-infrared spectrometer for the characteristic gas comprises the following steps:
[0045] Comparing the sample content of the characteristic gas in the sample ambient gas with the corresponding predicted deviation value to obtain the adaptation coefficient of the characteristic gas;
[0046] Accumulate the adaptation coefficients of all characteristic gases in all sample ambient gases to obtain the overall coefficient;
[0047] Accumulate the adaptation coefficients of the same characteristic gas in all sample ambient gases to obtain the integration coefficient of the characteristic gas;
[0048] The integration coefficient of the characteristic gas is divided by the overall coefficient to obtain the measurement error coefficient of the characteristic gas.
[0049] Preferably, the step of calculating the preliminary content of characteristic gases in the real home environment based on the actual content of hydrogen-containing groups comprises the following steps:
[0050] Arranging the preliminary contents of characteristic gases in the real home environment according to a first sort order to form a first actual row matrix, and arranging the actual contents of hydrogen-containing groups according to a second sort order to form a second actual row matrix;
[0051] The second actual row matrix is multiplied by the characteristic matrix to obtain a third actual row matrix;
[0052] 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.
[0053] Preferably, compensating the preliminary content of the characteristic gas to obtain the actual content of the characteristic gas includes the following steps:
[0054] 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 sequentially used as the compensation content of the characteristic gas in the first sorting;
[0055] The actual content of the characteristic gas is obtained by subtracting the initial content of the characteristic gas from the compensated content of the characteristic gas.
[0056] 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, comprising:
[0057] a substance determination module, wherein the substance determination module obtains at least one characteristic gas present in the home environment based on historical detection data, wherein one of the characteristic gases is formaldehyde gas, and the characteristic gas is a gas containing hydrogen groups;
[0058] a content determination module, the content determination module determining the hydrogen-containing groups of the characteristic gas and the proportion of the hydrogen-containing groups in the characteristic gas, and presetting the sample content of the characteristic gas in at least one sample ambient gas;
[0059] A sample calculation module, wherein the sample calculation module obtains a sample content of hydrogen-containing groups in the sample ambient gas through near-infrared spectrometer analysis, and calculates a predicted content of characteristic gases in the sample ambient gas based on the sample content of hydrogen-containing groups;
[0060] a deviation acquisition module, wherein the deviation acquisition module calculates the difference between the predicted content of the characteristic gas in the sample ambient gas and the sample content to obtain a predicted deviation value;
[0061] A model building module, wherein the model building module builds a detection error compensation model;
[0062] an actual calculation module, which 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;
[0063] a data compensation module, wherein the data compensation module compensates for the preliminary content of the characteristic gas based on a detection error compensation model to obtain the actual content of the characteristic gas;
[0064] A data determination module is provided for matching the actual content of the characteristic gas serving as the formaldehyde gas to the formaldehyde gas.
[0065] Compared with the prior art, the present invention has the following beneficial effects:
[0066] By setting up a sample calculation module, a deviation acquisition module, a model construction module and a data compensation module, the predicted deviation of the near-infrared spectrum can be obtained according to the set sample data, and the contribution of the same hydrogen-containing groups between different characteristic gases to the interference of the calculation can be estimated through the sample content of the characteristic gas in the sample environment gas and the proportion of hydrogen-containing groups in the characteristic gas, thereby generating a model construction module. Using the model construction module, the deviation generated by the near-infrared spectral analysis can be predicted, and the data can be compensated according to the prediction results, thereby being able to more reasonably reduce the deviation and improve the accuracy of the detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 Schematic diagram of a formaldehyde gas detection method and system for a smart home environment according to the present invention;
[0068] Figure 2 Schematic diagram of the process of determining the hydrogen-containing groups of the characteristic gas and the proportion of the hydrogen-containing groups in the characteristic gas according to the present invention;
[0069] Figure 3 A schematic diagram of a process for presetting the sample content of a characteristic gas in at least one sample ambient gas according to the present invention;
[0070] Figure 4 Schematic diagram of a process for calculating the predicted content of characteristic gases in a sample ambient gas based on the content of a sample containing hydrogen groups according to the present invention;
[0071] Figure 5 A schematic diagram of a process for constructing a detection error compensation model according to the present invention;
[0072] Figure 6 Schematic diagram of the process of calculating the error mutual influence coefficient of two characteristic gases according to the present invention;
[0073] Figure 7 A schematic diagram of a process for calculating the measurement error coefficient of a near-infrared spectrometer for characteristic gases according to the present invention;
[0074] Figure 8 Schematic diagram of a process for calculating the preliminary content of characteristic gases in a real home environment based on the actual content of hydrogen-containing groups according to the present invention;
[0075] Figure 9 This is a flow chart of compensating the preliminary content of characteristic gas to obtain the actual content of characteristic gas according to the present invention. DETAILED DESCRIPTION
[0076] The following description is intended to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are merely examples, and those skilled in the art may conceive of other obvious variations.
[0077] Reference Figure 1 As shown, a formaldehyde gas detection method for a smart home environment includes:
[0078] Based on historical detection data, at least one characteristic gas present in the home environment is obtained, one of the characteristic gases being formaldehyde gas, and the characteristic gas being a gas containing hydrogen groups;
[0079] Determining the hydrogen-containing groups of the characteristic gas and the proportion of the hydrogen-containing groups in the characteristic gas, and presetting the sample content of the characteristic gas in at least one sample ambient gas;
[0080] The sample content of hydrogen-containing groups in the sample ambient gas is obtained by analyzing with a near-infrared spectrometer, and the predicted content of characteristic gases in the sample ambient gas is calculated based on the sample content of hydrogen-containing groups;
[0081] The predicted content of the characteristic gas in the sample ambient gas is subtracted from the sample content to obtain a predicted deviation value;
[0082] Construct a detection error compensation model;
[0083] The actual content of hydrogen-containing groups in the real home environment is obtained by near-infrared spectrometer, and the preliminary content of characteristic gases in the real home environment is calculated based on the actual content of hydrogen-containing groups;
[0084] Based on the detection error compensation model, the preliminary content of the characteristic gas is compensated to obtain the actual content of the characteristic gas;
[0085] The actual content of the characteristic gas as formaldehyde gas is matched to the formaldehyde gas.
[0086] Here, the sample ambient gas is a sample, and the main purpose is to obtain the prediction deviation value, so as to build a detection error compensation model. The sample content of the characteristic gas in the sample ambient gas is known;
[0087] The near-infrared spectrometer can estimate the content of characteristic gases based on the data obtained from the measurement and the corresponding mathematical model. The near-infrared spectrometer mainly measures the situation of hydrogen-containing groups, but the hydrogen-containing groups of different characteristic gases may overlap. Although the near-infrared spectrometer can reduce the impact of overlap to a certain extent, it cannot completely eliminate it. Therefore, the uncertainty caused by the overlapping part will affect the final result. At the same time, there is a certain deviation in the measurement of the near-infrared spectrometer. Therefore, these two deviations need to be eliminated. In this scheme, the error is eliminated by constructing a detection error compensation model, and the construction of the model mainly depends on the detection and analysis of the sample environment gas.
[0088] Reference 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:
[0089] Obtaining a nutrient sample containing a single characteristic gas, measuring hydrogen-containing groups present in the nutrient sample using a near-infrared spectrometer to obtain at least one hydrogen-containing group of the characteristic gas;
[0090] The number of hydrogen-containing groups is expanded to ensure that the number of all characteristic gases after the expansion is consistent with the number of all hydrogen-containing groups;
[0091] The mass of the hydrogen-containing groups in the characteristic gas is measured using a near-infrared spectrometer. The mass of the hydrogen-containing groups in the characteristic gas is compared with the mass of the characteristic gas to obtain the proportion of the hydrogen-containing groups in the characteristic gas. When the hydrogen-containing groups do not exist in the characteristic gas, the proportion of the hydrogen-containing groups in the characteristic gas is 0.
[0092] In actual measurements, there are many characteristic gases, but for hydrogen-containing groups, CH, OH, and NH are usually detected. The number of groups will increase accordingly according to actual conditions, but the increase is limited. The content of the characteristic gas can be determined by detecting a few groups, so its number is usually smaller than the number of characteristic gases. However, in the subsequent process, since it is necessary to generate the inverse matrix of the sample matrix to calculate various types of data, the number of rows and columns of the sample matrix is determined by the number of characteristic gases and hydrogen-containing groups, respectively. Since only square matrices have inverse matrices, 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 increased hydrogen-containing groups themselves also exist in some characteristic gases, but in normal detection, they are not obtained as target data.
[0093] Reference Figure 3 As shown, presetting the sample content of the characteristic gas in at least one sample ambient gas includes the following steps:
[0094] Obtaining a range of characteristic gas content in a home environment, where the range includes abnormal and normal values;
[0095] Divide the characteristic gas content value range into equal intervals to obtain at least one identification point;
[0096] The sample content of the characteristic gas is a random value of at least one corresponding identification point, and each value of the sample content of all characteristic gases is regarded as a parameter setting of a sample ambient gas.
[0097] The sample content of the characteristic gas in the sample ambient gas is set to ensure the diversity of the sample data so that there will not be complete duplication.
[0098] Reference Figure 4 As shown, calculating the predicted content of characteristic gases in the sample ambient gas based on the sample content of hydrogen-containing groups includes the following steps:
[0099] Sort one of all characteristic gases as the first sort, and sort one of all hydrogen-containing groups as the second sort;
[0100] Arranging the predicted contents of characteristic gases in the sample ambient gas according to a first order to form a first sample row matrix, and arranging the sample contents of hydrogen-containing groups according to a second order to form a second sample row matrix;
[0101] Arranging the proportions of hydrogen-containing groups in the characteristic gas according to the second sorting to form a first sample column matrix, wherein the first sample column matrix corresponds to the characteristic gas;
[0102] According to the first sorting, the first sample column matrix is combined to form a sample square matrix, and the inverse matrix of the sample square matrix is obtained as the characteristic matrix. The second sample row matrix is multiplied by the characteristic matrix to obtain a third sample row matrix;
[0103] The first sample row matrix and the third sample row matrix are made equal to each other to obtain the predicted content of the characteristic gas in the sample ambient gas.
[0104] Here, a calculation method based on a matrix operation model is set up to calculate the results. The predicted content of the characteristic gas in the sample environmental gas is taken as an unknown number to form a first sample row matrix, and the predicted content of the characteristic gas in the sample environmental gas is obtained by equilibrating the first sample row matrix with the third sample row matrix. Here, the second sample row matrix and the characteristic matrix are both known quantities, so the third sample row matrix is also a known quantity, and according to the setting of the second sample row matrix and the sample matrix, the corresponding characteristic gases are arranged in the same order, and the characteristic matrix is the inverse matrix of the sample matrix. Therefore, the third sample row matrix obtained thereby is consistent with the order of the characteristic gases in the first sample row matrix. Therefore, they can be equilibrated to obtain the predicted content of the characteristic gas in the sample environmental gas.
[0105] Reference Figure 5 As shown in Figure 2, constructing a detection error compensation model includes the following steps:
[0106] 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;
[0107] Number the characteristic gases according to the order of the first sort;
[0108] 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 coefficient of the characteristic gas numbered i. N is the length of the first sorted sequence, and i and j are counting indices.
[0109] Accumulate all prediction deviation values to obtain the total deviation, accumulate the predicted content of the characteristic gas in all sample ambient gases to obtain the total predicted content, and divide the total deviation by the total predicted content to obtain the error estimation ratio;
[0110] The error matrix and error estimation ratio are used as the detection error compensation model.
[0111] The error is mainly caused by two parts. One is the error of the measurement itself, because the measurement of different groups cannot be completely accurate. The other is that the 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 attribution uncertainty, it cannot be completely eliminated. Therefore, it is necessary to determine the mutual influence coefficient of the errors of the two characteristic gases. This is the coefficient for distributing the errors, so as to construct an error matrix. On the other hand, it is necessary to estimate the proportion of errors in the calculated results, that is, the error estimation ratio, so as to obtain error data, and then use the error matrix to distribute the errors, and use the distributed errors to compensate and eliminate them.
[0112] Reference Figure 6 As shown, calculating the error mutual influence coefficient of two characteristic gases includes the following steps:
[0113] The two characteristic gases are respectively recorded as the first characteristic gas and the second characteristic gas;
[0114] The hydrogen-containing groups that appear simultaneously in the two characteristic gases are regarded as target hydrogen-containing groups;
[0115] 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 a 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;
[0116] Accumulate the first ratios of all target hydrogen-containing groups in the two characteristic gases to obtain a first coefficient;
[0117] 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 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.
[0118] Accumulate the second ratios of all target hydrogen-containing groups in the two characteristic gases to obtain a second coefficient;
[0119] The first coefficient and the second coefficient are superimposed to obtain the preliminary coefficients of the two characteristic gases;
[0120] The preliminary coefficients of all two characteristic gases are accumulated 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.
[0121] When the denominator is 0, the division is meaningless. Therefore, in this case, the second ratio of the target hydrogen-containing group needs to be additionally specified. Since the target hydrogen-containing group does not contribute to the error when its proportion in the second characteristic gas is 0, the first ratio of the target hydrogen-containing group is set to 0. Similarly, in similar cases, the second ratio of the target hydrogen-containing group can also be set to 0.
[0122] Since there are multiple target hydrogen-containing groups in the two characteristic gases, it is necessary to superimpose the data corresponding to all target hydrogen-containing groups to obtain more comprehensive data. Since the error mutual influence coefficient is a coefficient for distributing errors, it is actually a proportion less than 1, but the preliminary coefficient may be greater than 1. Therefore, the preliminary coefficient needs to be processed so that it can be less than 1 after processing, and then it is compared with the comprehensive coefficient to obtain the error mutual influence coefficient.
[0123] Reference Figure 7 As shown, calculating the measurement error coefficient of the near-infrared spectrometer for characteristic gases includes the following steps:
[0124] Comparing the sample content of the characteristic gas in the sample ambient gas with the corresponding predicted deviation value to obtain the adaptation coefficient of the characteristic gas;
[0125] Accumulate the adaptation coefficients of all characteristic gases in all sample ambient gases to obtain the overall coefficient;
[0126] Accumulate the adaptation coefficients of the same characteristic gas in all sample ambient gases to obtain the integration coefficient of the characteristic gas;
[0127] The integration coefficient of the characteristic gas is divided by the overall coefficient to obtain the measurement error coefficient of the characteristic gas.
[0128] Reference Figure 8 As shown, based on the actual content of hydrogen-containing groups, calculating the preliminary content of characteristic gases in the real home environment includes the following steps:
[0129] Arranging the preliminary contents of characteristic gases in the real home environment according to a first sort order to form a first actual row matrix, and arranging the actual contents of hydrogen-containing groups according to a second sort order to form a second actual row matrix;
[0130] The second actual row matrix is multiplied by the characteristic matrix to obtain a third actual row matrix;
[0131] 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.
[0132] Reference Figure 9 As shown, compensating the preliminary content of the characteristic gas to obtain the actual content of the characteristic gas includes the following steps:
[0133] 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 sequentially used as the compensation content of the characteristic gas in the first sorting;
[0134] The actual content of the characteristic gas is obtained by subtracting the initial content of the characteristic gas from the compensated content of the characteristic gas.
[0135] The first actual row matrix is multiplied by the error estimation ratio to obtain the actual error term. The actual error term is multiplied by the error matrix to distribute the actual error term, thereby obtaining the compensation content of each characteristic gas and eliminating the error.
[0136] 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, comprising:
[0137] a substance determination module, wherein the substance determination module obtains at least one characteristic gas present in the home environment based on historical detection data, wherein one of the characteristic gases is formaldehyde gas, and the characteristic gas is a gas containing hydrogen groups;
[0138] a content determination module, the content determination module determining the hydrogen-containing groups of the characteristic gas and the proportion of the hydrogen-containing groups in the characteristic gas, and presetting the sample content of the characteristic gas in at least one sample ambient gas;
[0139] A sample calculation module, wherein the sample calculation module obtains a sample content of hydrogen-containing groups in the sample ambient gas through near-infrared spectrometer analysis, and calculates a predicted content of characteristic gases in the sample ambient gas based on the sample content of hydrogen-containing groups;
[0140] a deviation acquisition module, wherein the deviation acquisition module calculates the difference between the predicted content of the characteristic gas in the sample ambient gas and the sample content to obtain a predicted deviation value;
[0141] A model building module, wherein the model building module builds a detection error compensation model;
[0142] an actual calculation module, which 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;
[0143] a data compensation module, wherein the data compensation module compensates for the preliminary content of the characteristic gas based on a detection error compensation model to obtain the actual content of the characteristic gas;
[0144] A data determination module is provided for matching the actual content of the characteristic gas serving as the formaldehyde gas to the formaldehyde gas.
[0145] Furthermore, the present 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.
[0146] It is understandable that the storage medium may 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).
[0147] To sum up, the advantages of the present invention are: by setting a sample calculation module, a deviation acquisition module, a model construction module and a data compensation module, the prediction deviation of the near-infrared spectrum can be obtained according to the set sample data, and the contribution of the same hydrogen-containing groups between different characteristic gases to the interference of the calculation can be estimated through the sample content of the characteristic gas in the sample environment gas and the proportion of hydrogen-containing groups in the characteristic gas, thereby generating a model construction module. Using the model construction module, the deviation generated by the near-infrared spectral analysis can be predicted, and the data can be compensated according to the prediction results, thereby being able to more reasonably reduce the deviation and improve the detection accuracy.
[0148] 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 to the above embodiments. The above embodiments and descriptions merely illustrate the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and modifications are intended to fall within the scope of the present invention. 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: include: Based on historical detection data, at least one characteristic gas present in the home environment is obtained, one of the characteristic gases being formaldehyde gas, and the characteristic gas being a gas containing hydrogen groups; Determining the hydrogen-containing groups of the characteristic gas and the proportion of the hydrogen-containing groups in the characteristic gas, and presetting the sample content of the characteristic gas in at least one sample ambient gas; The sample content of hydrogen-containing groups in the sample ambient gas is obtained by analyzing with a near-infrared spectrometer, and the predicted content of characteristic gases in the sample ambient gas is calculated based on the sample content of hydrogen-containing groups; The predicted content of the characteristic gas in the sample ambient gas is subtracted from the sample content to obtain a predicted deviation value; Construct a detection error compensation model; The actual content of hydrogen-containing groups in the real home environment is obtained by near-infrared spectrometer, and the preliminary content of characteristic gases in the real home environment is calculated based on the actual content of hydrogen-containing groups; Based on the detection error compensation model, the preliminary content of the characteristic gas is compensated to obtain the actual content of the characteristic gas; matching the actual content of the characteristic gas as formaldehyde gas to the formaldehyde gas; 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 coefficient of the characteristic gas numbered i. N is the length of the first sorted sequence, and i and j are counting indices. Accumulate all prediction deviation values to obtain the total deviation, accumulate the predicted content of the characteristic gas in all sample ambient gases to obtain the total predicted content, and divide the total deviation by the total predicted content to obtain the error estimation ratio; The error matrix and error estimation ratio are used as a detection error compensation model; The calculation of the preliminary content of characteristic gases in the real home environment based on the actual content of hydrogen-containing groups comprises the following steps: Arranging the preliminary contents of characteristic gases in the real home environment according to a first sort order to form a first actual row matrix, and arranging the actual contents of hydrogen-containing groups according to a second sort 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 characteristic gases in the real home environment; The method of 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 sequentially used as the compensation content of the characteristic gas in the first sorting; The actual content of the characteristic gas is obtained by subtracting the initial content of the characteristic gas from the compensated content of the characteristic gas.
2. A formaldehyde gas detection method for a smart home environment according to claim 1, characterized in that: Determining the hydrogen-containing groups of the characteristic gas and the proportion of the hydrogen-containing groups in the characteristic gas comprises the following steps: Obtaining a nutrient sample containing a single characteristic gas, measuring hydrogen-containing groups present in the nutrient sample using a near-infrared spectrometer to obtain at least one hydrogen-containing group of the characteristic gas; The number of hydrogen-containing groups is expanded to ensure that the number of all characteristic gases after the expansion is consistent with the number of all hydrogen-containing groups; The mass of the hydrogen-containing groups in the characteristic gas is measured using a near-infrared spectrometer. The mass of the hydrogen-containing groups in the characteristic gas is compared with the mass of the characteristic gas to obtain the proportion of the hydrogen-containing groups in the characteristic gas. When the hydrogen-containing groups do not exist in the characteristic gas, the proportion of the hydrogen-containing groups 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 step of presetting the sample content of the characteristic gas in at least one sample ambient gas comprises the following steps: Obtaining a range of characteristic gas content in a home environment, where the range includes abnormal and normal values; Divide the characteristic gas content value range into equal intervals to obtain at least one identification point; The sample content of the characteristic gas is a random value of at least one corresponding identification point, and each value of the sample content of all characteristic gases is regarded as a parameter setting of a sample ambient gas.
4. A formaldehyde gas detection method for a smart home environment according to claim 3, characterized in that: The step of calculating the predicted content of characteristic gases in the sample ambient gas based on the sample content of hydrogen-containing groups comprises the following steps: Sort one of all characteristic gases as the first sort, and sort one of all hydrogen-containing groups as the second sort; Arranging the predicted contents of characteristic gases in the sample ambient gas according to a first order to form a first sample row matrix, and arranging the sample contents of hydrogen-containing groups according to a second order to form a second sample row matrix; Arranging the proportions of hydrogen-containing groups in the characteristic gas according to the second sorting to form a first sample column matrix, wherein the first sample column matrix corresponds to the characteristic gas; According to the first sorting, the first sample column matrix is combined to form a sample square matrix, and the inverse matrix of the sample square matrix is obtained as the characteristic matrix. The second sample row matrix is multiplied by the characteristic matrix to obtain a third sample row matrix; The first sample row matrix and the third sample row matrix are made equal to each other 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 calculation of the error mutual influence coefficient of the two characteristic gases includes 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; 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 a 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 target hydrogen-containing groups in the two characteristic gases to obtain a 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 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 ratios 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 the two characteristic gases; The preliminary coefficients of all two characteristic gases are accumulated 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.
6. A formaldehyde gas detection method for a smart home environment according to claim 5, characterized in that: The calculation of the measurement error coefficient of the near-infrared spectrometer for the characteristic gas comprises the following steps: Comparing the sample content of the characteristic gas in the sample ambient gas with the corresponding predicted deviation value to obtain the adaptation coefficient of the characteristic gas; Accumulate the adaptation coefficients of all characteristic gases in all sample ambient gases to obtain the overall coefficient; Accumulate the adaptation coefficients of the same characteristic gas in all sample ambient gases to obtain the integration coefficient of the characteristic gas; The integration coefficient of the characteristic gas is divided by the overall coefficient to obtain the measurement error coefficient of the characteristic gas.
7. A formaldehyde gas detection system for a smart home environment, used to implement the formaldehyde gas detection method for a smart home environment according to any one of claims 1 to 6, characterized in that: include: a substance determination module, wherein the substance determination module obtains at least one characteristic gas present in the home environment based on historical detection data, wherein one of the characteristic gases is formaldehyde gas, and the characteristic gas is a gas containing hydrogen groups; a content determination module, the content determination module determining the hydrogen-containing groups of the characteristic gas and the proportion of the hydrogen-containing groups in the characteristic gas, and presetting the sample content of the characteristic gas in at least one sample ambient gas; A sample calculation module, wherein the sample calculation module obtains a sample content of hydrogen-containing groups in the sample ambient gas through near-infrared spectrometer analysis, and calculates a predicted content of characteristic gases in the sample ambient gas based on the sample content of hydrogen-containing groups; a deviation acquisition module, wherein the deviation acquisition module calculates the difference between the predicted content of the characteristic gas in the sample ambient gas and the sample content to obtain a predicted deviation value; A model building module, wherein the model building module builds a detection error compensation model; an actual calculation module, which 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, wherein the data compensation module compensates for the preliminary content of the characteristic gas based on a detection error compensation model to obtain the actual content of the characteristic gas; A data determination module is provided for matching the actual content of the characteristic gas serving as the 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