A Smart Electricity Metering and Prediction Method and System Based on Big Data

By constructing an LSTM-GRU model based on big data and combining multi-source data processing and attention mechanisms, the shortcomings of existing electricity metering and forecasting methods in handling nonlinear and multi-source data relationships are solved, and high-precision and stable electricity load forecasting is achieved.

CN120804607BActive Publication Date: 2025-11-14FUJIAN CHUANZHENG COMM COLLEGE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511292440.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-11
Publication Date
2025-11-14
Estimated Expiration
2045-09-11

AI Technical Summary

Technical Problem

Existing electricity metering and forecasting methods struggle to handle nonlinear and non-stationary electricity data, resulting in limited forecast accuracy and an inability to fully consider the complex relationships between multiple data sources, leading to unstable forecast performance.

Method used

By acquiring user electricity consumption, environmental parameters, and holiday data through the Internet of Things, a joint algorithm of sliding window and wavelet packet decomposition is used for signal reconstruction. Feature data is extracted by combining Kalman filtering and principal component analysis, an LSTM-GRU model is constructed, and an attention mechanism is introduced for feature weight allocation. Finally, the optimized model is used to predict electricity load.

Benefits of technology

It improves the accuracy and reliability of electricity load forecasting, effectively handles nonlinear and non-stationary data, comprehensively considers the influence of multiple factors, enhances model performance and stability, and displays the forecast results through visualization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120804607B_ABST
    Figure CN120804607B_ABST
Patent Text Reader

Abstract

This invention relates to the field of power technology and discloses a smart electricity metering and prediction method and system based on big data. It acquires user electricity consumption, environmental parameters, and holiday data in real time through the Internet of Things (IoT) to form an initial dataset. A joint algorithm of sliding window and wavelet packet decomposition is employed, dynamically adjusting thresholds through an exponentially weighted moving average control chart, and combined with Kalman filtering for multi-stage signal reconstruction to obtain denoised data. Time features, meteorological features, and user behavior features are extracted from the denoised data, and principal component analysis is used for dimensionality reduction to obtain target feature data. An LSTM-GRU model is constructed and trained using the target feature data. An attention mechanism is used to strengthen the weight allocation of features related to electricity load prediction. The data to be predicted is input into the optimized LSTM-GRU model to obtain the predicted electricity load, which is then visualized. This invention improves the accuracy of electricity load prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power technology, specifically to a smart electricity metering and prediction method and system based on big data. Background Technology

[0002] In power systems, accurate electricity consumption forecasting is crucial for rational power dispatch, optimal resource allocation, and user electricity management. With the development of smart grids and the application of big data technology, traditional electricity consumption forecasting methods are increasingly unable to meet the growing requirements for accuracy and reliability. Existing technologies commonly use electricity consumption forecasting methods, including time series analysis, regression analysis, and neural network methods; however, these methods suffer from the following problems:

[0003] Time series analysis and regression analysis methods typically assume that the data have a linear relationship, making it difficult to handle nonlinear and non-stationary electricity consumption data, and resulting in limited prediction accuracy.

[0004] Traditional neural network methods are prone to gradient vanishing or gradient exploding problems when processing long sequence data, which makes model training difficult and prediction results unstable.

[0005] Existing methods often only consider the impact of a single factor on electricity load, ignoring the complex relationships between multiple data sources, making it difficult to predict electricity load comprehensively and accurately. Summary of the Invention

[0006] The purpose of this invention is to solve the above problems by designing a smart electricity metering and prediction method and system based on big data.

[0007] The first aspect of this invention provides a smart electricity metering and prediction method based on big data, the method comprising the following steps:

[0008] The Internet of Things (IoT) is used to acquire real-time data on user electricity consumption, environmental parameters, and holidays to form an initial dataset.

[0009] A joint algorithm of sliding window and wavelet packet decomposition is adopted. The threshold is dynamically adjusted by the exponential weighted moving average control chart and Kalman filtering is combined to reconstruct the signal in multiple stages to obtain the denoised data. Time features, meteorological features and user behavior features are extracted from the denoised data, and the target feature data is obtained by dimensionality reduction using principal component analysis.

[0010] An LSTM-GRU model is constructed and trained using target feature data. The weight allocation of features related to electricity load prediction is enhanced through an attention mechanism. The gating mechanism of the LSTM layer and GRU layer in the LSTM-GRU model is fused at multiple scales, and a multi-granularity attention module is introduced. A qubit superposition encoding strategy is adopted, and a simulated annealing mechanism is combined to perform a global search of the parameter space.

[0011] The data to be predicted is input into the optimized LSTM-GRU model to obtain the predicted electricity load, and the predicted results are visualized.

[0012] Optionally, in a first implementation of the first aspect of the present invention, the method of employing a sliding window and wavelet packet decomposition joint algorithm, dynamically adjusting the threshold through an exponentially weighted moving average control graph, and combining it with Kalman filtering for multi-stage signal reconstruction to obtain denoised data includes:

[0013] The volatility of the current initial dataset is calculated using a sliding window, and the anomaly detection threshold is dynamically adjusted based on the EWMA control chart.

[0014] The initial dataset is decomposed using wavelet packet decomposition, and the signal is reconstructed after preserving the transient change features in the high-frequency band.

[0015] The reconstructed signal is input into a Kalman filter, and residual impulse noise is eliminated through the state equation and observation equation to obtain the denoised data.

[0016] Optionally, in a second implementation of the first aspect of the present invention, the step of extracting time features, meteorological features, and user behavior features from the denoised data, and obtaining target feature data by using principal component analysis for dimensionality reduction, includes:

[0017] The periodic variation pattern of electricity load is analyzed from the denoised data by Fourier transform, and periodic features including hourly, daily, weekly and monthly time dimensions are extracted to obtain time features;

[0018] The denoised data is filtered through correlation analysis and feature selection algorithms. The correlation coefficient between meteorological factors and electricity load is calculated. Meteorological factors with large correlation coefficients are selected as features to obtain meteorological features.

[0019] Users are categorized according to their electricity usage habits and patterns, and electricity usage behavior characteristics of different user groups are extracted through K-means clustering analysis.

[0020] The extracted time features, meteorological features, and user behavior features are integrated to form an initial feature dataset;

[0021] The initial feature dataset is standardized, the covariance matrix of the standardized data is calculated, and the eigenvalues ​​and eigenvectors of the covariance matrix are solved.

[0022] Based on the magnitude of the eigenvalues, the eigenvectors corresponding to the k largest eigenvalues ​​are selected to obtain the principal components;

[0023] The initial feature dataset is projected onto the principal components to obtain the dimensionality-reduced target feature data.

[0024] Optionally, in a third implementation of the first aspect of the present invention, the step of constructing an LSTM-GRU model, training the LSTM-GRU model using target feature data, and strengthening the weight allocation of features related to electricity load prediction through an attention mechanism includes:

[0025] The basic architecture of the LSTM-GRU model is determined, which includes an input layer, an LSTM layer, a GRU layer, an attention layer, and an output layer.

[0026] Set an appropriate number of neurons for the LSTM and GRU layers, and randomly initialize the connection weights and bias terms between each layer;

[0027] The target feature data is divided into training set, validation set and test set. The LSTM-GRU model is trained using the training set. The weight of each time step and each feature is calculated through the attention mechanism to strengthen the weight allocation of features related to electricity load prediction.

[0028] A qubit superposition encoding strategy is adopted, combined with simulated annealing mechanism for global search of parameter space, and the optimized parameters are applied to the LSTM-GRU model.

[0029] The trained LSTM-GRU model is evaluated using a test set. The prediction error, mean squared error, and mean absolute error of the model are calculated, and the optimized LSTM-GRU model is finally obtained.

[0030] Optionally, in the fourth implementation of the first aspect of the present invention, the adoption of a qubit superposition encoding strategy combined with a simulated annealing mechanism for global parameter space search includes:

[0031] The parameters of the LSTM-GRU model to be optimized are determined, and the model parameters are divided into continuous layers and discrete layers, and real number encoding and binary encoding strategies are adopted respectively.

[0032] An initial population is generated by utilizing the superposition property of qubits, and a simulated annealing mechanism is used to escape local optima during the iteration process.

[0033] When the validation set error fails to improve for five consecutive generations, a portion of the population is randomly reset and the search is restarted. When the maximum number of iterations is reached, the optimal parameters obtained through optimization are determined.

[0034] Optionally, in a fifth implementation of the first aspect of the present invention, the parameters of the LSTM-GRU model to be optimized include the learning rate, the number of neurons in the LSTM layer and the GRU layer, and the weights of the attention mechanism.

[0035] Optionally, in a sixth implementation of the first aspect of the present invention, the step of inputting the data to be predicted into the optimized LSTM-GRU model to obtain the predicted electricity load and visually displaying the predicted results includes:

[0036] The data to be predicted is input into the optimized LSTM-GRU model, the LSTM layer is used to capture low-frequency trends, and the memory unit is used to handle long-term dependencies.

[0037] The GRU layer captures high-frequency power fluctuations based on the output of the LSTM layer and handles short-term dynamic changes.

[0038] The output of the GRU layer is first dynamically assigned weights for different time steps through temporal attention to capture periodic patterns. Then, different weights are assigned to features through feature attention, and the attention weights are applied to the GRU output to obtain the context vector. Hierarchical attention is used to first perform coarse-grained filtering of time steps, and then fine-grained weighting of the filtered features.

[0039] The context vector is converted into actual values ​​through a fully connected layer, and the predicted power load is output.

[0040] A second aspect of the present invention provides a smart electricity metering and forecasting system based on big data, the system comprising:

[0041] The acquisition module is used to acquire user electricity consumption, environmental parameters, and holiday data in real time through the Internet of Things to form an initial dataset.

[0042] The processing module is used to employ a sliding window and wavelet packet decomposition joint algorithm, dynamically adjust the threshold through an exponentially weighted moving average control chart, and combine Kalman filtering to perform multi-stage signal reconstruction to obtain denoised data. From the denoised data, time features, meteorological features, and user behavior features are extracted, and principal component analysis is used to reduce the dimensionality to obtain the target feature data.

[0043] The building module is used to build the LSTM-GRU model, train the LSTM-GRU model using target feature data, and strengthen the weight allocation of features related to electricity load prediction through the attention mechanism.

[0044] The prediction module is used to input the data to be predicted into the optimized LSTM-GRU model to obtain the prediction results of the electricity load and to visualize the prediction results.

[0045] A third aspect of the present invention provides a big data-based smart electricity metering and prediction device, the big data-based smart electricity metering and prediction device comprising a memory and at least one processor, the memory storing instructions; the at least one processor calling the instructions in the memory to cause the big data-based smart electricity metering and prediction device to perform the various steps of the big data-based smart electricity metering and prediction method as described in any of the preceding claims.

[0046] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed by a processor, implement the steps of the big data-based smart metering and prediction method for electricity consumption as described in any of the preceding claims.

[0047] The technical solution provided by this invention acquires user electricity consumption, environmental parameters, and holiday data in real time through the Internet of Things to form an initial dataset; it employs a joint algorithm of sliding window and wavelet packet decomposition, dynamically adjusts the threshold through an exponentially weighted moving average control chart, and combines Kalman filtering for multi-stage signal reconstruction to obtain denoised data; it extracts time features, meteorological features, and user behavior features from the denoised data, and uses principal component analysis for dimensionality reduction to obtain target feature data; it constructs an LSTM-GRU model, trains the LSTM-GRU model using the target feature data, and strengthens the weight allocation of features related to electricity load prediction through an attention mechanism; it inputs the data to be predicted into the optimized LSTM-GRU model to obtain the predicted electricity load, and visualizes the prediction results; this invention, by constructing an LSTM-GRU model, fully leverages the long-term reliability of LSTM processing. Leveraging the advantages of relational analysis and GRU in capturing short-term changing characteristics, this approach effectively handles nonlinear and non-stationary electricity consumption data, improving the accuracy of electricity load forecasting. The introduction of an attention mechanism automatically learns and strengthens the weight allocation of target features more important for electricity load forecasting, further enhancing the model's predictive power. The GA-ACO hybrid algorithm optimizes model parameters, combining the global search capability of genetic algorithms with the positive feedback mechanism of ant colony algorithms, enabling rapid identification of the optimal parameter combination and improving model performance and stability. By integrating multi-source data such as historical user electricity consumption data, meteorological data, and holiday data, and extracting various relevant features, this approach comprehensively considers all factors affecting electricity load, improving the accuracy and reliability of forecasts. Visualization technology intuitively presents the forecast results to users, facilitating their understanding and analysis of electricity load trends and providing strong support for power system decision-making. Attached Figure Description

[0048] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention.

[0049] Figure 1 A flowchart illustrating the smart electricity metering and prediction method based on big data provided in this embodiment of the invention;

[0050] Figure 2 A schematic diagram of the structure of the smart electricity metering and prediction system based on big data provided in an embodiment of the present invention;

[0051] Figure 3 This is a schematic diagram of the structure of a smart electricity metering and prediction device based on big data, provided in an embodiment of the present invention. Detailed Implementation

[0052] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0053] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 The flowchart of the smart electricity metering and prediction method based on big data provided in this embodiment of the invention includes the following steps:

[0054] Step 101: Acquire user electricity consumption, environmental parameters, and holiday data in real time through the Internet of Things to form an initial dataset;

[0055] In this embodiment, the process of acquiring user electricity consumption, environmental parameters, and holiday data in real time through the Internet of Things (IoT) to form an initial dataset is achieved by relying on IoT sensing devices deployed on the user side and in public areas. At the user's electricity consumption end, smart meters, as core sensing nodes, record key data such as instantaneous and cumulative electricity consumption in real time according to a preset collection frequency, such as once every 15 minutes, and transmit the data to the local edge gateway via power line carrier or wireless communication modules such as LoRa and NB-IoT. Regarding environmental parameter acquisition, devices such as temperature and humidity sensors, light sensors, and wind speed sensors distributed in different areas continuously monitor real-time environmental information such as temperature, relative humidity, light intensity, and wind speed in the user's area. After standardization processing, this data is also aggregated to the data gateway through the IoT communication network. For holiday data, date attribute information, including statutory holidays, weekends, and adjusted workdays, is acquired in real time by connecting to government information systems or calendar service interfaces, and converted into structured data, such as using 0 and 1 to identify non-holidays and holidays, respectively. Ultimately, the electricity consumption data collected by smart meters, the environmental parameters obtained by environmental sensors, and the holiday data synchronized by the interface are timestamped and formatted at the edge gateway or cloud platform, together forming an initial dataset containing multi-dimensional information.

[0056] Step 102: Using a sliding window and wavelet packet decomposition joint algorithm, the threshold is dynamically adjusted through an exponentially weighted moving average control chart, and Kalman filtering is combined to perform multi-stage signal reconstruction to obtain denoised data. Time features, meteorological features and user behavior features are extracted from the denoised data, and principal component analysis is used to reduce the dimensionality to obtain the target feature data.

[0057] In this embodiment, the volatility of the current initial dataset is calculated by a sliding window, and the anomaly judgment threshold is dynamically adjusted based on the EWMA control chart. The initial dataset is decomposed by wavelet packet, and the signal is reconstructed after retaining the transient change characteristics of the high-frequency band. The reconstructed signal is input into a Kalman filter, and residual impulse noise is eliminated by the state equation and the observation equation to obtain the denoised data.

[0058] In this embodiment, Fourier transform is used to analyze the periodic variation of electricity load from the denoised data, extracting periodic features including hourly, daily, weekly, and monthly time dimensions to obtain time features. Correlation analysis and feature selection algorithms are used to filter the denoised data, calculating the correlation coefficient between meteorological factors and electricity load, and selecting meteorological factors with high correlation coefficients as features to obtain meteorological features. Users are classified according to their electricity consumption habits and patterns, and K-means clustering analysis is used to extract electricity consumption behavior features of different user groups. The extracted time features, meteorological features, and user behavior features are integrated to form an initial feature dataset. The initial feature dataset is standardized, the covariance matrix of the standardized data is calculated, and the eigenvalues ​​and eigenvectors of the covariance matrix are solved. Based on the magnitude of the eigenvalues, the eigenvectors corresponding to the k largest eigenvalues ​​are selected to obtain principal components. The initial feature dataset is projected onto the principal components to obtain the dimensionality-reduced target feature data.

[0059] In this embodiment, the denoised electricity load time-series data is subjected to Discrete Fourier Transform (DFT) to transform it from the time domain to the frequency domain, thereby decomposing the data into sine and cosine components of different frequencies. By analyzing the amplitude and phase of each frequency component in the frequency domain, significant periodic patterns are identified. For example, a 24-hour cycle corresponds to daily electricity consumption patterns such as morning and evening peak hours, a 7-day cycle corresponds to weekly electricity consumption patterns such as differences between weekdays and weekends, and a cycle of approximately 30 days corresponds to monthly electricity consumption fluctuations. To improve computational efficiency, a Fast Fourier Transform algorithm can be used. Subsequently, by setting a frequency threshold or energy percentage threshold, frequency components representing the main periodic changes are selected, and these components are reconstructed back into the time domain to obtain the periodic characteristics of each time dimension. For example, retaining the 24-hour periodic component yields daily periodic characteristics, and retaining the 7-day periodic component yields weekly periodic characteristics. Finally, these periodic characteristics are combined with the original timestamp information such as hour, day, week, and month to form a complete time feature set.

[0060] The denoised electricity load data is time-aligned with synchronously collected meteorological data such as temperature, humidity, air pressure, wind speed, and light intensity to ensure a one-to-one correspondence between data points in the time dimension. Then, the correlation coefficient between each meteorological factor and the electricity load is calculated. Common correlation coefficient calculation methods include Pearson correlation coefficient and Spearman rank correlation coefficient. For example, calculating the Pearson correlation coefficient between temperature and electricity load: a positive coefficient close to 1 indicates that electricity load increases with rising temperature, such as air conditioning electricity consumption in summer; a negative coefficient close to -1 indicates that electricity load decreases with rising temperature, such as heating electricity consumption in winter. To avoid multicollinearity, the correlation between various meteorological factors can be further calculated. If two meteorological factors are found to be highly correlated, such as temperature and perceived temperature, the one with a stronger correlation to the electricity load is selected. Finally, a correlation coefficient threshold is set, such as |r|>0.3, and meteorological factors exceeding the threshold are selected as the final meteorological features.

[0061] The denoised user electricity consumption data is preprocessed to extract feature vectors reflecting user electricity consumption habits, such as daily peak and off-peak hours, average electricity consumption, peak-to-valley difference, and electricity consumption time distribution entropy. To eliminate the influence of different feature dimensions, the feature vectors are standardized. Then, the K-means clustering algorithm is applied to classify users. The K value can be determined by evaluating the clustering effect using the elbow method or silhouette coefficient method. For example, when K=3, users may be divided into three categories: peak-type, off-peak-type, and balanced-type. For each cluster center, the statistical characteristics of its feature vectors are analyzed to extract the typical electricity consumption patterns of that user group. For example, the characteristics of "peak-type" users may include significantly higher electricity consumption between 9-11 am and 2-5 pm on weekdays, and relatively flat electricity consumption patterns on weekends. In addition, the distance between each user and its cluster center can be calculated to evaluate the stability of user electricity consumption patterns. Finally, these clustering results and typical electricity consumption patterns are used as user behavior features.

[0062] Step 103: Construct an LSTM-GRU model, train the LSTM-GRU model using target feature data, and strengthen the weight allocation of features related to electricity load prediction through an attention mechanism.

[0063] In this embodiment, the basic architecture of the LSTM-GRU model is determined, which includes an input layer, an LSTM layer, a GRU layer, an attention layer, and an output layer. Appropriate numbers of neurons are set for the LSTM and GRU layers, and the connection weights and bias terms between each layer are randomly initialized. The target feature data is divided into a training set, a validation set, and a test set. The LSTM-GRU model is trained using the training set, and the weights for each time step and each feature are calculated through an attention mechanism to strengthen the weight allocation of features related to electricity load prediction. A qubit superposition encoding strategy is adopted, combined with a simulated annealing mechanism, to perform a global search in the parameter space. The optimized parameters are applied to the LSTM-GRU model. The trained LSTM-GRU model is evaluated using the test set, and the prediction error, mean squared error, and mean absolute error of the model are calculated, ultimately yielding the optimized LSTM-GRU model.

[0064] In this embodiment, the parameters of the LSTM-GRU model to be optimized are determined, and the model parameters are divided into continuous layers and discrete layers, using real number encoding and binary encoding strategies respectively. An initial population is generated through the superposition property of qubits, and the simulated annealing mechanism is used to escape local optima during the iteration process. When the validation set error has not improved for 5 consecutive generations, some individuals in the population are randomly reset and the search is restarted. When the maximum number of iterations is reached, the optimal parameters obtained by optimization are determined.

[0065] Step 104: Input the data to be predicted into the optimized LSTM-GRU model to obtain the predicted results of the electricity load, and visualize the predicted results.

[0066] In this embodiment, the data to be predicted is input into the optimized LSTM-GRU model, and the long-term time dependencies are captured through the LSTM layer; the GRU layer processes short-term dynamic changes based on the output of the LSTM layer, calculates the importance weight of each time step based on the output of the GRU layer, and applies the attention weight to the GRU output to obtain the context vector; the context vector is converted into actual values ​​through a fully connected layer, and the predicted result of the electricity load is output.

[0067] In this embodiment, the data to be predicted is typically a preprocessed multi-dimensional sequence containing features such as historical electricity load and meteorological data. The LSTM layer consists of multiple LSTM units, each containing three key components: a forget gate, an input gate, and an output gate. When the sequence data is input sequentially, the forget gate determines which information in the cell state at the previous time step needs to be forgotten based on the current input and the hidden state at the previous time step. The input gate determines which information in the current input needs to be added to the cell state. The output gate generates the hidden state at the current time step based on the updated cell state. This gating mechanism enables LSTM to effectively capture long-term dependencies in the sequence, such as seasonal electricity consumption patterns and periodic differences between weekdays and weekends. When processing electricity load prediction, the LSTM layer can learn the impact of electricity consumption patterns over the past few days, weeks, or even months on the current load.

[0068] GRU is a simplified variant of LSTM that combines the forget gate and input gate into an update gate and introduces a reset gate to control the influence of previous hidden states. This structure makes GRU more efficient in handling short-term dynamic changes, enabling it to quickly capture sudden fluctuations in electricity load, such as changes in air conditioning load caused by sudden weather changes or temporary electricity peaks caused by special events. After the GRU layer processes the sequence data, an attention mechanism is applied to calculate the importance weights for each time step. Specifically, the output of GRU is mapped to a low-dimensional space through a feedforward neural network, and then converted into normalized attention weights using a softmax function. These weights represent the degree of contribution of each time step to the current prediction. For example, when predicting the electricity load for the next morning, the electricity data for the evening of the same day may be more important than the data from earlier times. Finally, the attention weights are weighted and summed with the GRU output to obtain a context vector, which is a fixed-dimensional feature representation containing the information in the sequence most relevant to the current prediction.

[0069] A fully connected layer consists of multiple neurons, each connected to all neurons in the previous layer. It maps input features to the output space using weight matrices and bias terms. In electricity load prediction, the output of the fully connected layer is typically a scalar value representing the predicted electricity load. To convert the model output into the actual electricity load value, destandardization may be necessary, mapping the model output back from a standardized numerical range to the original electricity unit. Furthermore, to improve the accuracy and reliability of the prediction, nonlinear activation functions, such as ReLU or tanh, can be introduced into the fully connected layer to capture the complex nonlinear relationship between input features and output. Finally, the value obtained after processing by the fully connected layer is the predicted electricity load, which can be used in practical applications such as power dispatching and load management.

[0070] In this embodiment, the multi-scale fusion of the gating mechanism is the core element for improving model performance in the optimized design of the LSTM-GRU model. The gating structure of the LSTM layer can effectively handle long-term dependencies in long sequences by finely adjusting the input, retention and output of information. However, its complex gating calculation has a certain lag when capturing high-frequency dynamics. The GRU layer, on the other hand, has a simpler update gate and reset gate structure, which maintains the ability to capture sequence dependencies while having faster computational efficiency and sensitivity to short-term fluctuations. Through multi-scale fusion, the model organically combines the low-frequency trend capture capability of the LSTM layer with the high-frequency fluctuation response capability of the GRU layer. Specifically, a cross-layer interaction mechanism is introduced in the gating parameter update process, so that the gating state of the LSTM can provide long-term trend reference for the gating decision of the GRU. At the same time, the gating feedback of the GRU can also dynamically adjust the LSTM's attention to recent information, so that the model can maintain the sensitivity to key information at different time scales.

[0071] After the data to be predicted is input into the optimized LSTM-GRU model, the LSTM layer first undertakes the task of capturing low-frequency trends and processing long-term dependencies. When the data flows through the LSTM layer, the forget gate will autonomously decide whether to retain or discard the contents of the previous memory cells based on the importance of historical information. For example, in electricity load forecasting, it will automatically filter out short-term fluctuations that are not seasonally relevant, while focusing on retaining annual or quarterly electricity trend features. The input gate is responsible for filtering the input information at the current moment and including data that is consistent with the long-term trend in the update scope. The output gate generates an output vector containing low-frequency trend features based on the current cell state and hidden state. Through this process, key information across multiple time steps can be accumulated and transmitted.

[0072] The GRU layer further captures high-frequency power consumption fluctuations based on the output of the LSTM layer, focusing on handling short-term dynamic changes. After receiving the low-frequency trend vector from the LSTM layer, the GRU layer uses it as background information and fuses it with the short-term fluctuation features in the original data. The reset gate plays a key role in this process. It evaluates the correlation between the current input and the output of the LSTM layer. When sudden power consumption changes are detected, such as short-term load peaks or power restoration after a sudden power outage, the reset gate reduces the influence of historical information, allowing the model to focus more on the current short-term fluctuations. The update gate is responsible for deciding how much new information to include in the hidden state, preserving the trend benchmark passed by the LSTM layer while quickly responding to short-term power consumption dynamics.

[0073] Building upon the GRU layer output, the multi-granularity attention module further refines key information through hierarchical processing of temporal and feature attention. First, the temporal attention mechanism dynamically assigns weights to different time steps in the GRU output. By calculating the correlation between the features of each time step and the overall sequence, it highlights time nodes with periodic patterns, such as daily peak electricity consumption periods and fixed high-load days each week, while weakening irregular noise interference. Next, the hierarchical attention performs coarse-grained filtering of time steps, retaining a subset of time steps with high contribution based on preset importance thresholds or cluster analysis, reducing redundant computation. Then, feature attention performs fine-grained weighting on the features included in the filtered time steps, such as electricity load, temperature, and holidays, adjusting the weight values ​​according to the correlation between the features and the prediction target. For example, in summer electricity consumption forecasting, the weight of the temperature feature is significantly increased. Finally, these attention weights are applied to the GRU output, resulting in a context vector that condenses the information of key time steps and highlights the influence of important features, significantly improving the model's ability to capture complex sequence patterns and its prediction accuracy.

[0074] Please see Figure 2 A schematic diagram of the structure of the smart electricity metering and prediction system based on big data provided in this embodiment of the invention. The system includes:

[0075] The acquisition module is used to acquire user electricity consumption, environmental parameters, and holiday data in real time through the Internet of Things to form an initial dataset.

[0076] The processing module is used to employ a sliding window and wavelet packet decomposition joint algorithm, dynamically adjust the threshold through an exponentially weighted moving average control chart, and combine Kalman filtering to perform multi-stage signal reconstruction to obtain denoised data. From the denoised data, time features, meteorological features, and user behavior features are extracted, and principal component analysis is used to reduce the dimensionality to obtain the target feature data.

[0077] The building module is used to build the LSTM-GRU model, train the LSTM-GRU model using target feature data, and strengthen the weight allocation of features related to electricity load prediction through the attention mechanism.

[0078] The prediction module is used to input the data to be predicted into the optimized LSTM-GRU model to obtain the prediction results of the electricity load and to visualize the prediction results.

[0079] Figure 3This is a schematic diagram of the structure of a big data-based smart electricity metering and prediction device 300 provided in an embodiment of the present invention. The big data-based smart electricity metering and prediction device 300 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 310 (e.g., one or more processors) and a memory 320, and one or more storage media 330 (e.g., one or more mass storage devices) for storing application programs 333 or data 332. The memory 320 and storage media 330 can be temporary or persistent storage. The program stored in the storage media 330 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the big data-based smart electricity metering and prediction device 300. Furthermore, the processor 310 may be configured to communicate with the storage media 330 and execute the series of instruction operations in the storage media 330 on the big data-based smart electricity metering and prediction device 300 to implement the method provided in the above embodiment.

[0080] The big data-based intelligent electricity metering and prediction device 300 may also include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input / output interfaces 360, and / or one or more operating systems 331, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 3 The structure of the smart electricity metering and prediction device based on big data shown does not constitute a limitation on the computer device provided by the present invention. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0081] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the various steps of the big data-based smart metering and prediction method for electricity consumption provided in the above embodiments.

[0082] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described equipment or apparatus / unit can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0083] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part 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 the present 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.

[0084] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.

Claims

1. A smart electricity metering and forecasting method based on big data, characterized in that, The method includes the following steps: The Internet of Things (IoT) is used to acquire real-time data on user electricity consumption, environmental parameters, and holidays to form an initial dataset. A joint algorithm of sliding window and wavelet packet decomposition is adopted. The threshold is dynamically adjusted by the exponential weighted moving average control chart and Kalman filtering is combined to reconstruct the signal in multiple stages to obtain the denoised data. Time features, meteorological features and user behavior features are extracted from the denoised data, and the target feature data is obtained by dimensionality reduction using principal component analysis. An LSTM-GRU model is constructed and trained using target feature data. The weight allocation of features related to electricity load prediction is enhanced through an attention mechanism. The gating mechanism of the LSTM layer and GRU layer is fused at multiple scales in the LSTM-GRU model, and a multi-granularity attention module is introduced. A qubit superposition encoding strategy is adopted, and a simulated annealing mechanism is combined to perform a global search of the parameter space to obtain the optimized LSTM-GRU model. The data to be predicted is input into the optimized LSTM-GRU model to obtain the predicted electricity load, and the predicted results are visualized.

2. The smart electricity metering and forecasting method based on big data as described in claim 1, characterized in that, The algorithm employs a combined sliding window and wavelet packet decomposition approach, dynamically adjusting the threshold using an exponentially weighted moving average control chart, and combining this with Kalman filtering for multi-stage signal reconstruction to obtain denoised data, including: The volatility of the current initial dataset is calculated using a sliding window, and the anomaly detection threshold is dynamically adjusted based on the EWMA control chart. The initial dataset is decomposed using wavelet packet decomposition, and the signal is reconstructed after preserving the transient change features in the high-frequency band. The reconstructed signal is input into a Kalman filter, and residual impulse noise is eliminated through the state equation and observation equation to obtain the denoised data.

3. The smart electricity metering and forecasting method based on big data as described in claim 1, characterized in that, The process of extracting time features, meteorological features, and user behavior features from the denoised data, and using principal component analysis to reduce dimensionality to obtain target feature data, includes: The periodic variation pattern of electricity load is analyzed from the denoised data by Fourier transform, and periodic features including hourly, daily, weekly and monthly time dimensions are extracted to obtain time features; The denoised data is filtered through correlation analysis and feature selection algorithms. The correlation coefficient between meteorological factors and electricity load is calculated. Meteorological factors with large correlation coefficients are selected as features to obtain meteorological features. Users are categorized according to their electricity usage habits and patterns, and electricity usage behavior characteristics of different user groups are extracted through K-means clustering analysis. The extracted time features, meteorological features, and user behavior features are integrated to form an initial feature dataset; The initial feature dataset is standardized, the covariance matrix of the standardized data is calculated, and the eigenvalues ​​and eigenvectors of the covariance matrix are solved. Based on the magnitude of the eigenvalues, the eigenvectors corresponding to the k largest eigenvalues ​​are selected to obtain the principal components; The initial feature dataset is projected onto the principal components to obtain the dimensionality-reduced target feature data.

4. The smart electricity metering and forecasting method based on big data as described in claim 1, characterized in that, The construction of the LSTM-GRU model involves training the LSTM-GRU model using target feature data and strengthening the weight allocation of features related to electricity load prediction through an attention mechanism, including: The basic architecture of the LSTM-GRU model is determined, which includes an input layer, an LSTM layer, a GRU layer, an attention layer, and an output layer. Set an appropriate number of neurons for the LSTM and GRU layers, and randomly initialize the connection weights and bias terms between each layer; The target feature data is divided into training set, validation set and test set. The LSTM-GRU model is trained using the training set. The weight of each time step and each feature is calculated through the attention mechanism to strengthen the weight allocation of features related to electricity load prediction. A qubit superposition encoding strategy is adopted, combined with simulated annealing mechanism for global search of parameter space, and the optimized parameters are applied to the LSTM-GRU model. The trained LSTM-GRU model is evaluated using a test set. The prediction error, mean squared error, and mean absolute error of the model are calculated, and the optimized LSTM-GRU model is finally obtained.

5. The smart electricity metering and forecasting method based on big data as described in claim 4, characterized in that, The method employs a qubit superposition encoding strategy combined with a simulated annealing mechanism for global parameter space search, including: The parameters of the LSTM-GRU model to be optimized are determined, and the model parameters are divided into continuous layers and discrete layers, and real number encoding and binary encoding strategies are adopted respectively. An initial population is generated by utilizing the superposition property of qubits, and a simulated annealing mechanism is used to escape local optima during the iteration process. When the validation set error fails to improve for five consecutive generations, a portion of the population is randomly reset and the search is restarted. When the maximum number of iterations is reached, the optimal parameters obtained through optimization are determined.

6. The smart electricity metering and forecasting method based on big data as described in claim 5, characterized in that, The parameters of the LSTM-GRU model to be optimized include the learning rate, the number of neurons in the LSTM and GRU layers, and the weights of the attention mechanism.

7. The smart electricity metering and forecasting method based on big data as described in claim 4, characterized in that, The process of inputting the data to be predicted into the optimized LSTM-GRU model to obtain the predicted electricity load results and visually displaying the prediction results includes: The data to be predicted is input into the optimized LSTM-GRU model, the LSTM layer is used to capture low-frequency trends, and the memory unit is used to handle long-term dependencies. The GRU layer captures high-frequency power fluctuations based on the output of the LSTM layer and handles short-term dynamic changes. The output of the GRU layer is first dynamically assigned weights for different time steps through temporal attention to capture periodic patterns. Then, different weights are assigned to features through feature attention, and the attention weights are applied to the GRU output to obtain the context vector. Hierarchical attention is used to first perform coarse-grained filtering of time steps, and then fine-grained weighting of the filtered features. The context vector is converted into actual values ​​through a fully connected layer, and the predicted power load is output.

8. A smart electricity metering and forecasting system based on big data, characterized in that: The system includes: The acquisition module is used to acquire user electricity consumption, environmental parameters, and holiday data in real time through the Internet of Things to form an initial dataset. The processing module is used to employ a sliding window and wavelet packet decomposition joint algorithm, dynamically adjust the threshold through an exponentially weighted moving average control chart, and combine Kalman filtering to perform multi-stage signal reconstruction to obtain denoised data. From the denoised data, time features, meteorological features, and user behavior features are extracted, and principal component analysis is used to reduce the dimensionality to obtain the target feature data. The building module is used to construct the LSTM-GRU model. It trains the LSTM-GRU model using target feature data and strengthens the weight allocation of features related to electricity load prediction through an attention mechanism. The LSTM-GRU model integrates the gating mechanisms of the LSTM layer and GRU layer at multiple scales and introduces a multi-granularity attention module. It adopts a qubit superposition encoding strategy and combines simulated annealing mechanism to perform global search of parameter space to obtain the optimized LSTM-GRU model. The prediction module is used to input the data to be predicted into the optimized LSTM-GRU model to obtain the prediction results of the electricity load and to visualize the prediction results.

9. A smart electricity metering and forecasting device based on big data, characterized in that, The big data-based smart electricity metering and forecasting device includes a memory and at least one processor, wherein the memory stores instructions; the at least one processor invokes the instructions in the memory to cause the big data-based smart electricity metering and forecasting device to perform each step of the big data-based smart electricity metering and forecasting method as described in any one of claims 1-7.

10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement each step of the big data-based smart metering and prediction method for electricity consumption as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Attention-GRU short-term load prediction method based on sparrow search optimization

    CN113516316A

  • Multi-target load prediction adjustment method, system, device, medium and program product

    CN119904040A