Method and device for predicting energy consumption

By combining models for holidays and non-holidays in short-term power forecasts, energy consumption is weighted by using CatBoost and BiLSTM-Attention models to calculate energy consumption, the accuracy problem of short-term power forecasts is solved and more accurate energy consumption prediction is achieved.

CN119151038APending Publication Date: 2024-12-17SIEMENS (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411127802.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

Short-term power forecasts are susceptible to a variety of factors and are difficult to achieve accurate predictions, especially during holidays and non-holidays.

Method used

Two models are used for energy consumption prediction on holidays and non-holidays respectively. The first model is based on the CatBoost and BiLSTM-Attention models. The total energy consumption during the prediction period is calculated by combining weight weighting.

Benefits of technology

It improves the accuracy of energy consumption prediction, making short-term power prediction results more reliable and accurate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119151038A_ABST
    Figure CN119151038A_ABST
Patent Text Reader

Abstract

The invention provides a method and a device for predicting energy consumption. The method comprises the following steps: acquiring a current time point and a preset prediction time period; judging whether different prediction periods are covered or not according to the current time point and the prediction time period, wherein the prediction periods comprise holidays and festivals and non-holidays; if the judgment result is yes, the energy consumption in the prediction time period is predicted according to the first model and the second model, the first model is used for non-holidays, and the second model is used for holidays. According to the invention, energy consumption prediction can be more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electric power systems, and in particular to a method and device for predicting energy consumption. Background Art

[0002] There are various power-consuming devices in buildings or factories, and power forecasting is an important basis for power systems to formulate power generation plans.

[0003] There are long-term and short-term forecasts for electricity consumption. Short-term forecasts are more easily affected by many factors, such as weather and personnel activity. Therefore, how to accurately predict electricity consumption in the short term is an urgent problem to be solved. Summary of the invention

[0004] In view of this, the present invention proposes a method for predicting energy consumption, comprising:

[0005] Get the current time point and the preset forecast time period;

[0006] Determining whether different forecast periods are covered according to the current time point and the forecast time period, the forecast period including holidays and non-holidays;

[0007] If the judgment result is yes, the energy consumption in the prediction time period is predicted according to the first model and the second model, the first model is used for non-holidays, and the second model is used for holidays.

[0008] According to the method as described above, optionally, predicting the energy consumption within the prediction period according to the first model and the second model includes:

[0009] Determine a first energy consumption according to a time period corresponding to a non-holiday within the preset period and a first model;

[0010] Determine the second energy consumption according to the time period corresponding to the holidays within the forecast period and the second model;

[0011] The energy consumption in the prediction period is taken as the sum of the first energy consumption and the second energy consumption.

[0012] According to the method as described above, optionally, the first model includes a front model and a back model, the front model is generated based on a CatBoost model, and the back model is generated based on a BiLSTM-Attention model; and / or

[0013] The second model is generated based on the CatBoost model.

[0014] According to the method described above, optionally, determining the first energy consumption according to the time period corresponding to the non-holiday period within the preset period and the first model includes:

[0015] First energy consumption = front model * first weight + rear model * second weight,

[0016] The sum of the first weight and the second weight is 1.

[0017] According to the method as described above, optionally, the prediction time period is 24 hours; or

[0018] The first model and / or the second model at least includes the following factors: temperature within a prediction period, production data of a target object within a prediction period, and historical data of energy consumption of the target object within a prediction period.

[0019] According to the method described above, optionally, if the judgment result is no, the corresponding prediction period is determined according to the current time point and the prediction time period, and the energy consumption within the prediction period is predicted according to the model corresponding to the determined prediction period.

[0020] The present invention also provides a device for predicting energy consumption, comprising:

[0021] An acquisition unit, used to acquire the current time point and a preset prediction time period;

[0022] a judgment unit, configured to judge whether different prediction periods are covered according to the current time point and the prediction time period, wherein the prediction period includes holidays and non-holidays, and trigger the prediction unit if the judgment result is yes;

[0023] The prediction unit is used to predict the energy consumption within the prediction time period according to the first model and the second model, the first model is used for non-holidays, and the second model is used for holidays.

[0024] According to the device as described above, optionally, the prediction unit includes:

[0025] A first determining subunit, configured to determine a first energy consumption according to a time period corresponding to a non-holiday period within the preset period and a first model;

[0026] A second determining subunit, configured to determine a second energy consumption according to a time period corresponding to a holiday within the forecast period and a second model;

[0027] A calculation subunit is used to calculate the energy consumption in the prediction period based on the sum of the first energy consumption and the second energy consumption.

[0028] According to the device as described above, optionally, the first model includes a front model and a rear model, the front model is generated based on a CatBoost model, and the rear model is generated based on a BiLSTM-Attention model; the first determining subunit is specifically used for:

[0029] First energy consumption = front model * first weight + rear model * second weight,

[0030] The sum of the first weight and the second weight is 1;

[0031] or

[0032] The second model is generated based on the CatBoost model.

[0033] The present invention further provides a method and device for predicting energy consumption, comprising:

[0034] at least one memory for storing instructions;

[0035] At least one processor is configured to execute the method for predicting energy consumption according to any one of the above items according to the instructions stored in the memory.

[0036] The present invention also provides a readable storage medium, wherein the readable storage medium stores machine-readable instructions. When the machine-readable instructions are executed by a machine, the machine executes the method for predicting energy consumption according to any one of the above items.

[0037] It can be seen from the above scheme that the present invention determines whether holidays and non-holidays are covered according to the predicted time period. If the determination result is yes, the energy consumption within the predicted time period is determined according to the non-holidays corresponding to the first model and the holidays corresponding to the second model. This can make the prediction result of energy consumption more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings so that the above and other features and advantages of the present invention will be more apparent to those skilled in the art. In the accompanying drawings:

[0039] Figure 1 FIG. 4 is a flow chart of a method for predicting energy consumption according to an embodiment of the present invention.

[0040] Figure 2 FIG. 4 is a flow chart of a method for predicting energy consumption according to another embodiment of the present invention.

[0041] Figure 3 4 is a schematic diagram of the structure of an apparatus for predicting energy consumption according to an embodiment of the present invention.

[0042] Figure 4 FIG. 4 is a schematic diagram of the structure of an apparatus for predicting energy consumption according to another embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the present invention more clear, the present invention is further described in detail with reference to the following embodiments. The nouns and pronouns related to people in this patent application are not limited to specific genders.

[0044] Energy consumption is the main indicator of energy consumption level and energy conservation and consumption reduction. Electricity is the most important energy consumption. Energy consumption management is crucial to the operation of enterprises and organizations, so it is necessary to predict energy consumption. As an exemplary illustration, the energy consumption in the present invention can specifically be electricity.

[0045] Embodiment 1

[0046] This embodiment provides a method for predicting energy consumption. The subject executing the method is a device for predicting energy consumption. The device can be set up separately, integrated into other devices or software platforms, or set up in the cloud, without specific limitation. The device for predicting energy consumption is used to predict the energy consumption of a target object within a predicted time period. The target object is, for example, an office building, a switch cabinet, etc., and can be set according to actual needs.

[0047] like Figure 1 FIG. 1 is a flow chart of a method for predicting energy consumption according to this embodiment. The method for predicting energy consumption includes:

[0048] Step 101, obtaining the current time point and a preset prediction time period.

[0049] The prediction time period can be set according to actual needs, for example, 10 hours or 20 hours, etc. For short-term prediction, the prediction time period can be one day, that is, 24 hours.

[0050] The current time point can be obtained in real time according to the clock of the device for predicting energy consumption, or can be determined by GPS (Global Positioning System). The specific time point can be obtained according to actual needs, which will not be described in detail here.

[0051] Step 102 , judging whether different forecast periods are covered according to the current time point and the forecast time period, where the forecast period includes holidays and non-holidays, and if the judgment result is yes, executing step 103 .

[0052] Taking the current time point as the starting point, determine whether the forecast time period covers different forecast periods. Holidays are weekends, non-holidays are weekdays, or holidays are based on the national holiday time published each year, and the rest of the time is non-holidays. These time periods can be input into the energy consumption forecasting device in advance for real-time judgment.

[0053] As an example, assuming that the current time point is 18:00 on Sunday and the prediction time period is 24 hours, the prediction time period covers different prediction periods, namely the prediction period from 18:00 to midnight corresponding to holidays and the prediction period from 0:00 to 18:00 on Monday corresponding to non-holidays.

[0054] Step 103: predicting energy consumption within a prediction time period according to the first model and the second model.

[0055] The first model is used for non-holidays, and the second model is used for holidays. Taking an office building as an example, during non-holidays, employees in the office building will go to work, and during holidays, employees in the office building will hardly go to work. Therefore, the model corresponding to the energy consumption during non-holidays should be different from the model corresponding to the energy consumption during holidays.

[0056] As an exemplary illustration, both the first model and the second model can be trained based on historical data to improve accuracy. More specifically, the training mechanisms of the first model and the second model are different. The first model can be trained based on historical data of non-holidays, and the second model can be trained based on historical data of holidays. The first model is used to predict energy consumption during the time period corresponding to non-holidays within the forecast period, and the second model is used to predict energy consumption during the time period corresponding to holidays within the forecast period.

[0057] As an exemplary illustration, steps 101 to 103 may be executed at preset intervals to continuously perform short-term predictions on the energy consumption of the target object.

[0058] The first model and / or the second model here include at least the following features: the ambient temperature within the prediction time period, the production data of the target object within the prediction time period, and the historical data of the energy consumption of the target object within the prediction time period. The historical data is, for example, at least one of the following data: the maximum value of multiple historical data of the target object within the prediction time period, the minimum value of multiple historical data of the target object within the prediction time period, and the average value of multiple historical data of the target within the prediction time period. The ambient temperature here can be obtained through weather forecasts. The target object here refers to the component or building for which energy consumption needs to be predicted. The production data here may include information such as the product's online time, offline time, product model, product quantity, team, process name, etc., as shown in Table 1, and of course, it may also include information such as temperature. Specifically, the product quantity, team, process name, etc. corresponding to each product model in each prediction time period in history can be added as features to the first model and / or the second model.

[0059] Table 1

[0060]

[0061]

[0062] Among them, product quantity and ambient temperature are continuous features, while product model, team, and process name are categorical features. Continuous features refer to features that can take any value within a certain interval. Their values ​​are continuous, and two adjacent values ​​can be infinitely divided, that is, they can take infinite values. The values ​​of categorical features are discrete, and are expressed as incompatible categories or attributes. The values ​​of these variables can only belong to one of several incompatible categories, such as team and process type.

[0063] The historical period here means the same period in history. For example, if the forecast period is 24 hours and the current time point is 0 o'clock, the historical period can be from 0 o'clock to 24 o'clock of the previous day, or from 0 o'clock to 24 o'clock of the next day. You can select the factors you need within the historical period.

[0064] The method of this embodiment is particularly suitable for short-term energy consumption prediction, such as prediction of energy consumption within 24 hours or 48 hours.

[0065] In this embodiment, whether the predicted time period covers holidays and non-holidays is determined based on the predicted time period. If the determination result is yes, the energy consumption within the predicted time period is determined based on the non-holidays corresponding to the first model and the holidays corresponding to the second model. This can make the energy consumption prediction result more accurate.

[0066] Embodiment 2

[0067] This embodiment further supplements the method for predicting energy consumption in the first embodiment.

[0068] like Figure 2 FIG. 1 is a flow chart of a method for predicting energy consumption according to this embodiment. The method includes:

[0069] Step 201, obtaining the current time point and a preset prediction time period.

[0070] This step is consistent with step 201 and will not be described again here.

[0071] Step 202, judging whether different forecast periods are covered according to the current time point and the forecast time period, where the forecast period includes holidays and non-holidays, if the judgment result is yes, executing step 203, if the judgment result is no, executing step 204.

[0072] The first model is used for non-holidays, and the second model is used for holidays. The first model can be generated by training based on non-holiday data, and the second model can be generated by training based on holiday data.

[0073] If the judgment result is no, the energy consumption is predicted according to the model corresponding to the determined prediction period.

[0074] Step 203, determine the first energy consumption according to the time period corresponding to non-holidays in the preset period and the first model, determine the second energy consumption according to the time period corresponding to holidays in the predicted period and the second model, and use the sum of the first energy consumption and the second energy consumption as the energy consumption in the predicted period.

[0075] As a specific example, the first model is generated based on the CatBoost model and BiLSTM, and the second model is generated based on the CatBoost model. Among them, the CatBoost model is a machine learning algorithm based on the Gradient Boosting Decision Tree (GBDT), which is suitable for processing data sets containing categorical features. It reduces overfitting through effective strategies while ensuring that all data sets can be used for learning. The CatBoost model can have multiple inputs and a single output. For example, within 24 hours, 4 sampling points are obtained every hour, so there are 96 power data in 24 hours. The input of 96 time-based power data will output 1 predicted power consumption data.

[0076] For the first model, it includes a front model and a back model. A bidirectional LSTM (BiLSTM-Attention) with an attention mechanism is used as the back model. The method of obtaining the front model can be consistent with the method of obtaining the second model below, that is, it is generated based on the CatBoost model and will not be repeated here. The final power load forecast for non-holidays is achieved by using a weighted combination method to weight the value predicted by the front model and the value predicted by the back model. The weights can be set according to actual needs, for example, both are 0.5. Specifically, the first energy consumption = first weight * front model + second weight * back model. The sum of the first weight and the second weight can be 1.

[0077] The following first gives a specific example to illustrate the latter model.

[0078] The latter model is formed based on the BiLSTM-Attention model. First, the model is trained using the initial parameters and energy consumption data training set. The model consists of forward and backward long short-term memory networks. The BiLSTM hidden layer adopts a two-layer structure, and each layer contains an LSTM (long short-term memory) network, but the two LSTM networks use opposite training methods, such as forward training and backward training respectively. Each LSTM unit has a long-term memory (CELL), an input gate, an output gate, and a forget gate.

[0079] The following is an explanation of how to obtain the post-model. For example, the prediction period is 24 hours. First, obtain the historical energy consumption sequence of the target object y = (x1, x2, x3, x4, ..., x 96 ) and several other factors, which constitute the M-dimensional feature matrix And build a BiLSTM-attention model based on the M-dimensional feature matrix, where the sampling point corresponding to time point t All the features at time point t are included. According to the sampling time, the samples x collected within 24 hours can be marked with subscripts indicating the sampling order. x1 represents the first sample collected within 24 hours. Indicates that the first sample contains M features, such as temperature, product model, etc., a total of M features, that is, all the features corresponding to the first sampling time point, Indicates that the second sample contains M features, and so on. The BiLSTM-attention model can predict the load at multiple time points in the future. Where F is the BiLSTM fitting function.

[0080] At time t, the M-dimensional feature matrix used to predict energy consumption is input into the Attention layer. First, the weights are calculated based on the input M-dimensional feature matrix. The specific method of calculating the weights belongs to the existing technology and will not be repeated here. Then the weights and the input sequence are combined to obtain a new vector, which is input into the BiLSTM hidden layer. Specifically, assuming that the M-dimensional feature matrix at time t is The corresponding weights are but in represents the attention weight of the nth feature at time t. The Softmax function is used to ensure that the sum of all attention weights is 1, so the M-dimensional feature matrix of BiLSTM becomes the new vector Assume that at the current time t, the input is xt , the hidden layer output at the current moment is h t , the current state of the memory unit is C t At this time, the calculation formula h of the BiLSTM-Attention model at time t is t As shown below:

[0081]

[0082]

[0083]

[0084]

[0085]

[0086] C t =f t *C t-1 +i t *g t

[0087] h t =O t *tanh(C t )

[0088] Among them, W xi , W xf , W xo , W xg Respectively represent the input weight, forget gate weight, output gate weight and current input unit weight, W hi , W hf , W ho , W hg They represent the state weight of the hidden layer input memory unit, the state weight of the hidden layer forget gate memory unit, the state weight of the hidden layer output gate memory unit and the state weight of the current input memory unit, respectively. hy represents the output weight, b i , b f , b c , b o They represent the forget gate bias, input gate bias, current input unit bias, and output gate bias, respectively. * indicates matrix element multiplication. σ() and tanh() represent Sigmoid and Tanh functions, respectively. t is the hidden state value at time t, h t-1 is the hidden state value at the previous sampling moment.

[0089] The hidden states of the forward LSTM layer and the backward LSTM layer at the current time t and The calculation method is:

[0090]

[0091]

[0092] Where f() is the forward information extraction function, b() is the backward information extraction function; w f is the weight matrix of the forward LSTM layer; b f is the bias of the forward LSTM layer; w b is the weight matrix of the backward LSTM layer; b b is the bias of the backward LSTM layer. Represents the hidden layer state of the forward LSTM (Long Short-Term Memory) layer corresponding to time t-1, Represents the hidden layer state of the subsequent LSTM layer at time t+1.

[0093] The post-model S at the current time t t The output value is calculated as:

[0094]

[0095] In the above formula, is the hidden state of the forward LSTM layer, is the hidden state of the backward LSTM layer, wy is the weight of the BiLSTM prediction output, and the matrix b y is the bias of the BiLSTM prediction output.

[0096] Next, we can judge the accuracy of the above calculation formula. After the Attention-BiLSTM model is trained, substitute the M-dimensional feature matrix in the test sample into the Attention-BiLSTM neural network model, and then substitute the M-dimensional feature matrix in the test sample into the trained Attention-BiLSTM neural network model. Finally, compare the model operation results with the actual energy consumption in the test sample. Specifically, the mean absolute percentage error (MAPE), root mean square error (RMSE), goodness of fit (R 2 ) as an evaluation method to compare the model operation results with the actual energy consumption in the test samples.

[0097] As an example, the calculation formula of the evaluation method is as follows:

[0098]

[0099]

[0100]

[0101] Where yi represents the actual energy consumption value of the i-th sample, and n represents the total number of samples.

[0102] In the process of calculating the first energy consumption, the front model and the back model are used to calculate the first energy consumption, which can make the calculation result of the first energy consumption more accurate. Energy consumption time series data usually contains complex time dependencies and nonlinear patterns. By fusing the two models, it is possible to avoid overfitting while fully capturing the complex patterns in non-holiday data, thereby increasing the robustness of the prediction results. The second model is generated based on the Catboost model. The Catboost model is a Boosting algorithm that can automatically process categorical features into numerical features, so that the data distribution is free from the influence of noise and low frequency.

[0103] For categorical features, pre-processing is required. As an example, we can use numerical variables To replace the k-th categorical feature of the i-th training sample The algorithm disrupts the order of the data set and assumes that all training samples containing the kth categorical feature The shuffled sequence is Traverse from σ1 to σ n , use the first p training samples traversed to calculate the value of the k-th categorical feature. The specific formula is as follows:

[0104]

[0105] Where: is the indicator function, which takes the value of 1 when the values ​​of the two features are equal and takes the value of 0 otherwise. j represents the jth row of data after the order is disrupted, σ p Indicates the pth row of data after the order is disrupted. is the specific value corresponding to the categorical feature; P is the added priori item, and a is the priori weight coefficient.

[0106] For example, feature information such as team, process name, part of the time (such as day of the week, month), etc. are considered categorical features, while product quantity, temperature, and historical energy consumption are considered continuous features. The values ​​of categorical features are discrete, which are expressed as mutually incompatible categories or attributes. The values ​​of these variables can only belong to one of several mutually incompatible categories, while the values ​​of continuous variables can be arbitrarily taken within a certain interval, and their values ​​are continuous. There can be infinite divisions between two adjacent values, that is, there are infinite values.

[0107] The core algorithm of this model is the Depth-wise algorithm based on GradientBoosting. Its main steps are as follows:

[0108] Based on the training data, perform the following steps:

[0109] Step 1: Initialize an empty tree, that is, the leaf node value is 0.

[0110] Step 2: For each decision tree, select the optimal depth to minimize the loss function.

[0111] Step 3: For each feature in the training set, select the optimal gradient descent step size to minimize the loss function.

[0112] Repeat steps 2 and 3 until the specified number of iterations is reached or the specified loss value is reached.

[0113] The mathematical model formula of CatBoost is as follows:

[0114]

[0115]

[0116]

[0117] in is the loss function, w i is the weight of the i-th sample, y i is the true value corresponding to the i-th sample, that is, the true energy consumption of the i-th sample, is the predicted value, is the loss of the i-th sample of the loss function, J(f) is the regularization term, K is the number of decision trees, and J k is the number of leaf nodes of the kth decision tree, a j is the weight of the leaf node, I(x i ∈R j ) is the indicator function, which indicates that sample x i Is it in the leaf node R j In, h j (x i ) is the function of the leaf node.

[0118] The Catboost model's prediction of future load is actually multiple predictions based on the characteristics of multiple sample points. For example, using 96 samples to predict energy consumption is actually using the Catboost model to make 96 predictions on the 96 samples.

[0119] As an exemplary illustration, in order to obtain an accurate second model, the training set data can be randomly divided into q sub-datasets, where q is a positive integer greater than or equal to 2, and the second model = (prediction model 1 + prediction model 2 + prediction model 3 + prediction model 4 + ... prediction model q) / q. Here, q is, for example, 5, and 5-fold cross validation is used to randomly divide the training set data into five sub-datasets: A, B, C, D, and E. The first training scheme: train the four data sets A, B, C, and D to obtain prediction model 1; the second training scheme: train the four data sets A, B, C, and E to obtain prediction model 2; the third training scheme: train the four data sets A, B, D, and E to obtain prediction model 3; the fourth training scheme: train the four data sets A, C, D, and E to obtain prediction model 4; the fifth training scheme: train the four data sets B, C, D, and E to obtain prediction model 5. Finally, the average of the five prediction models after training and verification is taken as the second model, that is, the second model = (prediction model 1 + prediction model 2 + prediction model 3 + prediction model 4 + prediction model 5) / 5.

[0120] The former model is also calculated in the same way as the second model, but the training set data used is different, which will not be repeated here.

[0121] Step 204, determining a corresponding prediction period according to the current time point and the prediction time period, and predicting the energy consumption within the prediction period according to the model corresponding to the determined prediction period.

[0122] If the prediction period is determined to be a holiday based on the current time point and the prediction time period, the model corresponding to the holiday can be used to predict energy consumption, and the specific method can be the same as the above. If the prediction period is determined to be a non-holiday based on the current time point and the prediction time period, the model corresponding to the non-holiday can be used to predict energy consumption, and the specific method can be the same as the above. That is, in the case of a negative judgment result, energy consumption can be predicted based on only one model.

[0123] According to this embodiment, the power consumption during the forecast period corresponding to holidays and the energy consumption during the forecast period corresponding to non-holidays are combined as the energy consumption during the forecast period, so that the forecast result is more accurate.

[0124] Embodiment 3

[0125] This embodiment provides a device for predicting energy consumption, which is used to execute the method for predicting energy consumption in Embodiment 1. The device for predicting energy consumption can be provided separately or integrated into a software platform.

[0126] like Figure 3, which is a schematic diagram of the structure of the device for predicting energy consumption according to this embodiment. The device for predicting energy consumption includes an acquisition unit 301 , a judgment unit 302 and a prediction unit 303 .

[0127] Among them, the acquisition unit 301 is used to obtain the current time point and the preset prediction time period; the judgment unit 302 is used to judge whether different prediction periods are covered according to the current time point and the prediction time period, and the prediction period includes holidays and non-holidays. If the judgment result is yes, the prediction unit 303 is triggered; the prediction unit 303 is used to predict the energy consumption within the prediction time period according to the first model and the second model, the first model is used for non-holidays, and the second model is used for holidays.

[0128] As an exemplary illustration, the first model includes a front model and a back model, the front model is generated based on the CatBoost model, and the back model is generated based on the BiLSTM-Attention model. As another exemplary illustration, the second model is generated based on the CatBoost model.

[0129] Optionally, the temperature within the prediction time period, the production data of the target object within the prediction time period, and the historical data of the energy consumption of the target object within the prediction time period.

[0130] The working methods of each unit in this embodiment are the same as those in the previous embodiment and will not be described again here.

[0131] Optionally, if the judgment result of the judgment unit 302 is no, a corresponding prediction period is determined according to the current time point and the prediction time period, and the energy consumption within the prediction period is predicted according to the model corresponding to the determined prediction period.

[0132] In this embodiment, whether the predicted time period covers holidays and non-holidays is determined based on the predicted time period. If the determination result is yes, the energy consumption within the predicted time period is determined based on the non-holidays corresponding to the first model and the holidays corresponding to the second model. This can make the energy consumption prediction result more accurate.

[0133] Embodiment 4

[0134] This embodiment further supplements the energy consumption prediction device of the third embodiment.

[0135] like Figure 4 , which is a schematic diagram of the structure of the device for predicting energy consumption according to this embodiment.

[0136] The prediction unit 303 in the device for predicting energy consumption includes a first determination subunit 3031 , a second determination subunit 3032 and a calculation subunit 3033 .

[0137] Among them, the first determination subunit 3031 is used to determine the first energy consumption according to the time period corresponding to non-holidays within the preset period and the first model; the second determination subunit 3032 is used to determine the second energy consumption according to the time period corresponding to holidays within the prediction period and the second model; the calculation subunit 3033 is used to use the sum of the first energy consumption and the second energy consumption as the energy consumption within the prediction period.

[0138] As an exemplary illustration, the first energy consumption = the front model * the first weight + the rear model * the second weight, and the sum of the first weight and the second weight is 1. For example, the first weight and the second weight are both 0.5.

[0139] The working methods of each unit in this embodiment are the same as those in the previous embodiment and will not be described again here.

[0140] According to this embodiment, the power consumption during the forecast period corresponding to holidays and the energy consumption during the forecast period corresponding to non-holidays are combined as the energy consumption during the forecast period, so that the forecast result is more accurate.

[0141] The present invention also provides a device for predicting energy consumption, comprising at least one memory and at least one processor, wherein the memory is used to store instructions, and the processor is used to execute the method for predicting energy consumption described in any of the above embodiments according to the instructions stored in the memory.

[0142] An embodiment of the present invention further provides a readable storage medium in which machine-readable instructions are stored, and when the machine-readable instructions are executed by a machine, the machine executes the method for predicting energy consumption described in any of the above embodiments.

[0143] The readable medium stores machine-readable instructions, which, when executed by the processor, cause the processor to execute any of the aforementioned methods. Specifically, a system or device equipped with a readable storage medium may be provided, on which a software program code implementing the functions of any of the above-mentioned embodiments is stored, and a computer or processor of the system or device reads and executes the machine-readable instructions stored in the readable storage medium.

[0144] In this case, the program code itself read from the machine-readable medium can realize the function of any one of the above-mentioned embodiments, and thus the machine-readable code and the machine-readable storage medium storing the machine-readable code constitute a part of the present invention.

[0145] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code may be downloaded from a server computer or a cloud via a communication network.

[0146] Those skilled in the art should understand that the various embodiments disclosed above can be modified and altered in various ways without departing from the essence of the invention. Therefore, the protection scope of the present invention should be defined by the appended claims.

[0147] It should be noted that not all steps and units in the above-mentioned processes and system structure diagrams are necessary, and some steps or units can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The device structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some units may be implemented by the same physical entity, or some units may be implemented by multiple physical entities, or some components in multiple independent devices may be implemented together.

[0148] In the above embodiments, the hardware unit can be realized by mechanical means or electrical means. For example, a hardware unit or a processor can include permanent dedicated circuits or logic (such as special processors, FPGA or ASIC) to complete the corresponding operation. The hardware unit or the processor can also include programmable logic or circuits (such as general-purpose processors or other programmable processors), which can be temporarily set by software to complete the corresponding operation. Concrete implementation (mechanical means or dedicated permanent circuits or temporarily set circuits) can be determined based on cost and time considerations.

[0149] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. Methods for predicting energy consumption, It is characterized in that include: Get the current time point and the preset forecast time period; Determining whether different forecast periods are covered according to the current time point and the forecast time period, the forecast period including holidays and non-holidays; If the judgment result is yes, the energy consumption in the prediction time period is predicted according to the first model and the second model, the first model is used for non-holidays, and the second model is used for holidays.

2. The method according to claim 1, It is characterized in that Predicting the energy consumption within the prediction period according to the first model and the second model includes: Determine a first energy consumption according to a time period corresponding to a non-holiday within the preset period and a first model; Determine the second energy consumption according to the time period corresponding to the holidays within the forecast period and the second model; The energy consumption in the prediction period is taken as the sum of the first energy consumption and the second energy consumption.

3. The method according to claim 1, It is characterized in that The first model includes a front model and a back model, the front model is generated based on a CatBoost model, and the back model is generated based on a BiLSTM-Attention model; and / or The second model is generated based on the CatBoost model.

4. The method according to claim 3, It is characterized in that Determining the first energy consumption according to the time period corresponding to the non-holiday period within the preset period and the first model includes: First energy consumption = front model * first weight + rear model * second weight, The sum of the first weight and the second weight is 1.

5. The method according to claim 1, It is characterized in that The forecast period is 24 hours; or The first model and / or the second model at least includes the following factors: temperature within a prediction period, production data of a target object within a prediction period, and historical data of energy consumption of the target object within a prediction period.

6. The method according to any one of claims 1 to 5, It is characterized in that If the judgment result is no, the corresponding prediction period is determined according to the current time point and the prediction time period, and the energy consumption in the prediction period is predicted according to the model corresponding to the determined prediction period.

7. Devices for predicting energy consumption, It is characterized in that include: An acquisition unit, used to acquire the current time point and a preset prediction time period; a judgment unit, configured to judge whether different prediction periods are covered according to the current time point and the prediction time period, wherein the prediction period includes holidays and non-holidays, and trigger the prediction unit if the judgment result is yes; The prediction unit is used to predict the energy consumption within the prediction time period according to the first model and the second model, the first model is used for non-holidays, and the second model is used for holidays.

8. The device according to claim 7, It is characterized in that The prediction unit comprises: A first determining subunit, configured to determine a first energy consumption according to a time period corresponding to a non-holiday period within the preset period and a first model; A second determining subunit, configured to determine a second energy consumption according to a time period corresponding to a holiday within the forecast period and a second model; A calculation subunit is used to calculate the energy consumption in the prediction period based on the sum of the first energy consumption and the second energy consumption.

9. The device according to claim 8, It is characterized in that The first model includes a front model and a back model, the front model is generated based on the CatBoost model, and the back model is generated based on the BiLSTM-Attention model; the first determination subunit is specifically used for: First energy consumption = front model * first weight + rear model * second weight, The sum of the first weight and the second weight is 1; or The second model is generated based on the CatBoost model.

10. Method and device for predicting energy consumption, It is characterized in that include: at least one memory for storing instructions; At least one processor is configured to execute the method for predicting energy consumption according to any one of claims 1 to 6 according to the instructions stored in the memory.

11. A readable storage medium, It is characterized in that The readable storage medium stores machine-readable instructions. When the machine-readable instructions are executed by a machine, the machine executes the method for predicting energy consumption according to any one of claims 1-6.