A method for predicting errors of digital temperature and humidity instruments in workshops based on machine learning
Through machine learning-based methods, intelligent analysis and error prediction of workshop temperature and humidity digital instrument data is solved, and the problems of insufficient accuracy and slow response speed in the existing technology are achieved, and higher measurement accuracy and response speed are achieved, and real-time monitoring and adjustment are supported.
Patent Information
- Application Number
- CN202411846996.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-08
AI Technical Summary
The existing workshop temperature and humidity digital instruments have problems such as insufficient accuracy, slow response speed, and inability to warn in real time, which makes it difficult to timely reflect changes in the workshop environment and affect the stability of product quality.
Using machine learning-based methods, intelligent analysis and error prediction of temperature and humidity digital instrument data is carried out, and accurate analysis and error prediction of instrument data is achieved through data preprocessing, alignment, filtering and outlier processing, and the establishment of multiple linear regression models.
The accuracy and response speed of temperature and humidity measurement are improved, real-time monitoring and adjustment of temperature and humidity digital instruments are realized, and the problems of small amount of data, misalignment of data timing, poor data continuity, unclear performance indicators, and poor abnormal responses are solved.
Smart Images

Figure CN119783060A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of industrial measurement, and in particular relates to an error prediction method for a workshop temperature and humidity digital instrument based on machine learning. Background Art
[0002] In the production process of a manufacturing enterprise workshop, temperature and humidity are key factors affecting product quality and production efficiency. At present, the temperature and humidity monitoring of the workshop mainly relies on traditional digital instruments for measurement, but these instruments have problems such as insufficient accuracy, slow response speed, and inability to provide real-time warnings. It is difficult to reflect changes in the workshop environment in a timely manner, affecting the stability of product quality. Therefore, it is necessary to measure digital temperature and humidity instruments. In the process of digital instrument measurement, there are problems such as small data volume, misaligned data timing, poor data continuity, unclear performance indicators, and poor abnormal response.
[0003] Therefore, it is very important to use appropriate algorithms to align and analyze instrument data for instrument measurement. Summary of the invention
[0004] In order to solve the deficiencies in the prior art, the present invention provides a workshop temperature and humidity digital instrument error prediction method based on machine learning. The method introduces advanced machine learning algorithms to intelligently analyze and predict errors in the temperature and humidity digital instrument data, improve the accuracy and response speed of temperature and humidity measurement, and realize real-time monitoring and adjustment of the temperature and humidity digital instrument.
[0005] In order to achieve the above object, the present invention adopts the following technical solution:
[0006] A method for predicting errors of digital temperature and humidity instruments in workshops based on machine learning, using temperature and humidity sensors, includes the following steps:
[0007] Step 1: Collect temperature and humidity data through the temperature and humidity sensor, and store the collected temperature and humidity data in the local database;
[0008] Step 2: Preprocess and align the collected temperature and humidity data;
[0009] Step 3: Predict the error of the collected temperature and humidity data;
[0010] Step 4: Adjustment and determination of measurement cycle.
[0011] Preferably, step 2 specifically includes the following steps:
[0012] Step 2.1: Use the moving average method or exponential smoothing method to eliminate random noise in the original data and make the data smoother; the moving average method calculation is shown in formula (1):
[0013]
[0014] Where k is the window radius, t is the time index, is the smoothed data of the sensor at time t; D sensor (t+i) is the data of the sensor at time t+i; i is the loop variable.
[0015] Step 2.2: Peak extraction, using local extreme value detection to obtain the local maximum value; as shown in formula (2):
[0016] D t =X t -X t-1 (2);
[0017] When D t-1 >0 and D t When ≤0, X t is a local maximum;
[0018] Step 2.3: Filtering and outlier processing;
[0019] Step 2.4: Time series mean alignment;
[0020] Use dynamic time warping to align data from different time series.
[0021] Preferably, step 2.3 specifically includes the following steps:
[0022] Step 2.3.1: Filtering;
[0023] The smoothed data is filtered using a low-pass filter, and the filter transfer function is:
[0024]
[0025] Among them, τ is the time constant and s is the Laplace transform variable;
[0026] Step 2.3.2: Outlier processing;
[0027] The 3σ method is used to clean the collected data for outliers. If a data point satisfies:
[0028] like but is an outlier;
[0029] Among them, μ is the mean of the data and σ is the standard deviation.
[0030] Preferably, step 3 specifically includes the following steps:
[0031] Step 3.1: Resample the data, unify the time scale of the data, and process it into time series data;
[0032] Resampling includes downsampling and upsampling; among them,
[0033] Downsampling: When the data sampling frequency is too high, select data according to a fixed step size s:
[0034] X ′ ={X1,X 1+s ,X 1+2s ,...,X n}
[0035] Upsampling: When the data sampling frequency is too low, use interpolation to increase the data points;
[0036] Step 3.2: Handle missing values in time series data;
[0037] Missing values are processed by linear interpolation; the linear interpolation calculation formula is as follows:
[0038]
[0039] Among them, (x1, y1), (x2, y2) are the coordinates of two known points, (x, y) are the coordinates of the point to be interpolated, and x is the x-coordinate value to be interpolated;
[0040] Step 3.3: Construct a multivariate linear regression prediction model to establish a relationship model between measurement error and multiple influencing factors;
[0041] Model form:
[0042]
[0043] Among them, β0 is the intercept, β1 is the regression coefficient, ∈t) is the error term; is the data set of the table under test, It is a standard table data set;
[0044] The coefficient of determination R of the regression model 2 for:
[0045]
[0046] in, is the average value of the data in the tested table, which is used to evaluate the degree of model fit;
[0047] At time t i The actual observed value on, that is, the output value of the measured sensor at that moment;
[0048] At time t i Standard or predicted value on ;
[0049] β0: intercept term, which represents the offset of the regression model, that is, the predicted value of the dependent variable when the independent variable is zero;
[0050] β1: slope, which indicates the strength and direction of the linear relationship between the independent variable and the dependent variable;
[0051] m: total number of samples.
[0052] Preferably, step 4 specifically includes the following steps:
[0053] Step 4.1: Predict future measurement errors based on the multivariate linear regression model;
[0054] Step 4.2: Based on the predicted metrology error, the calibration period is dynamically adjusted using an adaptive adjustment algorithm.
[0055] Beneficial technical effects brought by the present invention:
[0056] The present invention proposes a workshop temperature and humidity digital instrument error prediction method based on machine learning. The method effectively solves the measurement problems caused by small amount of data, misaligned data time series, poor data continuity, unclear performance indicators, and poor abnormal response on site, and combines time series and adaptive adjustment algorithms to improve the credibility of model prediction. The above technical method can reduce the human error of on-site measurement, the algorithm responds in real time, saves manpower, promotes the construction of digital workshops, and ensures the mathematical basis support of measurement. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 The figure is a flow chart of the algorithm of the method of the present invention.
[0058] Figure 2 Schematic diagram of error prediction results of the method of the present invention. DETAILED DESCRIPTION
[0059] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0060] Embodiment: In this embodiment, the temperature and humidity sensor data of a workshop is selected as the measured table data set D sensor , customized high-precision temperature and humidity probe data as the standard data set D standard The following steps are used to conduct comparative analysis of the two sets of data.
[0061] A method for predicting errors of digital temperature and humidity instruments in workshops based on machine learning. The process is as follows: Figure 1 As shown, the following steps are included:
[0062] Step 1: Collect temperature and humidity data in the workshop. Install a high-precision temperature and humidity sensor near the original temperature and humidity instrument for data collection, and store the collected temperature and humidity data in the local database.
[0063] Step 2: Preprocess and align the collected temperature and humidity data. The specific steps include:
[0064] Step 2.1: Use the moving average method or exponential smoothing method to eliminate random noise in the original data, making the data smoother and easier to analyze later. The moving average method calculation formula is as follows:
[0065]
[0066] Where k is the window radius, t is the time index, is the smoothed data of the sensor at time t.
[0067] Step 2.2: Peak extraction, use local extreme value detection to obtain the local maximum value. The formula is as follows:
[0068] D t =X t -X t-1
[0069] When D t-1 >0 and D t When ≤0, X t is a local maximum.
[0070] Step 2.3: Filtering and outlier processing: Eliminate high-frequency noise and abnormal data points to improve data quality; specifically include the following steps:
[0071] Step 2.3.1: Filtering
[0072] The smoothed data is filtered using a low-pass filter, and the filter transfer function is:
[0073]
[0074] Among them, τ is the time constant and s is the Laplace transform variable.
[0075] Take the Kalman filter as an example:
[0076] a) State prediction:
[0077]
[0078] b) Error covariance prediction:
[0079] P t|t-1 =AP t-1|t-1 AT +Q
[0080] c) Kalman gain calculation:
[0081] K t =P t|t-1 H T (HP t|t-1 H T +R) -1
[0082] d) Status update:
[0083]
[0084] e) Error covariance update:
[0085] P t|t =(IK t H)P t|t-1
[0086] Among them, A is the state transfer matrix, B is the control matrix, and u t-1 is the control vector, Q is the process noise covariance, H is the observation matrix, R is the measurement noise covariance, Z t is the observed value.
[0087] Step 2.3.2: Outlier handling:
[0088] The 3σ method is used to clean the collected data for outliers. If a data point satisfies:
[0089] like but Outliers
[0090] Among them, μ is the mean of the data and σ is the standard deviation.
[0091] Step 2.4: Time series mean alignment
[0092] Use Dynamic Time Warping to align data from different time series for easier comparison and analysis.
[0093] Align the data set of the table under test and the standard data set on the time axis and unify them into the same timestamp T = {t1, t2, ..., t n}.
[0094] Calculate the mean of the corresponding time points to get the aligned time series:
[0095]
[0096]
[0097] Where N is thei The amount of valid data.
[0098] Step 3: Predict the error of the collected data. Specifically include the following steps:
[0099] Step 3.1: Resample the data, unify the time scale of the data, eliminate the impact of different sampling frequencies, and process it into time series data.
[0100] Resampling process:
[0101] Downsampling: When the data sampling frequency is too high, select data according to a fixed step size s:
[0102] X ′ ={X1,X 1+s ,X 1+2s ,...,X n}
[0103] Upsampling: When the data sampling frequency is too low, use an interpolation method such as linear interpolation or spline interpolation to increase the data points.
[0104] Step 3.2: Handle missing values in time series data.
[0105] Apply linear interpolation method to the collected temperature and humidity data to process missing values. The linear interpolation calculation method is as follows.
[0106]
[0107] Among them, (x1, y1), (x2, y2) are the coordinates of two known points, (x, y) are the coordinates of the point you want to interpolate, and x is the x-coordinate value to be interpolated.
[0108] Step 3.3: Construct a multivariate linear regression prediction model and establish a relationship model between measurement error and multiple influencing factors.
[0109] Model form:
[0110]
[0111] Among them, β0 is the intercept, β1 is the regression coefficient, and ∈(t) is the error term; is the data set of the table under test, It is a standard table data set.
[0112] The coefficient of determination R of the regression model 2 for:
[0113]
[0114] in, is the average value of the data in the tested table, which is used to evaluate the degree of model fit;
[0115] Because this is at time t i The actual observed value on, that is, the output value of the measured sensor at that moment;
[0116] This is at time t i Standard or predicted value on ;
[0117] β0: is the intercept term, which represents the offset of the regression model, that is, the predicted value of the dependent variable when the independent variable is zero;
[0118] β1: is the slope, which indicates the strength and direction of the linear relationship between the independent variable and the dependent variable;
[0119] m: total number of samples.
[0120] Carry out 10 experiments to evaluate the error prediction model and obtain the average R 2 =0.98, indicating that the model fits well. The error prediction results are as follows Figure 2 shown.
[0121] Step 4: Adjust and determine the measurement cycle. Specifically includes the following steps:
[0122] Step 4.1: Predict future measurement errors based on the multivariate linear regression model.
[0123] Substitute the influencing factors of future moments into the regression model:
[0124]
[0125] in,
[0126] h is the prediction step length.
[0127] The forecast measurement error at the future time t+h;
[0128] The intercept term in the regression model;
[0129] The degree of influence of independent variables pressure, temperature and humidity on measurement error;
[0130] P t+h , T t+h , H t+h : Pressure, temperature, and humidity values at the future time t+h.
[0131] Step 4.2: Based on the predicted measurement error, use an adaptive adjustment algorithm to dynamically adjust the calibration period to ensure measurement accuracy.
[0132] Adjustment principles:
[0133] (1) Define the maximum allowable error threshold E max .
[0134] (2) When When , extend the calibration period T;
[0135] (3) When When the calibration period T is shortened.
[0136] Adjustment formula:
[0137]
[0138] Among them, the adjustment function Defined as:
[0139]
[0140] k: adjustment coefficient, 0 <k≤1;
[0141] T new : New calibration cycle;
[0142] T current : Current calibration cycle;
[0143] The adjustment function calculates the adjustment factor of the new calibration cycle according to the size of the predicted measurement error.
[0144] Predicted measurement error or actual measurement error;
[0145] E max : Maximum error threshold.
[0146] In this embodiment, we use the technical method proposed by the present invention to accurately predict the measurement error of the measured meter by introducing data smoothing, peak extraction, filtering and outlier processing, and establishing a multivariate linear regression model. The measurement calibration cycle is dynamically adjusted according to the predicted error, which not only ensures the accuracy of the measurement data, but also realizes error prediction.
[0147] The method of the present invention introduces a machine learning algorithm to perform intelligent analysis and error prediction on the temperature and humidity digital instrument data, improve the accuracy and response speed of temperature and humidity measurement, realize error analysis and prediction of the temperature and humidity digital instrument, and solve the problems of small data volume, misaligned data timing, poor data continuity, unclear performance indicators, and poor abnormal response. The deficiencies in the prior art are solved, and therefore, the present invention has the value of being applied to remote metering of temperature and humidity digital instrument data.
[0148] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. A method for predicting errors of digital temperature and humidity instruments in workshops based on machine learning, characterized in that: Using temperature and humidity sensors, including the following steps: Step 1: Collect temperature and humidity data through the temperature and humidity sensor, and store the collected temperature and humidity data in the local database; Step 2: Preprocess and align the collected temperature and humidity data; Step 3: Predict the error of the collected temperature and humidity data; Step 4: Adjustment and determination of measurement cycle.
2. The method for predicting the error of a workshop temperature and humidity digital instrument based on machine learning according to claim 1 is characterized in that: Step 2 specifically includes the following steps: Step 2.1: Use the moving average method or exponential smoothing method to eliminate random noise in the original data and make the data smoother; the moving average method calculation is shown in formula (1): Where k is the window radius, t is the time index, is the smoothed data of the sensor at time t; D sensor (t+i) is the data of the sensor at time t+i; i is the loop variable; Step 2.2: Peak extraction, using local extreme value detection to obtain the local maximum value; as shown in formula (2): D t =X t -X t-1 (2); When D t-1 >0 and D t When ≤0, X t is the local maximum; Step 2.3: Filtering and outlier processing; Step 2.4: Time series mean alignment; Use dynamic time warping to align data from different time series.
3. The method for predicting the error of a digital temperature and humidity meter in a workshop based on machine learning according to claim 2 is characterized in that: Step 2.3 specifically includes the following steps: Step 2.3.1: Filtering; The smoothed data is filtered using a low-pass filter, and the filter transfer function is: Among them, τ is the time constant and s is the Laplace transform variable; Step 2.3.2: Outlier processing; The 3σ method is used to clean the collected data for outliers. If a data point satisfies: like but is an outlier; Among them, μ is the mean of the data and σ is the standard deviation.
4. The method for predicting the error of a digital temperature and humidity meter in a workshop based on machine learning according to claim 1 is characterized in that: Step 3 specifically includes the following steps: Step 3.1: Resample the data, unify the time scale of the data, and process it into time series data; Resampling includes downsampling and upsampling; in, Downsampling: When the data sampling frequency is too high, select data according to a fixed step size s: X ′ ={X1,X 1+s ,X 1+2s ,...,X n } Upsampling: When the data sampling frequency is too low, use interpolation to increase the data points; Step 3.2: Handle missing values in time series data; Missing values are processed by linear interpolation; the linear interpolation calculation formula is as follows: Among them, (x1, y1), (x2, y2) are the coordinates of two known points, (x, y) are the coordinates of the point to be interpolated, and x is the x-coordinate value to be interpolated; Step 3.3: Construct a multivariate linear regression prediction model to establish a relationship model between measurement error and multiple influencing factors; Model form: Among them, β0 is the intercept, β1 is the regression coefficient, and ∈(t) is the error term; is the data set of the table under test, It is a standard table data set; The coefficient of determination R of the regression model 2 for: in, The average value of the data in the measured table is used to evaluate the degree of model fit; At time t i The actual observed value on, that is, the output value of the measured sensor at that moment; At time t i Standard or predicted value on ; β0: intercept term, which represents the offset of the regression model, that is, the predicted value of the dependent variable when the independent variable is zero; β1: slope, which indicates the strength and direction of the linear relationship between the independent variable and the dependent variable; m: the total number of samples.
5. The method for predicting the error of a digital temperature and humidity meter in a workshop based on machine learning according to claim 1 is characterized in that: Step 4 specifically includes the following steps: Step 4.1: Predict future measurement errors based on the multivariate linear regression model; Step 4.2: Based on the predicted metrology error, the calibration period is dynamically adjusted using an adaptive adjustment algorithm.
Citation Information
Cited By
Pressure gauge temperature data processing method based on temperature verification drift error compensation
CN120372233A
Temperature data processing method of pressure gauge based on temperature calibration drift error compensation
CN120372233B