Electricity consumption prediction method and system based on influence factors
By clustering and using neural networks to predict the influencing factors of provincial power grids in the new power system, the problem of accuracy in load-side electricity consumption forecasting has been solved, enabling accurate prediction and risk identification of future electricity consumption plans.
Patent Information
- Application Number
- CN202411033145.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-11-15
AI Technical Summary
Existing technologies struggle to accurately predict the influencing factors of electricity consumption on the load side of provincial power grids in new power systems, and there is a lack of effective methods for regulating electricity consumption on the load side.
By collecting raw data related to electricity consumption, calculating the vector of influencing factors, and using the K-Means clustering algorithm for clustering, the dataset is constructed and input into a neural network model for prediction.
It enables accurate prediction of future electricity consumption plans, can capture abnormal electricity consumption scenarios and discover potential electricity consumption risks, and provides a reference for improving electricity consumption rules.
Smart Images

Figure CN118970909A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power systems, and more specifically, to a method and system for predicting power consumption based on influencing factors. Background Art
[0002] The new power system is a power system with ensuring energy and power security as its basic premise, meeting the power demand of economic and social development as its primary goal, maximizing the consumption of new energy as its main task, a strong smart grid as its hub platform, and source-grid-load-storage interaction and multi-energy complementarity as its support. It has the basic characteristics of being clean and low-carbon, safe and controllable, flexible and efficient, intelligent and friendly, and open and interactive.
[0003] The development of renewable energy such as wind power and photovoltaic power is an important way to achieve the low-carbon transformation of the power system. With the continuous construction of new power systems, the scale of new energy installed capacity continues to rise, and its intermittent and instability exacerbates the volatility of the power grid. The new power system still faces many major challenges. First, the grid load forecast and the development of renewable energy lead to uncertainty in the economic parameters of the power grid. The technical application and technical improvement on the power supply side, the grid side, and the load side also lead to uncertainties in the technical parameters of the power grid. The grid connection of new energy has put forward higher requirements on the flexible adjustment mode of the power system, equipment capacity redundancy, fault recovery capability, and power balance in different regions and different time periods.
[0004] In addition, complex and variable multi-loads are an important part of the new power system, so load forecasting is of great significance for the planning, operation, control and dispatching of the new power system. Although there are various prediction methods for the power consumption trend on the load side of the power grid in the prior art, these prediction methods are difficult to effectively connect with the regulation method of the power consumption on the load side, and implement reasonable regulation of the power consumption on the load side according to the prediction. In addition, for the new power system, the prior art also lacks an accurate prediction method for the power consumption on the load side for the influencing factors of the provincial power grid.
[0005] In view of the above problems, a new electricity consumption forecasting method and system based on influencing factors is urgently needed. Summary of the invention
[0006] In order to solve the deficiencies in the prior art, the present invention provides a method and system for predicting electricity consumption based on influencing factors. By clustering the influencing factors in different time periods, typical electricity consumption data is obtained as the basis for deep learning, and the optimal electricity consumption plan is predicted.
[0007] The present invention adopts the following technical solution.
[0008] The first aspect of the present invention relates to a method for predicting electricity consumption based on influencing factors, the method comprising the following steps: collecting original data related to electricity consumption, and calculating the influencing factor vectors under different electricity consumption time periods based on the original data; clustering the influencing factor vectors using the K-Means clustering algorithm to obtain the optimal clustering result; constructing a data set based on the optimal clustering result, and inputting the data set into a pre-constructed neural network model for electricity consumption prediction to obtain the optimal electricity consumption plan for the future time period.
[0009] Preferably, original data related to electricity consumption are collected, and the influencing factor vectors in different electricity consumption periods are calculated based on the original data, including: the original data related to electricity consumption include system load, external transmission power, new energy output, daily rolling electricity price, and day-ahead electricity price in the provincial power market; the influencing factor vector includes multi-dimensional data, and the multi-dimensional data are net load, new energy output, proportion of new energy output, thermal power output, supply-demand ratio, daily rolling electricity price and day-ahead electricity price.
[0010] Preferably, the K-Means clustering algorithm is used to cluster the influencing factor vector to obtain the optimal clustering result, including: calculating the correlation between the prediction target and other dimensional data in the influencing factor vector, and sorting the other dimensional data based on the correlation; extracting key influencing factors from the influencing factor vector based on the sorting result, and constructing a key influencing factor vector; taking multiple key influencing factor vectors under different power consumption periods as input samples, and using the K-means clustering method to classify the input samples to obtain multiple clusters; calculating the aggregation characteristics of each cluster in the multiple clusters, and sorting the multiple clusters according to the aggregation characteristics, and extracting the cluster with priority in sorting as the optimal clustering result.
[0011] Preferably, the aggregation feature of each cluster in the multiple clusters is calculated, and the multiple clusters are sorted according to the aggregation feature, including: randomly selecting a current sample from the current cluster and calculating the aggregation feature of the current sample; traversing the aggregation feature of each current sample in the current cluster, averaging the aggregation feature of each current sample in the current cluster, and obtaining the average aggregation feature of the current cluster; solving the average aggregation feature of each cluster, and sorting the multiple clusters using the average aggregation feature.
[0012] Preferably, a current sample is randomly selected from the current cluster, and the aggregation feature of the current sample is calculated, including: randomly selecting a current sample from the current cluster, calculating the distance between all other samples in the current cluster and the current sample to obtain a first average distance S1 between the current sample and all other samples in the current cluster; for each other cluster excluding the current cluster in multiple clusters, calculating the average distance between the current sample and all samples in each other cluster, comparing the size of the average distance of each other cluster, and recording the smallest average distance as the second average distance S2; if the first average distance is equal to the second average distance, the aggregation feature is defined as 0, and if the first average distance is greater than the second average distance, the aggregation feature is If the first average distance is less than the second average distance, the aggregation feature is
[0013] Preferably, constructing a data set based on the optimal clustering result includes: constructing a data set using each sample in one or more clusters in the optimal clustering result as a piece of data; each piece of data includes the extended influencing factors under the power consumption period, the extended influencing factors under the previous power consumption period, and the extended influencing factors under the next power consumption period.
[0014] Preferably, the data set is input into a pre-constructed neural network model for electricity consumption prediction to obtain the optimal electricity consumption plan for the future period, including: based on the predicted demand, selecting an influencing factor from all influencing factors of the data set as the prediction target; inputting the data set into a neural network that introduces a self-attention mechanism to obtain a prediction result of the prediction target.
[0015] The second aspect of the present invention relates to an electricity consumption prediction system based on influencing factors using the method in the first aspect of the present invention, a collection module, a clustering module and a prediction module, wherein the collection module is used to collect original data related to electricity consumption, and calculate the influencing factor vectors under different electricity consumption time periods based on the original data; the clustering module is used to cluster the influencing factor vectors using the K-Means clustering algorithm to obtain the optimal clustering result; the prediction module is used to construct a data set based on the optimal clustering result, and input the data set into a pre-constructed neural network model for electricity consumption prediction to obtain the optimal electricity consumption plan for the future time period.
[0016] A third aspect of the present invention relates to a terminal, comprising a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute the steps of the method in the first aspect of the present invention.
[0017] A fourth aspect of the present invention relates to a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method in the first aspect of the present invention.
[0018] The beneficial effect of the present invention is that, compared with the prior art, the power consumption prediction method and system based on influencing factors in the present invention clusters the influencing factors in different time periods, obtains typical power consumption data as the basis for deep learning, and implements the prediction of the optimal power consumption plan. The prediction results of the present invention are accurate, can effectively capture abnormal power consumption scenarios, discover potential power consumption risks, and provide a reference for improving power consumption rules.
[0019] The beneficial effects of the present invention also include:
[0020] 1. The present invention obtains the clustering type and aggregation characteristics of the influencing factor vector by flexibly applying the K-means clustering algorithm, reasonably calculates the potential characteristics of the influencing factor vector in its clustering type through a variety of different methods, and provides key prediction basis for the prediction process of the neural network model.
[0021] 2. In the process of implementing the K-means clustering algorithm, on the one hand, the clustering speed is improved by simplifying the number of influencing factors used in clustering, and on the other hand, it ensures that the clustering results fully cover the different types of influencing factor vectors, so that the optimal clustering results can fully obtain the different characteristics and different types of influencing factor vectors, while excluding the influencing factor vectors with ambiguous types in advance, ensuring the clarity of the neural network prediction instructions.
[0022] 3. The neural network model obtains sufficient prediction basis through various methods, such as K-means clustering process parameters, division of time period characteristics, expansion of influencing factors of adjacent time periods, etc., and fully considers multiple dimensions such as time dimension, electricity consumption dimension, random combination of influencing factors, etc., to ensure that the neural network prediction process comprehensively considers the actual electricity consumption scenario and improves the accuracy of the prediction results. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A schematic diagram of a flow chart of a method for predicting electricity consumption based on influencing factors of the present invention;
[0024] Figure 2 It is a prediction effect diagram when the optimal clustering result is not screened and the time period type label is added in the power consumption prediction method based on influencing factors of the present invention;
[0025] Figure 3 This is a prediction effect diagram of a power consumption prediction method based on influencing factors of the present invention when the optimal clustering result is not screened;
[0026] Figure 4 A prediction effect diagram of a method for predicting electricity consumption based on influencing factors according to the present invention when clustering is performed based on time period types;
[0027] Figure 5This is a prediction effect diagram of a power consumption prediction method based on influencing factors of the present invention when clustering is not implemented;
[0028] Figure 6 This is a prediction effect diagram of a power consumption prediction method based on influencing factors of the present invention. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The embodiments described in the present invention are only embodiments of a part of the present invention, not all embodiments. Based on the spirit of the present invention, all other embodiments not recorded in the present invention obtained by ordinary technicians in this field according to the embodiments recorded in the present invention without making creative work should belong to the protection scope of the present invention.
[0030] Figure 1 The first aspect of the present invention relates to a method for predicting electricity consumption based on influencing factors, and the method includes steps 1 to 3.
[0031] Step 1: Collect raw data related to electricity consumption, and calculate the influencing factor vectors under different electricity consumption periods based on the raw data.
[0032] Preferably, original data related to electricity consumption are collected, and the influencing factor vectors in different electricity consumption periods are calculated based on the original data, including: the original data related to electricity consumption include system load, external transmission power, new energy output, daily rolling electricity price, and day-ahead electricity price in the provincial power market.
[0033] The data collected in the present invention are derived from the control center of the provincial power grid or the power data platform related to the provincial power market. The system load is the total load in the province, and the external power is the total amount of power transmitted from one region to other regions. The region here can be a provincial power grid. The new energy output is the power generation implemented by all photovoltaic, wind power and other new energy sources in the province. In one embodiment, the daily rolling electricity price on D day is obtained based on the electricity price and electricity volume bought and sold by market participants in the power market when participating in medium- and long-term time-sharing transactions from D-4 to D-2. The day-ahead electricity price is the day-ahead market's forecast of the electricity price for the next day. In the current power market, the day-ahead electricity price can provide practical guidance for the equipment operation and energy dispatching of the power grid according to the forecast situation. Therefore, accurate prediction of factors such as the day-ahead electricity price can effectively promote the accurate dispatching and system stability of the power system.
[0034] The present invention calculates part of the above raw data to obtain influencing factors that are more conducive to electricity consumption analysis. Preferably, the influencing factor vector includes multi-dimensional data, and the multi-dimensional data is net load, new energy output, new energy output ratio, thermal power output, supply-demand ratio, daily rolling electricity price and day-ahead electricity price.
[0035] The net load is the load after deducting the output of new energy from the total provincial power load. The output ratio of new energy is the proportion of the output of new energy in the total load of the provincial power system. The supply-demand ratio is related to the power supply and power purchase demand. In one embodiment, it is obtained according to the bidding process of the power purchaser and the power supplier in the power market. In another embodiment, it is obtained according to the power consumption on the demand side of the power system and the actual power generation on the power generation side. That is, this parameter can effectively analyze the transmission loss of the power grid. In addition, the daily rolling electricity price and the day-ahead electricity price can use the original data.
[0036] The present invention supports the use of more influencing factors and constructs an initial influencing factor vector S(t)=
[0037] [s 1t ,s 2t ,s 3t …s nt ],s 1t ,s 2t ,s 3t …s nt They are the multiple influencing factors mentioned above. The influencing factor vector is used to analyze the power consumption status in different time periods. Therefore, an influencing factor vector is a combination of the values of all influencing factors in the same time period t.
[0038] After constructing the influencing factor vector, the time period type corresponding to each vector is used as the label lab, and the label is added as a new dimension of the influencing factor vector. At this time, the vector is S(t)=[s 1t ,s 2t ,s 3t …s nt , lab]. In one embodiment, the time period types are weekdays and weekends.
[0039] In the present invention, before clustering the influencing factor vector, the original influencing factor vector needs to be preprocessed, which includes calculating the correlation between the influencing factor and the prediction target, normalizing the data, etc. In the subsequent content of the present invention, the process of screening the prediction target from all influencing factors is involved. Therefore, in order to extract effective features from the influencing factors, the influencing factor vector is converted according to the correlation between the prediction target and other influencing factors.
[0040] In one embodiment, for the selected prediction target s 1t, since multiple prediction target values are obtained in different time periods, the expectation and variance of the prediction target can be calculated. Similarly, for a certain influencing factor to be calculated, its expectation and variance can also be calculated. In the current time period, the Pearson correlation coefficient of the time period is calculated, and the correlation coefficient of the influencing factor in the time period can be obtained. At this time, the correlation coefficient can be used to replace the value of the influencing factor in the influencing factor vector in the current time period. Using this method, the correlation coefficients of all influencing factors in each time period are obtained, thereby updating the influencing factor vector In another embodiment, the calculated correlation coefficient may be used as a parameter for the self-attention mechanism.
[0041] By expanding the content of the data set in the above way, it is possible to capture the characteristics of different influencing factors and improve the accuracy of the prediction results.
[0042] Step 2: Use the K-Means clustering algorithm to cluster the influencing factor vectors to obtain the optimal clustering result.
[0043] After obtaining the influencing factor vector, multiple influencing factor vectors under different power consumption periods are extracted, each vector is a sample, and multiple samples are classified to obtain multiple influencing factor types.
[0044] Preferably, the correlation between the predicted target and other dimensional data in the influencing factor vector is calculated, and the other dimensional data is sorted based on the correlation; based on the sorting result, the key influencing factors are extracted from the influencing factor vector, and the key influencing factor vector is constructed; multiple key influencing factor vectors under different power consumption periods are used as input samples, and the input samples are classified using the K-means clustering method to obtain multiple clusters; the aggregation characteristics of each cluster in the multiple clusters are calculated, and the multiple clusters are sorted according to the aggregation characteristics, and the cluster with priority in sorting is extracted as the optimal clustering result.
[0045] In the present invention, since the day-ahead electricity price is used as the prediction target, the prediction result is the optimal day-ahead electricity price. In actual application, other influencing factors can also be selected as prediction targets. For example, when the output of new energy is the prediction target, a reasonable output of new energy can be predicted, thereby pre-adjusting the output of new energy in the power grid.
[0046] Calculating the correlation can determine whether there is a correlation between other influencing factors and the prediction target. Since each influencing factor is based on the sequence data of the time dimension, the correlation of each influencing factor under the time dimension can be calculated. The present invention supports a variety of methods in the prior art to obtain the degree of association between two different influencing factors, that is, the correlation.
[0047] By sorting the relevance of each other dimension data, the correlation degree between the other dimension data and the prediction target can be obtained. The higher the correlation degree, the higher the ranking. In the above manner, the arrangement order of multiple other dimension data is obtained, that is, the arrangement order of multiple other influencing factors.
[0048] According to the actual situation, the present invention supports selecting one or more influencing factors from the above-mentioned ranking as the basis for clustering the influencing factor vector. Therefore, by selecting a corresponding number of key influencing factors, the present invention supports the reconstruction of the influencing factor vector to be clustered. At this time, each vector only includes a plurality of key influencing factors as the input of the K-means algorithm, while other non-key influencing factors are not considered in the clustering process. In addition, according to the actual situation, the influence of the prediction target such as the day-ahead electricity price on the clustering result can also be excluded. In the above manner, multiple input samples of the K-means algorithm are obtained, and each sample only includes key influencing factors. In this way, a clustering algorithm is used to obtain multiple clusters of key influencing factor vectors.
[0049] Since the present invention implements clustering by simplifying all other influencing factors by obtaining key influencing factors, each cluster in the clustering result can actually include all the features of vectors of various different time periods, and the macroscopic discrete features of vectors of different time periods will not be missing at a certain level because a certain clustering result is excluded. In other words, although the subsequent process excludes some poor clustering results, the remaining multiple optimized clusters still include all the influencing factor features used for neural network prediction.
[0050] In one embodiment of the present invention, the key influencing factor most relevant to the day-ahead electricity price is the renewable energy output ratio. The characteristics of each cluster obtained after clustering include the mean renewable energy ratio and the maximum renewable energy ratio.
[0051] The present invention supports obtaining the optimal multiple clusters by analyzing and calculating the geometric features of each cluster. In one embodiment of the present invention, the analysis is based on the aggregation feature. The calculation process of this aggregation feature can select multiple key influencing factors, and can also further simplify the number of influencing factor dimensions for calculating the distance from multiple key influencing factors. For example, only the new energy proportion factor is used to calculate the one-dimensional distance, and non-key influencing factors that are not used for clustering can also be used as reference quantities for multi-dimensional distance calculation. The present invention selects a method for calculating the aggregation features according to actual conditions. These aggregation features, together with the clusters where the samples are located, can be used as a basis for expanding the input data content used in the neural network algorithm.
[0052] Preferably, the aggregation feature of each cluster in the multiple clusters is calculated, and the multiple clusters are sorted according to the aggregation feature, including: randomly selecting a current sample from the current cluster and calculating the aggregation feature of the current sample; traversing the aggregation feature of each current sample in the current cluster, averaging the aggregation feature of each current sample in the current cluster, and obtaining the average aggregation feature of the current cluster; solving the average aggregation feature of each cluster, and using the average aggregation feature to sort the multiple clusters.
[0053] In one embodiment of the present invention, the aggregate feature is solved for each class obtained by the clustering algorithm. The aggregate feature is the average value of the aggregate feature of each sample in the current class. In this way, by calculating each class, the ranking of the aggregate features of multiple clusters can be obtained, so that the multiple clusters can be selected.
[0054] Preferably, a current sample is randomly selected from the current cluster, and the aggregation feature of the current sample is calculated, including: randomly selecting a current sample from the current cluster, calculating the distance between all other samples in the current cluster and the current sample to obtain a first average distance S1 between the current sample and all other samples in the current cluster; for each other cluster excluding the current cluster in multiple clusters, calculating the average distance between the current sample and all samples in each other cluster, comparing the size of the average distance of each other cluster, and recording the smallest average distance as the second average distance S2; if the first average distance is equal to the second average distance, the aggregation feature is defined as 0, and if the first average distance is greater than the second average distance, the aggregation feature is If the first average distance is less than the second average distance, the aggregation feature is
[0055] The calculation of the aggregation feature of each sample is based on the average distance between the sample and all other samples in the class, and the average distance between the sample and all samples in other classes. By calculating this parameter, we can effectively analyze the position of the current sample in this class and the distance between the sample and other classes. Therefore, after solving the average aggregation feature of all samples, we can analyze from a macro perspective whether the division of samples in a class is accurate enough, and whether the degree of aggregation and dispersion of samples has achieved the ideal clustering effect.
[0056] Through this analysis, the advantages and disadvantages of multiple clusters obtained by the K-means algorithm can be ranked. If the average aggregation feature value of a cluster is higher, it means that the clustering result of this cluster is more accurate, and the basis for the sample to be classified into this class or not to be classified into this class is more sufficient.
[0057] The influencing factor vectors in the classes with insufficient classification basis, that is, the classes with small average aggregate feature values, are removed and will not be used as the classification basis for the neural network in the next step. For the multiple classes that remain, a new cluster type label clu can be added to the data set based on the K-means classification results. This type label can also be used as a data input dimension for subsequent neural network predictions. In addition to using new data labels as this new input dimension, it also supports the actual calculation of the difference in overall features between each sample and the class, thereby supplementing the unique features of the sample. For example, the mean and maximum values of the new energy output under each cluster are obtained, and the new energy output of a sample under the cluster is calculated with the mean and maximum values mentioned above to obtain the intra-class feature fea of the new energy output of the sample under its K-means clustering. This intra-class feature is used as a new data input dimension. At this time, the new influencing factor vector is
[0058] In another embodiment, in order to simplify the calculation process, the clustering algorithm of the present invention is not used to implement classification, but the influencing factor vectors are simply divided into two vectors with different labels, weekdays and weekends, based on the labels mentioned above.
[0059] Step 3: construct a data set based on the optimal clustering result, and input the data set into a pre-constructed neural network model for electricity consumption prediction to obtain the optimal electricity consumption plan for the future period.
[0060] Preferably, constructing a data set based on the optimal clustering result includes: constructing a data set using each sample in one or more clusters in the optimal clustering result as a piece of data; each piece of data includes the extended influencing factors under the power consumption period, the extended influencing factors under the previous power consumption period, and the extended influencing factors under the next power consumption period.
[0061] Although multiple key influencing factor vectors are obtained in step 2, this type of vector can be input into the neural network for prediction. However, the present invention also supports obtaining the generation time period of the influencing factor vector that can serve as the optimal classification basis based on multiple key influencing factor vectors, and recording the time periods corresponding to these key influencing factor vectors, and using these corresponding time periods, the influencing factor vectors generated from steps 1 and 2 are Input into the neural network.
[0062] Preferably, the extended influencing factors under the power consumption period include all multi-dimensional data in the influencing factor vector, the period type label, the cluster type label, and the intra-class characteristics; the extended influencing factors under the previous power consumption period and the extended influencing factors under the next power consumption period have the same data dimensions as the extended influencing factors under the power consumption period, or are less than the data dimensions of the extended influencing factors under the power consumption period.
[0063] In one embodiment, if the prediction target is pre-selected, in order to ensure the reliability of the subsequent deep learning process in the time dimension, the prediction target values of the previous or next one or more time periods of the prediction target in the current time period can be extracted respectively, and these contents are also added to the influencing factor vector, then S(t)=[s 1t ,s 2t ,s 3t …s nt ,lab t ,clu t ,fea t ,s 1(t-1) ,s 2(t-1) ,s 3(t-1) …s n(t-1) ,lab t-1 ,clu t-1 ,fea t-1 ,s 1(t-2) ,s 2(t-2) ,s 3(t-2) …s n(t-2) ,lab t-2 ,clu t-2 ,fea t-2 ,s 1(t+1) ,s 2(t+1) ,s 3(t+1) …s n(t+1) ,lab t+1 ,clu t+1 ,fea t+1 ,s 1(t+2) ,s 2(t+2) ,s 3(t+2) …s n(t+2) ,lab t+2 ,clu t+2 ,fea t+2 ].
[0064] Preferably, the extended influencing factors in the previous power consumption period and the extended influencing factors in the next power consumption period are the collected amount of the prediction target in the previous power consumption period and the predicted amount in the next power consumption period.
[0065] In another embodiment, it is also supported to expand the influencing factors of the prediction target in different time dimensions. For example, the content of the influencing factor vector in the data set is S(t)=[s 1t ,s 2t ,s 3t …s nt ,lab t ,clu t ,fea t ,s 1(t-1) ,s 1(t-2) ,s 1(t+1) ,s 1(t+2) ].
[0066] If the actual application of neural network to predict the future quantity of the prediction target, it does not support the prediction of s 1(t+1) ,s 1(t+2) Therefore, the method can use LSTM and other methods to fill the content of the above data first and then obtain the data set used for prediction, and use the historical data set as a training basis to adjust the accuracy of LSTM and neural network.
[0067] By fully expanding the influencing factor vector, the effectiveness and reliability of the neural network training results are ensured. The present invention obtains the key factors that best represent the characteristics from the time dimension, while ensuring the data sufficiency of the characteristics of different influencing factors, thereby greatly improving the prediction accuracy.
[0068] Preferably, the data set is input into a pre-constructed neural network model for electricity consumption prediction to obtain the optimal electricity consumption plan for the future period, including: based on the predicted demand, selecting an influencing factor from all influencing factors of the data set as the prediction target; inputting the data set into a neural network that introduces a self-attention mechanism to obtain a prediction result of the prediction target.
[0069] According to the different input vector dimensions mentioned above, the present invention also supports the use of different neural network models. For example, when there are multiple continuous data in time for predicting electricity prices, the LSTM structure can be added to the neural network model of the present invention, and the LSTM structure can be used in different ways.
[0070] After constructing the multiple influencing factor vectors obtained above into a data set, they are input into the neural network model. In one embodiment, the self-attention mechanism is introduced into the model to predict the prediction target. In other embodiments, simultaneous prediction of multiple prediction targets is also supported. In another embodiment, the long short-term memory network LSTM and the self-attention mechanism ATT are introduced into the neural network to perform self-attention calculation on the predicted target day-ahead electricity price in the classification prediction data set, with the predicted target as the key and other influencing factors as the query, so as to implement effective prediction of the day-ahead electricity price.
[0071] In one embodiment, the content of the data set is further subjected to feature extraction and data set normalization to facilitate the calculation of the neural network.
[0072] The neural network model needs to ensure the accuracy of the prediction results through the classification training and verification process of the model. In one embodiment of the present invention, the evaluation indicators of the neural network model are mean square error MSE, root mean square error RMSE, mean absolute error MAE, etc. The hyperparameters are adjusted in the above manner to obtain the optimal model performance, and the prediction effect of the model is evaluated using the data in the validation set. Using the trained model, the conditions to be predicted are set to obtain the prediction results for one or more prediction targets.
[0073] By adopting the above method, the present invention conducts a refined analysis of the factors affecting the day-ahead electricity price, and adopts a neural network training with a self-attention mechanism to consider the day-ahead electricity price prediction model of multiple influencing factors. After testing the actual electricity spot market, the test results show that the prediction accuracy of the method proposed by the present invention is high. In addition, the present invention reduces the training time of a single model and improves the prediction accuracy.
[0074] A number of embodiments of the method of the present invention are described below. In each embodiment, some or all of the calculation processes and some or all of the influencing factors mentioned above are selectively used, and the accuracy of the prediction results is evaluated.
[0075] Figure 2 This is a prediction effect diagram of a power consumption prediction method based on influencing factors of the present invention when the optimal clustering result is not screened and the time period type label is added. Figure 2 As shown, in one embodiment, the present invention is applied to the provincial power spot market to predict the day-ahead electricity price (2024-03-27), and the prediction effect is as follows Figure 2 As shown, the input data is first divided into weekdays and weekends to obtain the label lab. K-Means clustering is performed based on the proportion of new energy as the clustering parameter. The feature fea of the clustered samples is obtained based on the mean and maximum value of the proportion of new energy. Then, the long short-term memory network and the neural network with self-attention mechanism are introduced. The long short-term memory network supports the use of influencing factors in different time periods such as t-1 and t+1. The training time is 45.8847 seconds. The figure includes the time-varying curves of the predicted value and the actual value. The MAE of the prediction result is 0.0182, and the root mean square error RMSE is 0.0232.
[0076] Figure 3 This is a prediction effect diagram of a power consumption prediction method based on influencing factors of the present invention when the optimal clustering result is not selected. Figure 3As shown in the figure, without considering the label lab, if all the data are only clustered by K-Means and used as the input of the prediction model, the samples in the non-optimal clustering results can also be used as the input of the neural network. The clustering feature fea is calculated in a similar way, and the neural network with long short-term memory network and self-attention mechanism is introduced. The training time is 54.0050 seconds, the MAE of the prediction result is 0.0205, and the root mean square error RMSE is 0.0289.
[0077] Figure 4 This is a prediction effect diagram of the power consumption prediction method based on influencing factors of the present invention when clustering is implemented based on time period types. Figure 4 As described above, all data are only divided into weekdays and weekends for input into the prediction model. No clustering feature fea is used, and the optimal clustering result is not screened. A long short-term memory network and a neural network with a self-attention mechanism are introduced, and an extended influencing factor vector is used as input. The training time is 203.8314 seconds, the MAE of the prediction result is 0.0257, and the root mean square error RMSE is 0.0380.
[0078] Figure 5 This is a prediction effect diagram of a power consumption prediction method based on influencing factors of the present invention when clustering is not implemented. Figure 5 As shown in the figure, all the data are used as the input of the prediction model, without dividing the time period type or implementing clustering. Then, the long short-term memory network and the neural network with self-attention mechanism are introduced. The training time is 292.8009 seconds, the MAE of the prediction result is 0.0293, and the root mean square error RMSE is 0.0375.
[0079] Figure 6 This is a prediction effect diagram of a power consumption prediction method based on influencing factors of the present invention. Figure 6 As shown in the figure, by screening samples from multiple clusters with higher aggregation and separation in the clustering results, removing samples from non-optimal clustering results, performing K-Means clustering based on key influencing factors as clustering parameters, using time period type labels, cluster type labels, and aggregation features, and then introducing long short-term memory networks and neural networks with self-attention mechanisms, the root mean square error RMSE of the prediction results is 0.0203 and MAE is 0.0160. This method has the best prediction results.
[0080] In the model of the present invention that uses the day-ahead electricity price as the prediction target, if there is a time period in which abnormal electricity prices appear in the prediction results, the actual electricity consumption process can be regulated by increasing the capacity of the rotating reserve in that time period to ensure that the electricity price level fluctuates within a reasonable range.
[0081] The second aspect of the present invention relates to an electricity consumption prediction system based on influencing factors of the method in the first aspect of the present invention, comprising a collection module, a clustering module and a prediction module, wherein the collection module is used to collect original data related to electricity consumption, and calculate the influencing factor vectors under different electricity consumption time periods based on the original data; the clustering module is used to cluster the influencing factor vectors using the K-Means clustering algorithm to obtain the optimal clustering result; the prediction module is used to construct a data set based on the optimal clustering result, and input the data set into a pre-constructed neural network model for electricity consumption prediction to obtain the optimal electricity consumption plan for the future time period.
[0082] A third aspect of the present invention relates to a terminal, comprising a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute the steps of the method in the first aspect of the present invention.
[0083] A fourth aspect of the present invention relates to a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method in the first aspect of the present invention.
[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for predicting electricity consumption based on influencing factors, characterized in that: The method comprises the following steps: Collecting raw data related to electricity consumption, and calculating influencing factor vectors in different electricity consumption periods based on the raw data; Using K-Means clustering algorithm to cluster the influencing factor vectors to obtain the optimal clustering result; A data set is constructed based on the optimal clustering result, and the data set is input into a pre-constructed neural network model for electricity consumption prediction to obtain an optimal electricity consumption plan for a future period.
2. The method for predicting electricity consumption based on influencing factors according to claim 1, characterized in that: The collecting of raw data related to electricity consumption and calculating the influencing factor vectors in different electricity consumption periods based on the raw data include: The raw data related to electricity consumption include system load, external transmission power, new energy output, daily rolling electricity price, and day-ahead electricity price in the provincial power market; The influencing factor vector includes multi-dimensional data, and the multi-dimensional data is net load, new energy output, proportion of new energy output, thermal power output, supply-demand ratio, daily rolling electricity price and day-ahead electricity price.
3. The method for predicting electricity consumption based on influencing factors according to claim 2, characterized in that: The K-Means clustering algorithm is used to cluster the influencing factor vectors to obtain the optimal clustering result, including: Calculating the correlation between the prediction target and other dimensional data in the influencing factor vector, and sorting the other dimensional data based on the correlation; Extracting key influencing factors from the influencing factor vector based on the sorting result, and constructing a key influencing factor vector; Taking multiple key influencing factor vectors in different power consumption periods as input samples, a K-means clustering method is used to classify the input samples to obtain multiple clusters; The aggregation feature of each of the multiple clusters is calculated, and the multiple clusters are sorted according to the aggregation feature, and the cluster with priority in sorting is extracted as the optimal clustering result.
4. The method for predicting electricity consumption based on influencing factors according to claim 3 is characterized in that: The calculating the aggregation feature of each of the multiple clusters and sorting the multiple clusters according to the aggregation feature includes: Randomly select a current sample from the current cluster, and calculate the aggregation feature of the current sample; Traversing the aggregated features of each current sample in the current cluster, averaging the aggregated features of each current sample in the current cluster, and obtaining an average aggregated feature of the current cluster; An average aggregation feature of each cluster is solved, and the plurality of clusters are sorted using the average aggregation feature.
5. The method for predicting electricity consumption based on influencing factors according to claim 4, characterized in that: The randomly selecting a current sample from the current cluster and calculating the aggregated features of the current sample includes: Randomly select a current sample from the current cluster, and calculate the distances between all other samples in the current cluster and the current sample to obtain a first average distance S1 between the current sample and all other samples in the current cluster; For each other cluster in the multiple clusters excluding the current cluster, calculate the average distance between the current sample and all samples in each other cluster, compare the average distances of each other cluster, and record the smallest average distance as a second average distance S2; If the first average distance is equal to the second average distance, the aggregation feature is defined as 0; if the first average distance is greater than the second average distance, the aggregation feature is If the first average distance is less than the second average distance, the aggregation feature is 6. The method for predicting electricity consumption based on influencing factors according to claim 5, characterized in that: The constructing a data set based on the optimal clustering result includes: Each sample in one or more clusters in the optimal clustering result is used as a piece of data to construct a data set; Each piece of data includes the extended influencing factors in the current power consumption period, the extended influencing factors in the previous power consumption period, and the extended influencing factors in the next power consumption period.
7. The method for predicting electricity consumption based on influencing factors according to claim 6, characterized in that: The step of inputting the data set into a pre-constructed neural network model for electricity consumption prediction to obtain an optimal electricity consumption plan for a future period includes: Based on the prediction requirement, one influencing factor is selected from all influencing factors of the data set as a prediction target; The data set is input into a neural network that introduces a self-attention mechanism to obtain a prediction result of the prediction target.
8. A power consumption forecasting system based on influencing factors using the method according to any one of claims 1 to 7, characterized in that: The acquisition module, clustering module and prediction module, wherein: The acquisition module is used to collect raw data related to electricity consumption, and calculate the influencing factor vectors in different electricity consumption periods based on the raw data; The clustering module is used to cluster the influencing factor vectors using a K-Means clustering algorithm to obtain an optimal clustering result; The prediction module is used to construct a data set based on the optimal clustering result, and input the data set into a pre-constructed neural network model for power consumption prediction to obtain an optimal power consumption plan for a future period.
9. A terminal comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
