Method and device for selecting electricity consumption prediction model
By building a sample data set and configuration parameter search strategy suitable for the specified scenario, training and evaluation for the electricity prediction model, and selecting the optimal model to improve the accuracy of the power demand prediction, the accuracy of the electricity prediction algorithm in the prior art is solved.
Patent Information
- Application Number
- CN202411630640.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-02-25
AI Technical Summary
Existing electricity usage prediction algorithms cannot accurately predict power demand when real scenarios change, resulting in inaccurate power load planning and energy expenditure.
By building a sample data set that is suitable for the specified scenario, configure parameter search policies, parameter selection policies and parameter grids for the power consumption prediction model in the prediction algorithm pool, train and evaluate, and select the optimal power consumption prediction model to improve prediction accuracy.
It improves the prediction accuracy of power demand in different scenarios, ensures the accuracy of power load planning and energy expenditure, and reduces operating costs.
Smart Images

Figure CN119515599A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine learning, and in particular to a method and device for selecting an electricity consumption prediction model. Background Art
[0002] Electricity demand forecasting is crucial for power load planning, energy expenditure, and safe operation. Currently, electricity consumption forecasting algorithms are usually used to predict electricity demand. However, electricity consumption forecasting algorithms are usually only applicable to certain scenarios. When the actual scenario changes, the existing electricity consumption forecasting algorithms cannot accurately predict electricity demand.
[0003] Therefore, how to select a suitable electricity consumption prediction algorithm based on real-world scenarios is an urgent problem that needs to be solved. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a method and device for selecting a power consumption prediction model, so as to select a suitable power consumption prediction algorithm according to a real scenario.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] A first aspect of an embodiment of the present invention discloses a method for selecting a power consumption prediction model, the method comprising:
[0007] Constructing a sample data set adapted to a specified scenario, the sample data set comprising: real power demand data, historical data of specified power consumption influencing factors affecting the fluctuation of user power consumption;
[0008] Configuring parameter search strategies, parameter selection strategies and parameter grids for various types of power consumption prediction models in the prediction algorithm pool, wherein the parameter search strategy is a grid search strategy or a random search strategy, and the parameter grid includes: model parameters that need to be adjusted for the power consumption prediction model and the optimal value range of the model parameters;
[0009] According to the sample data set, the parameter search strategy, the parameter selection strategy and the parameter grid, each type of the power consumption prediction model is trained and evaluated to obtain specified evaluation indicators for each type of the power consumption prediction model;
[0010] By using the specified evaluation index, an optimal power consumption prediction model suitable for the specified scenario is selected from various types of power consumption prediction models.
[0011] Preferably, the specified evaluation index is root mean square error;
[0012] According to the sample data set, the parameter search strategy, the parameter selection strategy and the parameter grid, various types of the power consumption prediction models are trained and evaluated to obtain designated evaluation indicators of various types of the power consumption prediction models, including:
[0013] Dividing the sample data set into a training set and a test set in chronological order;
[0014] Using the training set, the parameter search strategy, the parameter selection strategy and the parameter grid, training various types of electricity consumption prediction models;
[0015] Inputting the historical data of the designated power consumption influencing factors in the test set into the various types of power consumption prediction models that have completed training, respectively, to obtain prediction results of the various types of power consumption prediction models that have completed training;
[0016] According to the real power demand data in the test set and the prediction results of the various types of power consumption prediction models that have completed training, the root mean square error of the various types of power consumption prediction models that have completed training is calculated.
[0017] Preferably, using the specified evaluation index, selecting the optimal power consumption prediction model adapted to the specified scenario from various types of power consumption prediction models includes:
[0018] The power consumption prediction model that has completed training and has the smallest root mean square error is selected as the optimal power consumption prediction model suitable for the specified scenario.
[0019] Preferably, the process of configuring parameter search strategies for various types of power consumption prediction models in the prediction algorithm pool includes:
[0020] Calculating the data volume of the sample data set;
[0021] If the data volume is less than the data volume threshold, a grid search strategy is configured for each type of power consumption prediction model in the prediction algorithm pool;
[0022] If the data volume is greater than or equal to the data volume threshold, a random search strategy is configured for each type of electricity consumption prediction model in the prediction algorithm pool.
[0023] Preferably, after selecting the optimal power consumption prediction model adapted to the specified scenario from the various power consumption prediction models, the method further includes:
[0024] Obtain the latest data of the specified power consumption influencing factor in the specified scenario;
[0025] The latest data of the designated power consumption influencing factors are input into the optimal power consumption prediction model to perform power consumption prediction, so as to obtain the power demand prediction result under the designated scenario.
[0026] A second aspect of an embodiment of the present invention discloses a device for selecting a power consumption prediction model, the device comprising:
[0027] A construction unit, used to construct a sample data set adapted to a specified scenario, wherein the sample data set includes: real power demand data, historical data of specified power consumption influencing factors affecting the fluctuation of user power consumption;
[0028] A configuration unit, configured to configure a parameter search strategy, a parameter selection strategy and a parameter grid for various types of power consumption prediction models in the prediction algorithm pool, wherein the parameter search strategy is a grid search strategy or a random search strategy, and the parameter grid includes: model parameters that need to be adjusted for the power consumption prediction model and an optimal value range of the model parameters;
[0029] A processing unit, configured to train and evaluate each type of the power consumption prediction model according to the sample data set, the parameter search strategy, the parameter selection strategy and the parameter grid, so as to obtain a specified evaluation index for each type of the power consumption prediction model;
[0030] A selection unit is used to select an optimal power consumption prediction model suitable for the specified scenario from various types of power consumption prediction models by using the specified evaluation index.
[0031] Preferably, the specified evaluation index is a root mean square error; and the processing unit comprises:
[0032] A division subunit, used to divide the sample data set into a training set and a test set in chronological order;
[0033] A training subunit, configured to train various types of electricity consumption prediction models using the training set, the parameter search strategy, the parameter selection strategy and the parameter grid;
[0034] A prediction subunit, used for inputting the historical data of the specified power consumption influencing factors in the test set into the various types of power consumption prediction models that have completed training, so as to obtain prediction results of the various types of power consumption prediction models that have completed training;
[0035] The calculation subunit is used to calculate the root mean square error of each type of electricity consumption prediction model that has been trained based on the real power demand data in the test set and the prediction results of each type of electricity consumption prediction model that has been trained.
[0036] Preferably, the selection unit is specifically used to: select the trained electricity consumption prediction model with the smallest root mean square error as the optimal electricity consumption prediction model suitable for the specified scenario.
[0037] Preferably, the configuration unit is specifically used to: calculate the data volume of the sample data set; if the data volume is less than a data volume threshold, configure a grid search strategy for each type of electricity consumption prediction model in the prediction algorithm pool; if the data volume is greater than or equal to the data volume threshold, configure a random search strategy for each type of electricity consumption prediction model in the prediction algorithm pool.
[0038] Preferably, it also includes:
[0039] The prediction unit is used to obtain the latest data of the specified power consumption influencing factors under the specified scenario; input the latest data of the specified power consumption influencing factors into the optimal power consumption prediction model to perform power consumption prediction, so as to obtain the power demand prediction result under the specified scenario.
[0040] Based on the above-mentioned embodiment of the present invention, a method and device for selecting a power consumption prediction model is provided. The method is as follows: constructing a sample data set adapted to a specified scenario; configuring parameter search strategies, parameter selection strategies and parameter grids for various types of power consumption prediction models in the prediction algorithm pool; training and evaluating various types of power consumption prediction models according to the sample data set, parameter search strategy, parameter selection strategy and parameter grid to obtain the specified evaluation indicators of various types of power consumption prediction models; using the specified evaluation indicators, selecting the optimal power consumption prediction model adapted to the specified scenario from various types of power consumption prediction models. This scheme configures parameter search strategies, parameter selection strategies and parameter grids for various types of power consumption prediction models in the prediction algorithm pool, and trains and evaluates various types of power consumption prediction models according to the sample data set, parameter search strategy, parameter selection strategy and parameter grid adapted to the specified scenario to obtain the specified evaluation indicators of the power consumption prediction model. Using the specified evaluation indicators, the optimal power consumption prediction model adapted to the specified scenario is selected from various types of power consumption prediction models, and the power demand under the specified scenario is predicted by the optimal power consumption prediction model, thereby improving the prediction accuracy of power demand under different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0042] Figure 1 A flow chart of a method for selecting an electricity consumption prediction model provided by an embodiment of the present invention;
[0043] Figure 2 A flowchart for obtaining a specified evaluation index provided by an embodiment of the present invention;
[0044] Figure 3Another flow chart of a method for selecting a power consumption prediction model provided by an embodiment of the present invention;
[0045] Figure 4 A structural block diagram of a device for selecting an electricity consumption prediction model provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0048] Electricity demand forecasting is crucial for power load planning, energy expenditure, cost economy and safe operation. With the dependence on power load, power suppliers are facing increasingly fierce competition in the demand market, which requires them to pay more attention to power quality, especially short-term maintenance, network power flow scheduling optimization and security strategies.
[0049] Inaccurate power load forecasting will increase operating costs, and the increase in power forecast errors will lead to a significant increase in operating costs. Since emergency power dispatch is very expensive, accurate power demand forecasting can better arrange and adjust relevant strategies for power generators and power users. However, due to factors such as climate, social activities and seasonal factors, it is difficult to predict power demand.
[0050] The inventors have discovered through research that the commonly used electricity consumption prediction algorithms are divided into two categories: traditional algorithms and artificial intelligence algorithms. Among them, traditional algorithms mainly include regression models and time series models. Traditional algorithms make predictions based on the similarity of development trends. The calculation principles and deconstruction forms are simple, and the calculation speed is fast, but the consideration of uncertain factors is insufficient. When the electricity consumption trend fluctuates greatly, the prediction effect of electricity demand will be significantly reduced.
[0051] Artificial intelligence algorithms include neural networks (NN), support vector regression (SVR), K-nearest neighbor regression (KNN regression), fuzzy logic system (FLS), expert system (Expert System), etc. Although artificial intelligence algorithms can comprehensively consider multiple influencing factors to adapt to the randomness and complexity of electricity consumption changes, each artificial intelligence algorithm is applicable to limited scenarios. Therefore, how to select a suitable electricity consumption prediction algorithm based on real scenarios is an urgent problem to be solved.
[0052] In order to solve the above problems, the embodiment of the present invention provides a method and device for selecting a power consumption prediction model, which configures parameter search strategies, parameter selection strategies and parameter grids for various types of power consumption prediction models in the prediction algorithm pool, and trains and evaluates various types of power consumption prediction models according to sample data sets, parameter search strategies, parameter selection strategies and parameter grids adapted to the specified scenario to obtain the specified evaluation indicators of the power consumption prediction models. The specified evaluation indicators are used to select the optimal power consumption prediction model adapted to the specified scenario from the various types of power consumption prediction models, and the optimal power consumption prediction model is used to predict the power demand in the specified scenario, thereby improving the prediction accuracy of power demand in different scenarios.
[0053] See also Figure 1 , which shows a flow chart of a method for selecting a power consumption prediction model provided by an embodiment of the present invention, the selection method comprising:
[0054] Step S101: construct a sample data set suitable for a specified scenario.
[0055] In the specific implementation of step S101, a sample data set adapted to the specified scenario is constructed, and the sample data set includes: real power demand data (equivalent to labels or real values), and historical data of specified power consumption influencing factors that affect the fluctuation of user power consumption.
[0056] Among them, the designated electricity consumption influencing factors that affect the fluctuation of user electricity consumption include but are not limited to: energy consumption, climate conditions, building characteristics, personnel flow, time factors (whether it is a holiday), etc.
[0057] In a specific implementation, the sample data set is selected, cleaned and processed through a variable construction module. Furthermore, in the variable construction module, the distribution and change pattern of the sample data in the sample data set are observed, and a series of preprocessing operations such as elimination and interpolation are performed on the sample data in response to missing and abnormal sample data in the sample data set.
[0058] Step S102: configuring parameter search strategies, parameter selection strategies and parameter grids for various types of electricity consumption prediction models in the prediction algorithm pool.
[0059] It should be noted that a prediction algorithm pool is pre-built, and a large number of power consumption prediction models built according to power consumption prediction algorithms are listed in the prediction algorithm pool. The power consumption prediction algorithms used in building the power consumption prediction models include traditional algorithms and artificial intelligence algorithms;
[0060] Among them, the artificial intelligence algorithms used to build the electricity consumption prediction model include but are not limited to: Multi-Layer Perceptron (MLP), Support Vector Regression (SVR), K-Nearest Neighbor Regression (KNN regression) and Gradient Boosting Regression (GBR), etc.
[0061] The traditional algorithms used to build the electricity consumption forecasting model include but are not limited to time series algorithms and regression algorithms, such as: Autoregressive Integrated Moving Average Model (ARIMA), Lasso Regression (Least Absolute Shrinkage and Selection Operator Regression) and Ridge Regression.
[0062] In the process of specifically implementing step S102, parameter search strategies, parameter selection strategies and parameter grids are configured for various types of electricity consumption prediction models in the prediction algorithm pool. The parameter search strategy configured for the electricity consumption prediction model is a grid search strategy or a random search strategy. The parameter grid includes: model parameters that need to be adjusted by the electricity consumption prediction model and the optimal value range of the model parameters.
[0063] In some embodiments, the process of configuring a parameter search strategy for a power consumption prediction model is as follows: calculating the data volume of a sample data set; if the data volume is less than a data volume threshold, configuring a grid search strategy for each type of power consumption prediction model in the prediction algorithm pool; if the data volume is greater than or equal to the data volume threshold, configuring a random search strategy for each type of power consumption prediction model in the prediction algorithm pool.
[0064] In practical applications, the grid parameter module can be used to configure parameter search strategies, parameter selection strategies, and parameter grids for various power consumption prediction models in the prediction algorithm pool. While storing the list of candidate model parameters, the grid parameter module also provides the search and selection of model parameters, thereby realizing the automatic parameter adjustment of the power consumption prediction algorithm, so that various power consumption prediction models (equivalent to the sub-models in the prediction algorithm pool) can achieve their own optimal prediction effect.
[0065] It should be noted that each electricity consumption prediction model usually has a series of model parameters that need to be set, and these model parameters will affect the performance of the electricity consumption prediction model. For example, the model parameters that need to be set for the MLP model include the learning rate, the number of layers, and the number of nodes in each layer.
[0066] Therefore, the grid parameter module has two main functions. The first function of the grid parameter module is to provide a parameter grid (parameter pool) for each power consumption forecasting model. The parameter grid is used to store the possible potential optimal values of all model parameters that need to be preset in the power consumption forecasting model;
[0067] The aforementioned “potentially optimal values” specifically mean that for each model parameter, the model parameter may have different values, and these values may lead to the best performance of the electricity consumption prediction model in some cases; by tuning these model parameters, the most suitable configuration for the current task can be found;
[0068] When designing the electricity consumption prediction model, all the model parameters that need to be preset for each electricity consumption prediction model will be created, so a grid parameter module is created to store these model parameters and the possible optimal value ranges of these model parameters. This will make it easier to select and adjust these model parameters during training and evaluation of the electricity consumption prediction model, thereby optimizing the performance of the electricity consumption prediction model;
[0069] Therefore, the parameter grid includes the model parameters that need to be adjusted in the electricity consumption forecasting model and the optimal value range of the model parameters.
[0070] The second function of the grid parameter module is to provide a parameter search strategy and a parameter selection strategy for the model parameters. The parameter search strategy and the parameter selection strategy are used to search for model parameters and select model parameters respectively, thereby realizing adaptive parameter adjustment and training of various electricity consumption prediction models.
[0071] The parameter grid (parameter pool), parameter search strategy and parameter selection strategy mentioned above are explained below.
[0072] (1) Parameter grid:
[0073] The model parameters in the parameter grid of some electricity consumption forecast models are listed as follows:
[0074] MLP: approximate solution algorithm, activation function, random state, maximum number of iterations, hidden layer structure;
[0075] SVR: kernel function, maximum number of iterations;
[0076] NN: solution algorithm, weight, and number of neighboring points limit (K);
[0077] GBR: loss function, learning rate, maximum number of iterations.
[0078] (2) Parameter search strategy:
[0079] The parameter search strategy includes a grid search strategy and a random search strategy, and the grid search strategy or the random search strategy is selected according to the data volume of the input sample data set.
[0080] Among them, the grid search strategy means: adjusting the parameters in the specified model parameter range in steps. The grid search strategy requires traversing all possible combinations of model parameters, which is very time-consuming in the case of large data sets and multiple parameters.
[0081] The random search strategy selects model parameters randomly within the specified model parameter range.
[0082] From the perspective of practical application, the grid search strategy is suitable for smaller data sets and parameter spaces, while the random search strategy is suitable for larger or high-dimensional data sets. Therefore, when the data volume of the sample data set is less than the data volume threshold (for example, when the sample data set has only a few hundred to a few thousand sample data), a grid search strategy is configured for various types of electricity consumption prediction models in the prediction algorithm pool;
[0083] When the data volume is greater than or equal to the data volume threshold (for example, when the sample data set has more than tens of thousands of sample data), a random search strategy is configured for various types of electricity consumption prediction models in the prediction algorithm pool.
[0084] For the random search strategy mentioned above, the random methods are divided into:
[0085] 1) For hyperparameters whose search range is a probability distribution, random sampling is performed according to the given distribution;
[0086] 2) For hyperparameters whose search range is a list, equal probability sampling is performed in the given list.
[0087] (3) Parameter selection strategy:
[0088] The parameter selection strategy mainly adopts the cross-validation method. The cross-validation method is: divide the sample data set into K parts, take one of them as the validation set and the rest as the training set to train the electricity consumption prediction model, and test the accuracy of the electricity consumption prediction model on the validation set; finally, take the average accuracy of K experiments as the average accuracy of the electricity consumption prediction model.
[0089] In the process of adaptive parameter adjustment, cross-validation is used to compare the accuracy of the electricity consumption prediction model under each set of model parameters. Through continuous cycles and comparisons, the model parameter group that makes the electricity consumption prediction model most expressive is finally found in the parameter grid (parameter pool).
[0090] Among them, the "optimal model parameter group" refers to: a set of model parameters finally selected after the parameter selection strategy; this is intended to make the electricity consumption prediction model perform best on a given sample data set.
[0091] Step S103: training and evaluating various types of power consumption prediction models according to the sample data set, parameter search strategy, parameter selection strategy and parameter grid to obtain designated evaluation indicators of various types of power consumption prediction models.
[0092] It should be noted that the parameter grid includes the model parameters that need to be adjusted in the electricity consumption forecasting model and the optimal value range of the model parameters.
[0093] In the process of specifically implementing step S103, after configuring parameter search strategies, parameter selection strategies and parameter grids for various types of electricity consumption prediction models in the prediction algorithm pool, various types of electricity consumption prediction models are trained and evaluated based on sample data sets, parameter search strategies, parameter selection strategies and parameter grids to obtain specified evaluation indicators for various types of electricity consumption prediction models.
[0094] In some embodiments, the specified evaluation index of the power consumption prediction model obtained by the above evaluation is the root mean square error (denoted as MSE). For details on how to evaluate the specified evaluation index of the power consumption prediction model, see the subsequent embodiments of the present invention. Figure 2 The content in.
[0095] Step S104: using the specified evaluation index, selecting the optimal power consumption prediction model suitable for the specified scenario from various power consumption prediction models.
[0096] In the specific implementation of step S104, after training and evaluating various power consumption prediction models to obtain the specified evaluation indicators, the trained power consumption prediction model with the smallest root mean square error is selected as the optimal power consumption prediction model suitable for the specified scenario through the algorithm selection module.
[0097] That is, the optimal electricity consumption prediction model suitable for a specified scenario is: the electricity consumption prediction model that has completed training with the smallest root mean square error.
[0098] In some embodiments, after selecting the optimal electricity consumption prediction model, the latest data of the specified electricity consumption influencing factors in the specified scenario is obtained; the latest data of the specified electricity consumption influencing factors are input into the optimal electricity consumption prediction model for electricity consumption prediction to obtain the electricity demand forecast result in the specified scenario (i.e., predicting the electricity load in the future period of time).
[0099] In order to better explain how to select the optimal electricity consumption prediction model suitable for a specified scenario, the following example is given from the perspective of practical application.
[0100] The hourly electricity consumption data of commercial buildings in a certain city in a certain year were selected for analysis. The sample data set was obtained by matching the equipment-level power consumption (lighting, elevator operation, air conditioning and office electricity), climate conditions (temperature, humidity and wind), time factors (whether it is a working day, hourly time), personnel flow in the building and other specified electricity consumption influencing factors; the various electricity consumption prediction models in the prediction algorithm pool were trained with the sample data set. During the training process, various electricity consumption prediction models predicted the total electricity consumption (power demand) of the commercial building. The prediction results are shown in Table 1.
[0101] Table 1:
[0102]
[0103] From the prediction results shown in Table 1 above, under the current sample data set, the prediction results of the MLP electricity consumption prediction model are the most accurate, with an MSE of only 0.5; therefore, MLP is selected as the optimal electricity consumption prediction model suitable for the specified scenario.
[0104] Subsequently, the latest data on electricity consumption (lighting, elevator operation, air conditioning and office electricity), climate conditions (temperature, humidity and wind speed), time factors (whether it is a working day or not, hourly time), and personnel flow in the building are input into the optimal electricity consumption prediction model, which can predict the total electricity consumption of the commercial building in the future.
[0105] In an embodiment of the present invention, parameter search strategies, parameter selection strategies and parameter grids are configured for various types of power consumption prediction models in the prediction algorithm pool, and various types of power consumption prediction models are trained and evaluated according to sample data sets, parameter search strategies, parameter selection strategies and parameter grids adapted to the specified scenario to obtain the specified evaluation index of the power consumption prediction model. The specified evaluation index is used to select the optimal power consumption prediction model adapted to the specified scenario from the various types of power consumption prediction models, and the power demand in the specified scenario is predicted by the optimal power consumption prediction model, thereby improving the prediction accuracy of power demand in different scenarios.
[0106] For the above-mentioned embodiment of the present invention Figure 1For details on obtaining the specified evaluation indicators of various power consumption prediction models involved in step S103, see Figure 2 , shows a flow chart of obtaining a specified evaluation index provided by an embodiment of the present invention, including the following steps:
[0107] Step S201: Divide the sample data set into a training set and a test set in chronological order.
[0108] In the specific implementation process of step S201, after assigning parameter grids to various types of electricity consumption prediction models, the various types of designated electricity consumption influencing factors in the sample data set are matched according to the time factor, and the first 80% (for example only) of the sample data set are selected as the training set in chronological order, and the last 20% (for example only) of the sample data set are selected as the test set.
[0109] Step S202: using the training set, parameter search strategy, parameter selection strategy and parameter grid to train various types of electricity consumption prediction models.
[0110] In the process of implementing step S202, various types of electricity consumption prediction models are trained using training sets, parameter search strategies, parameter selection strategies and parameter grids; wherein, in the process of training the electricity consumption prediction model, the parameter grid corresponding to the electricity consumption prediction model is traversed, and the optimized electricity consumption prediction model is finally obtained through adaptive training.
[0111] Step S203: inputting the historical data of the designated power consumption influencing factors in the test set into the various trained power consumption prediction models respectively, so as to obtain the prediction results of the various trained power consumption prediction models.
[0112] In the process of implementing step S203, after the various types of electricity consumption prediction models are trained, in addition to the real electricity demand data (real value) in the test set, the historical data of the specified electricity consumption influencing factors in the test set are input as independent variables into the various types of electricity consumption prediction models that have completed the training for prediction, and the prediction results of the various types of electricity consumption prediction models that have completed the training are obtained.
[0113] Step S204: Calculate the root mean square error of the various trained power consumption prediction models based on the actual power demand data in the test set and the prediction results of the various trained power consumption prediction models.
[0114] In the process of implementing step S204, based on the actual power demand data in the test set and the prediction results of various types of power consumption prediction models that have been trained (the prediction results obtained based on the historical data of the specified power consumption influencing factors in the test set), the root mean square error of the various types of power consumption prediction models that have been trained is calculated by formula (1), and the root mean square error is the specified evaluation indicator of the power consumption prediction model.
[0115]
[0116] In formula (1), y i is the real power demand data (true value) in the test set, is the prediction result (prediction value) of the trained electricity consumption prediction model, n is the number of dependent variables in the test set, and the dependent variable is the electricity demand to be predicted (equivalent to the target variable that the model attempts to predict, i.e., the prediction result);
[0117] The root mean square error of various power consumption prediction models can be calculated by formula (1). By comparing the root mean square errors of various power consumption prediction models, the power consumption prediction model with the smallest root mean square error is selected as the optimal power consumption prediction model.
[0118] To better explain how to select the optimal electricity consumption forecasting model, the following is an overall perspective. Figure 3 Another flowchart of a method for selecting an electricity consumption prediction model is shown as an example. Figure 3 The following steps are involved:
[0119] Step S301: construct a sample data set.
[0120] It should be noted that the constructed sample data set at least includes real electricity demand data, energy consumption, climate conditions, building characteristics, personnel flow, time factors, etc.
[0121] Step S302: preprocessing the sample data set, dividing the preprocessed sample data set into a training set and a test set; and using the training set to train various types of electricity consumption prediction models in the prediction algorithm pool.
[0122] It should be noted that the electricity consumption prediction model in the prediction algorithm pool is constructed by artificial intelligence algorithms and traditional algorithms, among which the artificial intelligence algorithms include but are not limited to MLP, SVR, KNN and GBR; the traditional algorithms include but are not limited to ARIMA, Lasso regression and ridge regression.
[0123] Step S303: using the test set to evaluate the trained electricity consumption prediction model, and calculating the MSE of the trained electricity consumption prediction model.
[0124] Step S304: selecting the optimal power consumption prediction model from various power consumption prediction models according to the MSE.
[0125] It should be noted that the execution principle of step S301 to step S304 can be found in the above embodiment of the present invention. Figure 1 and Figure 2 The content will not be repeated here.
[0126] From the contents of the above embodiments, this solution combines the data feature structure, based on historical electricity consumption data, natural conditions and other social factors, and selects the optimal electricity consumption prediction model suitable for the specified scenario from the prediction algorithm pool including traditional algorithms and artificial intelligence algorithms; therefore, this solution has the following beneficial effects:
[0127] 1. The electricity consumption forecasting model can be adaptively adjusted through the parameter grid to achieve more efficient learning and extraction of historical regional electricity consumption characteristics and regional social factors, and use the aforementioned characteristics as a basis to provide basic support for predicting electricity demand.
[0128] 2. Better combine data such as building characteristics, climate conditions, personnel flow, and time factors with regional power consumption data to achieve conditional prediction of regional electricity consumption and significantly improve the accuracy and reliability of regional electricity consumption predictions.
[0129] 3. Since data such as climate conditions, personnel flow, and time factors can be dynamically and real-time updated in the electricity consumption forecasting model, dynamic and current regional electricity consumption forecasts can be achieved more intelligently.
[0130] Corresponding to the method for selecting a power consumption prediction model provided in the above embodiment of the present invention, see Figure 4 , the embodiment of the present invention also provides a structural block diagram of a device for selecting a power consumption prediction model, the selection device comprising: a construction unit 100, a configuration unit 200, a processing unit 300 and a selection unit 400;
[0131] The construction unit 100 is used to construct a sample data set adapted to a specified scenario, wherein the sample data set includes: real power demand data, and historical data of specified power consumption influencing factors that affect the fluctuation of user power consumption.
[0132] The configuration unit 200 is used to configure parameter search strategies, parameter selection strategies and parameter grids for various types of power consumption prediction models in the prediction algorithm pool. The parameter search strategy is a grid search strategy or a random search strategy. The parameter grid includes: model parameters that need to be adjusted by the power consumption prediction model and the optimal value range of the model parameters.
[0133] In a specific implementation, the configuration unit 200 is specifically used to: calculate the data volume of the sample data set; if the data volume is less than the data volume threshold, configure a grid search strategy for each type of electricity consumption prediction model in the prediction algorithm pool; if the data volume is greater than or equal to the data volume threshold, configure a random search strategy for each type of electricity consumption prediction model in the prediction algorithm pool.
[0134] The processing unit 300 is used to train and evaluate various types of power consumption prediction models according to the sample data set, parameter search strategy, parameter selection strategy and parameter grid, so as to obtain the specified evaluation indicators of various types of power consumption prediction models.
[0135] The selection unit 400 is used to select an optimal power consumption prediction model suitable for a specified scenario from various power consumption prediction models using a specified evaluation index.
[0136] In an embodiment of the present invention, parameter search strategies, parameter selection strategies and parameter grids are configured for various types of power consumption prediction models in the prediction algorithm pool, and various types of power consumption prediction models are trained and evaluated according to sample data sets, parameter search strategies, parameter selection strategies and parameter grids adapted to the specified scenario to obtain the specified evaluation index of the power consumption prediction model. The specified evaluation index is used to select the optimal power consumption prediction model adapted to the specified scenario from the various types of power consumption prediction models, and the power demand in the specified scenario is predicted by the optimal power consumption prediction model, thereby improving the prediction accuracy of power demand in different scenarios.
[0137] Preferably, combined Figure 4 The content shown, the specified evaluation index is the root mean square error; the processing unit 300 includes a division subunit, a training subunit, a prediction subunit and a calculation subunit, and the execution principle of each subunit is as follows:
[0138] The partitioning subunit is used to partition the sample data set into a training set and a test set in chronological order.
[0139] The training subunit is used to train various electricity consumption prediction models using training sets, parameter search strategies, parameter selection strategies and parameter grids.
[0140] The prediction subunit is used to input the historical data of the specified electricity consumption influencing factors in the test set into various electricity consumption prediction models that have been trained to obtain the prediction results of the various electricity consumption prediction models that have been trained.
[0141] The calculation subunit is used to calculate the root mean square error of various trained electricity consumption prediction models based on the real power demand data in the test set and the prediction results of various trained electricity consumption prediction models.
[0142] Correspondingly, the selection unit 400 is specifically used to select the trained power consumption prediction model with the smallest root mean square error as the optimal power consumption prediction model suitable for the specified scenario.
[0143] Preferably, combined Figure 4 The content shown, the selection device also includes:
[0144] The prediction unit is used to obtain the latest data of the specified power consumption influencing factors under the specified scenario; input the latest data of the specified power consumption influencing factors into the optimal power consumption prediction model to perform power consumption prediction, so as to obtain the power demand prediction result under the specified scenario.
[0145] In summary, the embodiment of the present invention provides a method and device for selecting a power consumption prediction model, configuring parameter search strategies, parameter selection strategies and parameter grids for various types of power consumption prediction models in the prediction algorithm pool, and training and evaluating various types of power consumption prediction models according to sample data sets, parameter search strategies, parameter selection strategies and parameter grids adapted to specified scenarios to obtain specified evaluation indicators of the power consumption prediction models. The specified evaluation indicators are used to select the optimal power consumption prediction model adapted to the specified scenario from various types of power consumption prediction models, and the optimal power consumption prediction model is used to predict the power demand in the specified scenario, thereby improving the prediction accuracy of power demand in different scenarios.
[0146] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0147] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0148] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for selecting an electricity consumption prediction model, characterized in that: The method comprises: Constructing a sample data set adapted to a specified scenario, the sample data set comprising: real power demand data, historical data of specified power consumption influencing factors affecting the fluctuation of user power consumption; Configuring parameter search strategies, parameter selection strategies and parameter grids for various types of power consumption prediction models in the prediction algorithm pool, wherein the parameter search strategy is a grid search strategy or a random search strategy, and the parameter grid includes: model parameters that need to be adjusted for the power consumption prediction model and the optimal value range of the model parameters; According to the sample data set, the parameter search strategy, the parameter selection strategy and the parameter grid, each type of the power consumption prediction model is trained and evaluated to obtain specified evaluation indicators for each type of the power consumption prediction model; By using the specified evaluation index, an optimal power consumption prediction model suitable for the specified scenario is selected from various types of power consumption prediction models.
2. The method according to claim 1, characterized in that: The specified evaluation indicator is the root mean square error; According to the sample data set, the parameter search strategy, the parameter selection strategy and the parameter grid, various types of the power consumption prediction models are trained and evaluated to obtain designated evaluation indicators of various types of the power consumption prediction models, including: Dividing the sample data set into a training set and a test set in chronological order; Using the training set, the parameter search strategy, the parameter selection strategy and the parameter grid, training various types of electricity consumption prediction models; Inputting the historical data of the designated power consumption influencing factors in the test set into the various types of power consumption prediction models that have completed training, respectively, to obtain prediction results of the various types of power consumption prediction models that have completed training; According to the real power demand data in the test set and the prediction results of the various types of power consumption prediction models that have completed training, the root mean square error of the various types of power consumption prediction models that have completed training is calculated.
3. The method according to claim 2, characterized in that Using the specified evaluation index, selecting an optimal power consumption prediction model suitable for the specified scenario from various types of power consumption prediction models, including: The power consumption prediction model that has completed training and has the smallest root mean square error is selected as the optimal power consumption prediction model suitable for the specified scenario.
4. The method according to claim 1, characterized in that The process of configuring parameter search strategies for various power consumption prediction models in the prediction algorithm pool includes: Calculating the data volume of the sample data set; If the data volume is less than the data volume threshold, a grid search strategy is configured for each type of power consumption prediction model in the prediction algorithm pool; If the data volume is greater than or equal to the data volume threshold, a random search strategy is configured for each type of electricity consumption prediction model in the prediction algorithm pool.
5. The method according to any one of claims 1 to 4, characterized in that: After selecting the optimal power consumption prediction model suitable for the specified scenario from the various power consumption prediction models, the method further includes: Obtain the latest data of the specified power consumption influencing factor in the specified scenario; The latest data of the designated power consumption influencing factors are input into the optimal power consumption prediction model to perform power consumption prediction, so as to obtain the power demand prediction result under the designated scenario.
6. A device for selecting an electricity consumption prediction model, characterized in that: The device comprises: A construction unit, used to construct a sample data set adapted to a specified scenario, wherein the sample data set includes: real power demand data, and historical data of specified power consumption influencing factors affecting the fluctuation of user power consumption; A configuration unit, configured to configure a parameter search strategy, a parameter selection strategy and a parameter grid for various types of power consumption prediction models in the prediction algorithm pool, wherein the parameter search strategy is a grid search strategy or a random search strategy, and the parameter grid includes: model parameters that need to be adjusted for the power consumption prediction model and an optimal value range of the model parameters; A processing unit, configured to train and evaluate each type of the power consumption prediction model according to the sample data set, the parameter search strategy, the parameter selection strategy and the parameter grid, so as to obtain a specified evaluation index for each type of the power consumption prediction model; A selection unit is used to select an optimal power consumption prediction model suitable for the specified scenario from various types of power consumption prediction models by using the specified evaluation index.
7. The device according to claim 6, characterized in that The specified evaluation index is a root mean square error; the processing unit comprises: A division subunit, used to divide the sample data set into a training set and a test set in chronological order; A training subunit, configured to train various types of electricity consumption prediction models using the training set, the parameter search strategy, the parameter selection strategy and the parameter grid; A prediction subunit, used for inputting the historical data of the specified power consumption influencing factors in the test set into the various types of power consumption prediction models that have been trained, respectively, to obtain prediction results of the various types of power consumption prediction models that have been trained; The calculation subunit is used to calculate the root mean square error of each type of electricity consumption prediction model that has been trained based on the real power demand data in the test set and the prediction results of each type of electricity consumption prediction model that has been trained.
8. The device according to claim 7, characterized in that The selection unit is specifically used to select the trained electricity consumption prediction model with the smallest root mean square error as the optimal electricity consumption prediction model suitable for the specified scenario.
9. The device according to claim 6, characterized in that The configuration unit is specifically used to: calculate the data volume of the sample data set; if the data volume is less than the data volume threshold, configure a grid search strategy for each type of electricity consumption prediction model in the prediction algorithm pool; if the data volume is greater than or equal to the data volume threshold, configure a random search strategy for each type of electricity consumption prediction model in the prediction algorithm pool.
10. The device according to any one of claims 6 to 9, characterized in that: Also includes: A prediction unit, used to obtain the latest data of the specified power consumption influencing factor in the specified scenario; The latest data of the designated power consumption influencing factors are input into the optimal power consumption prediction model to perform power consumption prediction, so as to obtain the power demand prediction result under the designated scenario.