Power demand determination method and apparatus, storage medium, and electronic device

By decomposing electricity load data into multiple components and combining a bidirectional long short-term memory network and a self-attention mechanism in the electricity demand forecasting model, the problem of not being able to fully utilize time domain information in existing technologies is solved, thereby improving the accuracy of electricity demand forecasting.

CN119582181BActive Publication Date: 2026-05-12STATE GRID BEIJING ELECTRIC POWER CO +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
STATE GRID BEIJING ELECTRIC POWER CO
Filing Date
2024-11-25
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing electricity demand forecasting methods cannot fully utilize information across the entire time domain, resulting in low forecast accuracy. Long Short-Term Memory (LSTM) networks can only process data sequentially according to time series, failing to fully utilize temporal feature information.

Method used

The electricity load data is decomposed into multiple load components. An electricity demand forecasting model is adopted, which uses a bidirectional long short-term memory network and a self-attention mechanism for forecasting. The data volatility is reduced by a complete adaptive noise ensemble empirical mode decomposition algorithm, and key features are weighted by the self-attention mechanism.

Benefits of technology

It improves the accuracy of electricity demand forecasting by reducing data volatility through decomposition and weighting, and makes full use of time domain information to enhance forecast accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119582181B_ABST
    Figure CN119582181B_ABST
Patent Text Reader

Abstract

The application discloses a power demand determination method and device, a storage medium and an electronic device. It relates to the field of smart grids. The method comprises the following steps: acquiring current load data of a power consumption account in a current period; performing decomposition processing on the current load data to obtain a plurality of current load components; based on the plurality of current load components, using a power demand prediction model to obtain a plurality of predicted load components; and based on the plurality of predicted load components, obtaining a power demand prediction result of the power consumption account in a prediction period, wherein the prediction period is a next sampling period of the current period. The application solves the technical problem of low power demand prediction accuracy in the related art, i.e., directly predicting power demand in the form of a whole period, which cannot fully utilize information in the whole time domain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart grids, and more specifically, to a method, apparatus, storage medium, and electronic device for determining electricity demand. Background Technology

[0002] In the field of electricity demand forecasting, forecasting models play a crucial role in load forecasting. In recent years, deep learning technologies, represented by deep neural networks, have seen widespread development and become a popular research area. Long Short-Term Memory (LSTM) networks, a variant of recurrent neural networks, solve the gradient vanishing problem inherent in recurrent neural networks and can learn long-range dependencies in time-series data, making them the most popular deep neural network in load forecasting. However, LSTM networks can only process data sequentially over time, considering only past information and failing to fully utilize information across the entire time domain. Regarding the extraction of time-series feature information, the impact of information from different time steps in the electricity load data on the forecast results varies, and LSTM networks cannot identify key time-series feature information, making it difficult to achieve high forecast accuracy.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This invention provides a method, apparatus, storage medium, and electronic device for determining electricity demand, in order to at least solve the technical problem in related technologies where electricity demand forecasting is performed directly on the basis of the entire time period, which fails to fully utilize information from the entire time domain and results in low accuracy of electricity demand forecasting.

[0005] According to one aspect of the present invention, a method for determining electricity demand is provided, comprising: acquiring current load data of an electricity account in the current time period; decomposing the current load data to obtain multiple current load components; using an electricity demand forecasting model based on the multiple current load components to obtain multiple predicted load components; and obtaining a predicted electricity demand result of the electricity account in the predicted time period based on the multiple predicted load components, wherein the predicted time period is the next sampling period of the current time period.

[0006] According to another aspect of the present invention, an electricity demand determination apparatus is also provided, comprising: an acquisition module for acquiring current load data of an electricity account in the current time period; a decomposition module for decomposing the current load data to obtain multiple current load components; a prediction module for obtaining multiple predicted load components based on the multiple current load components using an electricity demand prediction model; and a result determination module for obtaining a predicted electricity demand result of the electricity account in the prediction time period based on the multiple predicted load components, wherein the prediction time period is the next sampling time period of the current time period.

[0007] According to another aspect of the present invention, a non-volatile storage medium is also provided, the non-volatile storage medium storing a plurality of instructions adapted for loading by a processor and executing any one of the power demand determination methods described herein.

[0008] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement any one of the power demand determination methods.

[0009] In this embodiment of the invention, the current load data of an electricity account in the current time period is obtained; the current load data is decomposed to obtain multiple current load components; based on the multiple current load components, an electricity demand forecasting model is used to obtain multiple predicted load components; based on the multiple predicted load components, the electricity demand forecasting result of the electricity account in the predicted time period is obtained, wherein the predicted time period is the next sampling time period of the current time period. This achieves the purpose of reducing the volatility of load data by decomposing the collected current load data into multiple load components, and further using an electricity demand forecasting model to forecast electricity demand. This achieves the technical effect of reducing the volatility of load data and improving the accuracy of electricity demand forecasting results, thereby solving the technical problem in related technologies where electricity demand forecasting is performed directly on the basis of the entire time period, which cannot fully utilize the information of the entire time domain, resulting in low accuracy of electricity demand forecasting. Attached Figure Description

[0010] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0011] Figure 1 This is a flowchart of a method for determining electricity demand according to an embodiment of the present invention;

[0012] Figure 2 This is a schematic diagram of an electricity demand determination device according to an embodiment of the present invention. Detailed Implementation

[0013] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. 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 should fall within the scope of protection of the present invention.

[0014] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus 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 apparatus.

[0015] According to an embodiment of the present invention, a method for determining electricity demand is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0016] Figure 1 This is a flowchart of a method for determining electricity demand according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:

[0017] Step S102: Obtain the current load data of the electricity account in the current time period;

[0018] Optionally, a day can be considered as a time period. The current time period can be, but is not limited to, a day. There can be one or more sampling times within the current time period, and the corresponding current load data can be one or more. That is, load data can be collected at multiple sampling times within the current time period.

[0019] Step S104: Decompose the current load data to obtain multiple current load components;

[0020] Optionally, but not limited to, empirical mode decomposition algorithms can be used to decompose the current load data into multiple current load components. By decomposing the collected current load data into multiple load components, the volatility of the load data can be reduced.

[0021] Optionally, if the current time period includes multiple sampling times and corresponding to multiple current load data, the current load data at each sampling time can be decomposed to obtain multiple current load components corresponding to each sampling time.

[0022] In one optional embodiment, the current load data is decomposed to obtain multiple current load components, including: adding Gaussian white noise multiple times to the current load data to obtain multiple sets of current noise data, wherein the multiple Gaussian white noises follow a standard normal distribution; performing empirical mode decomposition on each of the multiple sets of current noise data to obtain multiple sets of intrinsic mode functions, wherein the multiple sets of current noise data correspond one-to-one with the multiple sets of intrinsic mode functions, and each set of intrinsic mode functions includes multiple intrinsic mode functions, which are obtained by performing multiple empirical mode decompositions on the corresponding current noise data; and obtaining multiple current load components based on the multiple sets of intrinsic mode functions.

[0023] Optionally, adding Gaussian white noise can simulate noise interference in the real environment, making the data closer to reality and obtaining multiple sets of current load data containing noise for subsequent empirical mode decomposition (EMD) analysis. EMD decomposes complex signals into multiple intrinsic mode functions (EMFs), revealing the data's inherent structure and characteristics, resulting in multiple sets of data containing EMFs. Each EMF in the data set reflects different frequency and amplitude components in the original signal (i.e., the current load data). By analyzing and processing multiple sets of EMFs, different components and features in the current load data can be extracted, resulting in multiple current load components. Each component represents a specific component or feature in the original data, aiding in a better understanding and analysis of the current load data's characteristics. In the above approach, adding noise to the current load data, performing EMD, and extracting EMFs helps to gain a deeper understanding of the data's structure and characteristics, thus providing a more accurate and effective foundation for subsequent model predictions.

[0024] Step S106: Based on multiple current load components, a power demand forecasting model is used to obtain multiple predicted load components;

[0025] Optionally, multiple current load components can be used as model inputs, and the power demand forecasting model can be used to predict the predicted load component corresponding to each current component, thus obtaining multiple predicted load components.

[0026] Optionally, when load data is collected based on multiple sampling times within the current time period to obtain multiple current load data, a set of current load components corresponding to each current load data is obtained. Each set of current load components includes multiple current load components obtained by decomposing a current load data. The sets of current load components corresponding to the multiple current load data are input into the power demand forecasting model to obtain multiple sets of predicted load components. Each set of predicted load components includes multiple predicted load components within a forecast time period, and the multiple predicted load components correspond to different forecast times.

[0027] In one optional embodiment, the power demand forecasting model includes a first bidirectional long short-term memory (LSTM) network layer, an attention layer, a second bidirectional LSM network layer, and a fully connected layer. Based on multiple current load components, the power demand forecasting model is used to obtain multiple predicted load components, including: extracting hidden features from the multiple current load components using the first bidirectional LSM network layer to obtain multiple sets of initial hidden features; weighting the multiple sets of initial hidden features using the attention mechanism in the attention layer to obtain multiple sets of weighted hidden features; extracting features from the multiple sets of weighted hidden features using the second bidirectional LSM network layer to obtain multiple sets of feature extraction results; and using the fully connected layer based on the multiple sets of feature extraction results to predict multiple predicted load components.

[0028] Optionally, if the current time period includes multiple sampling times, multiple sets of current load components corresponding to the current load data are obtained respectively. First, the sets of current load components corresponding to the multiple sets of current load data are output to the first bidirectional long short-term memory network layer. This first bidirectional long short-term memory network layer can capture long-term dependencies and sequence information in time series data. The resulting multiple sets of initial hidden features contain important information and features in the current load components. The attention mechanism can help the network focus on learning key features in the multiple sets of initial hidden features, improving the model's attention to important information. The resulting multiple sets of weighted hidden features are processed by attention weighting, which further highlights and emphasizes important information. The second bidirectional long short-term memory network layer can further refine and extract key features from the multiple sets of weighted hidden features. The resulting multiple sets of feature extraction results contain data features processed by a multi-layer bidirectional long short-term memory network (LSTM). The fully connected layer can map the extracted multiple sets of feature extraction results to the output layer to predict the load components. The resulting multiple predicted load components are predicted based on the feature extraction results after multi-layer LSTM network and attention processing, which has higher prediction accuracy.

[0029] In one optional embodiment, an attention mechanism in the attention layer is used to weight multiple sets of initial hidden features to obtain multiple sets of weighted hidden features, including: obtaining any one set of weighted hidden features from the multiple sets of weighted hidden features in the following manner: for any one set of initial hidden features from the multiple sets of initial hidden features, determining the score values ​​corresponding to the multi-dimensional hidden features included in the set of initial hidden features; normalizing the score values ​​corresponding to the multi-dimensional hidden features to obtain the standard score values ​​corresponding to the multi-dimensional hidden features; determining the attention weights corresponding to the multi-dimensional hidden features; performing weighted calculations based on the attention weights and the standard score values ​​corresponding to the multi-dimensional hidden features to obtain any one set of weighted hidden features; and obtaining multiple sets of weighted hidden features by using the method of obtaining any one set of weighted hidden features.

[0030] In the above approach, by determining the score values ​​corresponding to the multidimensional hidden features in each initial set of hidden features, and then normalizing and calculating attention weights, weighted hidden features can be obtained. These weighted hidden features, after attention weighting, highlight important feature information, helping to improve the model's focus on key information. Normalization can unify the score values ​​of different dimensions to the same scale, avoiding the influence of different score value ranges on the results. The standard score values ​​corresponding to the multidimensional hidden features obtained through normalization make the score values ​​of different dimensions comparable, facilitating subsequent calculations and comparisons. Determining attention weights helps the model focus on learning key features, improving the model's focus on important information. The attention weights corresponding to the multidimensional hidden features are used to weight the feature values ​​of each dimension, highlighting the contribution of important features. Using attention weights to weight the standard score values ​​highlights important features, providing more accurate feature representations for subsequent feature extraction and prediction. The resulting multiple sets of weighted hidden features, after attention weighting, highlight important features, helping to improve the model's ability to learn and predict key information.

[0031] In an optional embodiment, before obtaining multiple predicted load components based on multiple current load components using an electricity demand forecasting model, the method further includes: acquiring historical load data collected in multiple historical time periods; preprocessing the historical load data collected in multiple historical time periods to obtain preprocessed load data corresponding to each of the multiple historical time periods, wherein the preprocessing includes at least one of the following: missing value imputation, outlier correction; normalizing the preprocessed load data corresponding to each of the multiple historical time periods to obtain normalized load data corresponding to each of the multiple historical time periods; and training an initial model based on the normalized load data corresponding to each of the multiple historical time periods to obtain an electricity demand forecasting model.

[0032] Optionally, preprocessing historical load data collected from multiple historical periods, such as filling in missing values ​​and correcting outliers, can help clean and prepare the data, making it more reliable. By normalizing the preprocessed historical load data, data from different ranges can be unified to the same scale, avoiding the impact of differences between features on model training. Based on the normalized historical load data, the initial model can be trained, and the characteristics and patterns of historical data can be used to establish an electricity demand forecasting model for accurate prediction of electricity demand in the future.

[0033] Optionally, during the training of the initial model based on normalized load data corresponding to multiple historical time periods, the same method as in step S104 can be used to decompose the normalized load data corresponding to the multiple historical time periods, resulting in multiple historical load components for each historical time period. Using the multiple historical load components corresponding to the previous historical time period as input and the multiple historical load components corresponding to the next historical time period as output, the initial model is trained, and the resulting short-term load forecasting model serves as the electricity demand forecasting model.

[0034] In one optional embodiment, the historical load data collected in multiple historical time periods are preprocessed, including: detecting whether there are missing values ​​in the historical load data collected in multiple historical time periods; filling in the missing values ​​if there are missing values ​​in the historical load data collected in multiple historical time periods; detecting whether there are outliers in the historical load data collected in multiple historical time periods; and correcting the outliers if there are outliers in the historical load data collected in multiple historical time periods.

[0035] It's understandable that detecting missing values ​​in historical load data helps identify missing data points in the dataset, preventing them from affecting the accuracy of the model in subsequent analysis. Imputing missing values ​​in historical load data completes the dataset and reduces the impact of data loss on the analysis results. Detecting outliers in historical load data helps identify abnormal data points that may affect model training and prediction results; correcting outliers reduces their interference with model training and prediction. By detecting and processing missing and outliers in historical load data, the integrity and quality of the data can be improved, providing a reliable data foundation for the subsequent training of electricity demand forecasting models.

[0036] In one optional embodiment, detecting whether outliers exist in historical load data collected from multiple historical time periods includes: determining whether the historical load data collected from multiple historical time periods all meet the following predetermined conditions:

[0037]

[0038] Where, x n,i This represents the load data corresponding to the i-th sampling time in the n-th historical time period. Each historical period includes multiple sampling times; n = 1, 2, ..., N represents any historical time period, and N represents the total number of historical time periods; x i σ represents the average load data corresponding to the i-th sampling time across multiple historical periods; i 2 σ represents the variance of the load data at the i-th sampling time. i ε represents the standard deviation of the load data at the i-th sampling time; ε represents the preset threshold.

[0039] If the load data corresponding to multiple historical periods does not meet the predetermined conditions, it is determined that there are no outliers in the load data corresponding to the multiple historical periods; if any load data in the load data corresponding to multiple historical periods meets the predetermined conditions, that load data is determined to be an outlier.

[0040] Optionally, the i-th sampling time can be the same sampling time within a day. For example, if a day is taken as a historical period and load data is collected at a fixed time each day, then the time for collecting load data each day is fixed. For example, if load data is collected every half hour starting from 12:00 AM, then the data collection times are 12:30 AM, 1:00 AM, 1:30 AM, etc., and the i-th time can be any one of the above times.

[0041] Step S108: Based on multiple predicted load components, obtain the predicted electricity demand of the electricity account during the predicted period, where the predicted period is the next sampling period of the current period.

[0042] Optionally, but not limited to, the electricity demand forecast for an electricity account during the forecast period can be obtained by superimposing multiple forecast load components.

[0043] Optionally, when load data is collected based on multiple sampling times within the current time period, the power demand forecasting model can be used to obtain the set of predicted load components corresponding to the multiple sampling times in the forecast period. By superimposing the multiple predicted load components included in the same set of predicted load components, the power demand forecasting results corresponding to the multiple sampling times can be obtained.

[0044] Through the above steps S102 to S108, the goal of reducing the volatility of load data by decomposing the collected current load data into multiple load components can be achieved. This allows for the use of a power demand forecasting model to predict power demand, thereby reducing the volatility of load data and improving the accuracy of power demand forecasting results. This also solves the technical problem in related technologies where power demand forecasting is performed directly on the basis of the entire time period, which fails to fully utilize information from the entire time domain and results in low accuracy of power demand forecasting.

[0045] Based on the above embodiments and optional embodiments, the present invention proposes an implementation method for an optional method for determining electricity demand. Figure 2 This is a flowchart of an optional method for determining electricity demand according to an embodiment of the present invention, such as... Figure 2 As shown, the method includes:

[0046] Step S1: Collect power data in real time through intelligent power equipment sensors, and preprocess the historical load data collected from multiple historical periods (such as the previous N days).

[0047] Data preprocessing mainly includes:

[0048] Step S1.1, Missing Value Imputation: Due to sensor malfunctions and human error, missing values ​​may occur during data acquisition. These missing values ​​are imputed by analyzing data values ​​near the missing values, using the following mean imputation method:

[0049]

[0050] in x is the average load on day n (i.e., the nth historical time period) from the collected historical load data. n,i Let I be the load value (i.e., load data) at the i-th sampling time on day n, where I is 48, representing 48 data points collected within 24 hours. defect The missing values ​​are filled in.

[0051] Step S1.2, Outlier Detection: Outliers in the collected historical load data can affect the accuracy of prediction. The outlier detection and correction process is as follows:

[0052] First, outliers are detected using the standard deviation, with the following criteria:

[0053]

[0054] In the formula, x i Let σ be the mean of the i-th sampling time of the day. iLet x be the standard deviation at the i-th sampling time, ε be the preset threshold set to 1.2, and N represent the total number of days of historical load data collected. If the load value x... n,i and The absolute value of the difference is greater than 3σ i If ε is an outlier, it is considered an outlier and corrected using the following formula:

[0055]

[0056] Where, x n,i 'x' is the correction value at the i-th sampling time on day n. m,i For example, x represents the data values ​​from i sampling times of the same day. m,i It can be the load value of the day before the nth day, and α and β are preset correction coefficients.

[0057] Step S1.3, Data Normalization:

[0058] Considering that excessive load variation can lead to large training errors, reducing prediction accuracy and convergence speed, the preprocessed load data obtained after steps S1.1 and S1.2 are subjected to max-min standardization. The load value x is normalized to the [0,1] interval using the following method:

[0059]

[0060] Where x represents the load value, x min x represents the minimum load value in the preprocessed load data obtained after steps S1.1 and S1.2. max x represents the maximum load value in the preprocessed load data obtained after steps S1.1 and S1.2. norm This represents the normalized value (i.e., normalized load data).

[0061] Step S2: To reduce data volatility, the processed historical load data (i.e., normalized load data) obtained in Step S1 is decomposed using a complete adaptive noise ensemble empirical mode decomposition algorithm to obtain multiple more stable intrinsic mode functions (IMFs). Standard empirical mode decomposition algorithms are prone to mode aliasing when decomposing complex signals, resulting in IMFs containing highly different characteristic time scales and poor decomposition performance. The complete adaptive noise ensemble empirical mode decomposition algorithm, based on the theory of empirical mode decomposition, effectively overcomes these shortcomings by adaptively adding Gaussian white noise during the decomposition process, achieving better decomposition results. The complete adaptive noise ensemble empirical mode decomposition algorithm includes the following steps:

[0062] Step S2.1: First, add V-order Gaussian white noise to the processed historical load data y(t) obtained in step S1.

[0063] y v (t)=y(t)+εN v (t)

[0064] Where y(t) represents the historical load data at any given time in the processed historical load data obtained in step S1, and N v (t)(v=1,2,...,V) is a Gaussian white noise signal that follows a standard normal distribution; v=1,2,...,V indicates the v-th time Gaussian white noise is added to the historical load data y(t), i.e., the noise level; ε is an adaptive function used to indicate the noise level of the corresponding historical load data; y v (t) is the new data obtained after adding white noise (which can be understood as noise data).

[0065] Step S2.2, regarding the above y v (t) Perform empirical mode decomposition to obtain V first-order mode components, and then average them to obtain the eigenmode functions obtained from the first empirical mode decomposition.

[0066] E(y v (t))=C1 v (t)+r v (t)

[0067]

[0068] Among them, E(y) v (t) represents y v The expected value of (t), C1 v (t) represents y v The first modal component of (t), r v (t) represents the remainder, and C1'(t) is a function of y. v (t) is the first-order modal component obtained after the first empirical mode decomposition.

[0069] Step S2.3: For the k-th (k>1) empirical mode decomposition, first obtain the residual r after the (k-1)-th empirical mode decomposition. k-1 (t), and then the intrinsic mode functions obtained from the kth empirical mode decomposition are obtained according to the following method:

[0070]

[0071]

[0072] Where, r k-1(t) represents the residual corresponding to the (k-1)th empirical mode decomposition; C represents the sum of the modal components obtained from the first k-1 empirical mode decompositions; k '(t) represents the intrinsic mode component obtained by the k-th empirical mode decomposition, E k-1 (·) represents the (k-1)th order mode component obtained from empirical mode decomposition.

[0073] Step S2.4: Determine the remainder r after the k-th decomposition. k If the number of extreme points of (t) is greater than 2, then proceed to step S2.3; if it is less than 2, the residual cannot be further decomposed, and the decomposition process ends; after K decompositions, K eigenmode functions and the residual r are obtained. K Historical load data (t) can be represented as follows.

[0074]

[0075] Where, r K (t) represents the residual corresponding to the (k-1)th empirical mode decomposition, where K is the total number of decompositions when the termination condition is met.

[0076] Step S3: Based on the decomposed load component data (i.e., modal components), train the model to establish a short-term load forecasting model based on self-attention (SAM) and bidirectional long and short time memory (BiLSTM) network as the electricity demand forecasting model. The output of the model is the load component data for the forecast day. This short-term load forecasting model based on self-attention and bidirectional long and short time memory network includes:

[0077] Input layer: The input variables are the load component data obtained above, with n components. A sliding window is used to extract the load component x, forming the input feature vector X.

[0078]

[0079] in, The feature vector extracted for the j-th sliding window of the v-th load component is t, where t is the prediction time, h is the prediction range, lag is the number of continuously lagging loads, m is the width of the sliding window, the window sliding step size is 1, and the number of sliding windows is T = lag + 1 - m.

[0080] Model training layer: The training layer mainly consists of two bidirectional long short-term memory network layers and a self-attention mechanism layer.

[0081] The first layer is a bidirectional long short-term memory network layer. This layer extracts hidden features from the load component data. The hidden feature vector can be represented as:

[0082] h t =[h t1 ,h t2 ,…,h tm ],t∈[1,T]

[0083] Among them, h t Let m be the hidden feature vector, and T be the dimension of the hidden feature and the number of time steps, respectively.

[0084] The second layer is the attention layer, which passes the extracted hidden features to the self-attention mechanism layer. This layer weights the hidden features through the self-attention mechanism. The process of weighting the hidden features includes:

[0085] First, calculate the score s of the hidden features in each dimension at different time steps. j,d :

[0086] s j,d =f sco (W j,d [h 1,d ,h 2,d ,…,h j,d ,…,h T,d ]), d=1,…,m,j=1,…,T

[0087] Among them, h j,d W represents the hidden feature in dimension d at the j-th time step. j,d The function f represents the weight vector adjusted during training. sco It is implemented through a fully connected layer, the number of which is equal to the number of time steps T.

[0088] Then, the softmax function is used to normalize the scores for a specific dimension, so that the sum of the scores at different time steps is 1:

[0089]

[0090] Finally, the scores of all dimensions at the same time step are averaged to obtain the attention weight at each time step; then the hidden layer features and attention weights at the corresponding time step are multiplied together to obtain a new feature matrix as the input for subsequent layers.

[0091]

[0092] Wherein, step S2.3 represents the self-attention weight score at the j-th time step, h j Let h represent the hidden feature vector at time step j. jwt Let represent the weighted hidden feature vector at time step j.

[0093] The third layer is the second bidirectional long short-term memory network layer, which extracts more abstract features from the weighted hidden features passed above.

[0094] Output Layer: The output layer consists of a fully connected layer, used to obtain the predicted values ​​of the load components and output the predicted results of the load components. v = 1, 2, ..., K.

[0095] Step S4: Superimpose and combine the predicted load components. The predicted vectors of the load components are superimposed and combined. The result of this superposition is used as the final load prediction result based on the improved empirical mode decomposition and bidirectional long short-term memory network prediction model.

[0096] Step S5: In practical application, the current load data of the electricity account in the current time period will be obtained, such as the load data collected on the same day; the current load data is input into the power demand prediction model trained in step S3 to obtain multiple predicted load components; the multiple current load components are then superimposed in the same way as in step S4 to obtain the final load prediction result as the power demand prediction result of the electricity account in the prediction period.

[0097] In this embodiment, the complete adaptive noise ensemble empirical mode decomposition algorithm is first used to decompose the load data into multiple more stable load components, reducing the impact of the volatility of the original load data on the prediction accuracy. Then, a bidirectional long short-term memory network is used to construct a prediction model for the load components, and a self-attention mechanism is introduced into the bidirectional long short-term memory network to weight sequence information, enhance key information, and weaken unimportant information, thereby improving the model's prediction accuracy.

[0098] It should be noted that in this embodiment, after preprocessing the original load data, the load data is decomposed into multiple load components using a complete adaptive noise ensemble empirical mode decomposition algorithm, reducing the volatility of the load data. This load stabilization process significantly improves the model's predictive performance. In constructing the training model, a bidirectional long short-term memory network is used. This network is a combination of forward and backward long short-term memory networks, enabling training of the load data from two time directions. It fully utilizes data information across the entire time domain, possesses stronger nonlinear expressive power, and can better uncover the temporal correlation of the load data. Furthermore, considering the varying degrees of influence of the temporal characteristics of the load data at different time steps on the prediction results, a self-attention mechanism is incorporated into the bidirectional long short-term memory network prediction model. This self-attention mechanism enhances key sequence information and weakens unimportant sequence information through weighted hidden features, further improving the model's prediction accuracy.

[0099] This embodiment also provides an electricity demand determination device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the terms "module" and "device" can refer to a combination of software and / or hardware that performs a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0100] According to an embodiment of the present invention, an apparatus embodiment for implementing the above-described method for determining electricity demand is also provided. Figure 2 This is a schematic diagram of a power demand determination device according to an embodiment of the present invention, as shown below. Figure 2 As shown, the above-mentioned electricity demand determination device includes: an acquisition module 200, a decomposition module 202, a prediction module 204, and a result determination module 206, wherein:

[0101] The acquisition module 200 is used to acquire the current load data of the electricity account in the current time period;

[0102] The decomposition module 202, connected to the acquisition module 200, is used to decompose the current load data to obtain multiple current load components;

[0103] Prediction module 204, connected to decomposition module 202, is used to obtain multiple predicted load components based on multiple current load components and using an electricity demand prediction model;

[0104] The result determination module 206, connected to the prediction module 204, is used to obtain the electricity demand prediction result of the electricity account in the prediction period based on multiple predicted load components, wherein the prediction period is the next sampling period of the current period.

[0105] In this embodiment of the invention, an acquisition module 200 is set up to acquire the current load data of the electricity account in the current time period; a decomposition module 202, connected to the acquisition module 200, is used to decompose the current load data to obtain multiple current load components; a prediction module 204, connected to the decomposition module 202, is used to obtain multiple predicted load components based on the multiple current load components and using an electricity demand prediction model; and a result determination module 206, connected to the prediction module 204, is used to obtain the electricity demand prediction result of the electricity account in the prediction period based on the multiple predicted load components. The prediction period is the next sampling period of the current time period. This achieves the purpose of reducing the volatility of the load data by decomposing the collected current load data into multiple load components, and further using an electricity demand prediction model to predict electricity demand. This achieves the technical effect of reducing the volatility of the load data and improving the accuracy of the electricity demand prediction result. In turn, it solves the technical problem in related technologies where electricity demand prediction is performed directly on the basis of the entire time period, which cannot make full use of the information in the entire time domain, resulting in low accuracy of electricity demand prediction.

[0106] It should be noted that the above modules can be implemented by software or hardware. For example, for the latter, it can be implemented in the following ways: the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0107] It should be noted that the acquisition module 200, decomposition module 202, prediction module 204, and result determination module 206 mentioned above correspond to steps S102 to S108 in the embodiments. The instances and application scenarios implemented by the above modules and their corresponding steps are the same, but they are not limited to the content disclosed in the above embodiments. It should be noted that the above modules, as part of the device, can run on a computer terminal.

[0108] It should be noted that the optional or preferred implementation methods of this embodiment can be found in the relevant descriptions in the embodiments, and will not be repeated here.

[0109] The aforementioned power demand determination device may also include a processor and a memory. The aforementioned acquisition module 200, decomposition module 202, prediction module 204, result determination module 206, etc., are all stored in the memory as program modules, and the processor executes the aforementioned program modules stored in the memory to realize the corresponding functions.

[0110] The processor contains a core that retrieves the corresponding program modules from memory. One or more cores may be configured. Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory includes at least one memory chip.

[0111] According to an embodiment of this application, an embodiment of a non-volatile storage medium is also provided. Optionally, in this embodiment, the non-volatile storage medium includes a stored program, wherein, when the program runs, it controls the device where the non-volatile storage medium is located to execute any of the above-mentioned power demand determination methods.

[0112] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals, and the non-volatile storage medium includes stored programs.

[0113] Optionally, during program execution, the device containing the non-volatile storage medium may be controlled to perform the following functions: obtain the current load data of the electricity account in the current time period; decompose the current load data to obtain multiple current load components; based on the multiple current load components, use an electricity demand forecasting model to obtain multiple predicted load components; based on the multiple predicted load components, obtain the electricity demand forecast result of the electricity account in the forecast period, wherein the forecast period is the next sampling period of the current time period.

[0114] According to an embodiment of this application, an embodiment of a processor is also provided. Optionally, in this embodiment, the processor is used to run a program, wherein the program executes any of the above-described methods for determining electricity demand.

[0115] According to an embodiment of this application, an embodiment of a computer program product is also provided, which, when executed on a data processing device, is adapted to execute a program that initializes the power demand determination method steps described above.

[0116] Optionally, when the above-mentioned computer program product is executed on a data processing device, it is suitable to execute an initialization program with the following method steps: obtaining the current load data of the electricity account in the current time period; decomposing the current load data to obtain multiple current load components; based on the multiple current load components, using an electricity demand forecasting model to obtain multiple predicted load components; and based on the multiple predicted load components, obtaining the electricity demand forecast result of the electricity account in the forecast period, wherein the forecast period is the next sampling period of the current time period.

[0117] This invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: acquiring the current load data of an electricity account in the current time period; decomposing the current load data to obtain multiple current load components; using an electricity demand forecasting model based on the multiple current load components to obtain multiple predicted load components; and obtaining the electricity demand forecast result of the electricity account in the forecast period based on the multiple predicted load components, wherein the forecast period is the next sampling period of the current time period.

[0118] The order of the above embodiments of the present invention is merely for description and does not represent the superiority or inferiority of the embodiments.

[0119] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0120] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of modules described above can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between modules, and may be electrical or other forms.

[0121] The modules described above as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0122] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0123] If the aforementioned integrated modules are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable non-volatile storage medium. Based on this understanding, the technical solution of this 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 non-volatile 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 of the various embodiments of this invention. The aforementioned non-volatile storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0124] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for determining electricity demand, characterized in that, include: Obtain the current load data of the electricity account in the current time period, wherein the current time period is one day, and the current load data includes load data collected at multiple sampling times within the current time period; The current load data is decomposed to obtain multiple current load components; Based on the multiple current load components, a power demand forecasting model is used to obtain multiple predicted load components, including: when the power demand forecasting model includes a first bidirectional long short-term memory network layer, an attention layer, a second bidirectional long short-term memory network layer, and a fully connected layer, the first bidirectional long short-term memory network layer is used to extract hidden features from the multiple current load components to obtain multiple sets of initial hidden features; the attention mechanism in the attention layer is used to weight the multiple sets of initial hidden features to obtain multiple sets of weighted hidden features; the second bidirectional long short-term memory network layer is used to extract features from the multiple sets of weighted hidden features to obtain multiple sets of feature extraction results; based on the multiple sets of feature extraction results, the fully connected layer is used to predict the multiple predicted load components. Based on the multiple predicted load components, the electricity demand prediction result of the electricity account in the prediction period is obtained, wherein the prediction period is the next sampling period of the current period.

2. The method according to claim 1, characterized in that, The current load data is decomposed to obtain multiple current load components, including: Gaussian white noise is added multiple times to the current load data to obtain multiple sets of current noise data, wherein the multiple Gaussian white noises follow a standard normal distribution; Empirical mode decomposition is performed on the multiple sets of current noise data to obtain multiple sets of intrinsic mode functions. The multiple sets of current noise data correspond one-to-one with the multiple sets of intrinsic mode functions. Each set of intrinsic mode functions includes multiple intrinsic mode functions. The multiple intrinsic mode functions are obtained by performing multiple empirical mode decompositions on the corresponding current noise data. Based on the multiple sets of intrinsic mode functions, the multiple current load components are obtained.

3. The method according to claim 1, characterized in that, The attention mechanism in the attention layer is used to weight the multiple sets of initial hidden features to obtain multiple sets of weighted hidden features, including: Any set of weighted hidden features from the plurality of weighted hidden features is obtained in the following manner: For any one set of initial hidden features from the plurality of initial hidden features, determine the score value corresponding to each of the multidimensional hidden features included in the set of initial hidden features; The score values ​​corresponding to the multidimensional hidden features are normalized to obtain the standard score values ​​corresponding to the multidimensional hidden features. Determine the attention weights corresponding to the multidimensional hidden features; The weighted calculation is performed based on the attention weights corresponding to the multidimensional hidden features and the standard score values ​​corresponding to the multidimensional hidden features to obtain any set of weighted hidden features; The multiple sets of weighted hidden features are obtained by using the method of obtaining any one set of weighted hidden features.

4. The method according to claim 1, characterized in that, Before obtaining multiple predicted load components by employing an electricity demand forecasting model based on the multiple current load components, the method further includes: Acquire historical load data collected from multiple historical time periods; The historical load data collected in the multiple historical time periods are preprocessed to obtain preprocessed load data corresponding to the multiple historical time periods, wherein the preprocessing includes at least one of the following: missing value imputation and outlier correction; The preprocessed load data corresponding to the multiple historical time periods are normalized to obtain the normalized load data corresponding to the multiple historical time periods. Based on the normalized load data corresponding to the multiple historical periods, the initial model is trained to obtain the electricity demand forecasting model.

5. The method according to claim 4, characterized in that, The preprocessing of historical load data collected from the multiple historical time periods includes: Detect whether there are missing values ​​in the historical load data collected in the multiple historical time periods; If the missing values ​​exist in the historical load data collected in the multiple historical time periods, the missing values ​​are filled in. Detect whether there are outliers in the historical load data collected in the multiple historical time periods; If the outliers are present in the historical load data collected in the multiple historical time periods, the outliers are corrected.

6. The method according to claim 5, characterized in that, The detection of outliers in the historical load data collected from the multiple historical time periods includes: Determine whether the historical load data collected in the multiple historical time periods all meet the following predetermined conditions: ; in, This represents the load data corresponding to the i-th sampling time in the n-th historical period among the multiple historical periods, where each historical period includes multiple sampling times; This represents any one of the multiple historical time periods, and N represents the total number of the multiple historical time periods; This represents the average value of the load data corresponding to the i-th sampling time among the multiple historical time periods; This represents the variance of the load data at the i-th sampling time. This represents the standard deviation of the load data at the i-th sampling time. Indicates the preset threshold; If the load data corresponding to each of the multiple historical time periods does not meet the predetermined conditions, it is determined that there are no outliers in the load data corresponding to each of the multiple historical time periods. If any load data in the load data corresponding to the multiple historical time periods meets the predetermined conditions, then the load data is determined to be an outlier.

7. A device for determining electricity demand, characterized in that, include: The acquisition module is used to acquire the current load data of the electricity account in the current time period, wherein the current time period is one day, and the current load data includes load data collected at multiple sampling times within the current time period; The decomposition module is used to decompose the current load data to obtain multiple current load components; The prediction module is used to obtain multiple predicted load components based on the multiple current load components using an electricity demand prediction model. This includes: when the electricity demand prediction model includes a first bidirectional long short-term memory (BSSM) network layer, an attention layer, a second bidirectional BSSM network layer, and a fully connected layer; using the first bidirectional BSSM network layer to extract hidden features from the multiple current load components to obtain multiple sets of initial hidden features; using the attention mechanism in the attention layer to weight the multiple sets of initial hidden features to obtain multiple sets of weighted hidden features; using the second bidirectional BSSM network layer to extract features from the multiple sets of weighted hidden features to obtain multiple sets of feature extraction results; and using the fully connected layer to predict the multiple predicted load components based on the multiple sets of feature extraction results. The result determination module is used to obtain the electricity demand prediction result of the electricity account in the prediction period based on the multiple predicted load components, wherein the prediction period is the next sampling period of the current period.

8. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores multiple instructions, which are adapted to be loaded by a processor and executed by the power demand determination method according to any one of claims 1 to 6.

9. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the electricity demand determination method according to any one of claims 1 to 6.