Metering terminal meter failure rate prediction method based on GRU-attention mechanism

By constructing a hybrid model based on the GRU-attention mechanism, the complex temporal characteristics of metering terminal meters are captured, solving the problem of low accuracy in metering terminal meter fault prediction, realizing early warning and precise operation and maintenance, and improving the effectiveness of equipment health management.

CN121009322APending Publication Date: 2025-11-25YUXI POWER SUPPLY BUREAU OF YUNNAN POWER GRID
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511100605.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-07
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

Existing metering terminal fault prediction methods are insufficient in processing complex time-series data features, struggle to capture the dynamic changes in equipment operating status, have low prediction accuracy, and lack efficient fault prediction means.

Method used

A method for predicting the failure rate of metering terminals based on the GRU-attention mechanism is adopted. By integrating equipment operating parameters, age parameters, and environmental parameters, a hybrid model of bidirectional GRU and attention mechanism is constructed, weights are dynamically allocated, complex time-series features are captured, and failure rate is predicted.

Benefits of technology

It significantly improves the accuracy and practicality of failure rate prediction, enables early warning, provides a scientific basis for operation and maintenance, reduces operation and maintenance costs, and improves equipment reliability and power grid operation reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121009322A_ABST
    Figure CN121009322A_ABST
Patent Text Reader

Abstract

The invention provides a GRU-attention mechanism-based metering terminal meter fault rate prediction method, relates to the technical field of smart power grid and power equipment health management, and aims to solve the problems of insufficient feature capture and low prediction precision of complex time sequence data in the prior art. The metering terminal meter fault rate prediction method based on the GRU-attention mechanism comprises the following steps: constructing a multi-dimensional fault prediction index system based on equipment operation parameters, age limit parameters and environmental parameters, and preprocessing original data by adopting a median filtering method and Min-Max normalization; an attention mechanism is embedded into a GRU layer to form an end-to-end GRU-attention mixed prediction model, and the steps of model training and optimization, failure rate prediction, result analysis and the like are carried out. According to the method, through fusing the time sequence modeling capability of the GRU and the feature focusing capability of the attention mechanism, the accuracy of metering terminal meter fault rate prediction is remarkably improved, the early warning of the metering equipment fault rate is effectively realized, and an auxiliary decision basis is provided for operation and maintenance work.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of smart grid and power equipment health management, and particularly relates to a metering terminal meter failure rate prediction method based on a GRU-attention mechanism. BACKGROUND

[0002] With the continuous promotion of the digital upgrade of the smart grid and the full coverage strategy of low-voltage distribution areas, the metering terminal meter as the core sensing unit of the power consumption information collection system undertakes the key functions of user-side electric energy metering, load monitoring and data interaction. At present, the scale of the metering terminal meter deployed throughout the network has broken through 1 billion, and its operation reliability is directly related to the quality of power marketing services and the economic operation level of the power grid.

[0003] However, in the long-term operation process, the metering terminal meter generally faces the following main problems: 1. High load operation of equipment: due to continuous high load operation, equipment components are prone to aging, resulting in a significant increase in failure rate. 2. Environmental stress erosion: complex operating environments such as high temperature, high humidity, and electromagnetic interference have a serious impact on equipment performance. 3. Incomplete operation and maintenance system: current operation and maintenance work relies too much on regular inspection and passive repair mode, and lacks efficient failure prediction means, making it difficult to achieve early warning and precise maintenance.

[0004] In addition, the existing research and technical means have obvious deficiencies: Existing power equipment health management research is mostly focused on high-voltage main equipment such as transformers and circuit breakers, and the proportion of failure prediction research for metering terminal meters is less than 3%, and the related technology accumulation is relatively weak. A few metering terminal meter failure prediction models based on discrete fault work orders only construct regression analysis, without fully considering real-time operating parameters, environmental factors and installation conditions and other multi-dimensional data, resulting in low prediction accuracy when dealing with differentiated scenarios.

[0005] The above problems show that the existing failure rate prediction method is insufficient in handling complex time series data features, and it is difficult to capture the dynamic change law of the equipment operating state, and the prediction accuracy cannot meet the actual demand. Therefore, there is an urgent need for a technical solution that can effectively integrate multi-source heterogeneous data, capture complex time series features and significantly improve prediction accuracy. SUMMARY

[0006] To solve the above problems, the present application proposes a metering terminal meter failure rate prediction method based on a GRU-attention mechanism, which significantly improves the accuracy of metering terminal meter failure rate prediction by integrating the time series modeling capability of GRU and the feature focusing capability of attention mechanism, effectively realizes early warning of metering equipment failure rate, and provides auxiliary decision basis for operation and maintenance work.

[0007] The technical scheme adopted by the present application is: The metering terminal meter failure rate prediction method based on the GRU-attention mechanism comprises the following steps: Step 1, constructing a metering terminal meter failure rate prediction index system: a comprehensive index system covering equipment operation parameters, age parameters and environmental parameters is constructed to provide input data basis for the model; Step 2, preprocessing the original data: the original data is smoothed by the median filtering method to eliminate abnormal values, and is normalized by Min-Max to eliminate noise and order of magnitude difference of the data; Step 3, constructing a GRU-attention hybrid prediction model: a hybrid model combining bidirectional GRU and attention mechanism is constructed to capture complex time sequence features of the data and focus on key time step information; the model includes a GRU input layer, a GRU layer, an attention mechanism layer and a fully connected output layer, wherein the attention mechanism layer dynamically allocates weights of different time sequence features; Step 4, model training and optimization: using the weighted mean square error WMSE loss function, the weight of high failure rate sample is tilted to improve the prediction ability of the model for rare events; using the optimizer Nadam and the learning rate decay mechanism to accelerate the convergence of the model; introducing Dropout and early stopping mechanism to enhance the model; Step 5, failure rate prediction and result analysis: using the trained model to generate accurate failure rate prediction results, and verifying its effectiveness and practicality combined with actual application scenarios.

[0008] Further, the equipment operation parameters include: data acquisition success rate , voltage fluctuation rate , current harmonic distortion rate , electric energy metering error , device restart frequency ; the age parameters include: cumulative running time , maintenance cycle compliance rate , hardware aging score .

[0009] Further, in the equipment operation parameters: The calculation formula of the data acquisition success rate is: ; In the formula, is the number of successfully collected data in unit time; is the total number of collection attempts in unit time; The calculation formula of the voltage fluctuation rate is: ; In the formula, is the sample standard deviation of voltage; The rated voltage of the equipment; Current harmonic distortion rate The calculation formula is: ; In the formula, For the first The effective value of the subharmonic current; This is the effective value of the fundamental current; The highest harmonic order is considered; Electricity metering error The calculation formula is: ; In the formula, The actual electrical energy value measured by the equipment; This is the nominal value of a standard electricity meter; Device restart frequency The calculation formula is: ; In the formula, This represents the number of abnormal restarts per unit of time. The statistical period is specified.

[0010] Furthermore, in the stated age parameter: Cumulative running time The calculation formula is: ; In the formula, This is the current timestamp; For the equipment installation timestamp; Maintenance cycle compliance rate The calculation formula is: ; In the formula, This refers to the actual number of maintenance operations performed. The number of planned maintenance sessions; Hardware aging rating The calculation formula is: ; In the formula, Runtime weighting factor; Cumulative running time; Design life of the equipment; To maintain the compliance rate weighting factor; To maintain the compliance rate of the cycle.

[0011] Furthermore, the environmental parameters include: installation location type coding rules, and ambient temperature values. Humidity measurement value Electromagnetic interference intensity measurement value (EMI); where the coding rule for installation location type is: 0 for indoor equipment and 1 for outdoor equipment.

[0012] Furthermore, in step 2, the outlier smoothing process performed on the original data using median filtering includes: Median filtering primarily replaces outliers by selecting the median value within a neighboring window for each data point in the original data sequence. The window size is dynamically adjusted based on the data sampling frequency. The sliding window size is The filter calculation formula is: ; In the formula, The first one after median filtering The filtered value of each data point; The first in the original data sequence One data point; The size of the sliding window represents the selected neighborhood range, which is dynamically adjusted according to the data sampling frequency. This represents half the length of the sliding window, and after rounding, it is used to determine the left and right boundaries of the window. This is a median function that calculates the median of all data points within a window, used to replace outliers.

[0013] Furthermore, in step 2, the calculation formula for normalization using Min-Max is as follows: ; In the formula, These are the normalized data values, ranging from [0,1]. The original data value is a certain indicator value that needs to be normalized. It is the minimum value in the current indicator sequence; This is the maximum value in the current indicator sequence.

[0014] Furthermore, in step 3, the hybrid model integrating bidirectional GRU and attention mechanism is an end-to-end prediction model formed by embedding the attention mechanism into the GRU layer, and its structure is as follows: Input layer: Input data shape (N,T,D); Where N is the number of samples, representing the number of device data samples used in a single training or prediction session; T is the time step, representing the number of historical time steps contained in each sample; and D is the feature dimension, representing the number of metrics collected at each time step. Bi-directional GRU layer (BiGRU): Bi-directional GRU captures past and future dependencies of time series through forward GRU and backward GRU respectively; The formula for calculating the forward GRU is: ; In the formula, For the forward GRU at time step The hidden state, preserved from the start time to Timing information; For time step The input feature vector has dimension D; For the forward GRU at time step The hidden state; The formula for calculating backward GRU is: ; In the formula, For backward GRU at time step The hidden state is preserved from the end point to the end point. Timing information; For backward GRU at time step The hidden state; Combine bidirectional outputs: ; In the formula, This is the hidden state after the merger; Attention layer: The attention mechanism dynamically allocates weights to highlight the key time steps for the current prediction and calculates the attention weight for each time step; The formula for calculating the attention layer is: ; In the formula, For time step The contribution weight to the current prediction, ranging from [0,1]; For time step For the current prediction time step Attention score; This represents the total number of time steps. ; In the formula, For the current time step The hidden state; For historical time steps The hidden state; This is a learnable attention weight matrix; This is a matrix transpose operation; The generated context vector is: ; In the formula, The weighted context vector integrates key information from all time steps.

[0015] Fully connected output layer: maps context vectors to failure rate predictions; The formula for calculating the fully connected output layer is: ; In the formula, The predicted failure rate ranges from [0,1]. This is the weight matrix of the fully connected layer; For bias terms of fully connected layers; The Sigmoid function constrains the output to the probability interval [0,1].

[0016] Furthermore, in step 4, model training and optimization includes the following steps: Step 4.1: Input the preprocessed training dataset into the metering terminal and meter equipment failure rate prediction model based on GRU-attention mechanism. The model input data has the shape (N,T,D). Step 4.2: On the training dataset, the model generates predicted values ​​through forward propagation. This refers to the equipment failure rate; then, through backpropagation and parameter updates, the predictive performance is gradually optimized. Step 4.3: During the training process, the weighted mean square error (WMSE) is used to calculate the loss function value; The calculation formula is: ; In the formula, The loss function value represents the error between the model's predicted value and the actual value. The total number of samples indicates the number of data samples used in training or evaluation. For the first The actual equipment failure rate of each sample, i.e., the label, i.e., the true target value; For the first The model's predicted value for each sample, i.e., the predicted result output by the model; No. The weights of each sample are used to adjust the contribution of different samples to the loss function; This is a hyperparameter used to control the degree of weight skew for samples with high failure rates; No. The squared prediction error for each sample measures the deviation between the model's predicted value and the actual value. Step 4.4: Employ the Adam optimizer, which combines Nadam with Nesterov momentum, and set the initial learning rate to... The loss on the validation set decreases dynamically with each training round, and Dropout is used to randomly drop some neurons between GRU layers with a probability of 0.3 to prevent overfitting. If the validation set loss does not decrease for 5 consecutive rounds, training is terminated. Step 4.5: After training, select the model with the smallest mean square error (WMSE) of the validation set from multiple iterations as the optimal prediction model and save its network parameters.

[0017] The beneficial effects of this invention are: This invention proposes a method for predicting the failure rate of metering terminals based on the GRU-attention mechanism. By integrating a multi-dimensional indicator system, an advanced deep learning model, and optimization strategies, it significantly improves the accuracy and practicality of failure rate prediction. Its main beneficial effects are as follows: 1. Enhanced Feature Capture Capability for Complex Time Series Data: The bidirectional GRU can simultaneously capture past and future dependencies in time series data, fully modeling the long-term dynamic changes in equipment operating status. By dynamically allocating weights, it highlights the key time step features for the current prediction, effectively solving the problem of insufficient feature extraction in traditional methods when processing complex time series data. Compared to single traditional GRU or LSTM models, this method demonstrates a stronger ability to capture complex time series features, significantly improving prediction accuracy.

[0018] 2. Significantly Improved Prediction Accuracy: A comprehensive indicator system covering equipment operating parameters, age parameters, and environmental parameters was constructed, providing rich input information for the model and ensuring more comprehensive and reliable prediction results. By introducing weighted mean squared error (WMSE) and tilting the weights of high-failure-rate samples, the model's predictive ability for rare events was significantly improved. The mean squared error (MSE) and mean absolute error (MAE) of this method on the test set significantly outperform traditional methods such as ARIMA, LSTM, and ordinary GRU models.

[0019] 3. Achieve early warning and precise operation and maintenance: By accurately predicting future failure rates, potential failure risks can be identified in advance, providing a scientific basis for operation and maintenance work and avoiding economic losses caused by sudden failures. Based on the prediction results, operation and maintenance personnel can develop more targeted maintenance plans, allocate resources rationally, reduce operation and maintenance costs, and improve equipment reliability.

[0020] 4. Enhancing Model Robustness and Generalization Ability: Median filtering smooths outliers and Min-Max normalization unifies the order of magnitude, effectively improving data quality and laying a solid foundation for model training. Dropout and early stopping mechanisms are introduced to enhance model robustness; the Nadam optimizer and learning rate decay strategy further improve the model's generalization ability. The model's performance is stable in tests across different scenarios, validating its strong versatility and adaptability.

[0021] 5. Promoting the Digital Upgrade of Smart Grids: This method provides an innovative technical means for the health management of metering terminals in smart grids, filling a research gap in the field of low-voltage equipment fault prediction. Through accurate prediction and early warning, it reduces power outage losses and maintenance costs caused by equipment failures, contributing to the economical operation of the power grid. It improves the operational reliability of the power system, ensures a better user experience, and promotes the digital upgrade and sustainable development of smart grids.

[0022] 6. Excellent scalability and applicability: This method is not only applicable to fault prediction of metering terminals, but can also be extended to the health management of other power equipment. By deploying to edge computing devices, real-time online prediction of metering terminal failure rates can be achieved, meeting the rapid response requirements of smart grids. This method can be seamlessly integrated into intelligent operation and maintenance platforms, combining technologies such as drone inspection and robot repair to build an integrated "prediction-early warning-response" operation and maintenance system. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0024] Figure 1 This is a flowchart of the meter failure rate prediction method for metering terminals based on the GRU-attention mechanism of the present invention; Figure 2 This is a graph showing the training loss and validation loss of this invention; Figure 3 This is a comparison chart of the MSE of the GRU-attention hybrid prediction model of this invention and different models on the test set; Figure 4 This is a graph showing the predicted failure rate of a metering terminal of a power grid company in 2024 for the next 7 days. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0026] Therefore, the following detailed description of the embodiments of the present invention is not intended to limit the scope of the claimed invention, but merely illustrates some embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention. It should be noted that, in the absence of conflict, the embodiments and features and technical solutions in the embodiments of the present invention can be combined with each other. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0027] To address the shortcomings of existing technologies in capturing complex time-series data features and achieving low prediction accuracy, this embodiment provides a method for predicting the failure rate of metering terminals based on a GRU-attention mechanism. Figure 1 As shown, the meter failure rate prediction method based on the GRU-attention mechanism includes the following steps: Step 1: Construct a predictive index system for the failure rate of metering terminals: A comprehensive indicator system covering equipment operating parameters, age parameters, and environmental parameters is constructed to provide the input data foundation for the model. Among these, equipment operating parameters include: data acquisition success rate. Voltage fluctuation rate Current harmonic distortion rate Electricity metering error Device restart frequency The time limit parameter includes: cumulative operating time. Maintenance cycle compliance rate Hardware aging score Environmental parameters include: installation location type coding rules, and ambient temperature value. Humidity measurement value Electromagnetic interference intensity measurement value (EMI); where the coding rule for installation location type is: 0 for indoor equipment and 1 for outdoor equipment.

[0028] Data collection success rate The calculation formula is: ; In the formula, The number of times data was successfully collected per unit of time; This represents the total number of data collection attempts per unit of time.

[0029] Voltage fluctuation rate The calculation formula is: ; In the formula, is the sample standard deviation of voltage; This is the rated voltage of the equipment.

[0030] Current harmonic distortion rate The calculation formula is: ; In the formula, For the first The effective value of the subharmonic current; This is the effective value of the fundamental current; To consider the highest harmonic order, it is usually taken as .

[0031] Electricity metering error The calculation formula is: ; In the formula, The actual electrical energy value measured by the equipment; This is the nominal value of a standard electricity meter.

[0032] Device restart frequency The calculation formula is: ; In the formula, This represents the number of abnormal restarts per unit of time. The statistical period is specified.

[0033] Cumulative running time The calculation formula is: ; In the formula, This is the current timestamp; For the device installation timestamp.

[0034] Maintenance cycle compliance rate The calculation formula is: ; In the formula, This refers to the actual number of maintenance operations performed. This refers to the planned number of maintenance sessions.

[0035] Hardware aging rating The calculation formula is: ; In the formula, This is the runtime weighting factor, by default. ; Cumulative running time; Design life of the equipment; To maintain the compliance rate weighting factor, the default is... ; To maintain the compliance rate of the cycle.

[0036] Step 1 establishes a predictive index system for the failure rate of metering terminals, ensuring that the model input data covers key factors affecting the health status of equipment, thus providing a scientific and reasonable data foundation for subsequent modeling.

[0037] Step 2: Preprocess the raw data: Median filtering was used to smooth out outliers in the original data, and Min-Max normalization was used to eliminate noise and magnitude differences in the data.

[0038] Median filtering primarily involves selecting the median value within a neighboring window to replace outliers for each data point in the original data sequence. The window size is dynamically adjusted based on the data sampling frequency. The sliding window size is The filter calculation formula is: ; In the formula, The first one after median filtering The filtered value of each data point; The first in the original data sequence One data point; The size of the sliding window represents the selected neighborhood range, which is dynamically adjusted according to the data sampling frequency. This represents half the length of the sliding window, and after rounding, it is used to determine the left and right boundaries of the window. This is a median function that calculates the median of all data points within a window, used to replace outliers.

[0039] The calculation formula for normalization using Min-Max is as follows: ; In the formula, These are the normalized data values, ranging from [0,1]. The original data value is a certain indicator value that needs to be normalized. It is the minimum value in the current indicator sequence; This is the maximum value in the current indicator sequence.

[0040] Step 2 preprocesses the raw data. Median filtering effectively smooths outliers and improves data continuity and stability. Normalization eliminates the order-of-magnitude differences between different indicators, ensuring the efficiency and effectiveness of model training.

[0041] Furthermore, the operating data of 1,000 metering terminals of a power grid company from 2022 to 2023, including 11 indicators such as voltage, current, power, and temperature, were selected. The sampling frequency was 15 minutes / time. A predictive index system for the failure rate of metering terminals was constructed, and the raw data was preprocessed.

[0042] To verify the rationality of the proposed fault prediction index system, Pearson correlation coefficient and Spearman rank correlation coefficient were used to analyze the correlation between each index and the equipment failure rate, as shown in the table below:

[0043] Pearson correlation coefficient and Spearman rank correlation coefficient were used to analyze the correlation between various indicators and equipment failure rate. The results showed that the selected indicators and failure rate had a moderate or higher correlation strength, proving that the indicator system design was reasonable. After preprocessing the operating data of 1000 metering terminals, the data distribution became more stable and outliers were significantly reduced, laying a high-quality data foundation for subsequent modeling.

[0044] Step 3: Construct a GRU-attention hybrid prediction model: A hybrid model integrating bidirectional GRU and attention mechanism is constructed to capture the complex temporal features of data and focus on key time step information. The model includes a GRU input layer, a GRU layer, an attention mechanism layer and a fully connected output layer, where the attention mechanism layer dynamically assigns weights to different temporal features.

[0045] The hybrid model that integrates bidirectional GRU and attention mechanisms is an end-to-end prediction model formed by embedding the attention mechanism into the GRU layer, and its structure is as follows: Input layer: Input data shape (N,T,D); Where N is the number of samples, representing the number of device data samples used in a single training or prediction session; T is the time step, representing the number of historical time steps contained in each sample; and D is the feature dimension, representing the number of metrics collected at each time step. Bi-directional GRU layer (BiGRU): Bi-directional GRU captures past and future dependencies of time series through forward GRU and backward GRU respectively; The formula for calculating the forward GRU is: ; In the formula, For the forward GRU at time step The hidden state, preserved from the start time to Timing information; For time step The input feature vector has dimension D; For the forward GRU at time step The hidden state; The formula for calculating backward GRU is: ; In the formula, For backward GRU at time step The hidden state is preserved from the end point to the end point. Timing information; For backward GRU at time step The hidden state; Combine bidirectional outputs: ; In the formula, This is the hidden state after the merger; Attention layer: The attention mechanism dynamically allocates weights to highlight the key time steps for the current prediction and calculates the attention weight for each time step; The formula for calculating the attention layer is: ; In the formula, For time step The contribution weight to the current prediction, ranging from [0,1]; For time step For the current prediction time step Attention score; This represents the total number of time steps. ; In the formula, For the current time step The hidden state; For historical time steps The hidden state; This is a learnable attention weight matrix; This is a matrix transpose operation; The generated context vector is: ; In the formula, The weighted context vector integrates key information from all time steps.

[0046] Fully connected output layer: maps context vectors to failure rate predictions; The formula for calculating the fully connected output layer is: ; In the formula, The predicted failure rate ranges from [0,1]. This is the weight matrix of the fully connected layer; For bias terms of fully connected layers; The Sigmoid function constrains the output to the probability interval [0,1].

[0047] The hybrid model constructed in step 3, which integrates bidirectional GRU and attention mechanism, uses bidirectional GRU to capture complex temporal dependencies and attention mechanism to focus on key time step features, significantly improving the model's expressive power and prediction accuracy.

[0048] Step 4, Model Training and Optimization: We use the weighted mean squared error (WMSE) loss function, tilting the weights of high failure rate samples to improve the model's ability to predict rare events; we employ the Nadam optimizer and learning rate decay mechanism to accelerate model convergence; and we introduce Dropout and early stopping mechanisms to enhance the model's robustness.

[0049] Model training and optimization specifically include the following steps: Step 4.1: Input the preprocessed training dataset into the metering terminal and meter equipment failure rate prediction model based on GRU-attention mechanism. The model input data has the shape (N,T,D). Step 4.2: On the training dataset, the model generates predicted values ​​through forward propagation. This refers to the equipment failure rate; then, through backpropagation and parameter updates, the predictive performance is gradually optimized. Step 4.3: During the training process, the weighted mean square error (WMSE) is used to calculate the loss function value; The calculation formula is: ; In the formula, The loss function value represents the error between the model's predicted value and the actual value. The total number of samples indicates the number of data samples used in training or evaluation. For the first The actual equipment failure rate of each sample, i.e., the label, i.e., the true target value; For the first The model's predicted value for each sample, i.e., the predicted result output by the model; No. The weights of each sample are used to adjust the contribution of different samples to the loss function; This is a hyperparameter used to control the degree of weight skew for samples with high failure rates; No. The squared prediction error for each sample measures the deviation between the model's predicted value and the actual value. Step 4.4: Employ the Adam optimizer, which combines Nadam with Nesterov momentum, and set the initial learning rate to... The loss on the validation set decreases dynamically with each training round, and Dropout is used to randomly drop some neurons between GRU layers with a probability of 0.3 to prevent overfitting. If the validation set loss does not decrease for 5 consecutive rounds, training is terminated. Step 4.5: After training, select the model with the smallest mean square error (WMSE) of the validation set from multiple iterations as the optimal prediction model and save its network parameters.

[0050] Among them, the weighted loss function increases the attention paid to samples with high failure rates, while the optimizer and regularization strategy enhance the model's generalization ability.

[0051] Furthermore, based on the operational data of 1000 metering terminals of a power grid company from 2022 to 2023, and according to the constructed metering terminal prediction index system, 70% of the data was used as the training set, 15% as the test set, and 15% as the validation set to ensure that the model can be effectively trained and evaluated on different data samples. Regarding model parameters, the number of GRU hidden units was set to 64, the bidirectional structure had a total of 128 dimensions, the attention dimension was 32, and the Dropout probability was set to 0.3 to enhance model robustness. In addition, a weighted loss function and hyperparameters were used. Set the initial learning rate to 0.5. The value is reduced to 0.9 times its original value every 10 rounds to optimize the stability of the training process.

[0052] The training loss and validation loss curves are as follows: Figure 2 As shown, the MSE of different models on the test set is compared to... Figure 3 As shown in the figure, during model training, the training loss gradually stabilizes after 50 rounds, and the mean squared error (MSE) drops below 0.001. The validation loss triggers an early stopping mechanism in the 60th round, and the final validation set MSE is 0.00082. By comparing the prediction performance of different models, the GRU-attention model significantly outperforms traditional methods on the test set. Specifically, its MSE is 0.00078, a 48% reduction compared to the traditional GRU, and its mean absolute error (MAE) is 0.021, indicating high accuracy in fault event classification. In contrast, the MSEs of the LSTM and ARIMA models are 0.0012 and 0.0034, respectively, demonstrating the advantage of the GRU-attention model in capturing temporal dependencies.

[0053] Step 5: Failure Rate Prediction and Result Analysis Using a trained model, the failure rate of a metering terminal for a power grid company in the next 7 days of 2024 was predicted, and the prediction results were plotted as follows: Figure 4As shown in the above practical examples, the GRU-attention model has better predictive performance than LSTM, ARIMA, and traditional GRU models. Through accurate prediction, it can achieve early warning and provide auxiliary decision-making basis for operation and maintenance work.

[0054] In summary, this method for predicting the failure rate of metering terminals based on the GRU-attention mechanism integrates multi-dimensional indicators and dynamic attention mechanism through the GRU-attention model. It not only considers parameters more comprehensively and specifically, but also achieves high-precision prediction of the failure rate of metering terminal equipment, effectively realizing early warning of the failure rate of metering equipment, and providing auxiliary decision-making basis for operation and maintenance work.

[0055] The above examples are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above examples. Any modifications, alterations, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. A method for predicting the failure rate of metering terminals based on the GRU-attention mechanism, characterized in that: Includes the following steps: Step 1: Construct a prediction index system for the failure rate of metering terminals: Construct a comprehensive index system covering equipment operating parameters, age parameters, and environmental parameters to provide the input data foundation for the model; Step 2: Preprocess the raw data: Use median filtering to smooth out outliers and Min-Max normalization to eliminate noise and magnitude differences in the data. Step 3: Construct a GRU-Attention Hybrid Prediction Model: Construct a hybrid model that integrates bidirectional GRU and attention mechanisms to capture the complex temporal features of the data and focus on key time step information; the model includes a GRU input layer, a GRU layer, an attention mechanism layer, and a fully connected output layer, where the attention mechanism layer dynamically assigns weights to different temporal features; Step 4, Model Training and Optimization: The weighted mean squared error (WMSE) loss function is used to skew the weights of high failure rate samples, thereby improving the model's ability to predict rare events; the Nadam optimizer and learning rate decay mechanism are adopted to accelerate model convergence; Dropout and early stopping mechanisms are introduced to enhance the model. Step 5: Failure Rate Prediction and Result Analysis: Generate accurate failure rate prediction results using the trained model, and verify its effectiveness and practicality in combination with actual application scenarios.

2. The metering terminal failure rate prediction method based on GRU-attention mechanism according to claim 1, characterized in that: The device operating parameters include: data acquisition success rate. Voltage fluctuation rate Current harmonic distortion rate Electricity metering error Device restart frequency The time limit parameter includes: cumulative operating time. Maintenance cycle compliance rate Hardware aging score .

3. The metering terminal failure rate prediction method based on GRU-attention mechanism according to claim 2, characterized in that: Among the equipment operating parameters: Data collection success rate The calculation formula is: ; In the formula, The number of times data was successfully collected per unit of time; This represents the total number of data collection attempts per unit of time. Voltage fluctuation rate The calculation formula is: ; In the formula, is the sample standard deviation of voltage; The rated voltage of the equipment; Current harmonic distortion rate The calculation formula is: ; In the formula, For the first The effective value of the subharmonic current; This is the effective value of the fundamental current; The highest harmonic order is considered; Electricity metering error The calculation formula is: ; In the formula, The actual electrical energy value measured by the equipment; This is the nominal value of a standard electricity meter; Device restart frequency The calculation formula is: ; In the formula, This represents the number of abnormal restarts per unit of time. The statistical period is specified.

4. The metering terminal failure rate prediction method based on GRU-attention mechanism according to claim 2, characterized in that: Among the time limit parameters: Cumulative running time The calculation formula is: ; In the formula, This is the current timestamp; For the equipment installation timestamp; Maintenance cycle compliance rate The calculation formula is: ; In the formula, This refers to the actual number of maintenance operations performed. The number of planned maintenance sessions; Hardware aging rating The calculation formula is: ; In the formula, Runtime weighting factor; Cumulative running time; Design life of the equipment; To maintain the compliance rate weighting factor; To maintain the compliance rate of the cycle.

5. The metering terminal failure rate prediction method based on GRU-attention mechanism according to claim 1, characterized in that: The environmental parameters include: installation location type coding rules, and ambient temperature value. Humidity measurement value Electromagnetic interference intensity measurement value (EMI); where the coding rule for installation location type is: 0 for indoor equipment and 1 for outdoor equipment.

6. The metering terminal failure rate prediction method based on GRU-attention mechanism according to claim 1, characterized in that: Step 2, which involves smoothing outliers in the original data using median filtering, includes: Median filtering primarily replaces outliers by selecting the median value within a neighboring window for each data point in the original data sequence. The window size is dynamically adjusted based on the data sampling frequency. The sliding window size is The filter calculation formula is: ; In the formula, The first one after median filtering The filtered value of each data point; The first in the original data sequence One data point; The size of the sliding window represents the selected neighborhood range, which is dynamically adjusted according to the data sampling frequency. This represents half the length of the sliding window, and after rounding, it is used to determine the left and right boundaries of the window. This is a median function that calculates the median of all data points within a window, used to replace outliers.

7. The metering terminal failure rate prediction method based on GRU-attention mechanism according to claim 1, characterized in that: In step 2, the calculation formula for normalization using Min-Max is as follows: ; In the formula, These are the normalized data values, ranging from [0,1]. The original data value is a certain indicator value that needs to be normalized. It is the minimum value in the current indicator sequence; This is the maximum value in the current indicator sequence.

8. The metering terminal failure rate prediction method based on GRU-attention mechanism according to claim 1, characterized in that: In step 3, the hybrid model that integrates bidirectional GRU and attention mechanism is an end-to-end prediction model formed by embedding the attention mechanism into the GRU layer, and its structure is as follows: Input layer: Input data shape (N,T,D); where N is the number of samples, representing the number of device data samples used in one training or prediction session; T is the time step, representing the number of historical time steps contained in each sample; and D is the feature dimension, representing the number of metrics collected at each time step. Bi-directional GRU layer (BiGRU): Bi-directional GRU captures past and future dependencies of time series through forward GRU and backward GRU respectively; The formula for calculating the forward GRU is: ; In the formula, For the forward GRU at time step The hidden state, preserved from the start time to Timing information; For time step The input feature vector has dimension D; For the forward GRU at time step The hidden state; The formula for calculating backward GRU is: ; In the formula, For backward GRU at time step The hidden state is preserved from the end point to the end point. Timing information; For backward GRU at time step The hidden state; Combine bidirectional outputs: ; In the formula, This is the hidden state after the merger; Attention layer: The attention mechanism dynamically allocates weights to highlight the key time steps for the current prediction and calculates the attention weight for each time step; The formula for calculating the attention layer is: ; In the formula, For time step The contribution weight to the current prediction, ranging from [0,1]; For time step For the current prediction time step Attention score; This represents the total number of time steps. ; In the formula, For the current time step The hidden state; For historical time steps The hidden state; This is a learnable attention weight matrix; This is a matrix transpose operation; The generated context vector is: ; In the formula, The weighted context vector integrates key information from all time steps; Fully connected output layer: maps context vectors to failure rate predictions; The formula for calculating the fully connected output layer is: ; In the formula, The predicted failure rate ranges from [0,1]. This is the weight matrix of the fully connected layer; For bias terms of fully connected layers; The Sigmoid function constrains the output to the probability interval [0,1].

9. The metering terminal failure rate prediction method based on GRU-attention mechanism according to claim 1, characterized in that: Step 4, model training and optimization includes the following steps: Step 4.1: Input the preprocessed training dataset into the metering terminal and meter equipment failure rate prediction model based on GRU-attention mechanism. The model input data has the shape (N,T,D). Step 4.2: On the training dataset, the model generates predicted values ​​through forward propagation. This refers to the equipment failure rate; then, through backpropagation and parameter updates, the predictive performance is gradually optimized. Step 4.3: During the training process, the weighted mean square error (WMSE) is used to calculate the loss function value; The calculation formula is: ; In the formula, The loss function value represents the error between the model's predicted value and the actual value. The total number of samples indicates the number of data samples used in training or evaluation. For the first The actual equipment failure rate of each sample, i.e., the label, i.e., the true target value; For the first The model's predicted value for each sample, i.e., the predicted result output by the model; No. The weights of each sample are used to adjust the contribution of different samples to the loss function; This is a hyperparameter used to control the degree of weight skew for samples with high failure rates; No. The squared prediction error for each sample measures the deviation between the model's predicted value and the actual value. Step 4.4: Employ the Adam optimizer, which combines Nadam with Nesterov momentum, and set the initial learning rate to... The loss on the validation set decreases dynamically with each training round, and Dropout is used to randomly drop some neurons between GRU layers with a probability of 0.3 to prevent overfitting. If the validation set loss does not decrease for 5 consecutive rounds, training is terminated. Step 4.5: After training, select the model with the smallest mean square error (WMSE) of the validation set from multiple iterations as the optimal prediction model and save its network parameters.

Citation Information

Cited By

  • Bulk cargo wharf operation and maintenance situation awareness method and system

    CN121389823A