CN-121430702-B - Real-time detection method for failure of temperature and humidity sensor
Abstract
The invention is suitable for the technical field of sensor detection, in particular to a real-time detection method for failure of a temperature and humidity sensor, which comprises the steps of collecting data, constructing input characteristics and preprocessing the input characteristics; the method comprises the steps of constructing a data set, dividing the data set into a plurality of parts, constructing a deviation prediction model based on a gradient lifting tree, training the deviation prediction model through a training set, checking the prediction accuracy of the deviation prediction model through a testing set after training is finished to obtain a trained deviation prediction model, collecting real-time characteristics of a sensor in real time, importing the real-time characteristics into the deviation prediction model, and judging the effectiveness of the sensor according to the temperature and humidity deviation output by the deviation prediction model. Compared with a deep learning model, the method has the advantages that the inference speed is higher, the single sample prediction takes time for millisecond, and the real-time monitoring requirement of the sensor can be met.
Inventors
- SUN JINLEI
- Bi Linyi
- MOU XIANGYANG
Assignees
- 山东亿格其工业自动化技术有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251119
Claims (6)
- 1. The real-time detection method for the failure of the temperature and humidity sensor is characterized by comprising the following steps of: Data acquisition is carried out, input features are constructed, preprocessing is carried out on the input features, and the input features comprise original features and derivative features; constructing a data set based on the preprocessed input features, dividing the data set into a plurality of parts, including a training set and a testing set, and constructing a deviation prediction model based on a gradient lifting tree; Training the deviation prediction model through a training set, and checking the prediction accuracy of the deviation prediction model through a testing set after the training is completed to obtain a trained deviation prediction model; acquiring real-time characteristics of the sensor in real time, importing the real-time characteristics into a deviation prediction model, and judging the effectiveness of the sensor according to the temperature and humidity deviation output by the deviation prediction model; The deviation prediction model adopts two single-output models or a multi-output model, the two single-output models are respectively used for outputting temperature deviation and humidity deviation, and the step of constructing the single-output model comprises the following steps: model initialization, namely constructing an initial model of a gradient lifting tree, and setting a loss function, wherein the loss function adopts an MSE loss function; Generating a base decision tree, namely fitting a negative gradient of a previous round of model through the base decision tree, constructing a plurality of base decision trees, and generating a total model based on the fusion of the base decision trees; Iteration, namely generating a single-output model containing the weighted sum of all base decision trees through multiple rounds of iteration; the loss function is expressed as ; Wherein, the For the humidity deviation actual value or the temperature deviation actual value, The true value of the humidity deviation is indicated, The true value of the temperature deviation is represented, In the process, the Indicating the predicted deviation of the humidity level, Indicating the predicted deviation of the temperature of the product, Representing an input feature; in the step of generating the base decision tree, for the ith sample, the predicted value of the m-1 th round of model is The negative gradient of the loss function is: ; Wherein, the Indicating a negative gradient in humidity or temperature sample, The true value of the humidity or temperature deviation corresponding to the ith sample.
- 2. The method for real-time detection of temperature and humidity sensor failure according to claim 1, wherein in the step of generating the total model based on base decision tree fusion, an mth base tree is used At a learning rate Weighting, merging the weighted total models of the previous round, and obtaining the total model of the mth round to be expressed as: 。
- 3. the method for real-time detection of temperature and humidity sensor failure according to claim 1, wherein in the step of generating a single-output model including a weighted sum of all base decision trees, the single-output model is expressed as: ; Wherein, the For the number of iterations, Is an initial model.
- 4. The method for real-time detection of temperature and humidity sensor failure according to claim 1, wherein the adoption of a robustness loss function instead of an MSE loss function is defined as: ; the negative gradient is then expressed as: 。
- 5. The method for real-time detection of temperature and humidity sensor failure according to claim 4, wherein the regularization loss is expressed as: ; Wherein, the , For the number of leaf nodes of the mth number, Is the output value of the jth leaf of the mth tree, 、 And Is a regularization coefficient.
- 6. The method for detecting the failure of the temperature and humidity sensor according to claim 1, wherein in the training process of the model, the accuracy of the model is evaluated through three groups of evaluation indexes, including average absolute error, root mean square error and decision coefficient.
Description
Real-time detection method for failure of temperature and humidity sensor Technical Field The invention belongs to the technical field of sensor detection, and particularly relates to a real-time detection method for failure of a temperature and humidity sensor. Background The reasons of the temperature and humidity sensor over-tolerance are mainly classified into factors of cross error, systematic error, response error, zero drift and full range drift, the interference of humidity on temperature measurement can cause errors caused by multi-parameter coupling of the sensor, circuit offset can cause fixed errors caused by sensor hardware design defects, response errors can be caused by measurement hysteresis when the environment suddenly changes, for example, the zero drift and full range error after long-term use can cause final over-tolerance of the sensor, and some errors can be overlapped to form comprehensive errors. In the use process of the sensor, whether the sensor fails or not needs to be checked manually at regular intervals or is replaced after the sensor fails, so that the manual checking mode is adopted in the industrial production process, the efficiency is low, production accidents are easy to occur, and serious loss is caused. Disclosure of Invention The invention aims to provide a real-time detection method for failure of a temperature and humidity sensor, which aims to solve the problems that whether the sensor fails or not needs to be checked manually and periodically in the use process of the sensor or is replaced after the sensor fails, so that the efficiency is low, production accidents are easy to occur and serious loss is caused by adopting a manual checking mode in the industrial production process. The invention discloses a real-time detection method for failure of a temperature and humidity sensor, which comprises the following steps: Data acquisition is carried out, input features are constructed, preprocessing is carried out on the input features, and the input features comprise original features and derivative features; constructing a data set based on the preprocessed input features, dividing the data set into a plurality of parts, including a training set and a testing set, and constructing a deviation prediction model based on a gradient lifting tree; Training the deviation prediction model through a training set, and checking the prediction accuracy of the deviation prediction model through a testing set after the training is completed to obtain a trained deviation prediction model; The method comprises the steps of collecting real-time characteristics of the sensor in real time, importing the real-time characteristics into a deviation prediction model, and judging the effectiveness of the sensor according to the temperature and humidity deviation output by the deviation prediction model. Preferably, the deviation prediction model adopts two single-output models or a multi-output model, the two single-output models are respectively used for outputting the temperature deviation and the humidity deviation, and the step of constructing the single-output model comprises the following steps: model initialization, namely constructing an initial model of a gradient lifting tree, and setting a loss function, wherein the loss function adopts an MSE loss function; Generating a base decision tree, namely fitting a negative gradient of a previous round of model through the base decision tree, constructing a plurality of base decision trees, and generating a total model based on the fusion of the base decision trees; And (3) performing iteration, namely generating a single-output model containing the weighted sum of all the base decision trees through multiple rounds of iteration. Preferably, the loss function is expressed as ; Wherein, the For the humidity deviation actual value or the temperature deviation actual value,The true value of the humidity deviation is indicated,The true value of the temperature deviation is represented,In the process, the Indicating the predicted deviation of the humidity level,Indicating the predicted deviation of the temperature of the product,Representing the input features. Preferably, in the step of generating the base decision tree, the predicted value of the mth-1 round model for the ith sample isThe negative gradient of the loss function is: ; Wherein, the Indicating a negative gradient in humidity or temperature sample,The true value of the humidity or temperature deviation corresponding to the ith sample. Preferably, in the step of generating the total model based on the base decision tree fusion, an mth base tree is selectedAt a learning rateWeighting, merging the weighted total models of the previous round, and obtaining the total model of the mth round to be expressed as: 。 Preferably, in the step of generating a single output model containing a weighted sum of all base decision trees, the single output model is expressed as: ; Wherein, the F