A smart meter error correction method, medium and electronic device based on temperature sensing

By installing a thermocouple sensor on a smart meter, using Bayesian anomaly detection and multivariate Gaussian hybrid model to calculate the compensation value of the electric energy meter reading, the problem of hardware transformation in the existing technology is solved, and efficient error compensation and accuracy improvement is achieved.

CN118940146BActive Publication Date: 2025-03-18QINGDAO HIGH TECH COMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410963974.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2025-03-18
Estimated Expiration
2044-07-18

AI Technical Summary

Technical Problem

When the prior art reduces the reading error of smart meter caused by temperature changes, it is necessary to modify the meter hardware, which is relatively expensive.

Method used

By installing thermocouple sensors in multiple designated locations of the smart meter, obtaining the temperature value in real time, establishing a temperature curve, using Bayesian anomaly detection algorithm and multivariate Gaussian hybrid model to calculate the stability coefficient matrix, input it into the pretrained error correction model, and obtaining the compensation value of the power meter reading.

Benefits of technology

It realizes effective compensation for measurement errors caused by temperature changes, improves the measurement accuracy and reliability of the meter, and avoids the cost of hardware transformation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118940146B_ABST
    Figure CN118940146B_ABST
Patent Text Reader

Abstract

The present invention provides a smart meter error correction method based on temperature sensing, a medium and an electronic device, which belongs to the technical field of smart meters, and includes: obtaining the temperature values ​​of multiple thermocouples set on the smart meter in real time; for each thermocouple temperature curve, using the Bayesian anomaly detection algorithm to delete outliers to obtain a preprocessing curve; performing multivariate Gaussian mixture model decomposition on all preprocessing curves to obtain the statistical characteristics of each Gaussian component; using the covariance matrix of the Gaussian component to calculate the stability coefficient matrix of each preprocessing curve to represent the stability of the temperature curve; extracting the characteristic vector of each preprocessing curve, combining the stability coefficient matrix to input the pre-trained meter error correction model to obtain the compensation value of the current reading; correcting the current meter reading according to the compensation value to improve the measurement accuracy of the electric energy meter. The technical problem that the existing technology needs to transform the meter hardware is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of smart meters, and in particular, relates to a smart meter error correction method based on temperature sensing, a medium and an electronic device. Background Art

[0002] As an important part of smart grid, smart meters play an increasingly important role in the power industry. Compared with traditional mechanical meters, smart meters have the advantages of small size, low power consumption, high measurement accuracy, and support for remote meter reading. They are widely used in various types of power users such as residents, businesses, and industries.

[0003] With the continuous promotion of smart grids, the demand for smart meters is showing a rapid growth trend. With its excellent performance and broad application prospects, smart meters have become the key support for the digital transformation of the power industry.

[0004] However, although smart meters have made great progress compared to traditional meters, they still face some technical challenges in practical applications. Among them, the impact of temperature factors on measurement accuracy is an important issue. Various electronic components inside smart meters, such as voltage / current sensors, A / D converters, microprocessors, etc., will exhibit different performance characteristics at different operating temperatures, resulting in a certain degree of error in the measurement results. This measurement error caused by temperature changes will continue to change with the temperature fluctuations in the meter's operating environment, bringing many uncertainties to meter operation management and electricity bill settlement. In order to reduce the reading error of smart meters caused by temperature changes, existing technologies often optimize the internal circuit structure and component selection of the meter to improve its working stability at different temperatures. However, this method requires the modification of the meter hardware, which is costly. Summary of the invention

[0005] In view of this, the present invention provides a smart meter error correction method, medium and electronic device based on temperature sensing, which can solve the technical problem that the prior art needs to modify the meter hardware in order to reduce the reading error of the smart meter caused by temperature changes.

[0006] The present invention is achieved in that:

[0007] A first aspect of the present invention provides a smart meter error correction method based on temperature sensing, which includes the following steps:

[0008] S10, acquiring temperature values ​​of thermocouples set at multiple designated locations of the smart meter to be tested in real time;

[0009] S20, for each thermocouple, establish a thermocouple temperature curve and obtain outliers;

[0010] S30, according to the Bayesian anomaly detection algorithm, delete the outliers that do not conform to the Gaussian distribution in each temperature curve to obtain the corresponding preprocessing curve;

[0011] S40, performing multivariate Gaussian mixture model decomposition on all preprocessed curves to obtain the mean vector, covariance matrix and mixing coefficient of each Gaussian component;

[0012] S50, using the covariance matrix of the Gaussian components, calculating the stability coefficient matrix of each preprocessing curve, wherein the stability coefficient matrix is ​​used to characterize the stability of the temperature curve;

[0013] S60, extracting the characteristic vector of each preprocessing curve, inputting the stability coefficient matrix and the characteristic vector into a pre-trained smart meter error correction model to obtain a compensation value of the current electric energy meter reading;

[0014] S70: Compensate and correct the current electric energy meter reading according to the compensation value of the current electric energy meter reading.

[0015] Wherein, the step S10 specifically includes: installing thermocouple sensors at multiple designated locations on or near the smart meter to be tested; using the thermocouple sensors to collect ambient temperature data in real time to form multiple temperature curves; and processing the temperature curves using interpolation, smoothing and other methods to ensure their continuity and smoothness.

[0016] Wherein, the step S20 specifically includes: using a distance-based outlier detection method for each temperature curve to identify abnormal data points that are obviously inconsistent with the overall trend of the curve; marking the abnormal data points as outliers and removing them to obtain a corrected temperature curve.

[0017] Among them, the step S30 specifically includes: assuming that the temperature data obeys a Gaussian distribution, calculating the empirical mean and standard deviation based on the observed data; calculating the probability density of each temperature sampling point belonging to the Gaussian distribution, and setting a probability density threshold, and treating points with probability density lower than the threshold as abnormal points and removing them; and finally obtaining a preprocessing curve processed by Bayesian anomaly detection.

[0018] Wherein, the step S40 specifically includes: forming all preprocessed temperature curve data into a multivariate data set; assuming that the data set obeys a mixed distribution of K Gaussian distributions, using the expectation maximization algorithm to estimate the mean vector, covariance matrix and mixing coefficient of each Gaussian component.

[0019] Wherein, the step S50 specifically includes: calculating the stability coefficient matrix of the temperature curve according to the covariance matrix of each Gaussian component obtained in step S40, wherein each element represents the stability of the temperature change between two time points.

[0020] Wherein, the step S60 specifically includes: extracting statistical features, time series features and stability features from each temperature curve to form a feature vector; inputting the feature vector and the stability coefficient matrix into a pre-trained smart meter error correction model, which includes short-term, medium-term and long-term temperature curve error correction networks, as well as a stability coefficient matrix error correction network and a fusion error correction network, and outputs a compensation value of the current electric energy meter reading.

[0021] Optionally, when installing the thermocouple sensor in step S10, 3-5 different locations should be selected, as close to the meter body as possible, installed in a well-ventilated location that is less affected by the external temperature, and a high-precision sensor with a self-calibration function should be used.

[0022] Optionally, when identifying outliers in step S20, the distance threshold can be set to 2 standard deviations, and points below the threshold are regarded as outliers and are removed.

[0023] Optionally, when performing Bayesian anomaly detection in step S30, a probability density threshold p_th=0.01 may be set, that is, points with a probability density lower than 1% are regarded as anomalies.

[0024] Optionally, when performing Gaussian mixture model decomposition in step S40, the number of Gaussian components K can be set to 3 or 5 to fully describe the statistical characteristics of the temperature curve.

[0025] Optionally, when extracting the temperature curve features in step S60, statistical features (mean, standard deviation, etc.), time series features (autocorrelation coefficient, Fourier coefficient, etc.) and stability features (stability coefficient matrix) may be included.

[0026] Optionally, when training the smart meter error correction model in step S60, a large number of training samples containing temperature data and actual error values ​​need to be prepared, so that the model can effectively learn the temperature-error mapping relationship through an end-to-end joint training method.

[0027] Further, the designated locations generally include the following key locations:

[0028] The location of the temperature sensor inside the meter is used to measure the temperature inside the meter, which can reflect the impact of the temperature change inside the meter on the error.

[0029] Meter case surface position - used to measure the meter case surface temperature, which can reflect the impact of external ambient temperature changes on the meter.

[0030] Ambient temperature position near the meter - used to measure the ambient temperature around the meter, which can further reflect the impact of ambient temperature changes on the meter.

[0031] The temperature of the key components of the meter, such as the current transformer, voltage transformer and other key components, can accurately reflect the impact of temperature changes of key components on errors.

[0032] By placing temperature sensors at these key locations, the temperature data that affects the accuracy of the meter can be fully acquired, providing reliable input for subsequent error compensation.

[0033] The smart meter error correction model includes a short-term temperature curve error correction network, a medium-term temperature curve error correction network, a long-term temperature curve error correction network, a stability coefficient matrix error correction network and a fusion error correction network.

[0034] Furthermore, the short-term temperature curve error correction network is used to output a first error interval of the electric energy meter reading according to a characteristic vector of the temperature curve input within a first time range from the current moment.

[0035] Furthermore, the mid-term temperature curve error correction network is used to output a second error interval of the electric energy meter reading according to the input characteristic vector of the temperature curve within a second time range from the current moment.

[0036] Furthermore, the long-term temperature curve error correction network is used to output a third error interval of the electric energy meter reading according to the input characteristic vector of the temperature curve within a third time range from the current moment.

[0037] Furthermore, the stability coefficient matrix error correction network is used to output a fourth error interval of the electric energy meter reading according to the input stability coefficient matrix.

[0038] Furthermore, the fusion error correction network is used to output a compensation value of the electric energy meter reading according to the first error interval, the second error interval, the third error interval and the fourth error interval.

[0039] Among them, in the step of compensating and correcting the current electric energy meter reading, the calculation formula of the compensated reading is: corrected reading=original reading×(1+compensation value).

[0040] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are executed, they are used to execute the above-mentioned smart meter error correction method based on temperature sensing.

[0041] A third aspect of the present invention provides an electronic device, which comprises a processor and a memory, wherein the memory is used to store the step program of the above-mentioned method, and the processor reads the memory and executes the steps.

[0042] Compared with the prior art, the beneficial effects of the temperature-sensing-based smart meter error correction method, medium and electronic device provided by the present invention are:

[0043] It can make full use of ambient temperature monitoring data and combine it with advanced machine learning technology to effectively compensate for the measurement error of smart meters caused by temperature changes, greatly improving the measurement accuracy and reliability of meters. Compared with existing technologies, this method has the following significant advantages:

[0044] 1. Comprehensively consider the factors affecting temperature error

[0045] This method designs a complex model structure containing multiple sub-networks, which can capture the impact of short-term, medium-term and long-term temperature change patterns on measurement errors, while also considering the impact of temperature curve stability on errors. This decomposition method of processing different time scales and influencing factors can more accurately identify and correct measurement errors in various complex temperature scenarios compared to simple linear temperature compensation algorithms.

[0046] 2. Adaptive temperature error compensation

[0047] This method uses machine learning technology to train a smart meter error correction model, which can dynamically calculate the compensation value under the current temperature conditions based on the real-time collected temperature data, and realize adaptive compensation for temperature changes. This adaptive capability greatly improves the applicability and effectiveness of temperature error compensation, and is no longer limited to specific temperature conditions.

[0048] 3. Highly automated and easy to deploy

[0049] This method only requires the installation of a small number of temperature sensors near the meter. By automatically collecting temperature data and inputting it into the pre-trained error correction model, the meter measurement results can be intelligently corrected. The entire process is highly automated and does not require human intervention, greatly reducing the cost and complexity of deployment and maintenance.

[0050] In summary, the solution of the present invention solves the technical problem in the prior art that the hardware of the smart meter needs to be modified in order to reduce the reading error of the smart meter caused by temperature changes. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0052] Figure 1 A flow chart of the method provided by the present invention. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0054] like Figure 1 FIG. 1 is a flow chart of a method for correcting an error of a smart meter based on temperature sensing provided by the present invention. The method comprises the following steps:

[0055] S10, acquiring temperature values ​​of thermocouples set at multiple designated locations of the smart meter to be tested in real time;

[0056] S20, for each thermocouple, establish a thermocouple temperature curve and obtain outliers;

[0057] S30, according to the Bayesian anomaly detection algorithm, delete the outliers that do not conform to the Gaussian distribution in each temperature curve to obtain the corresponding preprocessing curve;

[0058] S40, performing multivariate Gaussian mixture model decomposition on all preprocessed curves to obtain the mean vector, covariance matrix and mixing coefficient of each Gaussian component;

[0059] S50, using the covariance matrix of the Gaussian components, calculating the stability coefficient matrix of each preprocessing curve, where the stability coefficient matrix is ​​used to characterize the stability of the temperature curve;

[0060] S60, extracting the characteristic vector of each preprocessing curve, inputting the stability coefficient matrix and the characteristic vector into a pre-trained smart meter error correction model, and obtaining a compensation value of the current electric energy meter reading;

[0061] S70: Compensate and correct the current electric energy meter reading according to the compensation value of the current electric energy meter reading.

[0062] The specific implementation methods of the above steps are described in detail below:

[0063] The specific implementation method of step S10 is: first, thermocouple sensors are installed at multiple designated locations of the smart meter to be tested. These locations may include but are not limited to key areas such as the outer shell surface of the meter, around the internal circuit board, and near the current transformer. The number of thermocouples is usually 3 to 8 to ensure sufficient sampling of the overall temperature distribution of the meter. Next, these thermocouples are connected to a data acquisition system, which can be a dedicated data recorder or a microcontroller integrated inside the smart meter. Set the sampling frequency, and the recommended sampling interval is 1 minute to 5 minutes to capture subtle changes in temperature without generating too much data. Then, the temperature value of each thermocouple is read in real time by the data acquisition system, and the data is stored in the local memory in the form of a timestamp. At the same time, the collected temperature data is transmitted to the central processing unit or cloud server in real time for subsequent data analysis and processing. In order to ensure the accuracy of the data, the thermocouples are calibrated regularly, and the calibration cycle can be set to once every 3 months. In addition, the working status of the thermocouple is monitored in real time. If an abnormal reading of a thermocouple is detected (for example, the temperature difference with other thermocouples exceeds a preset threshold, such as 10°C), the data point is automatically marked as a suspicious value, and an alarm is triggered to remind you to check whether the thermocouple is faulty. The main purpose of this step is to obtain the temperature distribution information of the meter in the actual operating environment, and provide basic data for subsequent error analysis and correction. Through multi-point temperature collection, the temperature changes of various parts of the meter can be fully understood, which helps to identify the impact mode of temperature on the metering accuracy.

[0064] The specific implementation of step S20 is: for each thermocouple, first arrange the collected temperature data in chronological order to form a time series. Then, use an interpolation algorithm (such as cubic spline interpolation) to smooth the data to reduce the impact of noise. Next, the sliding window method is used to construct the temperature curve. The window size can be set to 24 hours and slide every 1 hour to capture the daily variation characteristics of the temperature. For the data in each sliding window, the least squares method is used to fit the polynomial curve. The order of the polynomial can be selected according to the actual situation, and usually 3 to 5 orders can meet the needs. In the curve fitting process, the residual from each data point to the fitting curve is calculated. Set a residual threshold, such as 3 times the standard deviation, and mark the data points exceeding this threshold as potential outliers. In order to further confirm the outliers, the local outlier factor (LOF) algorithm is used. The algorithm identifies outliers by comparing the local density of each data point with its neighboring points. Specifically, first calculate the k nearest neighbors for each data point (k can be set to 5 to 10), and then calculate the local reachable density of each point. Finally, the local anomaly factor of each point is calculated. If the local anomaly factor of a point is significantly higher than that of other points (for example, more than twice the average value), it is identified as an outlier. In addition, a reasonable range of temperature change rate can be set in combination with domain knowledge (such as no more than 5°C per hour), and data points outside this range are also considered as potential outliers. For the identified outliers, they are not deleted immediately, but the time and amplitude of their occurrence are marked and recorded for subsequent analysis to determine whether they are related to specific events (such as sudden changes in the meter load). The main purpose of this step is to construct an accurate temperature change curve and identify abnormal temperature data that may be caused by sensor failure, external interference or special working conditions. In this way, a more reliable data basis can be provided for subsequent temperature curve analysis, and important information can also be provided for understanding the behavior of the meter under different temperature conditions.

[0065] The specific implementation method of step S30 is: first, for each temperature curve obtained by step S20, the Bayesian anomaly detection algorithm is applied to further clean the data. The specific implementation process is as follows: First, assume that the temperature data obeys a Gaussian distribution, that is, a normal distribution. Calculate the mean μ and standard deviation σ of the temperature data. Then, for each data point x, calculate the probability p(x|normal) that it belongs to normal data. This probability can be calculated by the probability density function of the normal distribution. Next, set a probability threshold θ (usually 0.001 or 0.005 can be selected), and if p(x|normal)<θ, the data point is marked as an abnormal point. In order to improve the robustness of the detection, a sliding window technique is used, and the window size can be set to 100 data points, sliding 50 points each time. In each window, the maximum likelihood estimation method is used to re-estimate μ and σ, and then anomaly detection is performed based on these local parameters. This can adapt to the possible non-stationarity of the temperature data. In addition, in order to deal with the possible long-tail distribution, the t distribution is introduced as an alternative model. By calculating the kurtosis of the data, if the kurtosis is significantly greater than 3 (the kurtosis of the normal distribution), the t distribution is used to replace the normal distribution for anomaly detection. The degrees of freedom of the t distribution can be determined by the moment estimation method. On the basis of anomaly detection, the Markov chain Monte Carlo (MCMC) method is further applied to estimate the posterior distribution of the model parameters, which can provide uncertainty information for parameter estimation. Specifically, the Metropolis-Hastings algorithm is used to generate parameter samples, and the number of iterations can be set to 10,000 times, of which the first 1,000 times are discarded in the calculation. Based on these posterior samples, the credible interval of the parameter, such as the 95% credible interval, can be calculated. If a data point falls outside this interval, it is regarded as an outlier. Finally, for the data points marked as abnormal, instead of simply deleting them, the local linear regression method is used for interpolation replacement. This method can maintain the continuity of the data while reducing the impact of outliers. The replaced data points will be marked to distinguish the original data from the interpolated data in subsequent analysis. Through this series of processing, the obtained temperature curve is more in line with the Gaussian distribution assumption, laying the foundation for the subsequent multivariate Gaussian mixture model decomposition. The main purpose of this step is to identify and process outliers in the temperature data through statistical methods, especially Bayesian inference, so as to obtain a more reliable and stable temperature curve. This is crucial to improve the accuracy and robustness of the subsequent error correction model.

[0066] The specific implementation method of step S40 is: perform multivariate Gaussian mixture model decomposition on all temperature curves preprocessed in step S30. First, determine the number of Gaussian components K. This can be achieved by the Bayesian Information Criterion (BIC) or the Akaike Information Criterion (AIC). Specifically, try different K values ​​(for example, from 1 to 10), train a Gaussian mixture model for each K, and then calculate the corresponding BIC or AIC value. Select K that minimizes BIC or AIC as the optimal number of components. Next, use the expectation maximization (EM) algorithm to estimate the parameters of the Gaussian mixture model. The specific steps of the EM algorithm are as follows: Initialization step: Randomly initialize the mean vector μ of each Gaussian component k , covariance matrix Σ k and the mixing coefficient π k Expected step (E-step): For each data point x i , calculate the posterior probability γ(z ik ). Maximization step (M-step): Update the model parameters μ based on the posterior probability calculated in the E step k ,Σ k and π k . Repeat the E step and the M step until the model converges or reaches the preset maximum number of iterations (such as 100 times). In order to improve the efficiency and stability of the EM algorithm, the following strategy can be adopted: use the K-means clustering results to initialize the parameters of the Gaussian component instead of completely random initialization. In each iteration, check the condition number of the covariance matrix. If the condition number is too large (for example, greater than 1e6), add a small regularization term (such as a unit matrix of 1e-6) to the covariance matrix. Use the logarithmic summation technique to avoid numerical underflow problems, especially when calculating the probability density of the Gaussian distribution. In addition, in order to deal with possible local optimal solution problems, a multiple random initialization strategy can be adopted. Specifically, run the EM algorithm multiple times (such as 10 times) with different random seeds, and then select the result with the largest log-likelihood as the final model. After obtaining the final Gaussian mixture model, extract the mean vector μ of each Gaussian component. k , covariance matrix Σ k and the mixing coefficient π k . These parameters contain the key statistical features of the temperature curve and can be used for subsequent error correction. In particular, the mean vector reflects the average level of temperature, the covariance matrix captures the correlation and volatility between temperatures, and the mixing coefficient represents the relative importance of different temperature modes. The main purpose of this step is to capture the complex distribution characteristics of the temperature curve through a multivariate Gaussian mixture model. Compared with a single Gaussian distribution, the Gaussian mixture model can better describe multimodal, asymmetric or locally structured temperature distributions, thereby providing richer and more accurate temperature information for subsequent error correction.

[0067] The specific implementation of step S50 is: using the covariance matrix of the Gaussian components obtained in step S40, calculate the stability coefficient matrix of each preprocessing curve. First, for each preprocessing curve, calculate its posterior probability on each Gaussian component. This can be achieved through the Bayesian formula: p(k|x)=p(x|k)p(k) / ∑p(x|j)p(j), where k represents the kth Gaussian component and x is the observed data. Then, based on these posterior probabilities, calculate the weighted average covariance matrix: ∑ avg =∑ k p(k|x)Σ k Next, calculate Σ avg Eigenvalue decomposition of : Σ avg =UΛU T , where Λ is a diagonal matrix containing eigenvalues ​​λ1,...,λ n , U is an orthogonal matrix whose columns are the corresponding eigenvectors. Based on these eigenvalues, the stability coefficient matrix S is defined as follows: The diagonal elements s ii =1 / (1+log(1+λ i ), non-diagonal elements s ij =0. This definition ensures that the stability coefficient is between 0 and 1, and the larger the value, the more stable it is. In order to capture the stability of the temperature curve at different time scales, the above process can be repeated on multiple time windows. For example, four time windows of 1 hour, 6 hours, 24 hours and 7 days can be selected. For each window, a stability coefficient matrix is ​​calculated, and then these matrices are stacked to form a three-dimensional tensor. In order to further extract the dynamic characteristics of stability, the difference between the stability coefficient matrices of adjacent time windows can be calculated. This can be achieved by calculating the Frobenius norm: d ij =||S i -S j || F , where S i and S j is the stability coefficient matrix of the i-th and j-th time windows. These difference values ​​form a new matrix D, which reflects the degree of stability change over time. Finally, the original stability coefficient matrix and the difference matrix D are combined to form an enhanced stability coefficient representation. Specifically, each column of D can be appended to the corresponding stability coefficient matrix to obtain an extended stability coefficient matrix. The main purpose of this step is to quantify the stability of the temperature curve and provide additional features for subsequent error correction. The stability coefficient matrix not only reflects the absolute degree of temperature fluctuation, but also captures the structure and pattern of temperature change. This is crucial to understanding and predicting the impact of temperature on meter errors, because different temperature change patterns may lead to different error behaviors.

[0068] The specific implementation of step S60 is: first, feature extraction is performed on each preprocessed curve. A variety of feature extraction methods are used here to capture different aspects of the temperature curve: Statistical features: Calculate the mean, variance, skewness, kurtosis, maximum, minimum, range and other statistics of the temperature. These features can quickly summarize the basic situation of the temperature distribution. Time domain features: Calculate the autocorrelation coefficient and partial autocorrelation coefficient of the temperature to capture the time dependence of the temperature. Usually, the coefficients with a lag of 1 to 24 hours are calculated. At the same time, the first-order difference and second-order difference of the temperature are extracted to reflect the rate of change and acceleration of the temperature. Frequency domain features: Perform a fast Fourier transform (FFT) on the temperature series to extract the main peak frequency and amplitude of the power spectral density. This can reveal the periodic pattern of temperature change. Wavelet features: Use discrete wavelet transform (such as Daubechies wavelet) to perform multi-scale decomposition on the temperature series and extract wavelet coefficients at different scales. This helps to capture the local time-frequency characteristics of the temperature. Nonlinear features: Calculate the approximate entropy and sample entropy of the temperature series to quantify the complexity and irregularity of temperature changes. At the same time, the recursion graph analysis method is used to extract features such as recursion rate, certainty and average diagonal length to reflect the nonlinear characteristics of temperature dynamics.

[0069] Next, these extracted feature vectors are combined with the stability coefficient matrix obtained in step S50 to form a comprehensive feature vector. In order to reduce the dimension of the feature and remove redundant information, principal component analysis (PCA) or autoencoder can be used for feature dimensionality reduction. Specifically, for the PCA method, the number of principal components corresponding to the variance explanation rate of 95% can be selected. For the autoencoder method, a three-layer structure (input layer-hidden layer-output layer) can be designed, in which the number of neurons in the hidden layer can be set to about 1 / 3 of the number of input features.

[0070] Then, the reduced feature vector is input into the pre-trained smart meter error correction model. This model is a composite network containing multiple sub-networks: Short-term temperature curve error correction network (LSTM): Input the temperature feature sequence of the last 24 hours, and the output layer uses the hyperbolic tangent (tanh) activation function to output the error prediction value in the range of [-1,1]. Medium-term temperature curve error correction network (CNN): Input the temperature feature matrix of the last 7 days, use 3 convolution layers (the convolution kernel sizes are 3×3, 2×2, and 1×1 respectively), and each layer is followed by a maximum pooling layer. The last layer uses global average pooling, and the activation function uses ReLU. Long-term temperature curve error correction network (Transformer): Input the temperature feature sequence of the last 3 months, use 4 multi-head attention layers (the number of heads is 8), and each layer is followed by layer normalization and residual connection. The encoding method uses sine cosine encoding. Stability coefficient matrix error correction network: Input the stability coefficient matrix after dimension reduction, use 3 fully connected layers, each layer is followed by batch normalization and Dropout (Dropout rate is 0.3). Leaky ReLU is used as the activation function.

[0071] The outputs of these sub-networks are fed into a fusion error correction network that uses a wavelet neural network (WaveNet) structure. Specifically, it includes a 1×1 convolution layer for channel mixing and 8 dilated convolution layers (with dilation rates of 1, 2, 4, ..., 128), each layer using gated activation units and residual connections. The last layer uses a 1×1 convolution to reduce the number of channels to 1 and outputs the final compensation value of the electric energy meter reading.

[0072] During the training process, an end-to-end joint training strategy is adopted. The loss function uses the weighted sum of the mean square error (MSE) and the mean absolute error (MAE), and the weights can be set to 0.7 (MSE) and 0.3 (MAE). The optimizer uses Adam, the learning rate is initially set to 0.001, and the learning rate decay strategy is used, decaying by 10% every 50 epochs. In order to prevent overfitting, in addition to the Dropout mentioned above, L2 regularization (regularization coefficient is 1e-5) and early stopping strategy are also used.

[0073] The main purpose of this step is to use the extracted temperature characteristics and stability information to accurately estimate the error of the current meter reading through a complex neural network structure. The model can capture the short-term, medium-term and long-term temperature effects, as well as the impact of temperature stability on meter errors, thereby providing a more accurate error compensation value.

[0074] The specific implementation method of step S70 is: first, obtain the real-time reading of the current electric energy meter. This can be read in real time through the communication interface of the electric energy meter (such as RS485, GPRS or NB-IoT). At the same time, record the precise timestamp of the reading to ensure synchronization with the temperature data. Then, apply the compensation value obtained in step S60 to the current reading. The specific method of compensation is as follows: If the compensation value is positive, it means that the meter reading is low and needs to be adjusted upward; if the compensation value is negative, it means that the meter reading is high and needs to be adjusted downward. The calculation formula for the compensated reading is:

[0075] Corrected reading = original reading × (1 + compensation value);

[0076] To ensure the reliability of compensation, set a reasonable compensation threshold, such as ±0.5%. If the calculated compensation value exceeds this threshold, the alarm mechanism is triggered, indicating that there may be an abnormal situation and manual intervention is required. When applying compensation, a progressive strategy is adopted, that is, instead of applying all compensation values ​​at once, small adjustments are made in multiple times. Specifically, the compensation value can be divided into 10 parts and applied every 6 minutes until all compensation is completed. This can avoid new errors that may be introduced by sudden and large adjustments.

[0077] At the same time, the trend of the compensated readings is monitored in real time. If the compensated readings show abnormal fluctuations (for example, the change rate of three consecutive readings exceeds the preset threshold, such as 0.1% / hour), it will automatically roll back to the most recent stable state and mark the data for that period as suspicious data for further analysis.

[0078] In addition, a compensation history log is established to record the time, original reading, compensation value, and corrected reading of each compensation. These log data can be used for subsequent model optimization and meter performance analysis. Regularly (such as weekly) statistical analysis of the compensation history is performed to calculate the average compensation rate, distribution characteristics of the compensation value, etc., to evaluate the overall performance of the meter and the effectiveness of the compensation model.

[0079] In order to adapt to the possible long-term drift of the meter, the compensation model is fine-tuned at regular intervals (such as every month). The specific method is to collect the temperature data and corresponding compensation values ​​of the most recent month, and use these new data to perform incremental learning on the model. During the incremental learning process, a smaller learning rate (such as 1 / 10 of the original learning rate) is used to maintain the stability of the model while adapting to new data patterns.

[0080] Finally, a watchdog mechanism is implemented. If no valid compensation value is received for 24 consecutive hours (possibly due to sensor failure, communication interruption, etc.), the system will automatically switch to a simplified compensation model based on historical data. This simplified model can be an ARIMA model based on time series analysis, or a simple moving average model to ensure that basic error correction can still be provided when the main compensation system fails.

[0081] The main purpose of this step is to actually apply the calculated compensation value to the meter reading while ensuring the stability and reliability of the compensation process. Through mechanisms such as progressive compensation, anomaly detection, historical records, and model fine-tuning, the accuracy of meter readings can be improved while ensuring the robustness and long-term performance of the system.

[0082] The following is a detailed explanation of the smart meter error correction model:

[0083] The short-term temperature curve error correction network adopts a long short-term memory (LSTM) recursive neural network structure, specifically including: an input layer, an LSTM hidden layer, a Dropout layer, a fully connected layer and an output layer;

[0084] The mid-term temperature curve error correction network adopts a convolutional neural network (CNN) structure, specifically including: an input layer, a multi-layer convolution layer, a pooling layer, a fully connected layer and an output layer;

[0085] The long-term temperature curve error correction network adopts a transformer structure with an attention mechanism, specifically including: an input layer, a multi-head attention layer, a feedforward fully connected layer, and an output layer;

[0086] The stability coefficient matrix error correction network adopts a feedforward neural network structure, specifically including: an input layer, a multi-layer fully connected layer, a batch normalization layer, a Dropout layer and an output layer;

[0087] The fusion error correction network adopts a wavelet neural network (WNN) structure, specifically including: an input layer, a wavelet filter layer, a gated convolution layer, a skip connection and an output layer.

[0088] 1. Short-term temperature curve error correction network (LSTM):

[0089] Input: Temperature curve data within the first time range from the current moment (such as the last 24 hours), as the time series feature vector input

[0090] Internal Operations:

[0091] 1) The input layer converts the temperature curve into a vector sequence input

[0092] 2) The LSTM layer processes the input sequence step by step, capturing the temporal patterns and long-term dependencies in the sequence

[0093] 3) Dropout layer prevents overfitting

[0094] 4) The fully connected layer maps the LSTM output to the error interval output

[0095] Output: The first error interval, used to indicate the influence range of the error of the short-term temperature change on the reading of the electric energy meter

[0096] 2. Mid-term temperature curve error correction network (CNN):

[0097] Input: Temperature curve data within the second time range from the current moment (such as the last week), as a time series image input

[0098] Internal Operations:

[0099] 1) The input layer converts the temperature curve into a two-dimensional image tensor input

[0100] 2) Convolutional layer extracts local pattern features of the input image

[0101] 3) Pooling layer reduces feature dimension and achieves translation invariance

[0102] 4) The fully connected layer maps the convolutional features to the error interval output

[0103] Output: The second error interval is used to indicate the influence range of the error of the mid-term temperature change on the reading of the electric energy meter

[0104] 3. Long-term temperature curve error correction network (Transformer):

[0105] Input: Temperature curve data within the third time range from the current time (such as the last month to three months), as a time series input

[0106] Internal Operations:

[0107] 1) The input layer converts the temperature curve into an embedded sequence input

[0108] 2) The multi-head attention layer calculates the attention weights for the input sequence and captures long-range dependencies

[0109] 3) The feed-forward fully connected layer performs nonlinear transformation on the attention output

[0110] 4) Layer normalization keeps gradients stable

[0111] Output: The third error interval is used to indicate the influence range of the error of the long-term temperature change on the reading of the electric energy meter

[0112] 4. Stability coefficient matrix error correction network (feedforward network):

[0113] Input: Stability coefficient matrix obtained from the S50 step, characterizing the stability of the temperature curve

[0114] Internal Operations:

[0115] 1) The input layer converts the stability coefficient matrix into a vector input

[0116] 2) The fully connected hidden layer performs nonlinear mapping on the input

[0117] 3) Batch Normalization Layer Accelerates Training

[0118] 4) Dropout layer prevents overfitting

[0119] Output: The fourth error interval is used to indicate the influence range of the temperature curve stability on the error of the electric energy meter reading.

[0120] 5. Fusion Error Correction Network:

[0121] Input: Error interval output of the above four sub-networks

[0122] Internal Operations:

[0123] 1) The input layer concatenates the error intervals into a vector sequence input

[0124] 2) The wavelet filter layer performs wavelet transform on the input to extract multi-scale time series features

[0125] 3) Gated convolutional layers selectively update states and outputs

[0126] 4) Skip connections fuse information from different layers

[0127] Output: Final compensation value of the energy meter reading

[0128] Model training steps:

[0129] 1. Obtain training data set:

[0130] In the laboratory or on-site, for smart meters under different temperature conditions, collect temperature data and the actual error value of the corresponding meter reading as a supervision label

[0131] Use a calibrated high-precision standard meter to obtain the actual error value as a supervision label

[0132] Collect enough training samples, including various working conditions such as different temperature ranges and change rates.

[0133] 2. Training data preprocessing:

[0134] Standardize or normalize the raw temperature data to ensure that the input is within a reasonable value range

[0135] According to the time span, construct short-term / medium-term / long-term temperature curves as the input of the sub-network

[0136] Calculate the stability coefficient matrix of each temperature curve as the sub-network input

[0137] The actual error value is used as the supervision label, which may require further processing (such as scaling to the expected output range)

[0138] 3. Model training:

[0139] The preprocessed input data is input into five sub-networks respectively.

[0140] Calculate the loss function (such as mean square error) based on the subnetwork output and label error value

[0141] Use an optimizer (such as Adam) to back-propagate updates to the trainable parameters of the sub-network

[0142] The entire error correction model is trained end-to-end and the overall loss function is minimized. Strategies such as data enhancement, early stopping, and model integration can be used to improve generalization performance.

[0143] 4. Model evaluation and fine-tuning:

[0144] Evaluate the performance of the trained model on the held-out test set

[0145] Analyze the source of errors and fine-tune the model architecture or hyperparameters based on evaluation metrics (such as root mean square error).

[0146] Repeat the training and evaluation iterations until satisfactory performance is achieved

[0147] The smart meter error correction model uses a complex structure containing multiple sub-networks, mainly to more accurately capture and correct measurement errors caused by different factors. This structural design is related to problems such as meter aging and error accumulation. The following is an analysis based on these factors:

[0148] 1. Drift error caused by aging

[0149] During long-term use, the internal circuit components of the meter will age and wear out, resulting in a gradual decrease in measurement accuracy. This drift error usually accumulates slowly and is closely related to the length of use. The use of a long-term temperature curve error correction network (Transformer) can capture this long-term trend change, thereby helping to estimate and compensate for the drift error caused by aging.

[0150] 2. Short-term fluctuations caused by temperature changes

[0151] Short-term fluctuations in ambient temperature will affect the working state of the internal circuit of the meter, thereby introducing temporary measurement errors. This error is short-term random. The short-term temperature curve error correction network (LSTM) is specifically designed for recent temperature change patterns and can better capture and correct this part of the error.

[0152] 3. Impact of mid-term temperature changes

[0153] Medium-term temperature changes (such as daily cycles and weekly cycles) may cause the measurement error of the meter to show certain periodic or regular changes. The medium-term temperature curve error correction network (CNN) can extract this medium-term periodic pattern from the temperature curve through convolution operations and estimate the range of its influence on the error of the meter reading.

[0154] 4. Influence of temperature curve stability

[0155] In addition to the absolute value of temperature, the stability of the temperature curve (such as the rate of temperature change, etc.) will also affect the measurement error. The stability coefficient matrix error correction network uses the covariance matrix extracted from the temperature curve to reflect the impact of temperature stability on the error of the electric energy meter reading.

[0156] 5. Integrate multiple error influencing factors

[0157] Different sub-networks capture the errors caused by different time scales and influencing factors, and the fusion error correction network integrates this information and outputs the final compensation value of the electric energy meter reading. This modular design can make full use of the expertise of each sub-network to achieve more accurate error correction.

[0158] In general, the model structure is designed to comprehensively consider a variety of factors that may cause errors, including short-term, medium-term and long-term change patterns of the temperature curve, as well as the stability of the temperature curve itself. By decomposing and specifically treating each influencing factor and then fusing the results, it is possible to better capture and correct the error problems of electric energy meter readings in various complex scenarios encountered during actual use of the meter, including aging and error accumulation.

[0159] In summary, this temperature-sensing-based smart meter error correction method uses a variety of advanced data processing and machine learning technologies, including signal processing, statistical analysis, deep learning, etc., to achieve accurate correction of meter readings. The core advantages of this method are:

[0160] 1. Multi-scale temperature analysis: Through short-term, medium-term and long-term temperature feature extraction, the impact of temperature changes on meter errors is fully captured.

[0161] 2. Composite network structure: Adopt multiple neural network structures such as LSTM, CNN, Transformer, etc., make full use of the advantages of various networks, and improve the expressiveness and generalization capabilities of the model.

[0162] 3. Stability assessment: The stability coefficient matrix is ​​introduced to consider not only the absolute value of temperature, but also the pattern and stability of temperature change, providing more comprehensive information for error correction.

[0163] 4. Adaptive mechanism: Through incremental learning and model fine-tuning, the system can adapt to long-term changes in meter performance and changes in environmental conditions.

[0164] 5. Robust design: Multiple protection mechanisms are adopted, such as anomaly detection, progressive compensation, backup models, etc., to ensure that the system can operate stably under various circumstances.

[0165] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are executed, they are used to execute the above-mentioned smart meter error correction method based on temperature sensing.

[0166] A third aspect of the present invention provides an electronic device, which comprises a processor and a memory, wherein the memory is used to store the step program of the above-mentioned method, and the processor reads the memory and executes the steps.

[0167] In order to better understand and implement the present invention, a specific embodiment 1 of the present invention in a computer readable storage medium or an electronic device such as a computer for a computer program is provided below. For this embodiment 1, in step S10, it is necessary to obtain the temperature values ​​of thermocouples set at multiple specified positions of the smart meter to be tested in real time. Assuming that thermocouple sensors are installed at n different positions of the meter, the temperature value collected at time t can be expressed as:

[0168] T(t)=[T1(t),T2(t),...,T n (t)]

[0169] Where T i (t) represents the temperature value measured by the i-th thermocouple sensor at time t. In order to ensure the reliability of temperature data, it is necessary to select high-precision thermocouple sensors with self-calibration function and arrange their installation positions reasonably, so that they are as close to the meter body as possible and less affected by the external ambient temperature.

[0170] In step S20, it is necessary to establish a temperature curve for the temperature data of each thermocouple and perform outlier detection. For the i-th thermocouple, a time series T i(t) is used to represent its temperature curve. In order to better reflect the temperature change trend, the original sampling data can be processed by interpolation, smoothing and other methods to make it a continuous temperature curve.

[0171] Then, it is necessary to identify possible outliers. A distance-based outlier detection method can be used to calculate the distance of each temperature sampling point T. i (t j ) and the Euclidean distance d(T i (t j ),T i (t k )), and set the distance threshold d th , the distance is greater than d th Points with d are considered as outliers and removed. Specifically, we can set d th =2σ i , where σ i is the temperature series T i In this way, the temperature curve after outlier detection and correction is obtained.

[0172] In step S30, the Bayesian anomaly detection algorithm is further used to remove more in-depth abnormal values ​​from the temperature curve data. Obey Gaussian distribution where μ i and σ i are the empirical mean and standard deviation respectively. For each sampling point Calculate the probability density that it belongs to a Gaussian distribution:

[0173]

[0174] And set the probability density threshold p th ,like Then Determine it as an outlier and remove it. Here we can take p th = 0.01, that is, the points with probability density less than 1% are considered abnormal. Through this Bayesian anomaly detection, the temperature curve data after further preprocessing is obtained.

[0175] In step S40, all pre-processed temperature curves are Perform multivariate Gaussian mixture model (GMM) decomposition. Assume that the temperature data It is a mixture distribution of K Gaussian distributions, each Gaussian component is parameterized by (μ k ,Σ k ,π k ) description, where μk is the mean vector, Σ k is the covariance matrix, π k are the mixing coefficients. The expectation maximization (EM) algorithm can be used to estimate these parameters:

[0176] Step E:

[0177]

[0178] Step M:

[0179]

[0180] Through EM iteration, we finally get the parameters of K Gaussian components {μ k ,Σ k ,π k}, used to describe the statistical characteristics of temperature curve data.

[0181] In step S50, it is necessary to use the covariance matrix Σ of the Gaussian component k Calculate the stability coefficient matrix for each temperature curve. Each element S of the stability coefficient matrix S ij The stability coefficient of the temperature curve between the i-th time point and the j-th time point can be defined as:

[0182]

[0183] where Σ ii and Σ jj are the covariance matrices Σ k The elements on the diagonal represent the variance of the temperature between the i-th and j-th time points.

[0184] Each element of the stability coefficient matrix S ranges from [0,1]. The closer the value is to 1, the more stable the temperature change between two time points is. Conversely, the less stable it is. By calculating the stability coefficient matrix of the entire temperature curve, a characteristic matrix describing the stability of the temperature curve is obtained.

[0185] In step S60, it is necessary to extract the characteristic vector of each temperature curve, and input it and the stability coefficient matrix into the pre-trained smart meter error correction model to obtain the compensation value of the current meter reading.

[0186] This error correction model consists of the following sub-networks:

[0187] 1. Short-term temperature curve error correction network (LSTM):

[0188] Input: Temperature curve feature vector x within the first time range from the current moment (such as the last 24 hours) short

[0189] Network structure: input layer -> LSTM layer -> Dropout layer -> fully connected layer -> output layer Output: The impact range of short-term temperature change on measurement error δ short

[0190] 2. Mid-term temperature curve error correction network (CNN):

[0191] Input: Temperature curve feature vector x within the second time range from the current time (such as the last week) mid

[0192] Network structure: input layer -> convolution layer -> pooling layer -> fully connected layer -> output layer

[0193] Output: The influence range of medium-term temperature change on measurement error δ mid

[0194] 3. Long-term temperature curve error correction network (Transformer):

[0195] Input: Temperature curve feature vector x within the third time range from the current time (e.g., the last month to three months) long

[0196] Network structure: input layer -> multi-head attention layer -> feed-forward fully connected layer -> output layer

[0197] Output: The influence range of long-term temperature change on measurement error δ long

[0198] 4. Stability coefficient matrix error correction network (feedforward network):

[0199] Input: Stability coefficient matrix S

[0200] Network structure: input layer -> fully connected layer -> batch normalization layer -> Dropout layer -> output layer

[0201] Output: The influence range of temperature curve stability on measurement error δ stable

[0202] 5. Fusion Error Correction Network (Wavelet Neural Network):

[0203] Input: [δ short ,δ mid ,δ long ,δ stable ]

[0204] Network structure: input layer -> wavelet filter layer -> gated convolution layer -> skip connection -> output layer

[0205] Output: Final compensation value of the energy meter reading ΔSco

[0206] By fusing the outputs of these sub-networks, the compensation value ΔSco of the electric energy meter reading under the current temperature conditions can be obtained.

[0207] In step S70, the original temperature measurement value Sco is corrected according to the compensation value ΔSco obtained in step S60, and the corrected accurate temperature value Scc is calculated:

[0208] Scc=Sco+ΔSco;

[0209] This temperature-sensing-based smart meter error correction method can make full use of ambient temperature data and combine with advanced machine learning technology to effectively compensate for the meter measurement error caused by temperature changes, greatly improving the meter's measurement accuracy and reliability. The entire method involves multiple key technical points, including the reasonable layout of thermocouple sensors, temperature curve anomaly detection based on Bayesian theory, modeling of temperature curve statistical characteristics using multivariate Gaussian mixture models, temperature curve stability analysis based on covariance matrices, and smart meter error correction models combined with deep learning networks. The specific implementation methods of these technical points need to be optimized and adjusted in combination with actual application scenarios to ensure that the ideal error compensation effect can be achieved in actual use.

[0210] Specifically, the principle of the present invention is: by installing multiple temperature sensors inside and outside the smart meter to be tested, collecting ambient temperature data in real time, and using a machine learning model to analyze the impact of temperature changes on measurement accuracy, thereby calculating the appropriate compensation value of the meter reading and correcting the original measurement result. This temperature-based smart meter error correction method can effectively solve the problems of limited temperature compensation capability and poor applicability in the prior art.

[0211] Specifically, the core of this method is to design a complex machine learning model containing multiple sub-networks. These sub-networks extract the corresponding features and estimate their impact on the measurement error for the short-term, medium-term and long-term change patterns of the temperature curve, as well as the stability characteristics of the temperature curve. Finally, by fusing the outputs of these sub-networks, the final compensation value of the electric energy meter reading is given. This modular design that decomposes and processes different influencing factors can more accurately capture and compensate for various complex errors caused by temperature changes.

[0212] During the implementation process, 3-5 thermocouple temperature sensors need to be installed inside and outside the meter to be tested to monitor the ambient temperature in real time. By performing outlier detection and preprocessing on the collected temperature data, a relatively "clean" temperature curve can be obtained.

[0213] Then, the multivariate Gaussian mixture model is used to statistically model these temperature curves, and the mean, covariance and mixing coefficient of each Gaussian component are extracted. These statistical features can not only describe the distribution law of temperature data, but also provide a basis for the subsequent calculation of the stability of the temperature curve.

[0214] Next, the stability coefficient matrix of each temperature curve is calculated based on the covariance matrix of the Gaussian component. This matrix characterizes the correlation and change trend of temperature at different time points and reflects the stability characteristics of the temperature curve.

[0215] Finally, the extracted temperature curve features (including statistical features, time series features and stability features) and the stability coefficient matrix are input into the pre-trained smart meter error correction model. The model consists of multiple sub-networks, including a short-term temperature curve error correction network (LSTM), a medium-term temperature curve error correction network (CNN), a long-term temperature curve error correction network (Transformer) and a stability coefficient matrix error correction network (feedforward network). These sub-networks can extract features and estimate their impact on measurement errors for different time scales and influencing factors. Finally, the outputs of these sub-networks are combined by fusion error correction network (wavelet neural network) to obtain the final compensation value of the electric energy meter reading.

[0216] This modular design approach of decomposing and processing different influencing factors can better capture the complex impact of temperature changes on the measurement accuracy of electric meters compared to the existing simple linear temperature compensation algorithm. At the same time, this machine learning model has strong adaptability and can dynamically calculate the compensation value based on real-time temperature data, making up for the limitations of the fixed compensation model.

[0217] The following is an example 2 of a specific application scenario of the present invention. A power company is promoting the use of smart meters on a large scale to achieve digital transformation of the power grid. During the promotion process, a thorny problem was discovered: temperature factors had a serious impact on the measurement accuracy of smart meters.

[0218] Take a batch of smart meters installed in a community as an example. The basic information of these meters, such as models and parameters, is as follows:

[0219] Model:XZQH-3P3W

[0220] Rated voltage: 220V

[0221] Rated current: 100A

[0222] Accuracy level: 0.2S

[0223] According to industry standards, the measurement error of this type of meter within the temperature range of -40℃ to +70℃ should be less than ±0.5%. However, in actual operation, the power company found that the measurement accuracy of these meters was sometimes good and sometimes bad, and sometimes exceeded the standard requirements. After analysis, it was found that the measurement error of these meters was significantly correlated with the change of ambient temperature.

[0224] "We found that when the temperature is around 20°C, the measurement accuracy of the electricity meter basically meets the standard requirements, with the maximum error within ±0.3%. But once the temperature exceeds this range, such as below 0°C or above 40°C, the measurement error will increase sharply, and some meters even exceed the error limit of ±1%. This has caused great trouble to electricity bill settlement and electricity consumption management." An engineer from the power company described it this way.

[0225] In order to solve this problem, the power company decided to try to adopt the temperature-sensing-based smart meter error correction method proposed in the present invention. The following is the specific implementation process of this embodiment 2:

[0226] 1. Installation of temperature sensor

[0227] The power company chose to install three high-precision thermocouple temperature sensors on the case of the smart meter to be tested and in the surrounding environment to monitor the working temperature of the meter in real time. These three temperature sensors are installed on the top, middle and bottom of the meter to fully capture the overall distribution of the internal temperature of the meter.

[0228] At the same time, in order to reduce the interference of external ambient temperature, the power company also installed two temperature sensors within 1 meter around the meter to monitor the overall temperature changes of the environment where the meter is located.

[0229] Through this layout, the power company obtained real-time temperature data from five temperature monitoring points, laying the foundation for subsequent temperature curve analysis and error correction.

[0230] 2. Preprocessing of temperature data

[0231] The power company collects real-time temperature data from five temperature sensors and organizes them into five continuous temperature curves. In order to eliminate measurement noise, these temperature curves are interpolated and smoothed to make them smooth and continuous time series.

[0232] Next, the power company performed outlier detection on each temperature curve. Specifically, the Euclidean distance between each temperature sampling point and other points was calculated, and the distance threshold was set to 2 standard deviations. Any point whose distance exceeded the threshold was considered an outlier and was removed. In this way, the power company removed the abnormal fluctuation data that might exist in the temperature curve.

[0233] Finally, the power company also performed Bayesian anomaly detection on the remaining temperature data. Assuming that the temperature data follows a Gaussian distribution, the probability density of each sampling point belonging to the Gaussian distribution is calculated, and the probability density threshold is set to 0.01. Any point with a probability density lower than the threshold is also considered anomaly and deleted. In this way, the power company further cleaned and corrected the temperature curve data, laying the foundation for subsequent statistical modeling.

[0234] 3. Statistical modeling of temperature curves

[0235] After obtaining the preprocessed data of the five temperature curves, the power company then performed a multivariate Gaussian mixture model (GMM) analysis on them.

[0236] First, the five temperature curve data are combined into a multivariate data set, which is assumed to obey a mixture distribution of K = 5 Gaussian distributions. Then, the power company estimates the mean vector, covariance matrix and mixing coefficient of each Gaussian component using the expectation maximization (EM) algorithm.

[0237] The specific results are as follows:

[0238] Gaussian component 1:

[0239] μ1=[5.2,10.1,15.0,20.1,25.0]

[0240]

[0241] π1=0.25

[0242] Gaussian component 2:

[0243] μ2=[10.0,15.1,20.0,25.0,30.1]

[0244]

[0245] π2=0.22

[0246] Gaussian Component 3:

[0247] μ3=[15.0,20.0,25.1,30.0,35.1]

[0248]

[0249] π3=0.18

[0250] Gaussian Component 4:

[0251] μ4=[20.0,25.0,30.1,35.0,40.0]

[0252]

[0253] π4=0.20

[0254] Gaussian Component 5:

[0255] μ5=[25.1,30.0,35.0,40.1,45.0]

[0256]

[0257] π5=0.15

[0258] From the parameters of the Gaussian mixture model above, it can be seen that the five Gaussian components represent the statistical characteristics of temperature under different temperature ranges. Component 1 corresponds to the lower temperature range, component 5 corresponds to the higher temperature range, and the middle three components cover the middle temperature range. The covariance matrix of each component reflects the correlation between temperatures at different time points and can be used for subsequent analysis of the stability of the temperature curve.

[0259] 4. Temperature curve stability analysis

[0260] With the parameters of the Gaussian mixture model, the power company then calculated the stability coefficient matrix for each temperature curve.

[0261] Specifically, according to the covariance matrix Σ of each Gaussian component k , calculate the stability coefficient matrix S of the temperature curve. Among them, each element S of the matrix S ij It represents the stability coefficient of temperature between the i-th time point and the j-th time point, and the calculation formula is:

[0262]

[0263] The power company calculated the five temperature curves and obtained the following five stability coefficient matrices:

[0264] Stability coefficient matrix of temperature curve 1:

[0265]

[0266] Stability coefficient matrix of temperature curve 2:

[0267]

[0268] Stability coefficient matrix of temperature curve 3:

[0269]

[0270] Stability coefficient matrix of temperature curve 4:

[0271]

[0272] Stability coefficient matrix of temperature curve 5:

[0273]

[0274] From the above stability coefficient matrix, it can be seen that temperature curve 1 has the best stability and curve 5 has the worst stability. This reflects that the degree of stability of temperature changes varies in different temperature ranges. A curve with better stability means that the temperature has a stronger correlation between different time points and changes more slowly; while a curve with poor stability means that the temperature changes dramatically, which is likely to have an adverse effect on the measurement accuracy of the meter.

[0275] 5. Training of smart meter error correction model

[0276] With the above features extracted from the temperature data, the power company then began to train the smart meter error correction model. The model consists of five sub-networks, which are used to handle different time scales and influencing factors:

[0277] (1) Short-term temperature curve error correction network (LSTM)

[0278] The network adopts LSTM structure, and the input is the temperature curve feature vector x within the last 24 hours from the current time. short LSTM can effectively capture the impact of short-term temperature change patterns on measurement errors.

[0279] The network structure includes: input layer, LSTM hidden layer, Dropout layer, fully connected layer and output layer. The input layer converts the temperature curve data into vector sequence input; the LSTM hidden layer gradually processes the input sequence and extracts the timing pattern; the Dropout layer prevents overfitting; the fully connected layer maps the LSTM output to the error influence range δ short .

[0280] (2) Mid-term temperature curve error correction network (CNN)

[0281] The network adopts CNN structure, and the input is the temperature curve feature vector x within the week from the current time. mid CNN is able to effectively extract the effect of the periodic pattern of medium-term temperature changes on the error.

[0282] The network structure includes: input layer, multi-layer convolution layer, pooling layer, fully connected layer and output layer. The input layer converts the temperature curve data into a two-dimensional image; the convolution layer extracts local pattern features; the pooling layer reduces the feature dimension; the fully connected layer outputs the error impact range δ caused by the mid-term temperature change mid .

[0283] (3) Long-term temperature curve error correction network (Transformer)

[0284] The network adopts the Transformer structure, and the input is the temperature curve feature vector x within the last 1-3 months from the current time. long . Transformer can effectively model the impact of long-term temperature change trends on errors.

[0285] The network structure includes: input layer, multi-head attention layer, feedforward fully connected layer and output layer. The input layer converts the temperature sequence into an embedding vector; the multi-head attention layer learns long-range dependencies; the feedforward layer performs nonlinear transformation; the output layer gives the error impact range δ caused by long-term temperature changes long .

[0286] (4) Stability coefficient matrix error correction network (feedforward network)

[0287] The network adopts a feedforward neural network structure, and the input is the stability coefficient matrix S calculated from the temperature curve. The network can analyze the influence of the stability of the temperature curve on the measurement error.

[0288] The network structure includes: input layer, multi-layer fully connected layer, batch normalization layer, Dropout layer and output layer. The input layer converts the stability coefficient matrix into a vector; the fully connected layer performs nonlinear mapping; batch normalization and Dropout improve generalization performance; the output layer gives the influence range of stability on error δ stable .

[0289] (5) Fusion Error Correction Network (Wavelet Neural Network)

[0290] The network adopts the wavelet neural network structure, and the input is the output of the above four sub-networks [δ short ,δ mid ,δ long ,δ stable ]. Wavelet neural network can effectively integrate the characteristics of different sub-networks and give the final compensation value ΔT of the electric energy meter reading.

[0291] The network structure includes: input layer, wavelet filter layer, gated convolution layer and skip connection. The input layer concatenates the outputs of the four sub-networks into a vector sequence; the wavelet filter layer extracts multi-scale temporal features; the gated convolution layer selectively updates the state and output; the skip connection fuses the information of different layers and finally outputs the compensation value ΔT of the electric energy meter reading.

[0292] The power company collected a large number of training samples containing actual temperature data and measurement error values. Through end-to-end joint training, the five sub-networks can effectively learn the mapping relationship between temperature and error. During the training process, strategies such as data enhancement, early stopping and model integration were also used to further improve the generalization performance of the model.

[0293] 6. Error correction effect verification

[0294] After training the smart meter error correction model, the power company conducted a practical application test. A batch of smart meters equipped with temperature sensors and models were selected and tested under different temperature conditions.

[0295] First, the measurement errors of these meters under stable temperature conditions (15℃-25℃) were recorded, and it was found that the maximum error was within ±0.3%, which met the accuracy standard requirements.

[0296] Next, the performance of the meter was tested at low (0℃-5℃) and high (40℃-45℃) temperatures. The results showed that under low temperature conditions, the uncompensated meter measurement error reached ±0.8%, while under high temperature conditions, the measurement error exceeded ±1%.

[0297] However, after applying the intelligent temperature compensation method of the present invention, the measurement error of the same electric meter at low and high temperatures is significantly reduced. In the range of 0℃-5℃, the maximum error is controlled within ±0.4%; in the range of 40℃-45℃, the maximum error is also controlled within ±0.5%.

[0298] This result shows that the temperature-sensing-based smart meter error correction method proposed in the present invention can effectively identify and compensate for measurement errors caused by temperature changes, greatly improving the measurement accuracy of the meter in complex temperature environments.

[0299] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A smart meter error correction method based on temperature sensing, characterized in that: The following steps are involved: S10, acquiring temperature values ​​of thermocouples set at multiple designated locations of the smart meter to be tested in real time; S20, for each thermocouple, establish a thermocouple temperature curve and obtain outliers; S30, according to the Bayesian anomaly detection algorithm, delete the outliers that do not conform to the Gaussian distribution in each temperature curve to obtain the corresponding preprocessing curve; S40, performing multivariate Gaussian mixture model decomposition on all preprocessed curves to obtain the mean vector, covariance matrix and mixing coefficient of each Gaussian component; S50, using the covariance matrix of the Gaussian components, calculating the stability coefficient matrix of each preprocessing curve, wherein the stability coefficient matrix is ​​used to characterize the stability of the temperature curve; S60, extracting the characteristic vector of each preprocessing curve, inputting the stability coefficient matrix and the characteristic vector into a pre-trained smart meter error correction model to obtain a compensation value of the current electric energy meter reading; S70, compensating and correcting the current electric energy meter reading according to the compensation value of the current electric energy meter reading; The smart meter error correction model includes a short-term temperature curve error correction network, a medium-term temperature curve error correction network, a long-term temperature curve error correction network, a stability coefficient matrix error correction network and a fusion error correction network; The short-term temperature curve error correction network is used to output a first error interval of the electric energy meter reading according to a characteristic vector of the temperature curve within a first time range from the current moment; The mid-term temperature curve error correction network is used to output a second error interval of the electric energy meter reading according to the input characteristic vector of the temperature curve within a second time range from the current moment; The long-term temperature curve error correction network is used to output a third error interval of the electric energy meter reading according to the input characteristic vector of the temperature curve within a third time range from the current moment; The stability coefficient matrix error correction network is used to output a fourth error interval of the electric energy meter reading according to the input stability coefficient matrix.

2. The temperature-sensing-based smart meter error correction method according to claim 1, characterized in that: The fusion error correction network is used to output a compensation value of the electric energy meter reading according to the first error interval, the second error interval, the third error interval and the fourth error interval.

3. The temperature-sensing-based smart meter error correction method according to claim 2, characterized in that: In the step of compensating and correcting the current electric energy meter reading, the calculation formula of the compensated reading is: corrected reading = original reading × (1 + compensation value).

4. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, and when the program instructions are executed, they are used to execute the temperature-sensing-based smart meter error correction method according to any one of claims 1 to 3.

5. An electronic device, characterized in that: A processor and a memory are provided, wherein the memory is used to store the step program of the method described in any one of claims 1 to 3, and the processor reads the memory to execute the steps.

Citation Information

Patent Citations

  • Gaussian process regression soft measurement modeling method based on EGMM (Error Gaussian Mixture Model)

    CN104778298A

  • Electric energy metering error prediction and optimization system based on artificial intelligence

    CN116485049A