A method and system for predicting user power consumption
By constructing a multi -scale electricity prediction model based on LSTM and MDN, the problem of insufficient accuracy of electricity prediction in existing technologies has been solved, and more accurate and rich electricity prediction results are achieved. need.
Patent Information
- Application Number
- CN202310561412.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-16
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2043-05-16
AI Technical Summary
When the existing power consumption prediction method deals with uncertainty in user power consumption and various influencing factors, the prediction accuracy is insufficient and it is difficult to meet the complex needs of power scenarios.
Use long -term memory network (LSTM) and hybrid density network (MDN) to build a multi -scale electricity prediction model, extract the timing of timing through different standard timing sample data sets, and use the attention mechanism for feature fusion. In the end, the probability distribution Formation of the prediction results of the output power consumption.
It improves the accuracy and richness of electricity prediction, can better capture the diversity and uncertainty of users' electricity consumption, and provide more comprehensive information for the scheduling of power companies.
Smart Images

Figure CN116777049B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of power consumption prediction, and in particular relates to a method and system for predicting user power consumption. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Electricity consumption forecasting is an important research topic in user energy analysis. It can not only help power companies predict the development trend of electricity consumption in the entire industry, but also help companies to reasonably arrange electricity purchase plans. The existing electricity consumption forecasting methods are divided into classical forecasting methods and modern intelligent forecasting methods. The classical forecasting method is based on the similarity of development trends. When the electricity consumption trend fluctuates greatly, the forecasting effect will be significantly reduced. Modern intelligent forecasting methods, represented by neural network and support vector machine forecasting, have better performance than classical forecasting methods and have developed rapidly in recent years.
[0004] Nevertheless, modern intelligent prediction methods still have two major problems:
[0005] First, due to the inherent characteristics of electricity consumption, the prediction accuracy needs to be further improved. Specifically, (1) a variety of external factors affect user electricity consumption. User electricity consumption is not only affected by natural factors such as weather and season, but also correlated with a variety of socio-economic factors, which increases the difficulty of modeling electricity consumption forecasts; (2) short-term electricity consumption in the power grid is both volatile and nonlinear, which reduces the accuracy of electricity consumption forecasts; (3) traditional electricity consumption forecasting methods have certain limitations when mining electricity consumption big data with many types, large volume, high latitude and fast generation speed, making it difficult to accurately grasp the correlation factors and changing patterns of user electricity consumption.
[0006] The second aspect: Taking neural networks as an example, neural networks can fit any continuous function. During the training process, the output sample value of the neural network should be a certain value. However, for the situation where the output sample value may be multiple possible values, the effect of the neural network is very poor. In the prediction of user electricity consumption, this means that only point predictions can be made. However, for user electricity consumption with many types of influencing factors, suddenness and uncertainty, it is often unrealistic to predict accurate point values, or it does not conform to the uncertainty of the power scenario. Highly quantifying the uncertainty caused by multiple factors provides more comprehensive information and is more practical. Therefore, the existing point prediction method that only predicts the expected future value is difficult to meet actual needs and there is still a lot of room for improvement. Summary of the invention
[0007] In order to overcome the shortcomings of the above-mentioned prior art, the present invention provides a method and system for predicting user electricity consumption, which is based on a long short-term memory network (LSTM) and a mixed density network (MDN), considers the uncertainty of electricity consumption and the diversity of influencing factors, and constructs a multi-scale electricity consumption prediction model; obtains a multi-scale time series sample data set through preset time lengths of different scales, and trains the model; uses the trained model to perform probability prediction of user electricity consumption, and provides more accurate and richer data for user energy consumption analysis.
[0008] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions:
[0009] A first aspect of the present invention provides a method for predicting user power consumption;
[0010] A method for predicting user power consumption, comprising:
[0011] Taking the influencing factors of electricity consumption as features, the historical electricity consumption under different characteristic values is obtained. The electricity consumption and characteristic values of a time period are taken as a sample. By adjusting the length of the divided time period, time series sample data sets of multiple scales are obtained.
[0012] A multi-scale electricity consumption prediction model is constructed and trained based on time series sample data sets of multiple scales.
[0013] Use the trained multi-scale electricity consumption prediction model to predict the user's electricity consumption in the next period.
[0014] Among them, the multi-scale electricity consumption prediction model extracts the time series features of each scale through long short-term memory networks of different scales, performs feature fusion based on the attention mechanism, and uses a mixed density network to output the prediction results of user electricity consumption in the next period in the form of probability distribution.
[0015] Furthermore, the factors affecting the electricity consumption include natural factors, social factors, and economic factors, and each factor serves as a feature.
[0016] Furthermore, the natural factors include temperature, humidity, wind speed, rainfall and light intensity;
[0017] The social factors include holidays and major events;
[0018] The economic factors include day-ahead market prices, intraday market prices and real-time market prices.
[0019] Furthermore, after obtaining the historical electricity consumption under different characteristic values, data preprocessing is performed, including data cleaning, standardization and feature dimension reduction.
[0020] Furthermore, the time period is divided into multiple intervals based on a preset duration, and the samples corresponding to the time period are sorted in chronological order to obtain a time series sample data set.
[0021] Furthermore, the time series sample data sets of multiple scales are obtained by adjusting the duration of the divided time periods, specifically:
[0022] The preset time lengths are set to day, month, and year, and time series sample data sets of three scales are constructed according to the time intervals of 1 day, 1 month, and 1 year.
[0023] Furthermore, the multi-scale electricity consumption prediction model includes a feature extraction module, a feature fusion module and a hybrid density network;
[0024] The feature extraction module includes a long short-term memory network constructed for each scale, which is used to extract the temporal features of each scale;
[0025] The feature fusion module performs weighted fusion of the temporal features of each scale based on the attention mechanism to obtain fused features;
[0026] The mixed density network predicts the distribution of user power consumption in the next period of time according to the fused feature fitting. During the distribution fitting process, likelihood estimation is used to optimize the distribution error.
[0027] A second aspect of the present invention provides a user electricity consumption prediction system.
[0028] A user electricity consumption prediction system includes a data set construction module, a model construction module and a model prediction module:
[0029] The data set construction module is configured to: take the influencing factors of electricity consumption as features, obtain historical electricity consumption under different characteristic values, take the electricity consumption and characteristic values of a time period as a sample, and obtain time series sample data sets of multiple scales by adjusting the length of the divided time period.
[0030] The model building module is configured to: build a multi-scale electricity consumption prediction model and train the model based on time series sample data sets of multiple scales.
[0031] The model prediction module is configured to use the trained multi-scale power consumption prediction model to predict the user's power consumption in the next period.
[0032] Among them, the multi-scale electricity consumption prediction model extracts the time series features of each scale through long short-term memory networks of different scales, performs feature fusion based on the attention mechanism, and uses a mixed density network to output the prediction results of user electricity consumption in the next period in the form of probability distribution.
[0033] A third aspect of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps of a method for predicting user electricity consumption as described in the first aspect of the present invention.
[0034] The fourth aspect of the present invention provides an electronic device, including a memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in a method for predicting user electricity consumption as described in the first aspect of the present invention are implemented.
[0035] One or more of the above technical solutions have the following beneficial effects:
[0036] The present invention provides a method for constructing a multi-scale time series sample data set. By setting different preset time lengths, time is divided into multiple intervals, and samples corresponding to the time periods are sorted in chronological order to obtain a multi-scale time series sample data set, thereby improving the diversity and completeness of the data set samples, thereby improving the effect of model training.
[0037] The present invention constructs a long short-term memory network (LSTM) for the time series data of each scale, extracts the time series features of each scale, learns the feature information of different distances through weighted fusion based on the attention mechanism method, and performs weighted fusion according to the correlation between each scale and the target time period to obtain the final features, thereby improving the accuracy of feature extraction.
[0038] The present invention uses a hybrid density network MDN to predict the distribution of user electricity consumption in the next period according to the fused feature fitting, highly quantifies the uncertainty of multiple factors, provides the most comprehensive and richer information for user energy consumption analysis, and can better guide the dispatch of power companies.
[0039] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0041] Figure 1 This is a flow chart of the method of the first embodiment.
[0042] Figure 2 This is a structural diagram of the multi-scale electricity consumption prediction model of the first embodiment.
[0043] Figure 3 This is a network layer structure diagram of the long short-term memory network LSTM of the first embodiment.
[0044] Figure 4 This is a structural diagram of the feature fusion module of the first embodiment.
[0045] Figure 5 It is a system structure diagram of the second embodiment. DETAILED DESCRIPTION
[0046] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used in the present invention have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0047] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0048] Long short-term memory (LSTM) is a variant of recurrent neural network (RNN), which has strong competitiveness in various fields and can take into account the long-term dependence of time series. Considering that electricity consumption data is a typical time series with its time characteristics, the electricity consumption in the next period is related to the past, so the present invention uses LSTM to predict the electricity consumption of a single user.
[0049] Mixture Density Networks (MDN) is a network that combines Gaussian mixture models and neural networks. Unlike general neural networks, it no longer uses linear layers or softmax as prediction values in the output part of the network; in order to introduce uncertainty in the model, each output is considered to be a Gaussian mixture distribution, rather than a definite value or a simple Gaussian distribution, so its goal is to learn the output distribution parameters (mean, variance and distribution coefficient) based on given input data to approximate any complex conditional target distribution. The present invention uses MDN to process the fused features and outputs the prediction results of the user's electricity consumption in the next period in the form of probability distribution.
[0050] Embodiment 1
[0051] In one or more embodiments, a method for predicting user power consumption is disclosed, such as Figure 1 As shown, the following steps are included:
[0052] Step S1: Taking the influencing factors of electricity consumption as features, obtain the historical electricity consumption under different characteristic values, take the electricity consumption and characteristic value of a time period as a sample, and obtain time series sample data sets of multiple scales by adjusting the length of the divided time period.
[0053] In order to train the model and ensure the training effect of the model, a large amount of historical data needs to be collected, including power consumption, data on factors affecting power consumption, and statistical time; data on factors affecting power consumption can be captured from the Internet through crawlers, and power consumption can be obtained from power-related systems or imported from historical data tables.
[0054] Among them, the factors affecting electricity consumption include natural factors, social factors, and economic factors; natural factors include temperature, humidity, wind, rainfall, and light intensity, social factors include holidays and major events, and economic factors include day-ahead market prices, intraday market prices, and real-time market prices. Each factor is used as a feature, and the historical data obtained is shown in Table 1:
[0055] Table 1 Historical data table
[0056] time Electricity consumption (kWh) Factor 1 Factor 2 Factor 3 Factor 4 Factor 5 Factor 6 Factor 7 2022-1-1 5.1 3.4 1.1 1.7 3.1 2.8 2.4 2.1 2022-1-2 5 2.4 1.5 2.8 2.6 2.1 1.7 3.4 2022-1-3 5.1 1.7 2 2.6 2 2 2 2 2022-1-4 5.2 2.8 3.1 1.4 3.1 3.1 3.1 3.1 2022-1-5 5.3 2.1 2.6 1.7 2.6 3.4 2.6 2.4 2022-1-6 5.2 3.4 1.4 2.8 1.4 2.4 2 1.7 2022-1-7 5.1 2.6 1.7 1.8 1.9 1.7 3.1 2.4
[0057] The leftmost column in Table 1 is time series data with an interval of 1 day. Each row is a sample, and each column except the time column and the power consumption column is a feature. Taking the first row as an example, the sample contains 7 features. The following multi-scale power consumption prediction model learns the relationship between power consumption and multiple features.
[0058] In order to improve the learning effect and ensure the validity of the data, the acquired data needs to be preprocessed, including data cleaning, standardization and feature dimensionality reduction.
[0059] Data cleaning: For samples with missing or abnormal data, fill or replace them with the mean of the corresponding data of the previous sample and the next sample.
[0060] Standardization: discrete data such as holidays and major events are processed using one-hot encoding, and continuous data such as natural factors are standardized using z-score.
[0061] Feature dimensionality reduction, reduce the dimension of one-hot encoding to obtain the power consumption and feature vector corresponding to each time.
[0062] After preprocessing, a time series sample data set of multiple scales is constructed to facilitate the multi-scale electricity consumption prediction model to capture dependencies at different distances, specifically:
[0063] By presetting the duration, the time is divided into multiple intervals, namely time periods, and the samples corresponding to the time periods are sorted in chronological order to obtain a single-scale time series sample data set; the preset time length is set to day, month, and year respectively, and a three-scale time series sample data set is constructed according to the time intervals of 1 day, 1 month, and 1 year.
[0064] For example, taking 2022-1-1 as the target period, the time series sample data sets of the three scales are:
[0065] (1) Take the samples of the last 7 days to construct a time series sample data set with daily scale:
[0066] 2021-12-25, 2021-12-26, 2021-12-27, 2021-12-28, 2021-12-29, 2021-12-30, 2021-12-31.
[0067] (2) Take the samples of the last six months to construct a time series sample data set with a monthly scale:
[0068] 2021-7-1, 2021-8-1, 2021-9-1, 2021-10-1, 2021-11-1, 2021-12-1.
[0069] (3) Take the samples from the last three years to construct a time series sample data set with an annual scale:
[0070] 2019-1-1, 2020-1-1, 2021-1-1.
[0071] Step S2: Construct a multi-scale electricity consumption prediction model and train the model based on time series sample data sets of multiple scales.
[0072] Among them, the multi-scale electricity consumption prediction model extracts the time series features of each scale through long short-term memory networks (LSTM) of different scales, performs feature fusion based on the attention mechanism, and uses the mixed density network (MDN) to output the prediction results of user electricity consumption in the next period in the form of probability distribution.
[0073] Figure 2 It is the structure diagram of the multi-scale electricity consumption prediction model, such as Figure 2 As shown in FIG, the multi-scale electricity consumption prediction model includes a feature extraction module, a feature fusion module and a hybrid density network; these three parts are described in detail below.
[0074] (1) Feature extraction module, including a long short-term memory network (LSTM) constructed for each scale to extract temporal features at each scale.
[0075] The network structure and input time series data format of each scale LSTM network are the same, but different scale data are used for training. The input time series data at the nth moment can be expressed as: x1, ..., x t , …, x n .
[0076] The long short-term memory network LSTM contains multiple network layers. Figure 3 It is the structural diagram of each network layer, such as Figure 3 As shown, each network layer includes a forget gate, an input gate, and an output gate. The input x in the forget gate t With state memory unit s t-1 、Intermediate output h t-1 Together determine the forgetting part of the state memory unit, the forget gate x t Control the network layer to forget information, input gate s t-1 Control the information update of the network layer, output gate h t-1 Control the output of information, x in the input gate t After being transformed by the sigmoid and tanh functions, the retained vector in the state memory unit is jointly determined, and the intermediate output h t By the updated s t With output o t Joint decision, expressed as:
[0077]
[0078] Among them, f t 、i t , g t , o t 、h t 、s t are the states of the forget gate, input gate, input node, output gate, intermediate output and state unit respectively; W fx , W fh , W ix , W ih , W gx , W gh , W ox , W oh are the corresponding gates and input x t and intermediate output h t-1 The matrix weights to be multiplied; b f , b i , b g , b0 are the bias terms of the corresponding gates respectively; ⊙ represents the bitwise multiplication of the elements in the vector; σ represents the change of the sigmoid function, Indicates the change of tanh function.
[0079] The time series data of three scales are input into the corresponding LSTM respectively to learn the feature information of different distances and obtain the time series features H1, H2 and H3 of three scales.
[0080] (2) Feature fusion module: Based on the attention mechanism, the temporal features of each scale are weighted and fused to obtain the fused features.
[0081] The time series features H1, H2, H3 are fed into Figure 4 The feature fusion module shown in Figure 1 extracts the weights w1, w2, and w3 of the three time series features in the prediction, as shown in Figure 1. Figure 4 As shown in the figure, the feature fusion module contains a fully connected neural network with two hidden layers. The output of the neural network is used as the input of the Sigmoid function. The calculation formulas of the weight values w1, w2, and w3 are as follows:
[0082] w i =σ[W1(W2H i )] (2)
[0083] Among them, i∈{1, 2, 3}, W1 and W2 are the parameter vectors of the first and second hidden layers respectively, and σ is the Sigmoid function.
[0084] Based on the weight values w1, w2, and w3 of the three scales, the three time series features H1, H2, and H3 are weighted fused to obtain the fused feature H. The specific formula is:
[0085] H=H1×w1+H2×w2+H3×w3 (3)
[0086] (3) Mixed density network: predicts the distribution of user electricity consumption in the next period based on the fused feature fitting. During the distribution fitting process, likelihood estimation is used to optimize the distribution error.
[0087] The mixture density network MDN consists of two hidden layers and an output layer. The output layer outputs the Gaussian mixture model's g, u, and parameters. When the input variable x is given, the Gaussian mixture model gives the conditional probability distribution p(y|x) in the form of the following formula:
[0088]
[0089] Where m is the number of components in the mixed distribution, π i (x) is the mixing coefficient of the i-th Gaussian component, u i (x) and σ i (x) corresponds to the mean and variance of the i-th Gaussian component.
[0090] It should be noted that the sum of all mixing coefficients should be 1, as shown in the formula:
[0091]
[0092] The softmax function is usually used to output π i The value of (x) is expressed as follows:
[0093]
[0094] in, The softmax function ensures that the sum of the output mixed component coefficients is 1, and each mixed coefficient is in the range of [0, 1].
[0095] Standard deviation i (x) and mean u i (x) is output in the following format to ensure that it is greater than 0:
[0096]
[0097] in, It is the output value of the previous layer of network.
[0098] Finally, the loss function of the mixed density network is constructed through the maximum likelihood function, and its definition formula is as follows:
[0099]
[0100] The value of logL(y|x) will gradually decrease with each iteration during the training process, and the prediction error of the derivative table will decrease.
[0101] Step S3: Use the trained multi-scale electricity consumption prediction model to predict the user's electricity consumption in the next period.
[0102] The characteristic data of the next time period to be predicted is obtained, and after preprocessing, it is input into the trained multi-scale electricity consumption prediction model to obtain the parameters of the probability distribution of electricity consumption in the next time period, including the mean and variance of the Gaussian distribution; through these parameters, the probability distribution of electricity consumption in the next time period can be obtained.
[0103] By analyzing the probability distribution, we can get the prediction results of electricity consumption and confidence intervals for multiple time periods. Specifically, by sampling each probability distribution multiple times and taking the average, we can get the electricity consumption for the next time period, and by setting the confidence level for the probability distribution, we can get the confidence interval of the electricity consumption for the next time period.
[0104] Embodiment 2
[0105] In one or more embodiments, a user power consumption prediction system is disclosed, such as Figure 5 As shown, it includes a dataset building module, a model building module, and a model prediction module:
[0106] The data set construction module is configured to: take the influencing factors of electricity consumption as features, obtain historical electricity consumption under different characteristic values, take the electricity consumption and characteristic values of a time period as a sample, and obtain time series sample data sets of multiple scales by adjusting the length of the divided time period.
[0107] The model building module is configured to: build a multi-scale electricity consumption prediction model and train the model based on time series sample data sets of multiple scales.
[0108] The model prediction module is configured to use the trained multi-scale power consumption prediction model to predict the user's power consumption in the next period.
[0109] Among them, the multi-scale electricity consumption prediction model extracts the time series features of each scale through long short-term memory networks of different scales, performs feature fusion based on the attention mechanism, and uses a mixed density network to output the prediction results of user electricity consumption in the next period in the form of probability distribution.
[0110] Embodiment 3
[0111] The purpose of this embodiment is to provide a computer-readable storage medium.
[0112] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps in a method for predicting user power consumption as described in Embodiment 1 of the present disclosure.
[0113] Embodiment 4
[0114] The purpose of this embodiment is to provide an electronic device.
[0115] An electronic device includes a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps in a method for predicting user power consumption as described in Embodiment 1 of the present disclosure are implemented.
[0116] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for predicting user power consumption, characterized in that: include: Taking the influencing factors of electricity consumption as features, we obtain the historical electricity consumption under different characteristic values. We take the electricity consumption and characteristic values of a time period as a sample, and obtain time series sample data sets of multiple scales by adjusting the length of the divided time period. Build a multi-scale electricity consumption prediction model and train the model based on time series sample data sets at multiple scales; Use the trained multi-scale electricity consumption prediction model to predict the user's electricity consumption in the next period; The multi-scale electricity consumption prediction model extracts the time series features of each scale through long short-term memory networks of different scales, performs feature fusion based on the attention mechanism, and uses a mixed density network to output the prediction result of the user's electricity consumption in the next period in the form of probability distribution; The time period is to divide the time into multiple intervals based on the preset time length, and sort the samples corresponding to the time period in chronological order to obtain a time series sample data set; specifically, the preset time length is set to day, month, and year, and the time series sample data sets of three scales are constructed according to the time intervals of 1 day, 1 month, and 1 year; The multi-scale electricity consumption prediction model includes a feature extraction module, a feature fusion module and a hybrid density network; The feature extraction module includes a long short-term memory network LSTM constructed for each scale, which is used to extract the time series features of each scale; the time series data of the three scales are respectively input into the corresponding LSTM to learn the feature information of different distances to obtain the time series features of the three scales ; The feature fusion module performs weighted fusion of the temporal features of each scale based on the attention mechanism to obtain fused features; The mixed density network predicts the distribution of user power consumption in the next period based on the fused feature fitting. During the distribution fitting process, likelihood estimation is used to optimize the distribution error. The specific operations of the feature fusion module are: The timing characteristics Send it to the feature fusion module to extract the weights of the three time series features in the prediction The feature fusion module contains a fully connected neural network with two hidden layers. The output of the neural network is used as the input of the Sigmoid function. The weight value The calculation formula is as follows: in, , are the parameter vectors of the first and second hidden layers respectively, and σ is the Sigmoid function; Weight values based on three scales , for the three time series features Perform weighted fusion to obtain the fused features , the specific formula is: 。 2. A method for predicting user power consumption as claimed in claim 1, characterized in that: The factors affecting electricity consumption include natural factors, social factors, and economic factors, and each factor serves as a feature.
3. A method for predicting user power consumption as claimed in claim 2, characterized in that: The natural factors include temperature, humidity, wind speed, rainfall and light intensity; The social factors include holidays and major events; The economic factors include day-ahead market prices, intraday market prices and real-time market prices.
4. A method for predicting user power consumption as claimed in claim 1, characterized in that: After obtaining the historical electricity consumption under different characteristic values, data preprocessing is performed, including data cleaning, standardization and feature dimension reduction.
5. A user power consumption prediction system, characterized in that: Including dataset building module, model building module and model prediction module: The data set construction module is configured to: take the influencing factors of power consumption as features, obtain historical power consumption under different characteristic values, take the power consumption and characteristic value of a time period as a sample, and obtain time series sample data sets of multiple scales by adjusting the length of the divided time period; The model building module is configured to: build a multi-scale electricity consumption prediction model and train the model based on time series sample data sets of multiple scales; The model prediction module is configured to: use the trained multi-scale power consumption prediction model to predict the power consumption of users in the next period; The multi-scale electricity consumption prediction model extracts the time series features of each scale through long short-term memory networks of different scales, performs feature fusion based on the attention mechanism, and uses a mixed density network to output the prediction result of the user's electricity consumption in the next period in the form of probability distribution; The time period is to divide the time into multiple intervals based on the preset time length, and sort the samples corresponding to the time period in chronological order to obtain a time series sample data set; specifically, the preset time length is set to day, month, and year, and the time series sample data sets of three scales are constructed according to the time intervals of 1 day, 1 month, and 1 year; The multi-scale electricity consumption prediction model includes a feature extraction module, a feature fusion module and a hybrid density network; The feature extraction module includes a long short-term memory network LSTM constructed for each scale, which is used to extract the time series features of each scale; the time series data of the three scales are respectively input into the corresponding LSTM to learn the feature information of different distances to obtain the time series features of the three scales ; The feature fusion module performs weighted fusion of the temporal features of each scale based on the attention mechanism to obtain fused features; The mixed density network predicts the distribution of user power consumption in the next period based on the fused feature fitting. During the distribution fitting process, likelihood estimation is used to optimize the distribution error. The specific operations of the feature fusion module are: The timing characteristics Send it to the feature fusion module to extract the weights of the three time series features in the prediction The feature fusion module contains a fully connected neural network with two hidden layers. The output of the neural network is used as the input of the Sigmoid function. The weight value The calculation formula is as follows: in, , are the parameter vectors of the first and second hidden layers respectively, and σ is the Sigmoid function; Weight values based on three scales , for three time series features Perform weighted fusion to obtain the fused features , the specific formula is: 。 6. An electronic device, comprising: a memory for non-transitory storage of computer readable instructions; as well as a processor for executing the computer readable instructions, When the computer-readable instructions are executed by the processor, the method described in any one of claims 1 to 4 is executed.
7. A storage medium, characterized in that it non-temporarily stores computer-readable instructions, wherein: When the non-transitory computer-readable instructions are executed by a computer, the instructions of the method according to any one of claims 1 to 4 are executed.
Citation Information
Patent Citations
Load probability density prediction method based on time sequence Gaussian mixture density network
CN115759455A