A method, device and readable storage medium for predicting the life of a smart electric energy meter
By combining multi-scale deep convolutional neural networks and the Informer model, feature weights are dynamically adjusted to predict the lifespan of smart energy meters. This solves the problems of insufficient prediction accuracy and high computational complexity of traditional methods in complex environments, and achieves efficient and reliable lifespan prediction.
Patent Information
- Application Number
- CN202511121375.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-08-12
AI Technical Summary
Traditional lifetime prediction methods struggle to effectively capture the nonlinear dynamic correlation between complex environments and equipment states, and lack the ability to model multi-scale features from multiple sources. This results in insufficient prediction accuracy of smart meters in complex environments such as high humidity and heat, and high computational complexity, making it difficult to meet the lightweight deployment requirements of actual power systems.
We employ multi-scale deep convolutional neural networks for feature extraction, combine them with the Informer model to construct a time series prediction model, dynamically adjust feature weights through self-attention distillation layers and sparse attention mechanisms, and use masked multi-head probabilistic sparse self-attention for error evolution prediction, thereby achieving comprehensive modeling and efficient prediction of complex time series data.
It improves the comprehensiveness of feature representation and the reliability of prediction for the lifespan of smart energy meters, reduces computational complexity, improves the identification accuracy of key fault symptoms, and provides a reliable basis for preventive maintenance through efficient prediction of long-term error sequences.
Smart Images

Figure CN120633476B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method, device, and readable storage medium for predicting the lifespan of a smart energy meter, belonging to the field of device lifespan prediction technology. Background Technology
[0002] With the rapid development of smart grids, smart meters, as core devices for power metering and user-side data acquisition, play a crucial role in power grid safety management and economic regulation due to their long-term operational reliability and lifespan prediction accuracy. However, under complex environmental stresses such as high humidity and heat in coastal areas, the internal components of smart meters are susceptible to the coupled effects of multiple factors such as temperature, humidity, and salt spray, leading to accelerated performance degradation and frequent metering error drift. Traditional lifespan prediction methods often rely on single physical models or shallow statistical laws, making it difficult to effectively capture the nonlinear dynamic correlation between complex environments and equipment states. Furthermore, they lack the ability to model multi-scale features of multi-source time series, resulting in prediction accuracy that falls short of requirements.
[0003] Given the limitations of traditional lifetime prediction methods in addressing complex environmental challenges, current data-driven lifetime prediction methods offer new insights for smart meter lifetime prediction. Some studies have constructed hybrid models by fusing convolutional neural networks (CNNs) and long short-term memory networks (LSTMs) to balance local feature extraction with temporal dependency modeling. For example, Chinese invention patent application CN114219118B discloses a smart meter lifetime prediction method based on DS evidence theory. This method normalizes a sample set of smart meters to obtain a normalized smart meter sample set. Then, it defines the lifetime range of the smart meters and uses kernel-Fischer discriminant analysis to extract features from the normalized smart meter sample set, obtaining feature vectors. These feature vectors are then input into both a CNN model and an LSTM model to predict the lifetime range of the smart meters. Finally, using DS evidence theory, the lifetime ranges predicted by the two network models are fused to obtain the final smart meter lifetime prediction result. The methods disclosed in the aforementioned patents normalize smart meter data, simplifying the data processing flow; they also introduce DS evidence theory to fuse the outputs of two network models, resulting in more accurate predictions. However, the screening of environmental stress factors in these patents largely relies on general dimensionality reduction algorithms (such as kernel-Fischer discriminant analysis), failing to perform targeted optimization for key damage-causing factors in specific scenarios such as high humidity and heat. This leads to redundant input features and insufficient correlation with equipment degradation mechanisms. Secondly, traditional CNNs extract features through fixed-size convolutional kernels, making it difficult to simultaneously capture the instantaneous fluctuations, periodic trends, and macroscopic degradation patterns of meter errors. LSTM, on the other hand, has high computational complexity for long sequences and lacks a dynamic attention allocation mechanism for key time segments. Furthermore, while multi-model fusion schemes can improve prediction stability, their complex model structures and high computational resource consumption make them unsuitable for the lightweight deployment requirements of actual power systems.
[0004] In summary, there is an urgent need for a smart energy meter lifetime prediction method that can improve adaptability to complex environments while reducing computational complexity through targeted feature selection and multi-scale time series modeling. Summary of the Invention
[0005] To address the problems existing in the prior art, this invention proposes a method, device, and readable storage medium for predicting the lifespan of a smart energy meter.
[0006] The technical solutions of the present invention are as follows:
[0007] On one hand, the present invention provides a method for predicting the lifespan of a smart energy meter, the method comprising:
[0008] The system acquires the operating error data, environmental stress data, and operating time series of smart energy meters. It then uses the operating error data as a benchmark to reduce the dimensionality of the environmental stress data and combines the operating time series with the dimensionality-reduced environmental stress dataset to generate a multidimensional dataset.
[0009] Construct a multi-scale deep convolutional neural network to extract features from a multidimensional dataset and obtain multi-scale features;
[0010] A temporal prediction model based on the Informer model is constructed, including an encoder and a decoder. Multi-scale features are used as input to the encoder. By embedding a convolutional attention module in the self-attention distillation layer of the encoder, the feature weights are dynamically adjusted under the channel attention mechanism and spatial attention. The decoder outputs the error evolution based on the adjusted features to predict the sequence.
[0011] Based on the error evolution prediction sequence, the time point corresponding to the failure threshold of the smart energy meter is determined, and the remaining service life of the smart energy meter is calculated.
[0012] Preferably, the dimensionality reduction of environmental stress data based on operational error data specifically involves:
[0013] Calculate the product of the difference between each environmental stress data point and its mean, and the difference between each operational error data point and its mean, and then average the products.
[0014] Calculate the standard deviations of environmental stress data and operational error data separately;
[0015] The Pearson correlation coefficient of the environmental stress data based on the operational error data is obtained by dividing the average value by the product of the two standard deviations.
[0016] A preset Pearson correlation coefficient threshold is used to filter out environmental stress data whose Pearson correlation coefficient falls within the threshold range.
[0017] Preferably, the multi-scale deep convolutional neural network includes three parallel feature extraction branches and an adaptive feature fusion module, wherein:
[0018] The first branch of the three parallel feature extraction branches is a local feature extraction module composed of a single convolutional kernel, used to extract micro-features between adjacent time points in the multidimensional dataset; the second branch is an intermediate-scale feature extraction module containing two levels of cascaded convolutional layers, used to extract periodic temporal variation features in the multidimensional dataset, wherein the first level of cascaded convolutional layer uses uninterrupted sampling convolution, and the second level of cascaded convolutional layer uses interval sampling convolution; the third branch is a macro-feature extraction module composed of three levels of cascaded convolutional layers, used to extract long-term dependency features across time periods in the multidimensional dataset, wherein the interval sampling rate of each level of cascaded convolutional layer increases exponentially.
[0019] The adaptive feature fusion module is used to dynamically fuse the output features of the three parallel feature extraction branches through a weighted summation method to obtain multi-scale features. The fusion weights are automatically adjusted according to the contribution of each branch feature to the target task.
[0020] Preferably, the encoder includes an input layer, sparse attention blocks, and a self-attention convolutional distillation layer, wherein:
[0021] The input layer includes an embedding layer and a one-dimensional convolutional layer. The embedding layer is used to perform dimensionality mapping on multi-scale features, and the one-dimensional convolutional layer is used to perform preliminary temporal feature extraction on multi-scale features. The outputs of the embedding layer and the one-dimensional convolutional layer are fused to obtain fused features.
[0022] The sparse attention blocks have a total of One, of which ;
[0023] The fusion features are sequentially passed through A sparse attention block, wherein the sparse attention block employs a multi-head probabilistic sparse self-attention mechanism to filter key time node features from the features of the input sparse attention block;
[0024] The self-attention convolutional distillation layer has a total of Each self-attention convolutional distillation layer is located between two adjacent sparse attention blocks and is used to perform distillation operations on the key time node features output by the previous sparse attention block to obtain distilled features.
[0025] Preferably, the convolutional attention module embedded in the self-attention convolutional distillation layer is used to perform one-dimensional convolution operations on the distilled features, and to calculate the channel weights of the distilled features after one-dimensional convolution using a channel attention mechanism, and to adjust the channel dimension features in the distilled features based on the channel weights; to calculate the spatial weights of the distilled features after adjusting the channel dimension features using a spatial attention mechanism, and to adjust the temporal dimension features in the distilled features based on the spatial weights; to perform max pooling on the weighted distilled features, and to output them to the next sparse attention block;
[0026] Will The features output by each sparse attention block are concatenated along the channel dimension to generate a concatenated feature map.
[0027] Preferably, the decoder includes a masked multi-head probabilistic sparse self-attention layer, a multi-head attention layer, and a fully connected layer, wherein:
[0028] The concatenated feature map and the generated historical prediction sequence are concatenated along the channel dimension to obtain the decoder input features. The decoder input features are used as the input of the masked multi-head probabilistic sparse self-attention layer. The masked multi-head probabilistic sparse self-attention layer is used to filter out interference from future time nodes in the concatenation result to obtain sparse attention features.
[0029] Sparse attention features are used as input to the multi-head attention layer, and the output is a global feature map that fuses global information from the encoder and contextual features from the decoder.
[0030] The high-dimensional features in the global feature map are mapped to single-step prediction values through a fully connected layer to obtain the error prediction value at the current time step. The error prediction value at the current time step is then incorporated into the end of the historical prediction sequence as the input for the next time step, until the preset iteration prediction step size is reached, and the error evolution prediction sequence is output.
[0031] Preferably, the historical prediction sequence generation steps are as follows:
[0032] The decoder takes the spliced feature map output by the encoder as the input of the initial time step, generates the first predicted value based on the input of the initial time step, and uses the generated predicted value as the decoder input of the next time step. Through iterative prediction, the length of the prediction sequence is gradually expanded to generate a historical prediction sequence.
[0033] Preferably, the multi-head attention layer uses the concatenated feature map as the key matrix and value matrix, uses the features of the decoder at the current time step as the query matrix, calculates the similarity between the query matrix and the key matrix, performs a softmax operation on the similarity to obtain the attention weight matrix, and performs a weighted summation of the attention weight matrix and the value matrix to obtain a feature map that fuses the global information of the encoder and the context features of the decoder.
[0034] On the other hand, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a smart energy meter life prediction method as described in the present invention.
[0035] In another aspect, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for predicting the lifespan of a smart energy meter as described in the present invention.
[0036] The present invention has the following beneficial effects:
[0037] 1. This invention provides a method for predicting the lifespan of smart energy meters. Through a three-way parallel branch design of a multi-scale deep convolutional neural network, the first branch uses local convolutional kernels to extract micro-features at adjacent time points, the second branch captures periodic temporal changes through interval sampling convolution, and the third branch captures long-term dependent features by using progressively increasing sampling rates. Combined with an adaptive weighted fusion module, multi-scale features are dynamically integrated, achieving comprehensive modeling of complex time-series data. This method can analyze short-term fluctuations and periodic patterns, as well as mine potential correlations across time periods, improving the comprehensiveness of feature representation and the reliability of prediction.
[0038] 2. This invention provides a method for predicting the lifespan of a smart energy meter. The convolutional attention module embedded in the encoder is combined with a sparse attention distillation mechanism. Specifically, the feature dimension weights are dynamically adjusted through channel attention, spatial attention focuses on key time nodes, and probabilistic sparse self-attention is used to filter core temporal features. At the same time, convolutional distillation is used to compress redundant information. The above design enables the time-series prediction model to adaptively enhance the contribution of key features and suppress noise interference. While reducing the computational complexity of long sequences, it avoids prediction deviations caused by insufficient distinction of feature importance and improves the recognition accuracy of key fault symptoms.
[0039] 3. This invention provides a method for predicting the lifespan of smart meters. The decoder employs a masked multi-head probabilistic sparse self-attention mechanism and an iterative prediction mechanism. The masking mechanism shields future information interference, and the global features output by the encoder are used as key-value pairs. Combined with historical prediction sequences, the error evolution trend is gradually generated. Finally, the remaining lifespan is determined by the failure threshold. Through the above design, efficient prediction of long-term error sequences and accurate location of the lifespan end are achieved, overcoming the prediction inaccuracy problem caused by error accumulation and the difficulty of long-range dependency modeling. While ensuring computational efficiency, it provides a reliable basis for the preventive maintenance of smart meters. Attached Figure Description
[0040] Figure 1 This is a flowchart of the method of the present invention;
[0041] Figure 2 This is a specific architecture diagram of the multi-scale deep convolutional neural network in an embodiment of the present invention;
[0042] Figure 3 This is a specific architecture diagram of the time series prediction model in an embodiment of the present invention;
[0043] Figure 4 This is a lifespan prediction curve of an example energy meter in an embodiment of the present invention. Detailed Implementation
[0044] 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. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0045] It should be understood that the step numbers used in the text are for ease of description only and are not intended to limit the order in which the steps are performed.
[0046] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0047] The terms “comprising” and “including” indicate the presence of the described feature, whole, step, operation, element and / or component, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.
[0048] The term "and / or" refers to and includes any and all possible combinations of one or more of the associated listed items.
[0049] Example 1:
[0050] See Figure 1 This embodiment provides a method for predicting the lifespan of a smart energy meter, including the following steps:
[0051] S1. In this embodiment, the operating error data of the smart energy meter is collected through the metering automation system, the environmental stress data of the smart energy meter is obtained by the distributed sensor network, and the operating time series is collected by the Beidou time synchronization module, with the timestamp accuracy reaching the millisecond level.
[0052] It is worth noting that this embodiment does not limit the equipment used to acquire the above data. The above equipment is only used as an example. Furthermore, any equipment that can ensure the accuracy, reliability and timeliness of the acquired data to meet the needs of subsequent work such as performance evaluation and fault diagnosis of smart meters can be used as the equipment for acquiring data in this embodiment.
[0053] The environmental stress data is dimensionality reduced by using the operational error data as a benchmark, and the operational time series is combined with the dimensionality-reduced environmental stress dataset to generate a multidimensional dataset.
[0054] S11. The environmental stress data includes different types of data such as ambient temperature, humidity, air pressure, salt spray concentration, and altitude.
[0055] S12. The specific steps for dimensionality reduction of environmental stress data based on operational error data are as follows:
[0056] Calculate the product of the difference between each environmental stress data point and its mean, and the difference between each operating error data point and its mean. Then, calculate the average of these products to obtain the covariance between the environmental stress data and the operating error data.
[0057] Calculate the standard deviations of environmental stress data and operational error data separately;
[0058] Dividing the mean by the product of the two standard deviations yields the Pearson correlation coefficient of the environmental stress data based on the operational error data, expressed by the formula:
[0059] ;
[0060] In the formula, For the first Environmental stress data With running error data The Pearson correlation coefficient between them; For the first Environmental stress data With running error data covariance; For the first Environmental stress data The mean of all data of the corresponding type; For running error data The mean; For the first Environmental stress data Standard deviation; For running error data Standard deviation; This indicates that an average value calculation operation is being performed;
[0061] Preset a Pearson correlation coefficient threshold to filter out environmental stress data whose Pearson correlation coefficient falls within the threshold.
[0062] S13. Normalize the dimensionality-reduced environmental stress data to reduce the scale influence of different features.
[0063] S2. Construct a multi-scale deep convolutional neural network MsDCNN to extract features from a multidimensional dataset and obtain multi-scale features.
[0064] S21. The multi-scale deep convolutional neural network includes three parallel feature extraction branches and an adaptive feature fusion module. To overcome the problems of increased parameter count and low computational efficiency caused by traditional convolutional neural networks relying on layer stacking to expand the receptive field, this embodiment introduces a dilated convolution mechanism, adjusting the dilation rate... The insertion interval between convolution kernel elements enables an exponential expansion of the receptive field. The formula for calculating the receptive field of a single-layer dilated convolution is:
[0065] ;
[0066] In the formula, The kernel size; To experience the wild;
[0067] When stacked During layered convolution with holes, the total receptive field expands further, as expressed by the formula:
[0068] ;
[0069] In the formula, Indicates the first Stacking ratio of dilated convolutional layers Indicates the first The step size of the voided convolutional layer;
[0070] The above design allows for the capture of long-term time-dependent features using a lightweight architecture.
[0071] Furthermore, the three-way parallel feature extraction branch design is as follows:
[0072] The first branch is the local feature extraction module, which is used to extract micro-features between adjacent time points in the multidimensional dataset, specifically using a single hole rate. The receptive field of a conventional convolutional kernel (i.e., without interval sampling) (set up It directly acts on the microscopic interactions between adjacent time points, accurately capturing high-resolution details such as voltage transient fluctuations and noise pulses;
[0073] The second branch is the intermediate-scale feature extraction module, used to extract the periodic temporal variation features of data in the multidimensional dataset. Specifically, it consists of two levels of cascaded convolutions. The first level of cascaded convolutional layer uses uninterrupted sampling convolution. Preserving the original sampling granularity, the second-stage cascaded convolutional layer uses interval sampling convolution. Expand the receptive field to By using progressive void ratio design to model daily / weekly periodic patterns (such as day-night temperature difference cycles and weekday load peaks and valleys), long-term trend interference can be suppressed.
[0074] The third branch is the macro-feature extraction module, used to extract long-term dependency features across time periods from the data in the multidimensional dataset. Specifically, it employs a three-level cascaded dilated convolution, with the dilation rate calculated according to... The total receptive field is calculated by doubling the number of receptive fields. It covers long-term dependencies across quarterly and even annual scales (such as seasonal humidity accumulation and component aging drift), and its stacked dilated convolution reflects nonlinear coupling effects across time periods.
[0075] The adaptive feature fusion module dynamically fuses the output features of the three parallel feature extraction branches through a weighted summation method to obtain multi-scale features. The fusion weights are automatically adjusted according to the contribution of each branch feature to the target task. Specifically, firstly, global average pooling and fully connected mapping are performed on micro-features, periodic temporal variation features, and long-term dependency features respectively to generate normalized weights. (satisfy Based on the above normalized weighted fusion, the formula is as follows:
[0076] ;
[0077] In the formula, It is a multi-scale feature; Microscopic features; It exhibits periodic temporal variation characteristics; This is a long-term dependency characteristic;
[0078] The above design enables multi-scale deep neural convolutional networks to autonomously adjust the contribution of each scale according to the characteristics of the input data (such as noise intensity, periodicity, and trend slope). For example, it can automatically increase the weight in strong periodic load scenarios or increase the proportion in long-term drift-dominated degradation processes, thereby achieving robust modeling of complex temporal patterns.
[0079] S3. Construct a temporal prediction model CAformer based on the Informer model. The temporal prediction model includes an encoder and a decoder. Multi-scale features are used as the encoder input. By embedding a convolutional attention module in the self-attention distillation layer of the encoder, the feature weights are dynamically adjusted under the channel attention mechanism and spatial attention. The decoder outputs the error evolution based on the adjusted features to predict the sequence.
[0080] S31, The encoder includes an input layer, sparse attention blocks, and a self-attention convolutional distillation layer, wherein:
[0081] The input layer includes an embedding layer and a one-dimensional convolutional layer. The embedding layer is used to perform dimensionality mapping on multi-scale features, and the one-dimensional convolutional layer is used to perform preliminary temporal feature extraction on multi-scale features. The outputs of the embedding layer and the one-dimensional convolutional layer are added element by element and fused to obtain the fused features.
[0082] The sparse attention blocks have a total of One, of which ;like Figure 3 As shown, in this embodiment, take The fused features then pass through three sparse attention blocks in sequence. These sparse attention blocks employ a multi-head probabilistic sparse self-attention mechanism to filter key time-node features from the input sparse attention blocks. The core of this mechanism is the query sparsity metric formula, which calculates only the most important query matrix. ) and key matrix ( This avoids calculating all possible keys, thus improving computational efficiency. Furthermore, the sparsity metric formula is:
[0083] ;
[0084] In the formula, For the first Query vectors at each time step Bond matrix Corresponding query sparsity; The length of the key sequence; For the first Key vector at each time step Perform a transpose operation. This means performing a transpose operation; The feature dimension corresponding to the features of the input sparse attention block;
[0085] Furthermore, for example, the feature shape of the input sparse attention block is ,in, For batch size, For example, data from the past 96 hours. Generate through linear transformation ,So ( (for the set of real numbers), aligned with the input feature sequence, for Query by hour (current focus) Calculate its relationship with all sparsity ;
[0086] Design a query sparsity threshold, select query sparsity within the threshold range, and set the elements of other queries to zero to obtain a sparsified query matrix; calculate the sparse attention weights for the sparsified query matrix, expressed by the formula:
[0087] ;
[0088] In the formula, For sparse attention weights, For a sparse query matrix, Let be the dimension of the key matrix. It is a value matrix; for function;
[0089] The self-attention convolutional distillation layer has a total of In this embodiment, there are two self-attention convolutional distillation layers. Each self-attention convolutional distillation layer is located between two adjacent sparse attention blocks. That is, the first self-attention convolutional distillation layer is located between the first sparse attention block and the second sparse attention block, and the second self-attention convolutional distillation layer is located between the second sparse attention block and the third sparse attention block. It is used to perform distillation operation on the key time node features output by the previous sparse attention block to obtain distilled features.
[0090] Preferably, the convolutional attention module embedded in the self-attention convolutional distillation layer is used to perform one-dimensional convolution operations on the distillation features and to calculate the channel weights of the distillation features after one-dimensional convolution using a channel attention mechanism. Based on the channel weights, the channel dimension features in the distillation features are adjusted. Further, the channel attention mechanism generates channel weights through global average pooling and fully connected layers to enhance discriminative channel features. The channel weights are multiplied element-wise with the channel dimension features to obtain the channel-weighted distillation features.
[0091] The spatial weights of the distilled features after adjusting the channel dimension features are calculated through the spatial attention mechanism. The temporal dimension features in the distilled features are then adjusted based on the spatial weights. Furthermore, cross-channel max / average pooling is performed on the channel-weighted distilled features, and spatial weights are generated through convolutional layers. Focusing on key time nodes, the spatial weights are multiplied element-wise with the enhanced discriminative channel features to obtain the spatially weighted distilled features.
[0092] The distilled features, which are weighted by both channel and space, are subjected to max pooling to reduce dimensionality and output to the next sparse attention block.
[0093] The features output by the three sparse attention blocks corresponding to this embodiment are concatenated along the channel dimension to generate a concatenated feature map.
[0094] S32, The decoder includes a masked multi-head probabilistic sparse self-attention layer, a multi-head attention layer, and a fully connected layer, wherein:
[0095] The concatenated feature map and the generated historical prediction sequence are concatenated along the channel dimension to obtain the decoder input features. The decoder input features are used as the input of the masked multi-head probabilistic sparse self-attention layer. The masking mechanism of the masked multi-head probabilistic sparse self-attention layer can shield interference from future time nodes. Therefore, it is used to filter out interference from future time nodes in the concatenation result, retain causal constraints, and obtain sparse attention features.
[0096] Furthermore, the specific steps for generating historical prediction sequences are as follows:
[0097] The decoder takes the spliced feature map output by the encoder as the input of the initial time step, generates the first predicted value based on the input of the initial time step, and uses the generated predicted value as the decoder input of the next time step. Through iterative prediction, the length of the prediction sequence is gradually expanded to generate a historical prediction sequence.
[0098] The sparse attention features are used as input to the multi-head attention layer, and the output is a global feature map that fuses global information from the encoder and contextual features from the decoder. Further, the multi-head attention layer uses the concatenated feature map as the key matrix and the value matrix, and the features of the decoder at the current time step as the query matrix. The similarity between the query matrix and the key matrix is calculated, and a softmax operation is performed on the similarity to obtain the attention weight matrix. The attention weight matrix and the value matrix are then weighted and summed to obtain the feature map that fuses global information from the encoder and contextual features from the decoder.
[0099] The high-dimensional features in the global feature map are mapped to single-step prediction values through a fully connected layer to obtain the error prediction value at the current time step. The error prediction value at the current time step is then incorporated into the end of the historical prediction sequence as the input for the next time step, until the preset iteration prediction step size is reached, and the error evolution prediction sequence is output.
[0100] S4. Determine the time point corresponding to the failure threshold of the smart energy meter based on the error evolution prediction sequence, and calculate the remaining service life of the smart energy meter.
[0101] S41. In this embodiment, the failure threshold is a dynamic threshold set in conjunction with the influence of environmental stress, expressed by the formula:
[0102] ;
[0103] In the formula, For dynamic thresholds, The preset basic threshold is defined according to industry standards or historical failure data (e.g., failure is judged when the absolute value of the operating error continuously exceeds ±0.5%). This is the environmental compensation coefficient. This represents the normalized environmental stress influence factor.
[0104] Going a step further, This reflects the impact of different environmental conditions on the failure detection of smart meters. For example, when the ambient temperature is too high or too low, the performance of smart meters may be significantly affected. In high-temperature environments (such as outdoor temperatures exceeding 40°C in summer), the performance of electronic components may degrade, making the meter more prone to errors. In such cases, an environmental compensation coefficient is set. This indicates that in high-temperature environments, the failure threshold needs to be appropriately lowered in order to detect potential problems with the electricity meter more promptly. This reflects the comprehensive impact of current environmental stress on the performance of smart energy meters. Assuming that the environmental stress data considered in this embodiment includes temperature, humidity and salt spray concentration, the environmental stress influence weight of the environmental stress data on the performance of the energy meter is obtained through experiments or experience. The environmental stress data is normalized, and the normalized environmental stress influence factor is obtained by multiplying the environmental stress influence weight and the normalized environmental stress data element by element and then adding them together.
[0105] S42. The error evolution prediction sequence is judged for failure by the sliding window detection algorithm. Specifically, the mean and variance of the error in each window are calculated. When the mean error of a preset number of consecutive windows is greater than the dynamic threshold and the variance is less than the preset variance threshold, it is judged as a failure and a failure alarm is triggered.
[0106] Preferably, after the sliding window detection triggers a failure alarm, it is necessary to perform trend extrapolation verification on the sequence after the alarm point to confirm the continuity of the trend. Specifically, linear regression is performed on the sequence after the alarm point to obtain a regression equation. If the slope of the regression equation is greater than zero, it indicates that the error is on an upward trend. At the same time, if the sum of squared residuals corresponding to the regression equation is less than the residual sum of squared threshold, it indicates that the regression effect is good, the error prediction sequence conforms to the upward trend, and the continuity of the trend is confirmed.
[0107] S43. After triggering the failure alarm, the time point when the error first exceeds the failure threshold is found using the time-travel method, expressed as a formula:
[0108] ;
[0109] In the formula, The time point at which the failure threshold is first exceeded. For the error prediction sequence The numerical value at any given moment; This indicates the search for sequences in the error prediction sequence. Value of time Greater than or equal to the dynamic threshold The smallest independent variable value that holds true ;
[0110] S44. The remaining service life is calculated based on the time point when the failure threshold is first exceeded, expressed by the formula:
[0111] ;
[0112] In the formula, For the remaining service life, The current moment;
[0113] S5. To verify the feasibility of the method described in this embodiment, a three-phase prepaid smart energy meter from a certain company was selected as the test object. Its operating data covers the period from April 2018 to February 2024, with a sampling frequency of once per minute. The original environmental stress data includes six parameters: temperature, humidity, air pressure, salt spray concentration, altitude, and wind speed. After Pearson correlation coefficient analysis (threshold set at |0.5|), temperature, humidity, and salt spray concentration were retained as key influencing factors. The correlation coefficients between these key influencing factors and the operating error were 0.74, 0.60, and 0.52, respectively. The basic threshold corresponding to the failure threshold was set to ±2%.
[0114] To evaluate the model's generalization ability, this embodiment uses five-fold cross-validation. The dataset is divided into five subsets, with four subsets selected as the training set and the remaining one as the validation set each time. The mean squared error (MSE) of the predictions obtained through the above test is 0.0271% (standard deviation ± 0.002%), the coefficient of determination (R²) is 0.7506, and the adjusted coefficient of determination (Adjusted R²) is 0.9534. This shows that the model provided by the method described in this embodiment exhibits strong fitting ability and high accuracy.
[0115] The results from the first 1000 days of the test were selected for analysis, such as... Figure 4 As shown in the figure, the Y-axis represents the normalized lifespan value, ranging from 0.3 to 1; the X-axis represents the number of operating days, ranging from 0 to 1000 days. The curved solid line in the figure represents the trend of the predicted lifespan of the smart meter changing with the number of operating days. As the number of operating days increases, the predicted lifespan of the smart meter gradually decreases due to the influence of environmental stress. The data points below the curve are the actual observation data points. In reality, the difference between the lifespan of the smart meter and the predicted lifespan is small, and the prediction results are accurate.
[0116] In summary, the smart energy meter life prediction method provided in this embodiment effectively integrates environmental stress coupling effects and error evolution trends through multi-scale feature extraction (micro-temporal fluctuations, periodic changes, and long-term dependencies) and an adaptive attention mechanism (channel-space dynamic weighting). This provides a highly reliable prediction tool for smart energy meter condition-based maintenance and life management, and can be extended to the health status assessment of other power metering equipment.
[0117] Example 2:
[0118] This embodiment provides a method for predicting the lifespan of a smart energy meter. Based on Embodiment 1, when a multi-head probabilistic sparse self-attention mechanism is used in the sparse attention block, only the top-u high-activation query-key pairs are selected for calculation, expressed by the formula:
[0119] ;
[0120] In the formula, It is a constant, with a default value of 5; when When =96, then Then, the 23 queries with the highest sparsity are retained, and their attention weights are calculated, which significantly reduces the complexity.
[0121] Example 3:
[0122] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements a smart energy meter life prediction method as described in any embodiment of the present invention.
[0123] Example 4:
[0124] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements a smart energy meter life prediction method as described in any embodiment of the present invention.
[0125] In this embodiment of the invention, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, A and B simultaneously, or B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects have an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.
[0126] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0127] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0128] In several embodiments provided by this invention, any function, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0129] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for predicting the lifespan of a smart energy meter, characterized in that, The method comprises: The system acquires the operating error data, environmental stress data, and operating time series of smart energy meters. It then uses the operating error data as a benchmark to reduce the dimensionality of the environmental stress data and combines the operating time series with the dimensionality-reduced environmental stress dataset to generate a multidimensional dataset. Construct a multi-scale deep convolutional neural network to extract features from a multidimensional dataset and obtain multi-scale features; A temporal prediction model based on the Informer model is constructed, including an encoder and a decoder. Multi-scale features are used as input to the encoder. By embedding a convolutional attention module in the self-attention distillation layer of the encoder, the feature weights are dynamically adjusted under the channel attention mechanism and spatial attention. The decoder outputs the error evolution based on the adjusted features to predict the sequence. Based on the error evolution prediction sequence, the time point corresponding to the failure threshold of the smart energy meter is determined, and the remaining service life of the smart energy meter is calculated.
2. The method for predicting the lifespan of a smart energy meter according to claim 1, characterized in that, The specific steps for dimensionality reduction of environmental stress data based on operational error data are as follows: Calculate the product of the difference between each environmental stress data point and its mean, and the difference between each operational error data point and its mean, and then average the products. Calculate the standard deviations of environmental stress data and operational error data separately; The Pearson correlation coefficient of the environmental stress data based on the operational error data is obtained by dividing the average value by the product of the two standard deviations. A preset Pearson correlation coefficient threshold is used to filter out environmental stress data whose Pearson correlation coefficient falls within the threshold range.
3. The method for predicting the lifespan of a smart energy meter according to claim 1, characterized in that, The multi-scale deep convolutional neural network includes three parallel feature extraction branches and an adaptive feature fusion module, wherein: The first branch of the three parallel feature extraction branches is a local feature extraction module composed of a single convolutional kernel, used to extract micro-features between adjacent time points in the multidimensional dataset; the second branch is an intermediate-scale feature extraction module containing two levels of cascaded convolutional layers, used to extract periodic temporal variation features in the multidimensional dataset, wherein the first level of cascaded convolutional layer uses uninterrupted sampling convolution, and the second level of cascaded convolutional layer uses interval sampling convolution; the third branch is a macro-feature extraction module composed of three levels of cascaded convolutional layers, used to extract long-term dependency features across time periods in the multidimensional dataset, wherein the interval sampling rate of each level of cascaded convolutional layer increases exponentially. The adaptive feature fusion module is used to dynamically fuse the output features of the three parallel feature extraction branches through a weighted summation method to obtain multi-scale features. The fusion weights are automatically adjusted according to the contribution of each branch feature to the target task.
4. The method for predicting the lifespan of a smart energy meter according to claim 1, characterized in that, The encoder includes an input layer, sparse attention blocks, and a self-attention convolutional distillation layer, wherein: The input layer includes an embedding layer and a one-dimensional convolutional layer. The embedding layer is used to perform dimensionality mapping on multi-scale features, and the one-dimensional convolutional layer is used to perform preliminary temporal feature extraction on multi-scale features. The outputs of the embedding layer and the one-dimensional convolutional layer are fused to obtain fused features. The sparse attention blocks have a total of One, of which ; The fusion features are sequentially passed through A sparse attention block, wherein the sparse attention block employs a multi-head probabilistic sparse self-attention mechanism to filter key time node features from the features of the input sparse attention block; The self-attention convolutional distillation layer has a total of Each self-attention convolutional distillation layer is located between two adjacent sparse attention blocks and is used to perform distillation operations on the key time node features output by the previous sparse attention block to obtain distilled features.
5. The method for predicting the lifespan of a smart energy meter according to claim 4, characterized in that, The convolutional attention module embedded in the self-attention convolutional distillation layer is used to perform one-dimensional convolution operations on the distilled features and calculate the channel weights of the distilled features after one-dimensional convolution using the channel attention mechanism. Based on the channel weights, the channel dimension features in the distilled features are weighted and adjusted. The spatial weights of the distilled features after adjusting the channel dimension features are calculated using the spatial attention mechanism, and the temporal dimension features in the distilled features are weighted and adjusted based on the spatial weights. Max pooling is then performed on the weighted distilled features, and the output is sent to the next sparse attention block. Will The features output by each sparse attention block are concatenated along the channel dimension to generate a concatenated feature map.
6. The method for predicting the lifespan of a smart energy meter according to claim 5, characterized in that, The decoder comprises a masked multi-head probabilistic sparse self-attention layer, a multi-head attention layer, and a fully connected layer, wherein: The concatenated feature map and the generated historical prediction sequence are concatenated along the channel dimension to obtain the decoder input features. The decoder input features are used as the input of the masked multi-head probabilistic sparse self-attention layer. The masked multi-head probabilistic sparse self-attention layer is used to filter out interference from future time nodes in the concatenation result to obtain sparse attention features. Sparse attention features are used as input to the multi-head attention layer, and the output is a global feature map that fuses global information from the encoder and contextual features from the decoder. The high-dimensional features in the global feature map are mapped to single-step prediction values through a fully connected layer to obtain the error prediction value at the current time step. The error prediction value at the current time step is then incorporated into the end of the historical prediction sequence as the input for the next time step, until the preset iteration prediction step size is reached, and the error evolution prediction sequence is output.
7. The method for predicting the lifespan of a smart energy meter according to claim 6, characterized in that, The specific steps for generating historical prediction sequences are as follows: The decoder takes the spliced feature map output by the encoder as the input of the initial time step, generates the first predicted value based on the input of the initial time step, and uses the generated predicted value as the decoder input of the next time step. Through iterative prediction, the length of the prediction sequence is gradually expanded to generate a historical prediction sequence.
8. The method for predicting the lifespan of a smart energy meter according to claim 7, characterized in that, The multi-head attention layer uses the concatenated feature map as the key matrix and value matrix, and the features of the decoder at the current time step as the query matrix. It calculates the similarity between the query matrix and the key matrix, performs a softmax operation on the similarity to obtain the attention weight matrix, and performs a weighted summation of the attention weight matrix and the value matrix to obtain a feature map that fuses the global information of the encoder and the context features of the decoder.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements a method for predicting the lifespan of a smart energy meter as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements a method for predicting the lifespan of a smart energy meter as described in any one of claims 1 to 8.
Citation Information
Patent Citations
A method and system for predicting the life of smart meters based on DS evidence theory
CN114219118B
Intelligent electric meter service life prediction method and system based on D-S evidence theory
CN114219118A
Intelligent prediction and early warning method for life cycle of electric energy meter
CN119959853A