CN119783060A - A method for predicting errors of digital temperature and humidity instruments in workshops based on machine learning - Google Patents
A method for predicting errors of digital temperature and humidity instruments in workshops based on machine learning Download PDFInfo
- Publication number
- CN119783060A CN119783060A CN202411846996.8A CN202411846996A CN119783060A CN 119783060 A CN119783060 A CN 119783060A CN 202411846996 A CN202411846996 A CN 202411846996A CN 119783060 A CN119783060 A CN 119783060A
- Authority
- CN
- China
- Prior art keywords
- data
- humidity
- error
- temperature
- time
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Testing Or Calibration Of Command Recording Devices (AREA)
- Indication And Recording Devices For Special Purposes And Tariff Metering Devices (AREA)
Abstract
The invention discloses a machine learning-based workshop temperature and humidity digital instrument error prediction method, and belongs to the technical field of industrial metering. The method accurately predicts the measurement error of the measured table by introducing data smoothing, peak value extraction, filtering and outlier processing and establishing a multiple linear regression model, dynamically adjusts the metering calibration period according to the prediction error, ensures the accuracy of the measurement data and realizes error prediction. The method effectively solves the metering problem caused by small data quantity, unaligned data time sequence, poor data continuity, unclear performance index and poor abnormal response on site, combines a time sequence and a self-adaptive adjustment algorithm, and improves the reliability of model prediction. The technical method can reduce the human error of on-site measurement, the algorithm responds in real time, the labor is saved, the construction of a digital workshop is promoted, and the mathematical foundation support of metering is ensured.
Description
Technical Field
The invention belongs to the technical field of industrial metering, and particularly relates to a workshop temperature and humidity digital instrument error prediction method based on machine learning.
Background
In the production process of a production type enterprise workshop, temperature and humidity are key factors influencing product quality and production efficiency. At present, temperature and humidity monitoring in workshops mainly depends on traditional digital instruments for measurement, but the instruments have the problems of insufficient precision, slow response speed, incapability of real-time early warning and the like, and the change of workshop environments is difficult to reflect in time, so that the stability of product quality is affected. Therefore, the temperature and humidity digital instrument needs to be measured, and the problems of small data quantity, misalignment of data time sequence, poor data continuity, unclear performance index and poor abnormal response exist in the measurement process of the digital instrument.
Therefore, the data of the instrument are aligned and analyzed by adopting a proper algorithm, which is very important for metering of the instrument.
Disclosure of Invention
In order to solve the defects in the prior art, the invention provides a workshop temperature and humidity digital instrument error prediction method based on machine learning, which is realized by introducing an advanced machine learning algorithm, and intelligent analysis and error prediction are carried out on the temperature and humidity digital instrument data, so that the precision and response speed of temperature and humidity measurement are improved, and real-time monitoring and adjustment of the temperature and humidity digital instrument are realized. .
In order to achieve the above purpose, the present invention adopts the following technical scheme:
A workshop temperature and humidity digital instrument error prediction method based on machine learning adopts a temperature and humidity sensor, and comprises the following steps:
Step1, acquiring temperature and humidity data through a temperature and humidity sensor, and storing the acquired temperature and humidity data in a local database;
Step 2, preprocessing the acquired temperature and humidity data and aligning the data;
step 3, carrying out error prediction on the acquired temperature and humidity data;
and 4, adjusting and determining the metering period.
Preferably, in step 2, the method specifically comprises the following steps:
step 2.1, eliminating random noise in the original data by using a moving average method or an exponential smoothing method to enable the data to be smoother, wherein the calculation of the moving average method is shown as a 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 smoothed data of the sensor at time t+i, and i is the cyclic variable.
Step 2.2, extracting peak value, and obtaining local maximum value by using local extremum detection, wherein the local maximum value is shown in a formula (2):
Dt=Xt-Xt-1(2);
X t is a local maximum when D t-1 >0 and D t is less than or equal to 0;
step 2.3, filtering and outlier processing;
Step 2.4, aligning time series mean values;
Data of different time sequences are aligned using dynamic time warping.
Preferably, in step 2.3, the method specifically comprises the following steps:
step 2.3.1, filtering treatment;
and filtering the smoothed data by using a low-pass filter, wherein the transfer function of the filter is as follows:
Wherein τ is a time constant and s is a Laplacian transform variable;
step 2.3.2, processing abnormal values;
and (3) cleaning the abnormal value of the acquired data by adopting a 3 sigma method, and if a certain data point meets the following conditions:
If it is ThenIs an outlier;
where μ is the mean of the data and σ is the standard deviation.
Preferably, in step 3, the method specifically includes the following steps:
step 3.1, resampling the data, unifying the time scale of the data, and processing the data into time sequence data;
resampling includes downsampling and upsampling, wherein,
Downsampling, namely selecting data according to a fixed step length s when the data sampling frequency is too high:
X′={X1,X1+s,X1+2s,...,Xn}
upsampling, namely increasing data points by using an interpolation method when the data sampling frequency is too low;
Step 3.2, processing the missing value in the time sequence data;
the missing value is processed by a linear interpolation method, and the linear interpolation calculation formula is as follows:
Where (x 1,y1),(x2,y2) is the coordinates of two known points, (x, y) is the coordinates of the point to be interpolated, where x is the x coordinate value to be interpolated;
Step 3.3, constructing a multiple linear regression prediction model, and constructing a relation model between the metering error and various influencing factors;
Model form:
wherein β 0 is the intercept, β 1 is the regression coefficient, ε t) is the error term; In order for the data set of the table to be tested, Is a standard table dataset;
The decision coefficient R 2 of the regression model is:
Wherein, The average value of the measured table data is used for evaluating the fitting degree of the model;
the actual observed value at time t i, i.e. the output value of the sensor under test at that time;
A standard or predicted value at time t i;
β 0, an intercept term representing the offset of the regression model, i.e., the predicted value of the dependent variable when the independent variable is zero;
beta 1 slope, the strength and direction of the linear relationship between the independent and dependent variables;
m is the total number of samples.
Preferably, in step 4, the method specifically includes the following steps:
Step 4.1, predicting future metering errors according to a multiple linear regression model;
And 4.2, dynamically adjusting the calibration period by using an adaptive adjustment algorithm according to the predicted metering error.
The invention has the beneficial technical effects that:
The invention provides a workshop temperature and humidity digital instrument error prediction method based on machine learning, which effectively solves the metering problems caused by small data quantity, unaligned data time sequence, poor data continuity, unclear performance index and poor abnormal response on site, combines a time sequence and a self-adaptive adjustment algorithm, and improves the reliability of model prediction. The technical method can reduce the human error of on-site measurement, the algorithm responds in real time, the labor is saved, the construction of a digital workshop is promoted, and the mathematical foundation support of metering is ensured.
Drawings
FIG. 1 is a flow chart of the algorithm of the method of the present invention.
FIG. 2 is a schematic diagram of the error prediction result of the method of the present invention.
Detailed Description
The invention is described in further detail below with reference to the attached drawings and detailed description:
In the embodiment, temperature and humidity sensor data of a workshop are selected as a measured meter data set D sensor, and customized high-precision temperature and humidity probe data are selected as a standard data set D standard. The two sets of data were subjected to a comparative analysis of the metrology data by the following procedure.
The machine learning-based workshop temperature and humidity digital instrument error prediction method has a flow shown in fig. 1 and comprises the following steps:
and step 1, acquiring temperature and humidity data in a workshop, namely, additionally arranging a high-precision temperature and humidity sensor near the original temperature and humidity instrument to acquire the data, and storing the acquired temperature and humidity data in a local database.
And 2, carrying out data preprocessing and data alignment on the acquired temperature and humidity data. The method specifically comprises the following steps:
And 2.1, eliminating random noise in the original data by using a moving average method or an exponential smoothing method, so that the data is smoother, and the subsequent analysis is convenient. The moving average method has the following calculation formula:
Where k is the window radius, t is the time index, Is the smoothed data of the sensor at time t.
And 2.2, extracting peak values, and obtaining local maximum values by using local extremum detection. The formula is as follows:
Dt=Xt-Xt-1
X t is a local maximum when D t-1 >0 and D t is less than or equal to 0.
Step 2.3, filtering and outlier processing, namely eliminating high-frequency noise and outlier data points and improving data quality, wherein the method specifically comprises the following steps of:
step 2.3.1 Filter treatment
And filtering the smoothed data by using a low-pass filter, wherein the transfer function of the filter is as follows:
where τ is the time constant and s is the Laplace transform variable.
Taking a Kalman filter (KALMAN FILTER) as an example:
a) State prediction:
b) Error covariance prediction:
Pt|t-1=APt-1|t-1AT+Q
c) Kalman gain calculation:
Kt=Pt|t-1HT(HPt|t-1HT+R)-1
d) And (5) updating the state:
e) Error covariance update:
Pt|t=(I-KtH)Pt|t-1
Wherein A is a state transition matrix, B is a control matrix, u t-1 is a control vector, Q is a process noise covariance, H is an observation matrix, R is a measurement noise covariance, and Z t is an observation value.
Step 2.3.2, outlier processing:
and (3) cleaning the abnormal value of the acquired data by adopting a 3 sigma method, and if a certain data point meets the following conditions:
If it is ThenIs an outlier
Where μ is the mean of the data and σ is the standard deviation.
Step 2.4 time series mean alignment
Data of different time sequences are aligned for comparison and analysis using dynamic time warping.
The measured table dataset and the standard dataset are aligned on a time axis and unified to be the same time stamp T= { T 1,t2,...,tn }.
Calculating the average value of the corresponding time points to obtain an aligned time sequence:
where N is the number of valid data at time point t i.
And 3, carrying out error prediction on the acquired data. The method specifically comprises the following steps:
And 3.1, resampling the data, unifying the time scale of the data, eliminating the influence caused by different sampling frequencies, and processing the data into time sequence data.
Resampling:
Downsampling, namely selecting data according to a fixed step length s when the data sampling frequency is too high:
X′={X1,X1+s,X1+2s,...,Xn}
Upsampling, when the data sampling frequency is too low, the data points are added using interpolation methods, such as linear interpolation or spline interpolation.
And 3.2, processing the missing value in the time sequence data.
And (3) applying a linear interpolation method to the acquired temperature and humidity data, and processing the missing value. The linear interpolation calculation method is as follows.
Where (x 1,y1),(x2,y2) is the coordinates of two known points and (x, y) is the coordinates of the point to be interpolated, where x is the x coordinate value to be interpolated.
And 3.3, constructing a multiple linear regression prediction model, and constructing a relation model between the metering error and various influencing factors.
Model form:
Wherein β 0 is the intercept, β 1 is the regression coefficient, and e (t) is the error term; In order for the data set of the table to be tested, Is a standard table dataset.
The decision coefficient R 2 of the regression model is:
Wherein, The average value of the measured table data is used for evaluating the fitting degree of the model;
For this is the actual observation at time t i, i.e. the output value of the sensor under test at that time;
This is the standard or predicted value at time t i;
Beta 0 is an intercept term representing the offset of the regression model, i.e., the predicted value of the dependent variable when the independent variable is zero;
beta 1 is the slope, which represents the strength and direction of the linear relationship between the independent and dependent variables;
m is the total number of samples.
And carrying out 10 tests, and carrying out model evaluation on the error prediction model to obtain an average R 2 =0.98 of the model, wherein the model fitting effect is good. The error prediction result is shown in fig. 2.
And 4, metering cycle adjustment and determination. The method specifically comprises the following steps:
And 4.1, predicting future metering errors according to the multiple linear regression model.
Substituting the influence factors of the future time into a regression model:
Wherein,
H is the prediction step size.
Predicted metrology error at future time t+h;
Intercept term in regression model;
the degree of influence of independent variable pressure, temperature and humidity on metering errors;
P t+h,Tt+h,Ht+h pressure, temperature, humidity values at future time t+h.
And 4.2, dynamically adjusting the calibration period by using an adaptive adjustment algorithm according to the predicted metering error, so as to ensure the metering accuracy.
Adjustment principle:
(1) An allowable maximum error threshold E max is defined.
(2) When (when)Extending the calibration period T;
(3) When (when) At this time, the calibration period T is shortened.
And (3) adjusting a formula:
wherein the function is adjusted The definition is as follows:
k is an adjusting coefficient which is 0<k is less than or equal to 1;
t new a new calibration period;
t current current calibration period;
And (3) an adjustment function, wherein the adjustment factor of the new calibration period is calculated according to the predicted metering error.
Predicted metering errors or actual metering errors;
e max maximum error threshold.
In the embodiment, the technical method provided by the invention is adopted to accurately predict the measurement error of the measured table by introducing data smoothing, peak value extraction, filtering and outlier processing and establishing a multiple linear regression model. The metering calibration period is dynamically adjusted according to the prediction error, so that the accuracy of measured data is ensured, and error prediction is realized.
According to the method, the machine learning algorithm is introduced to conduct intelligent analysis and error prediction on the temperature and humidity digital instrument data, the precision and response speed of temperature and humidity measurement are improved, the error analysis and prediction on the temperature and humidity digital instrument are achieved, and the problems of small data quantity, misalignment of data time sequence, poor data continuity, unclear performance indexes and poor abnormal response are solved. The invention solves the defects in the prior art, and therefore, the invention has value of being applied to remote measurement of temperature and humidity digital instrument data.
It should be understood that the above description is not intended to limit the invention to the particular embodiments disclosed, but to limit the invention to the particular embodiments disclosed, and that the invention is not limited to the particular embodiments disclosed, but is intended to cover modifications, adaptations, additions and alternatives falling within the spirit and scope of the invention.
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202411846996.8A CN119783060A (en) | 2024-12-16 | 2024-12-16 | A method for predicting errors of digital temperature and humidity instruments in workshops based on machine learning |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202411846996.8A CN119783060A (en) | 2024-12-16 | 2024-12-16 | A method for predicting errors of digital temperature and humidity instruments in workshops based on machine learning |
Publications (1)
Publication Number | Publication Date |
---|---|
CN119783060A true CN119783060A (en) | 2025-04-08 |
Family
ID=95234905
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202411846996.8A Pending CN119783060A (en) | 2024-12-16 | 2024-12-16 | A method for predicting errors of digital temperature and humidity instruments in workshops based on machine learning |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN119783060A (en) |
-
2024
- 2024-12-16 CN CN202411846996.8A patent/CN119783060A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN117109487B (en) | Automatic nondestructive measurement method for metal thickness | |
CN118689866B (en) | A data optimization method and system for ultrasonic flowmeter | |
CN119397163B (en) | Fixed pollution source data collection calibration method, system, medium and program product | |
CN113935535A (en) | A principal component analysis method for medium and long-term forecasting models | |
CN109389314A (en) | A kind of quality hard measurement and monitoring method based on optimal neighbour's constituent analysis | |
CN110378542A (en) | Components measurement data statistical characteristic analysis method in error process | |
CN119958763B (en) | Calibration method and system for metering data of pressure sensor | |
CN110553631A (en) | water level measurement series error analysis method about water level flow relation | |
CN117434153A (en) | Road nondestructive testing method and system based on ultrasonic technology | |
CN116985183A (en) | Quality monitoring and management method and system for near infrared spectrum analyzer | |
CN117387884A (en) | Bridge deflection measurement method based on multi-sensor data fusion | |
CN119783060A (en) | A method for predicting errors of digital temperature and humidity instruments in workshops based on machine learning | |
CN117112981B (en) | Optimal acquisition method for steel plate thickness measurement data | |
CN117332205B (en) | High-precision automatic optimization method and device for temperature compensation resistance of piezoresistor | |
CN117310455B (en) | Oral cavity scanner circuit board fault detection method based on electric signals | |
CN107220705B (en) | Atmospheric tower top dry point prediction method for atmospheric and vacuum device | |
CN115015037B (en) | Coal preparation suspension density detection method and device, storage medium, and computer equipment | |
CN114050386B (en) | Debugging method based on cavity filter scattering parameter and screw mapping extraction | |
CN117131977A (en) | A method for dividing the runoff forecast sample set based on the minimum misjudgment risk criterion | |
CN110705180B (en) | Nonlinear autoregressive neural network machine tool thermal error modeling method with external input | |
CN117556362B (en) | Measurement data abnormity supervision system and method based on data analysis | |
CN118467988B (en) | Method and system for calibrating and outputting measurement result of liquid level meter | |
CN118999831A (en) | Thermal aging test box inspection control system | |
CN118997237A (en) | High liquid limit soil layering filling compaction degree monitoring and adjusting system | |
CN119334293A (en) | A liquid crystal glass quality detection system based on warping deformation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |