[go: up one dir, main page]

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 PDF

Info

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
Application number
CN202411846996.8A
Other languages
Chinese (zh)
Inventor
丁一
徐洋
崔福祥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CETC 41 Research Institute
Original Assignee
CETC 41 Research Institute
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by CETC 41 Research Institute filed Critical CETC 41 Research Institute
Priority to CN202411846996.8A priority Critical patent/CN119783060A/en
Publication of CN119783060A publication Critical patent/CN119783060A/en
Pending legal-status Critical Current

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

Machine learning-based workshop temperature and humidity digital instrument error prediction method
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)

1.一种基于机器学习的车间温湿度数字仪表误差预测方法,其特征在于:采用温湿度传感器,包括以下步骤:1. A method for predicting errors of digital temperature and humidity instruments in workshops based on machine learning, characterized in that a temperature and humidity sensor is used, and the method comprises the following steps: 步骤1:通过温湿度传感器采集温湿度数据,并将采集到的温湿度数据存储于本地数据库中;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; 步骤2:对采集的温湿度数据进行数据预处理和数据对齐;Step 2: Preprocess and align the collected temperature and humidity data; 步骤3:对采集的温湿度数据进行误差预测;Step 3: Predict the error of the collected temperature and humidity data; 步骤4:计量周期的调整和确定。Step 4: Adjustment and determination of measurement cycle. 2.根据权利要求1所述的基于机器学习的车间温湿度数字仪表误差预测方法,其特征在于:步骤2中,具体包括如下步骤:2. The method for predicting the error of a digital temperature and humidity meter based on machine learning according to claim 1 is characterized in that: in step 2, the method specifically comprises the following steps: 步骤2.1:使用移动平均法或指数平滑法消除原始数据中的随机噪声,使数据更加平滑;移动平均法计算如公式(1)所示: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): 其中,k为窗口半径,t为时间索引,是t时刻传感器平滑后的数据;Dsensor(t+i)是t+i时刻传感器的数据;i是循环变量;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; 步骤2.2:峰值提取,使用局部极值检测,获取局部极大值;如公式(2)所示:Step 2.2: Peak extraction, using local extreme value detection to obtain the local maximum value; as shown in formula (2): Dt=Xt-Xt-1 (2);D t =X t -X t-1 (2); 当Dt-1>0且Dt≤0时,Xt为局部最大值;When D t-1 >0 and D t ≤0, X t is a local maximum; 步骤2.3:滤波与异常值处理;Step 2.3: Filtering and outlier processing; 步骤2.4:时间序列均值对齐;Step 2.4: Time series mean alignment; 使用动态时间规整,将不同时间序列的数据对齐。Use dynamic time warping to align data from different time series. 3.根据权利要求2所述的基于机器学习的车间温湿度数字仪表误差预测方法,其特征在于:步骤2.3中,具体包括如下步骤:3. The method for predicting the error of a workshop temperature and humidity digital instrument based on machine learning according to claim 2 is characterized in that: in step 2.3, the method specifically comprises the following steps: 步骤2.3.1:滤波处理;Step 2.3.1: Filtering; 使用低通滤波器对平滑后的数据进行滤波,滤波器的传递函数为:The smoothed data is filtered using a low-pass filter, and the filter transfer function is: 其中,τ为时间常数,s为拉普拉斯变换变量;Among them, τ is the time constant and s is the Laplace transform variable; 步骤2.3.2:异常值处理;Step 2.3.2: Outlier processing; 采用3σ方法对采集数据进行异常值清洗,若某数据点满足: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.根据权利要求1所述的基于机器学习的车间温湿度数字仪表误差预测方法,其特征在于:步骤3中,具体包括如下步骤:4. 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: in step 3, the following steps are specifically included: 步骤3.1:对数据进行重采样,统一数据的时间尺度,处理成时间序列数据;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; among them, 下采样:当数据采样频率过高时,按照固定步长s选取数据:Downsampling: When the data sampling frequency is too high, select data according to a fixed step size s: X={X1,X1+s,X1+2s,...,Xn}X ={X 1 ,X 1+s ,X 1+2s ,...,X n } 上采样:当数据采样频率过低时,使用插值方法增加数据点;Upsampling: When the data sampling frequency is too low, use interpolation to increase the data points; 步骤3.2:对时间序列数据中的缺失值进行处理;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: 其中,(x1,y1),(x2,y2)是两已知点的坐标,(x,y)是想要插值的点的坐标,其中x是待插值的x坐标值;Among them, (x 1 ,y 1 ), (x 2 ,y 2 ) 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; 步骤3.3:构建多元线性回归预测模型,建立计量误差与多种影响因素之间的关系模型;Step 3.3: Construct a multivariate linear regression prediction model to establish a relationship model between measurement error and multiple influencing factors; 模型形式:Model form: 其中,β0为截距,β1为回归系数,∈(t)为误差项;为被测表数据集,为标准表数据集;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; 回归模型的决定系数R2为:The coefficient of determination R2 of the regression model is: 其中,被测表数据的平均值,用于评估模型拟合程度;in, The average value of the data in the tested table is used to evaluate the degree of model fit; 在时刻ti上的实际观测值,即被测传感器在该时刻的输出值; The actual observed value at time ti , that is, the output value of the measured sensor at that time; 在时刻ti上的标准值或预测值; The standard value or predicted value at time ti ; β0:截距项,表示回归模型的偏移量,即当自变量为零时,因变量的预测值;β 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:斜率,表示自变量与因变量之间的线性关系的强度和方向;β 1 : slope, which indicates the strength and direction of the linear relationship between the independent variable and the dependent variable; m:样本的总数。m: the total number of samples. 5.根据权利要求1所述的基于机器学习的车间温湿度数字仪表误差预测方法,其特征在于:步骤4中,具体包括如下步骤: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: in step 4, the following steps are specifically included: 步骤4.1:根据多元线性回归模型预测未来的计量误差;Step 4.1: Predict future measurement errors based on the multivariate linear regression model; 步骤4.2:根据预测的计量误差,使用自适应调整算法动态调整校准周期。Step 4.2: Based on the predicted metrology error, the calibration period is dynamically adjusted using an adaptive adjustment algorithm.
CN202411846996.8A 2024-12-16 2024-12-16 A method for predicting errors of digital temperature and humidity instruments in workshops based on machine learning Pending CN119783060A (en)

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)

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&#39;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