A method, medium and electronic device for analyzing and predicting self-heating error compensation of electric energy meter
By laying temperature sensors inside the power meter and collecting load data, using deep learning models to extract features and establishing a self-heating error compensation model, the problem of insufficient self-heating error compensation design of the electric meter is solved, and high-precision metering compensation is achieved.
Patent Information
- Application Number
- CN202411049386.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-08-01
AI Technical Summary
The existing power meter lacks error compensation design for self-heating errors, resulting in low metering accuracy.
By laying multiple temperature sensors inside the power meter, monitoring temperature changes in real time, collecting load data, extracting temperature and load characteristics using deep learning models, establishing a self-heating error compensation model, outputting error compensation values, and correcting the electrical metering number.
It realizes accurate prediction and compensation of the self-heating error of the electric energy meter, improves the metering accuracy of the electric energy meter, has strong adaptability and generalization capabilities, is flexible in deployment, and has low cost.
Smart Images

Figure CN118964850B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electric energy meters, and in particular, relates to a method, medium and electronic device for analyzing and predicting self-heating error compensation of an electric energy meter. Background Art
[0002] The electric energy meter is an important metering device in the smart grid, and its metering accuracy directly affects the operating efficiency and economic benefits of the power system. In practical applications, the metering error of the electric energy meter is often caused by multiple factors, among which self-heating error is a major source of error.
[0003] When the electric energy meter is subjected to loads such as power, current, and voltage during operation, the key internal components (such as current transformers, voltage transformers, and metering chips) will generate a certain amount of heat, which will cause the internal temperature of the entire electric energy meter to rise. This temperature rise caused by self-heating will affect the working characteristics of the internal components of the electric energy meter, thereby causing measurement errors. This measurement error caused by self-heating is called self-heating error.
[0004] The generation of self-heating error is closely related to the load state and temperature distribution of the energy meter. Generally speaking, when the energy meter is subjected to a large power, current or voltage load, its internal temperature rise will be more obvious, resulting in a larger self-heating error. At the same time, the temperature distribution of different parts will also affect the size and distribution of the self-heating error. Therefore, accurately predicting and compensating for the self-heating error is the key to improving the overall measurement accuracy of the energy meter.
[0005] The current electric energy meter has the technical problem of lacking the error compensation design considering the self-heating error of the electric energy meter. Summary of the invention
[0006] In view of this, the present invention provides an electric energy meter self-heating error compensation analysis and prediction method, medium and electronic device, which can solve the technical problem that the current electric energy meter lacks error compensation design considering the electric energy meter self-heating error.
[0007] The present invention is achieved in that:
[0008] A first aspect of the present invention provides a method for analyzing and predicting self-heating error compensation of an electric energy meter, which comprises the following steps:
[0009] S10, continuously acquiring temperature values collected by temperature sensors disposed at multiple designated positions inside the electric energy meter and load data of the electric energy meter;
[0010] S20, generating a temperature curve using the temperature values collected by each temperature sensor, and calculating a matrix corresponding to a two-dimensional transformation image of each temperature curve, which is recorded as a temperature matrix;
[0011] S30, clustering the temperature matrix to obtain a temperature clustering matrix;
[0012] S40, generating a matrix corresponding to the two-dimensional change image from the continuously acquired load data, which is recorded as a load matrix;
[0013] S50, clustering the load matrix to obtain a load clustering matrix;
[0014] S60, inputting the load clustering matrix and the temperature clustering matrices corresponding to the plurality of temperature sensors into a pre-trained electric energy meter self-heating error compensation model, and outputting an error compensation value of the electric energy meter;
[0015] S70, performing compensation calculation on the current electric power meter reading according to the error compensation value to obtain a corrected electric power reading.
[0016] The load data includes power load, current load, voltage load and power factor load.
[0017] The power load refers to the power of the electrical equipment or circuit monitored by the electric energy meter, including active power and reactive power. The power load will affect the working temperature and metering accuracy of the electric energy meter.
[0018] The current load refers to the current of the electrical equipment or circuit monitored by the electric energy meter. The current load will affect the heating degree and measurement error of the electric energy meter.
[0019] The voltage load refers to the voltage of the electrical equipment or circuit monitored by the electric energy meter. The change of voltage load will affect the working state and measurement accuracy of the electric energy meter.
[0020] The power factor load refers to the power factor of the electrical equipment or circuit monitored by the electric energy meter; changes in the power factor load will affect the measurement accuracy of the electric energy meter.
[0021] The electric energy meter self-heating error compensation model includes a temperature curve feature extraction branch, a load data feature extraction branch and a fusion layer.
[0022] Furthermore, the temperature curve feature extraction branch is used to extract features from temperature values collected by multiple temperature sensors.
[0023] Furthermore, the load data feature extraction branch is used to extract features from power, current, voltage and power factor load data.
[0024] Furthermore, the fusion layer adopts an interactive attention mechanism or an outer product attention mechanism to interactively fuse the temperature curve features and the load data features.
[0025] Furthermore, the self-heating error compensation model of the electric energy meter uses a feedforward neural network or a residual network as a main structure, inputs a fusion feature vector of temperature curve characteristics and load data characteristics, and outputs an error compensation value of the electric energy meter.
[0026] At the same time, the electric energy meter self-heating error compensation model introduces an attention mechanism or a gating mechanism to allow the model to adaptively focus on different features.
[0027] Specifically, the temperature curve feature extraction branch is used to extract features from temperature values collected by multiple temperature sensors, and includes the following key components:
[0028] Multi-scale convolution layer: Use convolution kernels of different scales to process the temperature curve in parallel and capture the temperature change patterns at different time scales.
[0029] Timing modeling layer: uses a recurrent neural network or Transformer structure to capture the temporal correlation of the temperature curve.
[0030] Temperature attention mechanism: The attention mechanism is introduced to enable the model to adaptively focus on key time points and sensor locations in the temperature curve.
[0031] The load data feature extraction branch is used to extract features from power, current, voltage and power factor load data, and includes the following key components:
[0032] Load convolution layer: A convolutional neural network is used to process the load data sequence and capture the correlation between load data.
[0033] Load attention layer: The self-attention mechanism is introduced to enable the model to adaptively focus on the key features in the load data.
[0034] Time series modeling layer: Recurrent neural network or Transformer is used to capture the time dependency of load data.
[0035] Furthermore, in the feature fusion layer, the correlation between the temperature curve features and the load data features needs to be considered more, so it can be adjusted as follows:
[0036] Interactive feature fusion layer: Use interactive attention mechanism or outer product attention mechanism to interactively fuse temperature curve features and load data features. It includes the following steps:
[0037] 1. Feature transformation layer: The temperature curve features and load data features are transformed into the same feature space through the fully connected layer.
[0038] 2. Interactive Attention Mechanism:
[0039] Calculate the similarity matrix for the transformed temperature and load characteristics
[0040] Calculate attention weights from the perspective of rows / columns
[0041] Take the weighted average of the row / column attention weights to obtain the load context feature corresponding to the temperature feature and the temperature context feature corresponding to the load feature
[0042] 3. Contextual feature fusion:
[0043] Cascade the temperature feature with its corresponding load context feature
[0044] Cascade the load feature with its corresponding temperature context feature
[0045] 4. Outer product fusion: Perform outer product operation on the cascaded feature vectors to generate outer product features.
[0046] This interactive feature fusion layer can fully model the correlation between temperature curve and load data, so that the subsequent error compensation model can better learn and utilize the interactive information between the two, thereby improving the prediction accuracy.
[0047] Error compensation model: Use feedforward neural network or residual network as the main structure, input fusion feature vector, and output the error compensation value of the electric energy meter. At the same time, introduce attention mechanism or gating mechanism to allow the model to adaptively focus on different features.
[0048] The model design can make full use of the characteristics of temperature curve and load data, and model the correlation between the two, so as to more accurately predict the self-heating error of the electric energy meter and improve the metering accuracy. During the training process, transfer learning and pre-training can be used to initialize the model weights of related tasks to improve the generalization ability.
[0049] The training steps of the electric energy meter self-heating error compensation model are as follows:
[0050] 1. Get training data
[0051] The acquisition of training data is a key step in model training, which requires the collection of a large amount of data in real scenarios:
[0052] a. Temperature data collection: Install temperature sensors at multiple designated locations, continuously collect temperature data under different working conditions (different load levels), and obtain temperature curves;
[0053] b. Load data collection: continuously monitor and record load data such as power, current, voltage, power factor, etc. of the energy meter;
[0054] c. Error compensation value collection: Under the above different working conditions, use standard equipment to measure the actual error value of the electric energy meter. The error value is the target value that needs to be compensated under the working condition;
[0055] d. Data synchronization and storage: ensure that the temperature, load and error data are one-to-one corresponding at the same time point, and store the collected data as a training sample set;
[0056] 2. Data Preprocessing
[0057] a. Pre-processing such as normalization and standardization of temperature curve / load data;
[0058] b. Convert the temperature curve / load data into a two-dimensional image matrix representation;
[0059] c. Cluster the temperature matrix / load matrix to obtain the clustering matrix as the model input;
[0060] 3. Model training
[0061] a. Concatenate the temperature clustering matrix and the load clustering matrix as model input;
[0062] b. Use the error compensation value as the training label;
[0063] c. Use an appropriate loss function (such as mean square error, etc.);
[0064] d. Use optimization algorithms (such as stochastic gradient descent, etc.) to train model parameters;
[0065] e. Use validation sets to monitor model performance during training to prevent overfitting;
[0066] 4. Model Evaluation
[0067] Evaluate the model’s error compensation performance metrics on the held-out test set;
[0068] 5. Model Tuning
[0069] According to the evaluation results, optimize the model performance by adjusting the model structure, regularization strategy, loss function, etc.;
[0070] In the above steps, obtaining high-quality and diverse training data is the key, which needs to cover different working conditions, different types of loads, different temperature distributions, etc. At the same time, you can also consider using data enhancement and other technologies to expand the training data.
[0071] The multiple designated positions include at least: a current transformer, a voltage transformer, a metering chip, a power circuit board, and an inner surface of a housing. Specifically, according to the structure and heating characteristics of the electric energy meter, temperature sensors are usually set at the following positions to collect temperature values:
[0072] 1. Current transformer: The current transformer is the core measuring component of the electric energy meter. It carries the current load and will generate a certain amount of heat. Therefore, it is necessary to install a temperature sensor near the current transformer.
[0073] 2. Voltage transformer: The voltage transformer is also an important measuring component of the electric energy meter. Although it generates less heat, temperature changes also need to be monitored.
[0074] 3. Metering chip: The metering chip is the core component of electric energy metering. It will generate a certain amount of heat when working, and its working temperature needs to be monitored.
[0075] 4. Power circuit board: The power circuit board that supplies power to the energy meter will also generate heat during operation, so a temperature sensor needs to be installed.
[0076] 5. Inner surface of the shell: The inner surface temperature of the electric energy meter's shell will also be affected by internal heating. Installing a temperature sensor can monitor the overall heating situation.
[0077] 6. Ventilation holes: Some electric energy meters are equipped with vents for heat dissipation. Temperature sensors can be installed at the vents to monitor the heat dissipation effect.
[0078] The temperature data at these locations, combined with the load data, can fully reflect the heat distribution and temperature rise of the electric energy meter under different working conditions, providing an important reference for self-heating error compensation.
[0079] 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 method for analyzing and predicting self-heating error compensation of an electric energy meter.
[0080] 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.
[0081] Compared with the prior art, the beneficial effects of the self-heating error compensation analysis and prediction method, medium and electronic device provided by the present invention are:
[0082] 1. Comprehensively consider the impact of temperature distribution and load status on self-heating error
[0083] Multiple temperature sensors are installed inside the electric energy meter to monitor the temperature changes in different parts in real time.
[0084] At the same time, the load data such as power, current, voltage, power factor, etc. of the electric energy meter are collected.
[0085] Through the deep learning model, the temperature distribution characteristics and load change characteristics are fully explored, and the intrinsic relationship between the two is established to achieve accurate prediction of self-heating errors.
[0086] 2. Strong adaptability and generalization capabilities
[0087] Using deep learning methods, there is no need to rely on pre-established empirical models.
[0088] By training with a large amount of measured data, the model can automatically learn the complex mapping relationship between temperature, load and error.
[0089] During deployment, a federated learning approach can be used to continuously optimize the data from the actual working environments of different electricity meters to improve generalization performance.
[0090] 3. Low computational complexity and flexible deployment
[0091] The core of this method is a deep learning model that can be efficiently deployed in the embedded system of the electricity meter or in the cloud.
[0092] The trained model parameters are small in size, occupy less resources, and are suitable for running directly on the electricity meter hardware.
[0093] There is no need for a lot of parameter calibration and complex thermal network modeling, and the deployment cost is low.
[0094] Therefore, the solution of the present invention solves the technical problem that the current electric energy meter lacks error compensation design considering the self-heating error of the electric energy meter. BRIEF DESCRIPTION OF THE DRAWINGS
[0095] 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.
[0096] Figure 1 A flow chart of the method provided by the present invention. DETAILED DESCRIPTION
[0097] 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.
[0098] like Figure 1 FIG. 1 is a flow chart of a method for analyzing and predicting self-heating error compensation of an electric energy meter provided by the present invention. The method comprises the following steps:
[0099] S10, continuously acquiring temperature values collected by temperature sensors disposed at multiple designated positions inside the electric energy meter and load data of the electric energy meter;
[0100] S20, generating a temperature curve using the temperature values collected by each temperature sensor, and calculating a matrix corresponding to a two-dimensional transformation image of each temperature curve, which is recorded as a temperature matrix;
[0101] S30, clustering the temperature matrix to obtain a temperature clustering matrix;
[0102] S40, generating a matrix corresponding to the two-dimensional change image from the continuously acquired load data, which is recorded as a load matrix;
[0103] S50, clustering the load matrix to obtain a load clustering matrix;
[0104] S60, inputting the load clustering matrix and the temperature clustering matrices corresponding to the plurality of temperature sensors into a pre-trained electric energy meter self-heating error compensation model, and outputting an error compensation value of the electric energy meter;
[0105] S70, performing compensation calculation on the current electric power meter reading according to the error compensation value to obtain a corrected electric power reading.
[0106] The specific implementation methods of the above steps are described in detail below:
[0107] The specific implementation of step S10 is: continuously collecting temperature values obtained by temperature sensors arranged at multiple designated positions inside the electric energy meter and load data of the electric energy meter.
[0108] First, multiple temperature sensors need to be installed at key locations inside the energy meter to monitor the temperature changes inside the energy meter in real time. These key locations include: near the current transformer, near the voltage transformer, at the metering chip, at the power circuit board, on the inner surface of the housing, at the vents, etc. By placing temperature sensors at these locations, the heat distribution and temperature rise of the energy meter under different working conditions can be fully reflected.
[0109] The data collected by the temperature sensor forms a temperature curve, which records the temperature change trend of each monitoring point inside the electric energy meter over time. At the same time, it is also necessary to continuously obtain the load data of the electric energy meter, including power load, current load, voltage load and power factor load. These load data reflect the actual load status of the electric energy meter under different working conditions.
[0110] It should be noted that the collection of temperature values and load data needs to be synchronized to ensure that the temperature curve and load change data correspond one to one. This can better analyze the correlation between temperature changes and load changes.
[0111] By continuously collecting temperature and load data, sufficient training samples can be obtained, laying the foundation for subsequent temperature curve feature extraction and load data feature extraction. At the same time, these collected raw data also provide the necessary input for the training of the self-heating error compensation model of the electric energy meter.
[0112] The specific implementation of step S20 is: generating a temperature curve from the temperature values collected by each temperature sensor, and calculating a matrix corresponding to the two-dimensional transformation image of each temperature curve, which is recorded as a temperature matrix.
[0113] First, the temperature value sequence collected by each temperature sensor needs to be converted into a temperature curve. The temperature curve can intuitively reflect the trend of temperature change over time.
[0114] Next, these temperature curves need to be transformed into two dimensions. Specifically, methods such as Fourier transform or wavelet transform can be used to transform the one-dimensional temperature curve into a two-dimensional temperature matrix. This two-dimensional matrix representation can better capture the time-frequency characteristics of the temperature curve.
[0115] Through two-dimensional transformation, the temperature curve corresponding to each temperature sensor will generate a temperature matrix. These temperature matrices are recorded as temperature matrix sets, which provide input for subsequent temperature clustering.
[0116] The purpose of this step is to convert the original one-dimensional temperature curve into a two-dimensional temperature matrix representation to facilitate subsequent feature extraction and pattern recognition. The two-dimensional matrix can better reflect the time and frequency characteristics of the temperature curve and provide richer information for the analysis and prediction of the self-heating error of the electric energy meter.
[0117] The specific implementation of step S30 is: clustering the temperature matrix to obtain a temperature clustering matrix.
[0118] First, it is necessary to select a suitable clustering algorithm to perform cluster analysis on the temperature matrix set. Commonly used clustering algorithms include K-means algorithm, hierarchical clustering algorithm, Gaussian mixture model clustering algorithm, etc. These algorithms can divide the temperature matrix into several clusters according to the similarity between the temperature matrices.
[0119] In the clustering process, it is necessary to determine the number of clusters K. The optimal number of clusters can be determined by indicators such as the silhouette coefficient. Generally speaking, when the number of clusters increases to a certain extent, the clustering effect will tend to be stable.
[0120] After cluster analysis, each temperature matrix is assigned to a cluster. These clusters form a new temperature cluster matrix. Each cluster represents a typical temperature distribution pattern.
[0121] The purpose of this step is to extract the pattern characteristics of the temperature curve. Through cluster analysis, the temperature variation patterns of different parts inside the electric energy meter can be identified, providing an important reference for the subsequent self-heating error analysis. The temperature clustering matrix contains the temperature distribution characteristics of the electric energy meter under different working conditions, providing rich input for model training.
[0122] The specific implementation of step S40 is: generating a matrix corresponding to the two-dimensional change image from the continuously acquired load data, which is recorded as a load matrix.
[0123] Similar to the processing of temperature curves, the continuously collected load data also needs to be transformed into a two-dimensional load matrix. Specifically, the same Fourier transform or wavelet transform method as the temperature curve can be used to transform the one-dimensional load data sequence into a two-dimensional load matrix.
[0124] The purpose of this is to extract the time-frequency characteristics of the load data. The load matrix can better reflect the changing rules of load indicators such as power, current, voltage, and power factor in the time and frequency domains. These characteristic information is helpful for subsequent load data feature extraction and model training.
[0125] Similar to the temperature matrix, each load indicator generates a load matrix, which constitutes a load matrix set and provides input for the load clustering in step S50.
[0126] In general, the purpose of this step is to convert the original one-dimensional load data sequence into a two-dimensional load matrix representation to facilitate subsequent feature extraction and pattern recognition. The load matrix can better describe the time and frequency characteristics of the load data and provide richer information for the self-heating error analysis of the electric energy meter.
[0127] The specific implementation of step S50 is: clustering the load matrix to obtain a load clustering matrix.
[0128] Similar to step S30, this step also requires selecting a suitable clustering algorithm to perform cluster analysis on the load matrix set. Commonly used clustering algorithms include K-means algorithm, hierarchical clustering algorithm, Gaussian mixture model clustering algorithm, etc.
[0129] In the clustering process, it is necessary to determine the number of clusters K. The optimal number of clusters can be determined by indicators such as the silhouette coefficient. Generally, when the number of clusters increases to a certain extent, the clustering effect tends to be stable.
[0130] After cluster analysis, each load matrix is assigned to a cluster. These clusters form a new load cluster matrix. Each cluster represents a typical load distribution pattern.
[0131] The purpose of this step is to extract the pattern characteristics of the load data. Through cluster analysis, the load variation law of the electric energy meter under different working conditions can be identified, which provides an important reference for the subsequent self-heating error analysis. The load clustering matrix contains the load distribution characteristics of the electric energy meter under different load conditions, providing rich input for model training.
[0132] The specific implementation of step S60 is: inputting the load clustering matrix and the temperature clustering matrices corresponding to the multiple temperature sensors into a pre-trained electric energy meter self-heating error compensation model, and outputting the error compensation value of the electric energy meter.
[0133] In this step, a pre-trained self-heating error compensation model for electric energy meters is used. The inputs of this model include:
[0134] 1. Load clustering matrix: represents the load distribution characteristics of the electric energy meter under different load conditions.
[0135] 2. Temperature clustering matrix: represents the temperature distribution characteristics of the electric energy meter under different working conditions.
[0136] These two types of matrix features are obtained through cluster analysis in steps S30 and S50. They reflect the relationship between the internal temperature distribution and the load state of the electric energy meter and provide important reference information for self-heating error analysis.
[0137] The pre-trained self-heating error compensation model usually adopts deep learning methods, including convolutional neural networks, recurrent neural networks, attention mechanisms, etc. These models can effectively learn the correlation between temperature curve characteristics and load data characteristics, thereby predicting the self-heating error compensation value of the electric energy meter under the current working conditions.
[0138] It is worth noting that during the model training process, a large amount of temperature, load and error data in real scenarios needs to be collected as training samples. Through iterative optimization training, the model can gradually improve its accuracy in predicting self-heating errors.
[0139] In general, this step is to input the previously extracted temperature and load characteristics into the pre-trained self-heating error compensation model to obtain the error value that the electric energy meter needs to compensate under the current working conditions. This provides a key basis for subsequent error correction.
[0140] The specific implementation of step S70 is: performing compensation calculation on the current electric power meter reading according to the error compensation value to obtain a corrected electric power reading.
[0141] In this step, the self-heating error compensation value of the electric energy meter obtained in step S60 needs to be applied to the current electric energy reading of the electric energy meter, so as to obtain a corrected electric energy reading.
[0142] Specifically, the following formula can be used for calculation:
[0143] Corrected electricity reading = original electricity reading + error compensation value
[0144] The original electric energy reading is the electric energy value directly measured by the electric energy meter under the current working condition, and the error compensation value is predicted by the self-heating error compensation model in step S60.
[0145] Adding these two values together will give the corrected electricity meter reading, which more accurately reflects the actual energy consumption of the meter under the current working conditions, thereby improving the metering accuracy of the meter.
[0146] It should be noted that the calculation accuracy of the error compensation value directly affects the accuracy of the corrected electricity meter readings. Therefore, the quality of temperature feature extraction, load feature extraction, and the fusion modeling of the two in the previous steps will have an impact on this step. Only by fully exploring the intrinsic connection between temperature curves and load data can a more accurate self-heating error compensation value be obtained.
[0147] In general, this step is to apply the predicted self-heating error compensation value to the original electricity meter reading to obtain the corrected electricity meter measurement result. This can effectively eliminate the self-heating error generated by the electricity meter under different working conditions and improve the overall measurement accuracy of the electricity meter.
[0148] Implementation details of the temperature curve feature extraction branch:
[0149] Multi-scale convolution layer: In the temperature curve feature extraction branch, the use of multi-scale convolution layer is an effective feature extraction method. Specifically, different sizes of convolution kernels (such as 3x3, 5x5, 7x7, etc.) can be used to process the input temperature matrix in parallel to capture the changing characteristics of the temperature curve at different time scales. In this way, short-term, medium-term and long-term patterns in the temperature curve can be extracted, providing richer input for subsequent time series modeling.
[0150] Time series modeling layer: For temperature curve data, its time correlation is a very important feature. Therefore, in the temperature curve feature extraction branch, an appropriate time series modeling layer is needed to capture the time dependency in the temperature curve. Commonly used methods include recurrent neural networks (such as LSTM, GRU) and transformer structures. These models can effectively learn the time series features in the temperature curve and provide important input for self-heating error analysis.
[0151] Temperature attention mechanism: Since temperature sensors at different locations inside the electric energy meter will produce different temperature curves, their contributions to self-heating errors may also be different. In order to adaptively focus on key temperature sensors and time points, an attention mechanism can be introduced in the temperature curve feature extraction branch. Specifically, self-attention or interactive attention can be used to allow the model to learn the importance weights in the temperature curve, thereby extracting more representative temperature features.
[0152] Implementation details of the load data feature extraction branch:
[0153] Load convolution layer: Load data also has certain correlations, and appropriate methods are needed to extract its features. Convolutional neural networks can be used to extract features from load data sequences. The convolution layer can capture local correlations in load data, such as the correlation patterns between indicators such as power, current, and voltage. This feature extraction method can help the model understand the inherent structure of load data.
[0154] Load attention layer: Similar to the temperature curve feature extraction, different indicators (power, current, voltage, power factor) in the load data also contribute differently to the self-heating error. Therefore, the attention mechanism can also be introduced in the load feature extraction branch. The self-attention mechanism enables the model to adaptively focus on the key features in the load data, improving the pertinence and effectiveness of feature extraction.
[0155] Time series modeling layer: Load data also has obvious time correlation, and appropriate time series modeling methods need to be adopted. Recurrent neural networks or transformer structures can be used to capture the time-dependent characteristics in load data.
[0156] 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 method for analyzing and predicting self-heating error compensation of an electric energy meter.
[0157] 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.
[0158] In order to better understand and implement the present invention, a specific embodiment of the present invention is provided below, which is used for a computer program in a computer-readable storage medium or an electronic device such as a computer or a control chip inside a smart meter. In this embodiment, the specific implementation of step S10 is as follows:
[0159] The temperature value collected by the temperature sensor at each key position o inside the electric energy meter is recorded as T i(t), where i = 1, 2, ..., N, represents the i-th temperature sensor, and t represents time. At the same time, the load data of the energy meter includes power load P(t), current load I(t), voltage load V(t) and power factor load cosφ(t), all of which change with time t.
[0160] In step S10, it is necessary to continuously collect these temperature values and load data to ensure that they are corresponding in time, that is, the temperature value T i (t) and load data P(t), I(t), V(t), cosφ(t) are collected synchronously. This can better analyze the correlation between temperature change and load change, laying the foundation for subsequent feature extraction and model training.
[0161] Specifically, the following methods can be used to collect temperature and load data:
[0162] 1. Install multiple temperature sensors at key locations inside the energy meter (such as near the current transformer, near the voltage transformer, at the metering chip, at the power circuit board, on the inner surface of the housing, at the vent, etc.) to monitor the temperature changes inside the energy meter in real time. The data collected by these temperature sensors form a temperature curve T i (t).
[0163] 2. At the same time, the power load P(t), current load I(t), voltage load V(t) and power factor load cosφ(t) of the electric energy meter are collected to form the load data sequence of the electric energy meter.
[0164] 3. The temperature value T needs to be guaranteed i (t) and the load data P(t), I(t), V(t), CoSφ(t) are synchronized in time, that is, they are collected and recorded at the same time t.
[0165] 4. The collected temperature values and load data can be stored in the database to facilitate subsequent feature extraction and model training.
[0166] The temperature and load data obtained in this way can fully reflect the heat distribution, temperature rise and load changes of the electric energy meter under different working conditions, and provide important input for subsequent self-heating error analysis.
[0167] The specific implementation of step S20 is as follows:
[0168] For each temperature value sequence T collected by temperature sensor i i (t), which needs to be converted into a two-dimensional temperature matrix T i The specific method is as follows:
[0169] 1. Use Fourier transform or wavelet transform to transform the one-dimensional temperature curve T i (t) is converted into a two-dimensional temperature matrix T i Here we use the Short Time Fourier Transform (STFT) as an example:
[0170] T i =STFT(T i (t))
[0171] Among them, STFT stands for short-time Fourier transform, which can transform the one-dimensional temperature sequence T i (t) is converted into a two-dimensional time-frequency matrix T i , reflecting the changing characteristics of temperature in the time and frequency domains.
[0172] 2. For the temperature values collected by N temperature sensors, N temperature matrices T can be obtained 1 , T 2 , ..., T N , forming a temperature matrix set
[0173] This two-dimensional temperature matrix representation can better capture the time-frequency characteristics of the temperature curve and provide input for subsequent temperature clustering analysis. Compared with the original one-dimensional temperature curve, the temperature matrix can describe the pattern of temperature change in more detail and help to explore the inherent laws of temperature distribution.
[0174] The specific implementation of step S30 is as follows:
[0175] The temperature matrix set obtained in step S20 It is necessary to perform cluster analysis to obtain the temperature clustering matrix Where K represents the number of clusters. The specific method is as follows:
[0176] 1. Choose a suitable clustering algorithm, such as K-means algorithm, hierarchical clustering algorithm or Gaussian mixture model clustering algorithm. Here we take K-means algorithm as an example:
[0177]
[0178] Among them, KMeans represents the K-means clustering algorithm, and the input is the temperature matrix set And the number of clusters K, the output is K clusters
[0179] 2. When clustering, it is necessary to determine the optimal number of clusters K. This can be evaluated by indicators such as the silhouette coefficient S or WCSS (internal sum of squares within the cluster):
[0180]
[0181] Among them, a represents the average distance from the sample to the center of the cluster to which it belongs, and b represents the minimum distance from the sample to the center of other clusters. The larger the S value, the better the clustering effect.
[0182]
[0183] Among them, μ k Indicates the center of the kth cluster. The smaller the WCSS value, the better the clustering effect.
[0184] 3. After cluster analysis, each temperature matrix T i will be assigned to a cluster C k , thus forming a temperature clustering matrix set Each cluster C k Represents a typical temperature distribution pattern.
[0185] The purpose of this step is to extract the pattern characteristics of the temperature curve, which provides an important reference for the subsequent self-heating error analysis. The temperature clustering matrix contains the temperature distribution characteristics of the electric energy meter under different working conditions and is an important input for model training.
[0186] The specific implementation of step S40 is as follows:
[0187] The load data sequences P(t), I(t), V(t) and Cosφ(t) collected continuously in step S10 need to be converted into a two-dimensional load matrix L. The specific method is as follows:
[0188] 1. Use the temperature matrix T i The same two-dimensional transformation method, such as short-time Fourier transform (STFT), converts the one-dimensional load data sequence into a two-dimensional load matrix L:
[0189] L=STFT([P(t), I(t), V(t), cosφ(t)])
[0190] Among them, STFT stands for short-time Fourier transform, which can convert multiple one-dimensional load data sequences into a two-dimensional load matrix L that reflects the changing characteristics of these load indicators in the time and frequency domains.
[0191] 2. The load matrix L obtained in this way contains the comprehensive information of power load, current load, voltage load and power factor load in the time and frequency domain.
[0192] This two-dimensional load matrix representation can better describe the time-frequency characteristics of load data and provide input for subsequent load clustering analysis. Compared with the original one-dimensional load data sequence, the load matrix can more carefully describe the correlation between different load indicators and help to explore the inherent laws of load distribution.
[0193] The specific implementation of step S50 is as follows:
[0194] For the load matrix L obtained in step S40, it is necessary to perform cluster analysis on it to obtain the load clustering matrix Where L represents the number of clusters. The specific method is as follows:
[0195] 1. Choose a suitable clustering algorithm, such as K-means algorithm, hierarchical clustering algorithm or Gaussian mixture model clustering algorithm. Here we take K-means algorithm as an example:
[0196]
[0197] KMeans represents the K-means clustering algorithm, the input is the load matrix L and the number of clusters L, and the output is L clusters
[0198] 2. When clustering, it is necessary to determine the optimal number of clusters L. This can be evaluated by indicators such as silhouette coefficient S or WCSS, similar to step S30:
[0199]
[0200] Among them, v l Represents the center of the lth cluster.
[0201] 3. After cluster analysis, the load matrix L will be divided into L different clusters Form a load clustering matrix set. Each cluster D l Represents a typical load distribution pattern.
[0202] The purpose of this step is to extract the pattern characteristics of load data and provide an important reference for the subsequent self-heating error analysis. The load clustering matrix contains the load distribution characteristics of the electric energy meter under different load conditions and is an important input for model training.
[0203] The specific implementation of step S60 is as follows:
[0204] In this step, it is necessary to use the pre-trained electric energy meter self-heating error compensation model and input the temperature clustering matrix set obtained in steps S30 and S50 and the load clustering matrix set Output the self-heating error compensation value ΔE of the electric energy meter.
[0205] The self-heating error compensation model usually adopts deep learning methods, including convolutional neural networks, recurrent neural networks, and attention mechanisms. The specific structure of the model is as follows:
[0206] 1. Temperature curve feature extraction branch:
[0207] Multi-scale convolution layer: Use convolution kernels of different scales to process the temperature matrix {C k}, capturing the changing characteristics of the temperature curve on different time scales.
[0208] Timing modeling layer: Use recurrent neural networks (such as LSTM) or Transformer structures to model the time correlation in the temperature curve.
[0209] Temperature attention mechanism: The attention mechanism is introduced to enable the model to adaptively focus on key time points and sensor locations in the temperature curve.
[0210] 2. Load data feature extraction branch:
[0211] Load convolution layer: Use convolutional neural network to process the load matrix {D l}, capturing the correlation between indicators such as power, current, and voltage.
[0212] Load attention layer: introduces the self-attention mechanism to make the model focus on the key features in the load data.
[0213] Time series modeling layer: Use recurrent neural networks (such as GRU) or Transformer to model the time dependencies in load data.
[0214] 3. Feature fusion layer:
[0215] Feature transformation: The temperature features and load features are mapped to the same feature space through the fully connected layer.
[0216] Interactive attention mechanism: Calculate the similarity between temperature features and load features to obtain mutual contextual features.
[0217] Outer product fusion: Perform outer product operation on the transformed feature vector to extract the interactive information between the two.
[0218] 4. Error compensation prediction layer:
[0219] Feedforward neural network or residual network is used as the main structure.
[0220] Introducing attention mechanism or gating mechanism enables the model to adaptively focus on different features.
[0221] Output the self-heating error compensation value ΔE of the electric energy meter.
[0222] During the training process, transfer learning and pre-training can be used to initialize the model weights of related tasks to improve generalization ability. At the same time, in terms of training loss functions, mean square error (MSE) or Huber loss can be used to select appropriate loss functions according to actual conditions. The optimization algorithm can use stochastic gradient descent, Adam or RMSProp.
[0223] The specific steps of training are as follows:
[0224] 1. The temperature clustering matrix obtained in steps S30 and S50 is set and the load clustering matrix set Spliced into model input:
[0225]
[0226] 2. Collect the self-heating error data ΔE of the electric energy meter under the actual test environment as training labels.
[0227] 3. Input X and ΔE into the self-heating error compensation model for training and optimize the model parameters so that the predicted self-heating error compensation value As close as possible to the true value ΔE.
[0228] 4. During the training process, use the validation set to monitor model performance and prevent overfitting. Hyperparameters such as model structure, regularization strategy, and learning rate can be adjusted based on the validation set error.
[0229] 5. When the model training converges, save the trained self-heating error compensation model parameters for subsequent use.
[0230] The self-heating error compensation model trained in this way can effectively utilize the temperature curve characteristics and load data characteristics, and model the complex relationship between the two, so as to more accurately predict the self-heating error of the electricity meter under different working conditions.
[0231] The specific implementation of step S70 is as follows:
[0232] According to the self-heating error compensation value ΔE output in step S60, the current electric energy meter reading E 0 Correction is performed to obtain the corrected electricity quantity E, and the calculation formula is:
[0233] E=E 0 +ΔE
[0234] in:
[0235] E 0 It indicates the original electric energy consumption value directly measured by the electric energy meter under the current working conditions.
[0236] ΔE represents the self-heating error compensation value predicted in step S60 .
[0237] E represents the corrected electric energy meter reading.
[0238] The original electricity quantity E 0 Adding the self-heating error compensation value ΔE, the corrected electric energy meter reading E can be obtained. This corrected electric energy meter reading more accurately reflects the actual electric energy consumption of the electric energy meter under the current working conditions, thereby improving the overall measurement accuracy of the electric energy meter.
[0239] It should be noted that the calculation accuracy of the self-heating error compensation value ΔE directly affects the accuracy of the corrected electricity meter E. Therefore, the quality of temperature feature extraction, load feature extraction, and the fusion modeling of the two in the previous steps will have an important impact on this step. Only by fully exploring the intrinsic connection between temperature curve and load data can a more accurate self-heating error compensation value be obtained, thereby improving the overall metering accuracy.
[0240] In general, step S70 is to apply the predicted self-heating error compensation value to the original electric energy meter reading, thereby obtaining a corrected electric energy meter measurement result. This can effectively eliminate the self-heating error generated by the electric energy meter under different working conditions and improve the overall measurement accuracy of the electric energy meter.
[0241] In the embodiment, the relevant variables are explained as follows: T i (t): the temperature value collected by the i-th temperature sensor at time t; p(t): the power load monitored by the electric energy meter at time t; I(t): the current load monitored by the electric energy meter at time t; V(t): the voltage load monitored by the electric energy meter at time t; The power factor load monitored by the energy meter at time t; T i : The temperature matrix obtained by two-dimensional transformation of the temperature curve collected by the i-th temperature sensor; C k : The kth temperature cluster represents a typical temperature distribution pattern; D l : the lth load cluster, representing a typical load distribution pattern; L: load matrix; X: model input, including temperature cluster matrix and load cluster matrix; ΔE: actual self-heating error compensation value of the energy meter; The self-heating error compensation value predicted by the model; E 0: The original energy consumption value directly measured by the energy meter under the current working condition; E: The corrected energy meter reading; i: The number of the temperature sensor; k: The number of the temperature cluster; l: The number of the load cluster; N: The total number of temperature sensors; K: The number of temperature clusters; L: The number of load clusters; STFT: Short-time Fourier transform, used to convert a one-dimensional signal into a two-dimensional matrix representation; KMeans: K-means clustering algorithm, used to cluster the temperature matrix and the load matrix; S: Silhouette coefficient, used to evaluate the clustering effect; WCSS: The sum of squares within the cluster, used to evaluate the clustering effect; a: The average distance from the sample to the center of the cluster to which it belongs; b: The minimum distance from the sample to the center of other clusters; μ k : The center of the kth temperature cluster; v l : The center of the lth load cluster; MSE: Mean square error loss function; Huber: Huber loss function.
[0242] Specifically, the principle of the present invention is:
[0243] 1. Multi-source data fusion:
[0244] Multiple temperature sensors are deployed inside the electric energy meter to continuously collect temperature change curves at different locations.
[0245] At the same time, the load data such as power, current, voltage, power factor, etc. of the electric energy meter are collected.
[0246] The temperature curve data and load data are synchronized in time to form complete working status data of the electric energy meter.
[0247] 2. Feature extraction and fusion:
[0248] The temperature curve data is transformed into a two-dimensional form to obtain a temperature matrix, which reflects the changing characteristics of temperature in the time-frequency domain.
[0249] A similar two-dimensional transformation is also performed on the load data to obtain the load matrix, which describes the correlation between load indicators.
[0250] The temperature curve feature extraction branch and load data feature extraction branch of the deep learning model are used to extract the key features of the two types of data respectively.
[0251] In the feature fusion layer, the interactive attention mechanism is introduced to model the intrinsic connection between temperature features and load features.
[0252] 3. Self-heating error prediction:
[0253] The fused features are input into a pre-trained self-heating error compensation model, which is implemented based on a deep learning method.
[0254] The model can effectively learn the complex mapping relationship between temperature distribution, load status and self-heating error.
[0255] The output self-heating error compensation value can be directly applied to the correction of the original electric energy meter measurement value to improve the measurement accuracy.
[0256] 4. Model training and optimization:
[0257] A large amount of temperature, load and error data under real working conditions are collected as training samples.
[0258] Use transfer learning and pre-training to initialize the model and improve generalization performance.
[0259] Use appropriate loss functions and optimization algorithms to continuously optimize model parameters.
[0260] During the training process, a validation set is used to monitor performance and prevent overfitting.
[0261] This self-heating error compensation method based on deep learning can make full use of the rich temperature and load data inside the electric energy meter, and establish a complex relationship between temperature distribution, load state and self-heating error through feature extraction and fusion, so as to achieve accurate prediction of self-heating error. Compared with traditional methods based on empirical models or thermal network models, this method has stronger adaptability and generalization ability, does not require a large amount of parameter calibration, and has lower deployment cost.
[0262] At the same time, the deep learning model structure adopted by this method, such as multi-scale convolution, time series modeling, interactive attention and other technologies, can effectively extract and fuse key features and enhance the learning ability of the self-heating error formation mechanism. During model training, the prediction accuracy and generalization can be further improved through transfer learning and continuous optimization strategies.
[0263] In summary, the self-heating error compensation analysis and prediction method of the electric energy meter proposed in the present invention gives full play to the advantages of deep learning in feature extraction and pattern recognition, can accurately predict the self-heating error and perform effective compensation, greatly improves the metering accuracy of the electric energy meter, and provides an effective solution for the high-precision metering application of the smart grid.
[0264] 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 method for analyzing and predicting self-heating error compensation of an electric energy meter, characterized in that: The following steps are involved: S10, continuously acquiring temperature values collected by temperature sensors disposed at multiple designated positions inside the electric energy meter and load data of the electric energy meter; S20, generating a temperature curve using the temperature values collected by each temperature sensor, and calculating a matrix corresponding to a two-dimensional transformation image of each temperature curve, which is recorded as a temperature matrix; S30, clustering the temperature matrix to obtain a temperature clustering matrix; S40, generating a matrix corresponding to the two-dimensional change image from the continuously acquired load data, recorded as a load matrix; S50, clustering the load matrix to obtain a load clustering matrix; S60, inputting the load clustering matrix and the temperature clustering matrices corresponding to the plurality of temperature sensors into a pre-trained electric energy meter self-heating error compensation model, and outputting an error compensation value of the electric energy meter; S70: Perform compensation calculation on the current electric power meter readings according to the error compensation value to obtain a corrected electric power reading.
2. The method for analyzing and predicting self-heating error compensation of an electric energy meter according to claim 1, characterized in that: The load data includes power load, current load, voltage load and power factor load.
3. The method for analyzing and predicting self-heating error compensation of an electric energy meter according to claim 1, characterized in that: The electric energy meter self-heating error compensation model includes a temperature curve feature extraction branch, a load data feature extraction branch and a fusion layer.
4. The method for analyzing and predicting self-heating error compensation of an electric energy meter according to claim 3, characterized in that: The temperature curve feature extraction branch is used to extract features from temperature values collected by multiple temperature sensors.
5. The method for analyzing and predicting self-heating error compensation of an electric energy meter according to claim 3, characterized in that: The load data feature extraction branch is used to extract features from power, current, voltage and power factor load data.
6. The method for analyzing and predicting self-heating error compensation of an electric energy meter according to claim 3, characterized in that: The fusion layer adopts an interactive attention mechanism or an outer product attention mechanism to interactively fuse the temperature curve features and the load data features.
7. The method for analyzing and predicting self-heating error compensation of an electric energy meter according to claim 1, characterized in that: The multiple designated positions include at least: a current transformer, a voltage transformer, a metering chip, a power circuit board, and an inner surface of the housing.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, which, when executed, are used to execute the method for analyzing and predicting self-heating error compensation of an electric energy meter as claimed in any one of claims 1 to 7.
9. 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 7, and the processor reads the memory to execute the steps.
Citation Information
Patent Citations
Impact load prediction method based on improved GRU and differential error compensation
CN113837480A
Two-stage short-term power load combined prediction method considering error compensation
CN116526450A