An online diagnosis method for electric energy meter inaccuracy based on lightweight neural network

By combining wavelet transform and lightweight neural network technology, efficient and accurate diagnosis of energy meter misalignment is achieved, which solves the problems of traditional methods that are time-consuming, labor-intensive, high-cost, and poor real-time performance, and improves the accuracy and efficiency of diagnosis.

CN119089314BActive Publication Date: 2025-01-21国网安徽省电力有限公司营销服务中心 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411591505.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-01-21
Estimated Expiration
2044-11-08

AI Technical Summary

Technical Problem

Traditional electrical meter misalignment diagnosis methods are time-consuming, labor-intensive, costly, poor real-time, insufficient accuracy and reliability, difficult to deal with complex and diverse misalignment causes, and complex maintenance.

Method used

An online diagnosis method for electric energy meter misalignment based on lightweight neural network is adopted, data is denoised through wavelet transform, and a 1D-ResNet neural network is designed to diagnose electric energy meter misalignment. This method combines adaptive wavelet basis function selection and lightweight neural network technology to achieve efficient and accurate diagnosis of energy meter misalignment.

Benefits of technology

It improves the accuracy and efficiency of energy meter misalignment diagnosis, reduces the burden of algorithm operation on the energy meter, achieves rapid response and real-time monitoring, and is suitable for applications in resource-constrained environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119089314B_ABST
    Figure CN119089314B_ABST
Patent Text Reader

Abstract

The invention discloses an online diagnosis method for misalignment of electric energy meters based on a lightweight neural network, which belongs to the technical field of intelligent device detection and solves the problem of how to improve the accuracy of misalignment diagnosis of electric energy meters and reduce the burden of algorithm operation on electric energy meters. The invention realizes adaptive wavelet basis function selection according to the principle of maximum wavelet coefficient energy, enhances the adaptability of wavelet decomposition, and effectively removes noise from data by using wavelet decomposition, thereby improving the accuracy of data and reducing the influence of data on the operation results of neural network. The invention realizes automatic diagnosis of misalignment of electric energy meters by using lightweight neural network, accelerates the operation speed, training speed and convergence speed of the algorithm, and reduces the load of CPU operation caused by the operation of the algorithm. At the same time, the method can improve the accuracy of misalignment diagnosis of electric energy meters and reduce the occupation of operation resources of electric energy meters, thereby meeting the requirements of modern smart grids for real-time monitoring, efficient operation and maintenance and intelligent management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of intelligent device detection, and relates to an online diagnosis method for misalignment of an electric energy meter based on a lightweight neural network. Background Art

[0002] The electric energy meter is an important device used to measure the electric energy consumption in the power system. Its accuracy and reliability are directly related to the fairness of power supply and billing. With the development of smart grids and the increasing requirements of users for the accuracy of electric energy metering, the performance of the electric energy meter is particularly important. However, during the long-term use of the electric energy meter, due to environmental factors, aging, transformer errors and other reasons, inaccuracy may occur, affecting the accuracy and reliability of measurement. Therefore, it is of great practical significance to study and develop a method that can accurately diagnose the inaccuracy of the electric energy meter.

[0003] Traditional methods for diagnosing misalignment of electric energy meters mainly rely on manual inspection and periodic calibration, which is not only time-consuming and labor-intensive, but also costly, and it is difficult to detect and deal with the misalignment of electric energy meters in real time. With the development of modern information technology and data processing technology, diagnostic methods based on data analysis and machine learning have gradually become a research hotspot. These methods can use a large amount of historical data and real-time data to analyze and predict the operating status of electric energy meters, thereby achieving early detection and accurate diagnosis of misalignment of electric energy meters.

[0004] The traditional methods for diagnosing inaccuracy of electric energy meters have the following main disadvantages:

[0005] (1) Inspection and periodic verification are time-consuming and labor-intensive: Traditional methods rely on manual inspection and periodic verification, which requires a lot of manpower and time, is inefficient, and cannot achieve rapid response;

[0006] (2) High cost: Manual inspection and verification is not only time-consuming, but also requires professional equipment and technicians, so the cost is high. For large-scale electricity meter systems, this method is not economical.

[0007] (3) Poor real-time performance: Traditional methods are usually carried out periodically and cannot monitor and diagnose the status of the electric energy meter in real time; therefore, the inaccuracy problem of the electric energy meter between two calibrations may not be discovered and handled in time, affecting the accuracy of measurement;

[0008] (4) Insufficient accuracy and reliability: Manual inspection and verification are easily affected by human factors and subjective judgment, and there are errors and uncertainties, resulting in low accuracy and reliability of diagnostic results;

[0009] (5) Difficulty in handling complex and diverse causes of inaccuracy: There are many reasons for the inaccuracy of electric energy meters, including environmental factors, aging, transformer errors, etc. Traditional methods often find it difficult to effectively diagnose and handle different causes;

[0010] (6) Complex maintenance: There are a large number of electricity meters, which are widely distributed. Traditional methods make maintenance and management complex and it is easy to miss some equipment that needs calibration and maintenance. Summary of the invention

[0011] The technical solution of the present invention is used to solve the problem of how to improve the accuracy of misalignment diagnosis of an electric energy meter and reduce the burden of the algorithm operation on the electric energy meter.

[0012] The present invention solves the above technical problems through the following technical solutions:

[0013] The present invention provides an online diagnosis method for electric energy meter misalignment based on a lightweight neural network, comprising the following steps:

[0014] Step 1: Get the measured value of the electric energy parameter of the electric energy meter, recorded as , Indicates the first measurement value, n represents the number of data points;

[0015] Step 2: Adopting the principle of maximum wavelet coefficient energy to adaptively select wavelet decomposition basis functions;

[0016] Step 3: Connect the transformer output to the ADC to obtain the measurement value calculated by the ADC, which is recorded as ,in, Indicates the ADC measurement value Values;

[0017] Step 4: Perform wavelet denoising on the obtained ADC calculated measurement value to obtain the denoised detail coefficient , Indicates the ADC calculated measurement value after denoising. Detail coefficients; perform inverse wavelet transform on the denoised detail coefficients to obtain the ADC measurement value after denoising ,in, The ADC measurement value after denoising. Values;

[0018] Step 5: Design a lightweight neural network to diagnose the inaccuracy of the electric energy meter;

[0019] Step 6: Input the data of the electric energy meter to be diagnosed into the trained 1D-ResNet neural network, and judge the inaccuracy of the electric energy meter according to the operation results.

[0020] Furthermore, the method for adaptively selecting the wavelet decomposition basis function using the principle of maximum wavelet coefficient energy is specifically as follows:

[0021] Step 2.1, using Db1-Db10 as the candidate functions of the wavelet decomposition basis function, using the candidate functions to perform wavelet decomposition on the meter value, and obtaining the wavelet decomposition detail coefficient vector under each candidate function ,in, Indicates The detail coefficient, Represents the length of the detail coefficient vector;

[0022] Step 2.2, calculate the total wavelet coefficient energy, and select the wavelet basis function corresponding to the maximum total wavelet coefficient energy as the optimal wavelet decomposition basis function according to the principle of maximum wavelet coefficient energy;

[0023] Step 2.3: Use the wavelet decomposition result corresponding to the optimal wavelet decomposition basis function to denoise the meter value and obtain the denoised detail coefficient. ,in, Indicates the denoised value of the electric energy meter. Detail coefficients;

[0024] Step 2.4: Perform inverse wavelet transform on the denoised detail coefficients to obtain the denoised electric energy meter measurement value , The first A measurement value.

[0025] Furthermore, the calculation formula of the total wavelet coefficient energy is as follows:

[0026]

[0027] in, represents the wavelet coefficient, j is the calculation factor, and its value is 1, 2,…, m.

[0028] Furthermore, the method for designing a lightweight neural network to diagnose the misalignment of an electric energy meter is specifically as follows:

[0029] Step 5.1: Perform maximum and minimum normalization on the data set to obtain the normalized data set , ,in, Indicates the normalized value of the electric energy meter. Values; The first ADC value after normalization. Values;

[0030] Step 5.2: Connect the energy meter measurement value and the ADC measurement value to obtain the lightweight neural network input vector , where the first n are the energy meter measurement values, and the last n are the ADC measurement values;

[0031] Step 5.3, design the 1D-Resnet neural network as follows:

[0032]

[0033] in, represents the output of two convolutions in the residual network, is the output feature, is the input feature, represents the convolution operation, and is the convolution kernel weight, and is the convolution kernel bias;

[0034] Finally, after the residual network, the fully connected layer, and the output layer, the final output is obtained, as shown in the following formula:

[0035]

[0036] in, is the final output of the residual network, is the final output vector;

[0037] Step 5.4, using a fine-grained pruning method to perform a pruning operation on the 1D-ResNet neural network; the fine-grained pruning method to perform a pruning operation on the 1D-ResNet neural network includes: weight importance evaluation, determining a pruning threshold, pruning decision, and fine-tuning after pruning;

[0038] The formula for weight importance evaluation is as follows:

[0039]

[0040] in, is the neural network weight;

[0041] Select pruning ratio To adapt to the online operation of the electric energy meter, the 1D-ResNet neural network is pruned using the formula for weight importance evaluation to find the absolute value of all weights. Percentile, calculated as follows:

[0042]

[0043] in, represents the set of all absolute values ​​of weights, is the calculated pruning threshold, To find the weight Percentile operations;

[0044] According to the determined pruning threshold , the following formula is used for pruning decision:

[0045]

[0046] Finally, fine-tuning is performed after pruning. The pruned 1D-ResNet neural network is retrained using the mean square error loss function and the stochastic gradient descent optimizer to restore the performance and obtain the final output vector .

[0047] Furthermore, the structure of the 1D-Resnet neural network is: one input layer, one convolution layer, one batch normalization layer, one ReLU activation layer, three residual modules, one fully connected layer and one output layer; wherein, the dimension of the input layer is 2n×1; the number of convolution layer filters is 64, the convolution kernel size is 3, the step size is 1, and the activation function is ReLU; three residual modules, each residual module is composed of a convolution layer, a batch normalization layer, a ReLU activation layer, a convolution layer, a batch normalization layer, and a residual connection layer, the number of filters in each convolution layer is 64, the convolution kernel size is 3, the step size is 1, and the activation function is ReLU; one fully connected layer, the number of neural units in the fully connected layer is 128, the activation function is ReLU, one output layer, and the output vector dimension size is n×1.

[0048] Furthermore, the mean square error loss function calculation formula is as follows:

[0049]

[0050] in, is the sample size, Indicates The true value of the samples, Indicates The predicted value of a sample.

[0051] Furthermore, the update formula of the stochastic gradient descent optimizer is as follows:

[0052]

[0053] in, Indicates an update operation. are model parameters, is the learning rate, Represents the mean square error loss function Parameters gradient.

[0054] Furthermore, the updating method of the stochastic gradient descent optimizer is as follows: First, the model parameters are randomly initialized ; Secondly, randomly select a sample from the training set to calculate the mean square error loss function and its gradient ; Then, update the model parameters ; Finally, the iteration is repeated until convergence or the predetermined number of iterations is reached.

[0055] The present invention also provides an electronic device, comprising a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the above-mentioned online diagnosis method for electric energy meter misalignment based on lightweight neural network, and the processor is configured to execute the program stored in the memory.

[0056] The present invention also provides a storage medium having a computer program stored thereon. When the computer program is run by a processor, the steps of the above-mentioned online diagnosis method for misalignment of an electric energy meter based on a lightweight neural network are executed.

[0057] The method of the present invention achieves accurate diagnosis of the misalignment of the electric energy meter by obtaining the measured value of the electric energy parameter of the electric energy meter and combining wavelet transform and lightweight neural network technology. The method first performs denoising on the measured value of the electric energy meter through wavelet transform to remove noise and improve the accuracy of the data. Wavelet transform is a time-frequency analysis method that can effectively perform multi-scale analysis on signals, thereby removing noise while retaining the main features of the signal. In order to ensure the denoising effect, the method of the present invention adopts an adaptive wavelet basis function selection method, by calculating the total wavelet coefficient energy, selecting the optimal wavelet basis function for wavelet decomposition and denoising, thereby enhancing the adaptability of wavelet decomposition and reducing the impact of the denoising process on the neural network.

[0058] After data preprocessing, a 1D-ResNet neural network model is designed and the model is lightweighted by fine-grained pruning to realize the diagnosis of electric energy meter inaccuracy. Through residual connection, 1D-ResNet can effectively alleviate the gradient vanishing problem, so that deeper networks can be trained smoothly. At the same time, residual connection allows gradients to be propagated more directly, improving training efficiency. Neural network is a computational model that simulates the structure and function of human brain neurons and has powerful data processing and pattern recognition capabilities. Compared with traditional deep neural networks, lightweight neural networks have the advantages of simple structure, small amount of calculation, and fast training speed, which are very suitable for application in resource-constrained environments. The designed lightweight neural network model includes an input layer, a convolutional layer, a batch normalization layer, a ReLU activation layer, three residual modules, a fully connected layer, and an output layer. The electric energy meter measurement value and ADC calculation value are normalized and input into the neural network as input vectors. After training, the diagnosis result of electric energy meter inaccuracy is obtained.

[0059] In order to improve the training effect and diagnostic accuracy of the neural network model, the mean square error loss function and stochastic gradient descent optimizer are used to train the model. The mean square error loss function can measure the gap between the model's predicted value and the true value, and the stochastic gradient descent optimizer iteratively optimizes the model parameters to gradually reduce the loss function, thereby improving the model's prediction ability. During the model training process, the model parameters are first randomly initialized, and then samples are randomly selected from the training set to calculate the loss function and its gradient, and then the model parameters are updated. This process is repeated until the model converges or reaches a predetermined number of iterations.

[0060] In summary, the method of the present invention realizes efficient and accurate diagnosis of electric energy meter misalignment by combining wavelet transform and lightweight neural network technology. This method can not only denoise the metering data of electric energy meters in complex environments and improve the accuracy of data, but also use lightweight neural networks to realize rapid diagnosis of electric energy meter misalignment, which has important practical application value and broad application prospects. In the future, with the continuous development and optimization of data processing technology and machine learning algorithms, the electric energy meter misalignment diagnosis method will become more intelligent and automated, further improving the metering accuracy and reliability of electric energy meters, and providing strong guarantee for the stable operation of power systems.

[0061] Compared with the prior art, the present invention has the following beneficial effects:

[0062] (1) Efficient denoising: The present invention uses wavelet transform to denoise the measured value of the electric energy meter. By adaptively selecting the optimal wavelet basis function, the noise can be effectively removed and the accuracy of the data can be improved. This method is more accurate and efficient than traditional low-pass filtering or simple smoothing methods.

[0063] (2) Adaptive wavelet basis function selection: The present invention calculates the total wavelet coefficient energy and selects the optimal wavelet basis function for wavelet decomposition and denoising, thereby enhancing the adaptability of wavelet decomposition and ensuring the best denoising effect. Traditional methods usually use fixed wavelet basis functions, which cannot be adaptively adjusted according to data characteristics, and the denoising effect is not ideal.

[0064] (3) Lightweight neural network: The present invention designs and uses a lightweight neural network model to diagnose electricity meter inaccuracy. Compared with traditional deep neural networks, it has a simple structure, small computational complexity, and fast training speed, making it particularly suitable for application in resource-constrained environments. Traditional methods mostly rely on complex machine learning models or manual rules, consume a lot of computing resources, and are difficult to apply in real time.

[0065] (4) Comprehensive data analysis: The present invention combines the meter measurement value and the ADC calculation value, and uses a neural network for comprehensive analysis to improve the accuracy and reliability of the meter misalignment diagnosis. In contrast, traditional methods are mostly single data source analysis and fail to fully utilize the information from multiple source data. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 It is a flow chart of the online diagnosis method of electric energy meter misalignment based on lightweight neural network of the present invention;

[0067] Figure 2 It is a data comparison diagram between the measured value of the electric energy meter 1 of the present invention and the ADC calculated value;

[0068] Figure 3 It is a data comparison diagram between the measured value of the electric energy meter 2 of the present invention and the ADC calculated value. DETAILED DESCRIPTION

[0069] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in combination with the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0070] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and specific embodiments:

[0071] Embodiment 1

[0072] The present embodiment discloses an online diagnosis method for misalignment of electric energy meters based on a lightweight neural network. The method of the present embodiment realizes adaptive wavelet basis function selection according to the principle of maximum wavelet coefficient energy, thereby enhancing the adaptability of wavelet decomposition, and at the same time effectively removes noise from data by using wavelet decomposition, thereby improving the accuracy of data and reducing the influence of data on the operation results of the neural network. The lightweight neural network is used to realize automatic diagnosis of misalignment of electric energy meters, thereby accelerating the operation speed, training speed and convergence speed of the algorithm and reducing the load of the algorithm operation on the CPU operation. At the same time, the accuracy of diagnosis of misalignment of electric energy meters can be improved, the resource occupation of electric energy meters can be reduced, and the requirements of modern smart grids for real-time monitoring, efficient operation and maintenance, and intelligent management can be met. For details, refer to Figure 1 , including the following steps:

[0073] The present invention provides an online diagnosis method for electric energy meter misalignment based on a lightweight neural network, comprising the following steps:

[0074] Step 1: Get the measured value of the electric energy parameter of the electric energy meter, recorded as , Indicates the first measurement value, n represents the number of data points;

[0075] Step 2: Adopt the principle of maximum wavelet coefficient energy to adaptively select the wavelet decomposition basis function. The specific method is as follows:

[0076] Step 2.1, using Db1-Db10 as the candidate functions of the wavelet decomposition basis function, using the candidate functions to perform wavelet decomposition on the meter value, and obtaining the wavelet decomposition detail coefficient vector under each candidate function ,in, Indicates The detail coefficient, Represents the length of the detail coefficient vector;

[0077] Step 2.2, calculate the total wavelet coefficient energy, and select the wavelet basis function corresponding to the maximum total wavelet coefficient energy as the optimal wavelet decomposition basis function according to the principle of maximum wavelet coefficient energy;

[0078] The calculation formula of the total wavelet coefficient energy is as follows:

[0079]

[0080] in, represents the wavelet coefficient, j is the calculation factor, and its value is 1, 2,…, m.

[0081] Step 2.3: Use the wavelet decomposition result corresponding to the optimal wavelet decomposition basis function to denoise the meter value and obtain the denoised detail coefficient. ,in, Indicates the denoised value of the electric energy meter. Detail coefficients;

[0082] Step 2.4: Perform inverse wavelet transform on the denoised detail coefficients to obtain the denoised electric energy meter measurement value , The first A measurement value;

[0083] Step 3: Connect the transformer output to the ADC to obtain the measurement value calculated by the ADC, which is recorded as ,in, Indicates the ADC measurement value Values;

[0084] Step 4: Perform wavelet denoising on the obtained ADC calculated measurement value to obtain the denoised detail coefficient , Indicates the ADC calculated measurement value after denoising. Detail coefficients; perform inverse wavelet transform on the denoised detail coefficients to obtain the ADC measurement value after denoising ,in, The ADC measurement value after denoising. Values;

[0085] Step 5: Design a lightweight neural network to diagnose the inaccuracy of the electric energy meter. The specific method is as follows:

[0086] Step 5.1: Perform maximum and minimum normalization on the data set to obtain the normalized data set , ,in, Indicates the normalized value of the electric energy meter. Values; The first ADC value after normalization. Values;

[0087] Step 5.2: Connect the energy meter measurement value and the ADC measurement value to obtain the lightweight neural network input vector , where the first n are the energy meter measurement values, and the last n are the ADC measurement values;

[0088] Step 5.3, design the 1D-Resnet neural network as follows:

[0089]

[0090] in, represents the output of two convolutions in the residual network, is the output feature, is the input feature, represents the convolution operation, and is the convolution kernel weight, and is the convolution kernel bias;

[0091] Finally, after the residual network, the fully connected layer, and the output layer, the final output is obtained, as shown in the following formula:

[0092]

[0093] in, is the final output of the residual network, is the final output vector.

[0094] The structure of the 1D-Resnet neural network is: one input layer, one convolution layer, one batch normalization layer, one ReLU activation layer, three residual modules, one fully connected layer and one output layer; wherein the input layer has a dimension of 2n×1; the number of convolution layer filters is 64, the convolution kernel size is 3, the step size is 1, and the activation function is ReLU; three residual modules, each residual module is composed of a convolution layer, a batch normalization layer, a ReLU activation layer, a convolution layer, a batch normalization layer, and a residual connection layer, the number of filters in each convolution layer is 64, the convolution kernel size is 3, the step size is 1, and the activation function is ReLU; one fully connected layer, the number of neural units in the fully connected layer is 128, the activation function is ReLU, one output layer, and the output vector dimension size is n×1.

[0095] Step 5.4, after the training is completed, in order to enable the neural network to run online on the electric meter, a fine-grained pruning method is used to prune the 1D-ResNet neural network; the fine-grained pruning method used to prune the 1D-ResNet neural network includes: weight importance evaluation, determination of pruning threshold, pruning decision, and fine-tuning after pruning.

[0096] The formula for weight importance evaluation is as follows:

[0097]

[0098] in, is the neural network weight;

[0099] Select pruning ratio To adapt to the online operation of the electric energy meter, the 1D-ResNet neural network is pruned using the formula for weight importance evaluation to find the absolute value of all weights. Percentile, calculated as follows:

[0100]

[0101] in, represents the set of all absolute values ​​of weights, is the calculated pruning threshold, To find the weight Percentile operations;

[0102] According to the determined pruning threshold , the following formula is used for pruning decision:

[0103]

[0104] Finally, fine-tuning is performed after pruning. The pruned 1D-ResNet neural network is retrained using the mean square error loss function and the stochastic gradient descent optimizer to restore the performance and obtain the final output vector .

[0105] The mean square error loss function calculation formula is as follows:

[0106]

[0107] in, is the sample size, Indicates The true value of the samples, Indicates The predicted value of a sample.

[0108] The update formula of the stochastic gradient descent optimizer is as follows:

[0109]

[0110] in, Indicates an update operation. are model parameters, is the learning rate, Represents the mean square error loss function Parameters gradient.

[0111] The updating method of the stochastic gradient descent optimizer is as follows: First, the model parameters are randomly initialized ; Secondly, randomly select a sample from the training set to calculate the mean square error loss function and its gradient ; Then, update the model parameters ; Finally, the iteration is repeated until convergence or the predetermined number of iterations is reached.

[0112] Step 6: Input the data of the electric energy meter to be diagnosed into the trained 1D-ResNet neural network, and judge the inaccuracy of the electric energy meter according to the operation results.

[0113] Simulation test

[0114] Table 1 shows the results of adaptive selection of wavelet basis functions. As shown in Table 1, the total wavelet energy corresponding to different data of basis functions Db1-Db10 is also different. The larger the total wavelet energy, the more information it contains after decomposition. Therefore, after decomposition, the basis function corresponding to the maximum total wavelet coefficient energy can be selected as the basis function for subsequent wavelet decomposition.

[0115] Table 1 Results of adaptive selection of wavelet basis functions

[0116]

[0117] Table 2 shows the error of wavelet decomposition under each wavelet basis function. As shown in Table 2, it can be seen that selecting the wavelet decomposition basis function according to the maximum total wavelet coefficient energy can basically ensure the minimum error.

[0118] Table 2 Error of wavelet decomposition under each wavelet basis function

[0119]

[0120] Figure 2 It is a data comparison between the measurement value of the energy meter 1 and the ADC calculated value. After the lightweight neural network calculation, it can be seen that most of the data remain near 0. Therefore, it can be seen that the measurement value of the energy meter is almost equal to the ADC calculated value, so there is no inaccuracy in the energy meter.

[0121] Figure 3 It is a data comparison between the measurement value of the energy meter 2 and the ADC calculated value. After the lightweight neural network calculation, it can be seen that only a small part of most of the data is near 0. Therefore, it can be seen that there is a large difference between the measurement value of the energy meter and the ADC calculated value, so the energy meter is inaccurate.

[0122] The method of the present invention has the advantages of high diagnostic accuracy, online operation, low operating burden, effective data noise removal, etc. The adaptability of wavelet decomposition is enhanced by adaptive wavelet basis function selection, data noise is effectively removed, and data accuracy is improved. At the same time, a lightweight neural network is used to accelerate the training speed and convergence speed, thereby improving the accuracy of the misalignment diagnosis of the electric energy meter and reducing the burden of the algorithm operation on the electric energy meter, thereby providing an important guarantee for the smooth operation of the power grid.

[0123] Embodiment 2

[0124] An electronic device includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the online diagnosis method for misalignment of an electric energy meter based on a lightweight neural network in Example 1, and the processor is configured to execute the program stored in the memory.

[0125] Embodiment 3

[0126] A storage medium stores a computer program, which, when executed by a processor, executes the steps of the online diagnosis method for misalignment of an electric energy meter based on a lightweight neural network in embodiment 1.

[0127] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An online diagnosis method for electric energy meter misalignment based on lightweight neural network, characterized in that: The following steps are involved: Step 1: Get the measured value of the electric energy parameter of the electric energy meter, recorded as , Indicates the energy meter measurement value, n represents the number of data points; Step 2: Adopting the principle of maximum wavelet coefficient energy to adaptively select wavelet decomposition basis functions; Step 3: Connect the transformer output to the ADC to obtain the measurement value calculated by the ADC, which is recorded as ,in, Indicates the ADC measurement value Values; Step 4: Perform wavelet denoising on the obtained ADC calculated measurement value to obtain the denoised detail coefficient , Indicates the ADC calculated measurement value after denoising. Detail coefficients; perform inverse wavelet transform on the denoised detail coefficients to obtain the ADC measurement value after denoising ,in, The ADC measurement value after denoising. values; Step 5: Design a lightweight neural network to diagnose the inaccuracy of the electric energy meter; Step 6: Input the data of the electric energy meter to be diagnosed into the trained 1D-ResNet neural network, and judge the inaccuracy of the electric energy meter according to the operation results.

2. The method for online diagnosis of electric energy meter misalignment based on lightweight neural network according to claim 1 is characterized in that: The method for adaptively selecting the wavelet decomposition basis function using the principle of maximum wavelet coefficient energy is as follows: Step 2.1, using Db1-Db10 as the candidate functions of the wavelet decomposition basis function, using the candidate functions to perform wavelet decomposition on the meter value, and obtaining the wavelet decomposition detail coefficient vector under each candidate function ,in, Indicates The detail coefficient, Represents the length of the detail coefficient vector; Step 2.2, calculate the total wavelet coefficient energy, and select the wavelet basis function corresponding to the maximum total wavelet coefficient energy as the optimal wavelet decomposition basis function according to the principle of maximum wavelet coefficient energy; Step 2.3: Use the wavelet decomposition result corresponding to the optimal wavelet decomposition basis function to denoise the meter value and obtain the denoised detail coefficient. ,in, Indicates the denoised value of the electric energy meter. Detail coefficients; Step 2.4: Perform inverse wavelet transform on the denoised detail coefficients to obtain the denoised electric energy meter measurement value , The first A measurement value.

3. The method for online diagnosis of electric energy meter misalignment based on lightweight neural network according to claim 2 is characterized in that: The calculation formula of the total wavelet coefficient energy is as follows: in, represents the wavelet coefficient, j is the calculation factor, and its value is 1, 2,…, m.

4. The method for online diagnosis of electric energy meter misalignment based on lightweight neural network according to claim 1, characterized in that: The method for designing a lightweight neural network to diagnose the misalignment of an electric energy meter is specifically as follows: Step 5.1: Perform maximum and minimum normalization on the data set to obtain the normalized data set , ,in, Indicates the normalized value of the electric energy meter. values; The first ADC value after normalization. values; Step 5.2: Connect the energy meter measurement value and the ADC measurement value to obtain the lightweight neural network input vector , where the first n are the energy meter measurement values, and the last n are the ADC measurement values; Step 5.3, design the 1D-Resnet neural network as follows: in, represents the output of two convolutions in the residual network, is the output feature, is the input feature, represents the convolution operation, and is the convolution kernel weight, and is the convolution kernel bias; Finally, after the residual network, the fully connected layer, and the output layer, the final output is obtained, as shown in the following formula: in, is the final output of the residual network, is the final output vector; Step 5.4, using a fine-grained pruning method to perform a pruning operation on the 1D-ResNet neural network; the fine-grained pruning method to perform a pruning operation on the 1D-ResNet neural network includes: weight importance evaluation, determining a pruning threshold, pruning decision, and fine-tuning after pruning; The formula for weight importance evaluation is as follows: in, is the neural network weight; Select pruning ratio To adapt to the online operation of the electric energy meter, the 1D-ResNet neural network is pruned using the formula for weight importance evaluation to find the absolute value of all weights. Percentile, calculated as follows: in, represents the set of all absolute values ​​of weights, is the calculated pruning threshold, To find the weight Percentile operations; According to the determined pruning threshold , the following formula is used for pruning decision: Finally, fine-tuning is performed after pruning. The pruned 1D-ResNet neural network is retrained using the mean square error loss function and the stochastic gradient descent optimizer to restore the performance and obtain the final output vector .

5. The method for online diagnosis of electric energy meter misalignment based on lightweight neural network according to claim 1, characterized in that: The structure of the 1D-Resnet neural network is: one input layer, one convolution layer, one batch normalization layer, one ReLU activation layer, three residual modules, one fully connected layer and one output layer; wherein the input layer has a dimension of 2n×1; the number of convolution layer filters is 64, the convolution kernel size is 3, the step size is 1, and the activation function is ReLU; three residual modules, each residual module is composed of a convolution layer, a batch normalization layer, a ReLU activation layer, a convolution layer, a batch normalization layer, and a residual connection layer, the number of filters in each convolution layer is 64, the convolution kernel size is 3, the step size is 1, and the activation function is ReLU; one fully connected layer, the number of neural units in the fully connected layer is 128, the activation function is ReLU, one output layer, and the output vector dimension size is n×1.

6. The method for online diagnosis of electric energy meter misalignment based on lightweight neural network according to claim 1, characterized in that: The mean square error loss function calculation formula is as follows: in, is the sample size, Indicates The true value of the samples, Indicates The predicted value of a sample.

7. The method for online diagnosis of electric energy meter misalignment based on lightweight neural network according to claim 1, characterized in that: The update formula of the stochastic gradient descent optimizer is as follows: in, Indicates an update operation. are model parameters, is the learning rate, Represents the mean square error loss function Parameters gradient.

8. The method for online diagnosis of electric energy meter misalignment based on lightweight neural network according to claim 7, characterized in that: The updating method of the stochastic gradient descent optimizer is as follows: First, the model parameters are randomly initialized ; Secondly, randomly select a sample from the training set to calculate the mean square error loss function and its gradient ; Then, update the model parameters ; Finally, the iteration is repeated until convergence or the predetermined number of iterations is reached.

9. An electronic device, comprising a memory and a processor, characterized in that: The memory is used to store a program that supports the processor to execute the online diagnosis method for electric energy meter misalignment based on a lightweight neural network as described in any one of claims 1 to 8, and the processor is configured to execute the program stored in the memory.

10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the online diagnosis method for electric energy meter misalignment based on a lightweight neural network as described in any one of claims 1 to 8 are executed.

Citation Information

Patent Citations

  • Intelligent fault diagnosis method and device for aircraft fuel pump and storage medium

    CN115017939A

  • Electric energy meter misalignment diagnosis method, electronic equipment and storage medium

    CN118628835A