CN116090637A - Short-time electricity consumption prediction method and system - Google Patents

Short-time electricity consumption prediction method and system Download PDF

Info

Publication number
CN116090637A
CN116090637A CN202310060036.8A CN202310060036A CN116090637A CN 116090637 A CN116090637 A CN 116090637A CN 202310060036 A CN202310060036 A CN 202310060036A CN 116090637 A CN116090637 A CN 116090637A
Authority
CN
China
Prior art keywords
power consumption
electricity consumption
consumption data
short
gate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310060036.8A
Other languages
Chinese (zh)
Inventor
顾杨青
白锐
何平
兴胜利
赵灿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Power Supply Co of State Grid Jiangsu Electric Power Co Ltd
Original Assignee
Suzhou Power Supply Co of State Grid Jiangsu Electric Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Power Supply Co of State Grid Jiangsu Electric Power Co Ltd filed Critical Suzhou Power Supply Co of State Grid Jiangsu Electric Power Co Ltd
Priority to CN202310060036.8A priority Critical patent/CN116090637A/en
Publication of CN116090637A publication Critical patent/CN116090637A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/06Electricity, gas or water supply

Abstract

The utility model provides a short-term prediction method and system of power consumption, mainly provides a short-term prediction method of power consumption of enterprises that can have strong adaptability, degree of accuracy is high, and it has increased the classification on traditional long-term memory artificial neural network and has classified the power consumption of enterprises into daily electricity consumption of work and holiday power consumption, and has introduced external influence factor, for example: average stock price, net profit, total revenue and the like, carrying out weight distribution on an attention layer after model training of the neural network, and finally outputting a short-time prediction result; the method can generate more accurate results on short-time prediction results of the power data, is favorable for taking the data as a drive, and better manages and implements strategic deployment in combination with the conditions of enterprises.

Description

Short-time electricity consumption prediction method and system
Technical Field
The invention belongs to the technical field of data prediction, and particularly relates to a short-time prediction method and system for electricity consumption.
Background
The short-term prediction research of the power consumption of the enterprise can help the enterprise to conduct data analysis, analyze the specific situation of the enterprise and conduct planning adjustment at any time.
Although the traditional data analysis method can solve the related prediction problem to a certain extent, the traditional data analysis method still has certain defects:
the method based on the support vector machine comprises the following steps: the performance of the support vector machine mainly depends on the selection of kernel functions, so for a practical problem, how to select a suitable kernel function according to a practical data model to construct an SVM algorithm. The selection of the current mature kernel function and the parameters thereof is artificial and selected according to experience, and has certain randomness.
The BP neural network-based method comprises the following steps: in general, when the training ability is poor, the prediction ability is also poor, and to some extent, as the training ability is improved, the prediction ability is improved. However, this trend is not fixed, and has a limit, when this limit is reached, the predictive power decreases instead with increasing training power, i.e. the phenomenon called "overfitting" occurs. The reason for this phenomenon is that the network learns too many sample details, so that the learned model can not reflect the rules contained in the sample, so how to grasp the learning degree, and solving the contradiction problem between the network prediction capability and the training capability is also an important research content of the BP neural network.
The method based on the long-term and short-term memory artificial neural network comprises the following steps: LSTM handles time-series tasks better than CNN as RNNs; at the same time, LSTM solves the long-term dependence problem of RNN and alleviates the problem of gradient disappearance caused by reverse propagation of RNN during training. The model structure of LSTM itself is relatively complex and training is more time consuming than CNN; furthermore, the nature of RNN networks determines that they cannot parallelize data well; furthermore, LSTM, while somewhat alleviating the long-term dependency problem of RNN, is also troublesome for longer sequence data.
Disclosure of Invention
In order to solve the defects in the prior art, the invention provides a short-time prediction method and a short-time prediction system for electricity consumption, which mainly provide a short-time prediction method for the electricity consumption of enterprises, which has strong adaptability and high accuracy, wherein the method is characterized in that two categories are added on a traditional long-and-short-term memory artificial neural network to classify the electricity consumption of the enterprises, the electricity consumption is divided into daily electricity consumption for work and holiday electricity consumption, and external influence factors are introduced, such as: average stock price, net profit, total revenue and the like, carrying out weight distribution on an attention layer after model training of the neural network, and finally outputting a short-time prediction result; the method can generate more accurate results on short-time prediction results of the power data, is favorable for taking the data as a drive, and better manages and implements strategic deployment in combination with the conditions of enterprises.
The invention adopts the following technical scheme.
A short-time electricity consumption prediction method comprises the following steps:
step 1, acquiring a plurality of electricity consumption data of an enterprise, and classifying the data;
step 2, substituting the plurality of electricity consumption data into the CNN model;
step 3, all the characteristic values l are calculated t The LSTM model is entered in time order.
Preferably, the plurality of electricity consumption data X in the step 1 are as follows:
X=[x 1 ,x 2 ,…x t …,x n ]
x t =[P t ,h t ,…]
wherein x is t For the t-th power consumption data, P t H is the total power consumption of the power consumption as the t-th power consumption data t And n is the quantity of the electricity consumption data, and the value range of t is a positive integer from 1 to n.
Preferably, h t =0or 1, where0 represents holidays and 1 represents workdays.
Preferably, x t The following formula is shown:
x t =[P t ,h t ,p t ,s t ,m t ,…]
wherein p is t Net profit for the day enterprise to which the tth electricity usage data pertains, s t Average stock price, m, for the day enterprise to which the tth electricity consumption data belongs t And (5) collecting the total sum of the enterprises on the day of the t-th power consumption data.
Preferably, the step 2 specifically includes:
step 2.1, extracting characteristic values l of a plurality of power consumption data by using a convolution layer in the CNN model t
l t =tanh(x t *k t +b t )
Wherein tanh is an activation function, x t For the tth power consumption data as input vector, k t B is the weight of the convolution kernel for the t-th power consumption data t Bias for convolution kernel for the t-th power usage data;
step 2.2, the characteristic value l t Substituting into the pooling layer in the CNN model, thereby reducing the dimension of the characteristic value lt.
Preferably, the step 3 specifically includes:
step 3.1, calculating the output value f of the forgetting gate t
f t =σ(w f ·[l t-1 ,x t ]+b f )
Wherein f t The value range of (1, 0), w f Weight of forgetting gate b f Bias for forgetting the door;
step 3.2, calculating the output value i of the input gate t And candidate cell state
Figure BDA0004061090820000031
The following formula is shown:
i t =σ(w i *[l t-1 ,x t ]+b i )
Figure BDA0004061090820000032
wherein i is t The value range is (0, 1), w i B is the weight of the input gate i For biasing the input gate, w k Weights for candidate input gates, b k Bias for candidate input gates;
step 3.3, updating to obtain the current cell state C t The following formula is shown:
Figure BDA0004061090820000033
wherein C is t The value range of (1) is (0);
step 3.4, calculating the output value O of the output gate t The following formula is shown:
O t =σ(w h ·[h t-1 ,x t ]+b h )
wherein O is t The value range of (1, 0), w h To output the weight of the gate, b h Offset for the output gate;
step 3.5, by calculating the output O of the output gate t And the current cell state C t Obtaining the output value h of LSTM t The following formula is shown:
h t =O t *tanh(C t )。
a short-term electricity consumption prediction system comprising:
the system comprises an acquisition module, a classification module and a storage module, wherein the acquisition module is used for acquiring a plurality of power consumption data of an enterprise and classifying the power consumption data;
the substituting module is used for substituting the plurality of electricity consumption data into the CNN model;
and the input module is used for inputting all the characteristic values into the LSTM model according to the time sequence.
Preferably, the plurality of electricity consumption data X are represented by the following formula:
X=[x 1 ,x 2 ,…x t …,x n ]
x t =[P t ,h t ,…]
wherein x is t For the t-th power consumption data, P t H is the total power consumption of the power consumption as the t-th power consumption data t And n is the quantity of the electricity consumption data, and the value range of t is a positive integer from 1 to n.
Preferably, h t =0or 1, where 0 represents holiday and 1 represents workday.
Preferably, x t The following formula is shown:
x t =[P t ,h t ,p t ,s t ,m t ,…]
wherein p is t Net profit for the day enterprise to which the tth electricity usage data pertains, s t Average stock price, m, for the day enterprise to which the tth electricity consumption data belongs t And (5) collecting the total sum of the enterprises on the day of the t-th power consumption data.
Preferably, the substitution module is further configured to extract a plurality of eigenvalues l of the electricity consumption data by using a convolution layer in the CNN model t
l t =tanh(x t *k t +b t )
Wherein tanh is an activation function, x t For the tth power consumption data as input vector, k t B is the weight of the convolution kernel for the t-th power consumption data t Bias for convolution kernel for the t-th power usage data; for combining the characteristic values l t Pooling layer substituted into CNN model to reduce eigenvalue l t Is a dimension of (c).
Preferably, the input module is further used for calculating the output value f of the forgetting gate t
f t =σ(w f ·[l t-1 ,x t ]+b f )
Wherein f t The value range of (1, 0), w f Weight of forgetting gate b f Bias for forgetting the door; for calculating the output value i of the input gate t And candidate cell state
Figure BDA0004061090820000041
The following formula is shown:
i t =σ(w i ·[l t-1 ,x t ]+b i )
Figure BDA0004061090820000042
wherein i is t The value range is (0, 1), w i B is the weight of the input gate i For biasing the input gate, w k Weights for candidate input gates, b k Bias for candidate input gates; for updating to obtain the current cell state C t The following formula is shown:
Figure BDA0004061090820000043
wherein C is t The value range of (1) is (0); for calculating the output value O of the output gate t The following formula is shown:
O t =σ(w h ·[h t-1 ,x t ]+b h )
wherein O is t The value range of (1, 0), w h To output the weight of the gate, b h Offset for the output gate; output O for output gate by calculation t And the current cell state C t Obtaining the output value h of LSTM t The following formula is shown:
h t =O t *tanh(C t )。
a terminal comprising a processor and a storage medium; the method is characterized in that:
the storage medium is used for storing instructions;
the processor is used for operating according to the instruction to execute the steps of the power utilization short-time prediction method.
A computer readable storage medium having stored thereon a computer program, characterized in that the program when executed by a processor implements the steps of the power consumption short-term prediction method.
Compared with the prior art, the invention has the beneficial effects that the two categories are added on the traditional long-short-term memory artificial neural network to classify the power consumption of enterprises, the power consumption is divided into the daily power consumption for work and the holiday power consumption, and external influencing factors are introduced, such as: average stock price, net profit, total revenue and the like, carrying out weight distribution on an attention layer after model training of the neural network, and finally outputting a short-time prediction result; the method can generate more accurate results on short-time prediction results of the power data, is favorable for taking the data as a drive, and better manages and implements strategic deployment in combination with the conditions of enterprises.
Drawings
FIG. 1 is a flow chart of steps 1 to 3 of the present invention;
FIG. 2 is a flow chart of steps 2.1 to 2.2 of the present invention;
FIG. 3 is a flow chart of steps 3.1 to 3.5 of the present invention;
FIG. 4 is a schematic diagram of the structure models of the encoder and the decoder of the CNN-like structure according to the present invention;
fig. 5 is a schematic structural diagram of the power consumption short-time prediction system according to the present invention.
Detailed Description
The invention belongs to the technical field of data prediction, and particularly relates to a time sequence data prediction method.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. The embodiments described herein are merely some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art without making any inventive effort, are within the scope of the present invention.
The short-term prediction research of the power consumption of the enterprise can help the enterprise to conduct data analysis, analyze the specific situation of the enterprise and conduct planning adjustment at any time. According to the invention, two categories are added on the traditional long-short-term memory artificial neural network to classify the power consumption of enterprises into daily power consumption and holiday power consumption, and external influence factors are introduced, such as: average stock price, net profit, total revenue, etc., weight distribution is performed in the attention layer after model training of the neural network, and finally short-term prediction results are output.
As shown in FIG. 1, the method for predicting the electricity consumption in short time comprises the following steps:
step 1, acquiring a plurality of electricity consumption data of an enterprise, and classifying the data;
in a preferred but non-limiting embodiment of the present invention, the plurality of electricity consumption data X in the step 1 are represented by the following formula:
X=[x 1 ,x 2 ,…x t …,x n ]
x t =[P t ,h t ,…]
wherein x is t For the t-th power consumption data, P t H is the total power consumption of the power consumption as the t-th power consumption data t And n is the quantity of the electricity consumption data, and the value range of t is a positive integer from 1 to n.
In a preferred but non-limiting embodiment of the invention, x t May be the power consumption data of a certain day of an enterprise, and h t =0or 1, where 0 represents holiday and 1 represents workday.
In a preferred but non-limiting embodiment of the invention, x t The following formula is shown:
x t =[P t ,h t ,p t ,s t ,m t ,…]
wherein p is t For the t-th power consumption dataNet profit of the business on the day of the business, s t Average stock price, m, for the day enterprise to which the tth electricity consumption data belongs t And (5) collecting the total sum of the enterprises on the day of the t-th power consumption data.
For the electricity consumption of enterprises, the influence of holidays inside the enterprises causes the irregularity of the electricity consumption, and the influence of factors such as net profits, average stock price, total share and the like are outside, so that more accurate short-time electricity consumption prediction results can be obtained. For the electricity consumption of enterprises, the influence of holidays inside the enterprises causes the irregularity of the electricity consumption, and the influence of factors such as net profits, average stock price, total share and the like are outside, so that more accurate short-time electricity consumption prediction results can be obtained. Thus, the power consumption needs to be classified, and the power consumption is assumed to be p= [ P ] 1 ,P 2 ,…,P n ]。
Then, an h parameter, h= { 0or 1}, is set, the electricity consumption P is labeled with h, 1 represents a working day, 0 represents a holiday, and various external factors K such as total business income, net profit, average stock price, etc. are input.
Step 2, substituting the plurality of electricity consumption data into the CNN model;
in a preferred but non-limiting embodiment of the present invention, as shown in fig. 2, the step 2 specifically includes:
step 2.1, extracting characteristic values l of a plurality of power consumption data by using a convolution layer in the CNN model t
l t =tanh(x t *k t +b t )
Wherein tanh is an activation function, x t For the tth power consumption data as input vector, k t B is the weight of the convolution kernel for the t-th power consumption data t Bias for convolution kernel for the t-th power usage data;
specifically, the CNN model mainly includes a convolution layer and a pooling layer, where each convolution layer includes a multi-element convolution kernel. The power consumption data is subjected to feature extraction after passing through a convolution operation layer, and as the extracted feature dimension is very high, in order to solve the problem, a network for reducing training cost is provided, and a pooling layer is added after the convolution layer to reduce the feature dimension.
Therefore, step 2 of the present invention further comprises: step 2.2, the characteristic value l t Pooling layer substituted into CNN model to reduce eigenvalue l t Is a dimension of (c).
Step 3, all the characteristic values l are calculated t The LSTM model is entered in time order.
In a preferred but non-limiting embodiment of the present invention, as shown in fig. 3, the step 3 specifically includes:
step 3.1, calculating the output value f of the forgetting gate t
f t =σ(w f ·[l t-1 ,x t ]+b f )
Wherein f t The value range of (1, 0), w f Weight of forgetting gate b f Bias for forgetting the door;
specifically, step 3.1 is to use the characteristic value l as the output value of the previous time t-1 And the tth electricity consumption data x as an input value of the current time t Input to the forgetting gate, and obtain the output value of the forgetting gate through calculation.
Step 3.2, calculating the output value i of the input gate t And candidate cell state
Figure BDA0004061090820000081
The following formula is shown:
i t =σ(w i ·[l t-1 ,x t ]+b i )
Figure BDA0004061090820000082
wherein i is t The value range is (0, 1), w i B is the weight of the input gate i For biasing the input gate, w k Weights for candidate input gates, b k Bias for candidate input gates;
specifically, in step 3.2, the output value of the last time and the input value of the current time are input to the input gate, and the output value of the input gate and the candidate cell state are obtained after calculation.
Step 3.3, updating to obtain the current cell state C t The following formula is shown:
Figure BDA0004061090820000083
wherein C is t The value range of (1) is (0);
step 3.4, calculating the output value O of the output gate t The following formula is shown:
O t =σ(w h ·[h t-1 ,x t ]+b h )
wherein O is t The value range of (1, 0), w h To output the weight of the gate, b h Offset for the output gate;
step 3.5, by calculating the output O of the output gate t And the current cell state C t Obtaining the output value h of LSTM t The following formula is shown:
h t =O t *tanh(C t )。
table 1 below shows specific parameters of the CNN-LSTM model
TABLE 1
Figure BDA0004061090820000084
Figure BDA0004061090820000091
The relevant model parameters of the CNN are modified by parameter setting based on the characteristics of the electricity consumption, the reason for selecting the ReLu function of the activation function of the convolution layer is that the electricity consumption at peak time is maximum, and the extraction of the numerical value is maximum for the ReLu function of the activation function, but the electricity consumption at valley time is mainly represented in a form of more stable and less electricity consumption, so that the data can be extracted more completely by selecting the Sigmod activation function, and the accuracy of the extracted characteristics is ensured. The selection of the Batch-size is 128 in combination with the experiment in view of the size of the network structure, so that the accuracy and the speed of the experiment are ensured.
Inspired by a CNN model, the feature extraction is carried out on data by adopting an encoder and decoder structure model of the following CNN, firstly, input power consumption data into a convolution layer, and then, the maximum pooling is carried out, and the classification is carried out by using an Arcface due to the characteristics of the power consumption data. For this, we can acquire two kinds of data, namely peak-time electric quantity and valley-time electric quantity, and then apply two different activation functions to maximize pooling, the peak-time electric quantity is the maximum value, and the extraction of the numerical value is the maximum value for the activation function ReLu function, but for the valley-time electric quantity, the peak-time electric quantity is mainly represented in a form of relatively stable and less electric quantity, so that the Sigmod activation function is selected to extract the data more completely, and the accuracy of the extracted characteristics is ensured. The decoder is completed, namely the data needs to be returned to the original form, namely the operations of convolution and up-sampling, and the specific structure is shown in fig. 4.
As described above, for the external influence factor K, where k= (K) 1 ,K 2 ,...,K i ) The value of the ith external influence factor is K i The main principle of PCA is therefore employed in the present invention, which is to find an appropriate linear transformation to convert the relevant variables into new variables independent of each other, wherein the variables with larger variances can reflect the main information contained in the original plurality of variables.
The invention divides the electricity consumption model into two types of daily electricity consumption and holiday electricity consumption, the two types of electricity consumption are quite different, the electricity consumption is relatively small in change and relatively stable in holiday, and the electricity consumption is relatively large in change and fluctuation and unstable in working days. The biggest advantage of ridge regression is its stability and robustness to small changes in model inputs, thus enabling the electricity usage of holidays to be largely preserved intact. In contrast, LASSO regression can completely exclude unexpected predictors by reducing its parameters to zero, so the LASSO regression model is suitable for work day power prediction.
The formula is thus as follows:
f(k)=w 1 k 1 +w 2 k 2 +…+w n k n
wherein w= (w) 1 ,w 2 ,…,w n ) The loss function is defined as:
Figure BDA0004061090820000101
loss 2 (w)=||f(k)-y (1) || 21 ||w|| 1
wherein y is (0) Representing the actual electricity consumption of holidays, y (1) Representing the actual power consumption of the working day by solving loss 1 (w),loss 2 And (w) obtaining final main external influence factors, and respectively inputting the final main external influence factors into the CNN-LSTM model for training to obtain a prediction result.
As described above, for the external influence factor K, where k= (K) 1 ,K 2 ,...,K i ) The value of the ith external influence factor is K i The main principle of PCA is therefore employed in the present invention, which is to find an appropriate linear transformation to convert the relevant variables into new variables independent of each other, wherein the variables with larger variances can reflect the main information contained in the original plurality of variables.
As described above, for the external influence factor K, where k= (K) 1 ,K 2 ,...,K i ) The value of the ith external influence factor is K i The invention thus employs PCA whose main principle is to find the appropriate linear transformation to convert the relevant variables into new independent variables, where the variable with larger variance can reflect the original multipleThe primary information contained in the individual variables.
The invention classifies the input data of the electricity consumption model, because the actual condition of the electricity consumption can generate high and low electricity consumption periods in the corresponding time periods, but only if the input data are classified in this way, out-of-range data can be generated. Considering the Arcface method to divide the power consumption into two types, it can be found that for Arcface he can maintain compactness within the class, highlighting the differences between classes. The period with high electricity consumption is called as peak electricity consumption period, the period with low electricity consumption is called as valley electricity consumption period, the valley electricity consumption is input into the CNN model, the peak electricity consumption is greatly changed, PCA principal component correlation analysis is carried out on the correlation factors and the peak electricity consumption according to the factors, then an elastic net regularization method is added to correct the correlation data, and the elastic net allows a sparse model with less zero weight than lasso to be learned, and meanwhile, the stability of ridge regression is maintained.
The formula for the ArcFace function is thus as follows:
Figure BDA0004061090820000111
wherein target logic is
Figure BDA0004061090820000112
The prediction type in the full-connection layer output matrix is the output of the real type, the real type is the peak power consumption, and the non-real type is the valley power consumption.
For the peak power consumption, the related formula is as follows
f(k)=w 1 k 1 +w 2 k 2 +…+w n k n
Wherein w= (w) 1 ,w 2 ,…,w n ) The loss function is defined as:
Figure BDA0004061090820000113
wherein y is (1) The actual electricity consumption of the working day is represented, the final main external influence factors are obtained by solving loss (w), and the final main external influence factors are respectively input into a CNN-LSTM model for training to obtain a prediction result. The pseudo code of the corresponding ArcFace function is shown in table 2:
TABLE 2
Figure BDA0004061090820000114
Figure BDA0004061090820000121
According to the ArcFace method, the electricity consumption data is used as x to be input, and by finding the optimal super parameter m, n=2, the group-Truth ID is the label of the electricity consumption peak time and the valley time which are manually marked and distinguished for the electricity consumption data before, the electricity consumption at the valley time with weight value of 0 can be output through training of the ArcFace function, and the two types of electricity consumption at the peak time of 1 are classified, judged and input to the next level.
The method has the advantages that the super-parameter acquisition of the margin is obtained through an ablation experiment, the ablation experiment is carried out by keeping parameters except the margin parameters and adjusting the margin values, and the experiment of selecting a plurality of margin values of 0.5,0.55,1.0,1.25,1.5,5, 10 and the like proves that the margin parameters of 1.25 are more effective and accurate.
According to the method, an interpolation method is used for solving the optimal solution of the collected power data, and the best effect is obtained when the margin super parameter is 1.25 through parameter adjustment experiments.
As shown in fig. 5, a short-term electricity consumption prediction system according to the present invention includes:
the system comprises an acquisition module, a classification module and a storage module, wherein the acquisition module is used for acquiring a plurality of power consumption data of an enterprise and classifying the power consumption data;
in a preferred but non-limiting embodiment of the present invention, the plurality of electricity consumption data X are represented by the following formula:
X=[x 1 ,x 2 ,…x t …,x n ]
x t =[P t ,h t ,…]
wherein x is t For the t-th power consumption data, P t H is the total power consumption of the power consumption as the t-th power consumption data t And n is the quantity of the electricity consumption data, and the value range of t is a positive integer from 1 to n.
In a preferred but non-limiting embodiment of the invention, x t May be the power consumption data of a certain day of an enterprise, and h t =0or 1, where 0 represents holiday and 1 represents workday.
In a preferred but non-limiting embodiment of the invention, x t The following formula is shown:
x t =[P t ,h t ,p t ,s t ,m t ,…]
wherein p is t Net profit for the day enterprise to which the tth electricity usage data pertains, s t Average stock price, m, for the day enterprise to which the tth electricity consumption data belongs t And (5) collecting the total sum of the enterprises on the day of the t-th power consumption data.
The substituting module is used for substituting the plurality of electricity consumption data into the CNN model;
in a preferred but non-limiting embodiment of the present invention, the substitution module is further configured to extract a plurality of characteristic values l of the electricity consumption data by using a convolution layer in the CNN model t
l t =tanh(x t *k t +b t )
Wherein tanh is an activation function, x t For the tth power consumption data as input vector, k t B is the weight of the convolution kernel for the t-th power consumption data t Bias for convolution kernel for the t-th power usage data; for incorporating characteristic valuesl t Pooling layer substituted into CNN model to reduce eigenvalue l t Is a dimension of (c).
An input module for inputting all characteristic values l t The LSTM model is entered in time order.
In a preferred but non-limiting embodiment of the invention, the input module is further adapted to calculate the output value f of the forgetting gate t
f t =σ(w f ·[l t-1 ,x t ]+b f )
Wherein f t The value range of (1, 0), w f Weight of forgetting gate b f Bias for forgetting the door; for calculating the output value i of the input gate t And candidate cell state
Figure BDA0004061090820000131
The following formula is shown:
i t =σ(w i ·[l t-1 ,x t ]+b i )
Figure BDA0004061090820000132
wherein i is t The value range is (0, 1), w i B is the weight of the input gate i For biasing the input gate, w k Weights for candidate input gates, b k Bias for candidate input gates; for updating to obtain the current cell state C t The following formula is shown:
Figure BDA0004061090820000133
wherein C is t The value range of (1) is (0); for calculating the output value O of the output gate t The following formula is shown:
O t =σ(w h ·[h t-1 ,x t ]+b h )
wherein O is t The range of the values is as follows(0,1),w h To output the weight of the gate, b h Offset for the output gate; output O for output gate by calculation t And the current cell state C t Obtaining the output value h of LSTM t The following formula is shown:
h t =O t *tanh(C t )。
a terminal comprising a processor and a storage medium; the method is characterized in that:
the storage medium is used for storing instructions;
the processor is used for operating according to the instruction to execute the steps of the power utilization short-time prediction method.
A computer readable storage medium having stored thereon a computer program, characterized in that the program when executed by a processor implements the steps of the power consumption short-term prediction method.
Compared with the prior art, the invention has the beneficial effects that the two categories are added on the traditional long-short-term memory artificial neural network to classify the power consumption of enterprises, the power consumption is divided into the daily power consumption for work and the holiday power consumption, and external influencing factors are introduced, such as: average stock price, net profit, total revenue and the like, carrying out weight distribution on an attention layer after model training of the neural network, and finally outputting a short-time prediction result; the method can generate more accurate results on short-time prediction results of the power data, is favorable for taking the data as a drive, and better manages and implements strategic deployment in combination with the conditions of enterprises.
The present disclosure may be a system, method, and/or computer program product. The computer program product may include a computer readable storage medium having computer readable program instructions embodied thereon for causing a processor to implement aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: portable computer disks, hard disks, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static Random Access Memory (SRAM), portable compact disk read-only memory (CD-ROM), digital Versatile Disks (DVD), memory sticks, floppy disks, mechanical coding devices, punch cards or in-groove structures such as punch cards or grooves having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media, as used herein, are not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., optical pulses through fiber optic cables), or electrical signals transmitted through wires.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
Computer program instructions for performing the operations of the present disclosure can be assembly instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, c++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present disclosure are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with state information of computer readable program instructions, which can execute the computer readable program instructions.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Finally, it should be noted that the above embodiments are only for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the above embodiments, it should be understood by those skilled in the art that: modifications and equivalents may be made to the specific embodiments of the invention without departing from the spirit and scope of the invention, which is intended to be covered by the claims.

Claims (14)

1. The short-time electricity consumption prediction method is characterized by comprising the following steps of:
step 1, acquiring a plurality of electricity consumption data of an enterprise, and classifying the data;
step 2, substituting the plurality of electricity consumption data into the CNN model;
step 3, all the featuresSign value l t The LSTM model is entered in time order.
2. The short-term electricity consumption prediction method according to claim 1, wherein the plurality of electricity consumption data X in step 1 are represented by the following formula:
X=[x 1 ,x 2 ,...x t ...,x n ]
x t =[P t ,h t ,...]
wherein x is t For the t-th power consumption data, P t H is the total power consumption of the power consumption as the t-th power consumption data t And n is the quantity of the electricity consumption data, and the value range of t is a positive integer from 1 to n.
3. The short-term electricity consumption prediction method according to claim 2, wherein h t =0or 1, wherein 0 represents holiday and 1 represents workday.
4. The power consumption short-term prediction method according to claim 2, wherein x is t The following formula is shown:
x t =[P t ,h t ,p t ,s t ,m t ,...]
wherein p is t Net profit for the day enterprise to which the tth electricity usage data pertains, s t Average stock price, m, for the day enterprise to which the tth electricity consumption data belongs t And (5) collecting the total sum of the enterprises on the day of the t-th power consumption data.
5. The method for short-term prediction of electricity consumption according to claim 1, wherein the step 2 specifically comprises:
step 2.1, extracting characteristic values l of a plurality of power consumption data by using a convolution layer in the CNN model t
l t =tanh(x t *k t +b t )
Wherein tanh is an activation function, x t For the tth power consumption data as input vector, k t B is the weight of the convolution kernel for the t-th power consumption data t Bias for convolution kernel for the t-th power usage data;
step 2.2, the characteristic value l t Pooling layer substituted into CNN model to reduce eigenvalue l t Is a dimension of (c).
6. The method for short-term prediction of electricity consumption according to claim 1, wherein the step 3 specifically comprises:
step 3.1, calculating the output value f of the forgetting gate t
f t =σ(w f ·[l t-1 ,x t ]+b f )
Wherein f t The value range of (1, 0), w f Weight of forgetting gate b f Bias for forgetting the door;
step 3.2, calculating the output value i of the input gate t And candidate cell state
Figure FDA0004061090810000023
The following formula is shown:
i t =σ(w i ·[l t-1 ,x t ]+b i )
Figure FDA0004061090810000021
wherein i is t The value range is (0, 1), w i B is the weight of the input gate i For biasing the input gate, w k Weights for candidate input gates, b k Bias for candidate input gates;
step 3.3, updating to obtain the current cell state C t The following formula is shown:
Figure FDA0004061090810000022
wherein C is t The value range of (1) is (0);
step 3.4, calculating the output value O of the output gate t The following formula is shown:
O t =σ(W h ·[h t-1 ,x t ]+b h )
wherein O is t The value range of (1, 0), w h To output the weight of the gate, b h Offset for the output gate;
step 3.5, by calculating the output O of the output gate t And the current cell state C t Obtaining the output value h of LSTM t The following formula is shown:
h t =O t *tanh(C t )。
7. a short-term electricity consumption prediction system, comprising:
the system comprises an acquisition module, a classification module and a storage module, wherein the acquisition module is used for acquiring a plurality of power consumption data of an enterprise and classifying the power consumption data;
the substituting module is used for substituting the plurality of electricity consumption data into the CNN model;
an input module for inputting all characteristic values l t The LSTM model is entered in time order.
8. The short-term electricity consumption prediction system according to claim 7, wherein the plurality of electricity consumption data X are represented by the following formula:
X=[x 1 ,x 2 ,...x t ...,x n ]
x t =[P t ,h t ,...]
wherein x is t For the t-th power consumption data, P t H is the total power consumption of the power consumption as the t-th power consumption data t And n is the quantity of the electricity consumption data, and the value range of t is a positive integer from 1 to n.
9. The short-term electricity prediction system according to claim 8, wherein h t =0or 1, wherein 0 represents holiday and 1 represents workday.
10. The short-term power prediction system according to claim 8, wherein x is t The following formula is shown:
x t =[P t ,h t ,p t ,s t ,m t ,...]
wherein p is t Net profit for the day enterprise to which the tth electricity usage data pertains, s t Average stock price, m, for the day enterprise to which the tth electricity consumption data belongs t And (5) collecting the total sum of the enterprises on the day of the t-th power consumption data.
11. The short-term electricity consumption prediction system according to claim 7, wherein the substitution module is further configured to extract the characteristic values l of the plurality of electricity consumption data by using a convolution layer in the CNN model t
l t =tanh(x t *k t +b t )
Wherein tanh is an activation function, x t For the tth power consumption data as input vector, k t B is the weight of the convolution kernel for the t-th power consumption data t Bias for convolution kernel for the t-th power usage data; for combining the characteristic values l t Pooling layer substituted into CNN model to reduce eigenvalue l t Is a dimension of (c).
12. The short-term power prediction system according to claim 7, wherein the input module is further configured to calculate an output value f of the forgetting gate t
f t =σ(w f ·[l t-1 ,x t ]+b f )
Wherein f t The value range of (1, 0), w f Weight of forgetting gate b f Bias for forgetting the door; for calculating the output value i of the input gate t And candidate cell state
Figure FDA0004061090810000031
The following formula is shown:
i t =σ(w i ·[l t-1 ,x t ]+b i )
Figure FDA0004061090810000032
wherein i is t The value range is (0, 1), w i B is the weight of the input gate i For biasing the input gate, w k Weights for candidate input gates, b k Bias for candidate input gates; for updating to obtain the current cell state C t The following formula is shown:
Figure FDA0004061090810000033
wherein C is t The value range of (1) is (0); for calculating the output value O of the output gate t The following formula is shown:
O t =σ(w h ·[h t-1 ,x t ]+b h )
wherein O is t The value range of (1, 0), w h To output the weight of the gate, b h Offset for the output gate; output O for output gate by calculation t And the current cell state C t Obtaining the output value h of LSTM t The following formula is shown:
h t =O t *tanh(C t )。
13. a terminal comprising a processor and a storage medium; the method is characterized in that:
the storage medium is used for storing instructions;
the processor being operative according to the instructions to perform the steps of the method as claimed in any one of claims l-6.
14. Computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the steps of the method according to any of claims 1-6.
CN202310060036.8A 2023-01-19 2023-01-19 Short-time electricity consumption prediction method and system Pending CN116090637A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310060036.8A CN116090637A (en) 2023-01-19 2023-01-19 Short-time electricity consumption prediction method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310060036.8A CN116090637A (en) 2023-01-19 2023-01-19 Short-time electricity consumption prediction method and system

Publications (1)

Publication Number Publication Date
CN116090637A true CN116090637A (en) 2023-05-09

Family

ID=86213587

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310060036.8A Pending CN116090637A (en) 2023-01-19 2023-01-19 Short-time electricity consumption prediction method and system

Country Status (1)

Country Link
CN (1) CN116090637A (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108830487A (en) * 2018-06-21 2018-11-16 王芊霖 Methods of electric load forecasting based on long neural network in short-term
CN109886444A (en) * 2018-12-03 2019-06-14 深圳市北斗智能科技有限公司 A kind of traffic passenger flow forecasting, device, equipment and storage medium in short-term
AU2020101900A4 (en) * 2020-08-21 2020-11-05 Qinghu Rising Sunshine Data Technology (Beijing) Co., Ltd. A method, device and equipment for detecting abnormal electric meter
CN112241802A (en) * 2019-07-18 2021-01-19 内蒙古电力(集团)有限责任公司内蒙古电力科学研究院分公司 Interval prediction method for wind power
KR20210023388A (en) * 2019-08-23 2021-03-04 주식회사 화성 Photo-voltiac prediction system based on machine learning
CN112990556A (en) * 2021-02-24 2021-06-18 江苏大学 User power consumption prediction method based on Prophet-LSTM model
CN113516271A (en) * 2021-04-05 2021-10-19 东北电力大学 Wind power cluster power day-ahead prediction method based on space-time neural network
KR20210131160A (en) * 2020-04-23 2021-11-02 한국전력공사 Apparatus and method for predicting electric power demand based on deep learning model
CN114169639A (en) * 2021-12-23 2022-03-11 重庆工商大学 Enterprise power consumption prediction method
CN114595874A (en) * 2022-02-24 2022-06-07 武汉大学 Ultra-short-term power load prediction method based on dynamic neural network
CN114692947A (en) * 2022-02-28 2022-07-01 江苏大学 VMD-Lasso-CNN-LSTM-based user electricity consumption prediction method
KR20220096406A (en) * 2020-12-31 2022-07-07 계명대학교 산학협력단 Method for forecasting electric power demand using convolutional neural network, recording medium and device for performing the method
CN115169703A (en) * 2022-07-12 2022-10-11 广东电网有限责任公司广州供电局 Short-term power load prediction method based on long-term and short-term memory network combination

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108830487A (en) * 2018-06-21 2018-11-16 王芊霖 Methods of electric load forecasting based on long neural network in short-term
CN109886444A (en) * 2018-12-03 2019-06-14 深圳市北斗智能科技有限公司 A kind of traffic passenger flow forecasting, device, equipment and storage medium in short-term
CN112241802A (en) * 2019-07-18 2021-01-19 内蒙古电力(集团)有限责任公司内蒙古电力科学研究院分公司 Interval prediction method for wind power
KR20210023388A (en) * 2019-08-23 2021-03-04 주식회사 화성 Photo-voltiac prediction system based on machine learning
KR20210131160A (en) * 2020-04-23 2021-11-02 한국전력공사 Apparatus and method for predicting electric power demand based on deep learning model
AU2020101900A4 (en) * 2020-08-21 2020-11-05 Qinghu Rising Sunshine Data Technology (Beijing) Co., Ltd. A method, device and equipment for detecting abnormal electric meter
KR20220096406A (en) * 2020-12-31 2022-07-07 계명대학교 산학협력단 Method for forecasting electric power demand using convolutional neural network, recording medium and device for performing the method
CN112990556A (en) * 2021-02-24 2021-06-18 江苏大学 User power consumption prediction method based on Prophet-LSTM model
CN113516271A (en) * 2021-04-05 2021-10-19 东北电力大学 Wind power cluster power day-ahead prediction method based on space-time neural network
CN114169639A (en) * 2021-12-23 2022-03-11 重庆工商大学 Enterprise power consumption prediction method
CN114595874A (en) * 2022-02-24 2022-06-07 武汉大学 Ultra-short-term power load prediction method based on dynamic neural network
CN114692947A (en) * 2022-02-28 2022-07-01 江苏大学 VMD-Lasso-CNN-LSTM-based user electricity consumption prediction method
CN115169703A (en) * 2022-07-12 2022-10-11 广东电网有限责任公司广州供电局 Short-term power load prediction method based on long-term and short-term memory network combination

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
明悦: "多源视觉信息感知与识别", 31 August 2020, 北京:北京邮电大学出版社, pages: 126 - 127 *

Similar Documents

Publication Publication Date Title
Chou et al. Forward forecast of stock price using sliding-window metaheuristic-optimized machine-learning regression
US11586919B2 (en) Task-oriented machine learning and a configurable tool thereof on a computing environment
Moniz et al. Smoteboost for regression: Improving the prediction of extreme values
Cerqueira et al. Vest: Automatic feature engineering for forecasting
Ying et al. Prediction model of dow jones index based on lstm-adaboost
Akşehir et al. How to handle data imbalance and feature selection problems in CNN-based stock price forecasting
Thangamayan et al. Stock price prediction using hybrid deep learning technique for accurate performance
CN110738363A (en) photovoltaic power generation power prediction model and construction method and application thereof
Ahmed et al. Enhancing stock portfolios for enterprise management and investment in energy industry
Singhania et al. Forecasting the United States unemployment rate by using recurrent neural networks with Google Trends data
Al-Thelaya et al. Forecasting of bahrain stock market with deep learning: Methodology and case study
Co et al. Comparison between ARIMA and LSTM-RNN for VN-index prediction
Dhanalakshmi et al. A Logical Investigation of Stock Market Prediction and Analysis using Supervised Machine Learning Algorithm
Raipitam et al. Comparative Study on Stock Market Prediction using Generic CNN-LSTM and Ensemble Learning
CN116090637A (en) Short-time electricity consumption prediction method and system
Sun et al. Short-term stock price forecasting based on an svd-lstm model
CN111340632A (en) Resource control method and device
Chu et al. Boosting
Supriyanto Comparison of Grid Search and Evolutionary Parameter Optimization with Neural Networks on JCI Stock Price Movements during the Covid 19
Khanpara et al. Stock Trend Prediction: A Comparative Study using Different Approaches
Zhang et al. Boosting portfolio choice in the big data era
Lu et al. Technology Stock Forecasting Based on Hybrid Model and Data Migration
Vispute et al. Predicting Stock Prices using Machine Learning Techniques: An Analysis of Historical Market Data
Jarrah Time Series Prediction Analysis of Long Short Term Memory Models
Sizykh et al. Forecasting Ability of Hybrid Methods on an Example of Stock Prices Forecast using ARIMA/LTSM

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination