Similar day selection method and device for short-term load forecasting
By building a similarity prediction model based on machine learning and utilizing historical data on load and meteorological factors, the problem of short-term load forecasting relying on experience is solved, achieving more accurate and stable prediction results.
Patent Information
- Application Number
- CN202210146123.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-17
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-02-17
AI Technical Summary
In the existing technology, the effect of short-term load forecasting depends on the experience of forecasters, resulting in unsatisfactory forecasting results.
A similarity prediction model is constructed using a machine learning algorithm. By obtaining historical data on load and meteorological factors, a training sample set is constructed. Feature exchange and unbiased sample expansion are used to train the machine learning model, calculate the similarity between the predicted day and historical days, and determine similar days.
It improves the accuracy and stability of short-term load forecasting, reduces dependence on forecaster experience, and improves forecasting results.
Smart Images

Figure CN114819250B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power market, and in particular relates to a similar day selection method and device for short-term load forecasting. Background Art
[0002] The production, transmission, distribution and use of electric energy are carried out simultaneously. Since electric energy cannot be stored in large quantities, the supply and demand of electricity must be balanced in real time. Power dispatching needs to formulate unit start-up and shutdown and power equipment maintenance plans in advance based on future load demand. Therefore, accurate load forecasting is of great significance to the dispatching and operation of the power grid. The level of load forecasting directly affects the economic and social benefits of the power system.
[0003] Short-term load forecasting generally refers to the prediction of future load demand 1 to 7 days in advance. In short-term load forecasting, rationally selecting similar days is an effective way to improve the accuracy of load forecasting.
[0004] In related technologies, selecting similar days is a complex task, as power load is affected by multiple factors, including weather, social events, electricity prices, and the load's own conditions. Traditional methods based on manual experience are limited by the level of human experience, making expert experience difficult to quantify and resulting in unsatisfactory prediction results that rely heavily on the skill of the forecaster. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to overcome the shortcomings of the existing technology and provide a similar day selection method and device for short-term load forecasting, so as to solve the problem in the existing technology that the forecast effect depends on the level of the forecaster, resulting in unsatisfactory forecast effect.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: a similar day selection method for short-term load forecasting, comprising:
[0007] Obtaining historical data of load and meteorological factors and obtaining a training sample set by exchanging features and constructing unbiased samples based on the historical data;
[0008] The machine learning model is trained using the training sample set to obtain a similarity prediction model; the similarity prediction model is used to represent the relationship between sample characteristics and load similarity;
[0009] Calculating the similarity between the historical data of the first preset number of days before the day to be predicted and the pre-acquired prediction data of the day to be predicted by the similarity prediction model, and obtaining the prediction similarity;
[0010] A similar day is determined according to the predicted similarity.
[0011] Furthermore, the meteorological factors include:
[0012] Average temperature, maximum temperature, minimum temperature, humidity, and weather type.
[0013] Furthermore, constructing a training sample set based on the historical data by exchanging features and constructing unbiased samples includes:
[0014] Selecting historical days that are a second preset number of days before the day to be predicted as a first set, and selecting a first date from the first set;
[0015] Selecting historical days that are a third preset number of days before the first date as a second set, and selecting a second date from the second set;
[0016] Each first date in the first set and the corresponding second date in the second set constitutes a sample, wherein the sample includes a sample feature and a sample target value;
[0017] Traversing the first set in a manner of constructing unbiased samples to obtain unbiased samples and constructing a supplementary sample for each date in the first set in a manner of feature exchange;
[0018] The unbiased samples and the supplementary samples constitute a training sample set.
[0019] Furthermore, the feature swapping is to swap the position of the features of the first date with the features of the second date to form a new sample to expand the sample; wherein, the sample formed by each first date in the first set and the corresponding second date in the second set and the new sample obtained by the feature swapping constitute the supplementary sample;
[0020] The method of constructing the unbiased sample is to obtain the third date from the first set and obtain the third date again, and the third date and the third date are constructed into the unbiased sample.
[0021] Furthermore, the method of using the training sample set to train the machine learning model to obtain a similarity prediction model includes:
[0022] Divide the training sample set into training set and test set;
[0023] Using the training set to train a machine learning model and using the test set to perform parameter optimization on the machine learning model to determine hyperparameters of the machine learning model;
[0024] Get the similarity prediction model.
[0025] Furthermore, the similarity prediction model is used to calculate the similarity between the historical daily data of the first preset number of days before the day to be predicted and the pre-acquired prediction data of the day to be predicted, including:
[0026] Selecting a plurality of historical days from a first preset number of days before the day to be predicted and the day to be predicted to form sample features, and constructing a first prediction sample set;
[0027] Inputting the first prediction sample set into a similarity prediction model to obtain first prediction similarity results for multiple historical days and the day to be predicted;
[0028] The to-be-predicted day and a plurality of historical days selected from the to-be-predicted day and the historical days a first preset number of days before the to-be-predicted day form sample features to construct a second prediction sample;
[0029] Inputting the second prediction sample set into the similarity prediction model to obtain second prediction similarity results between the to-be-predicted day and a plurality of historical days;
[0030] The first prediction similarity result and the second prediction similarity result of the day to be predicted and multiple historical days are averaged to obtain a final prediction similarity result.
[0031] Furthermore, the predicted similarity includes multiple ones.
[0032] Furthermore, determining the similar day according to the predicted similarity includes:
[0033] The date with the highest prediction similarity is determined as the similar day to the day to be predicted.
[0034] The present application provides a similar day selection device for short-term load forecasting, comprising:
[0035] An acquisition module, configured to acquire historical data of load and meteorological factors and obtain a training sample set based on the historical data;
[0036] A training module, configured to train a machine learning model using the training sample set to obtain a similarity prediction model; the similarity prediction model is configured to represent a relationship between sample features and load similarity;
[0037] A calculation module, configured to calculate the similarity between the historical daily data of a first preset number of days before the to-be-predicted day and the pre-acquired prediction data of the to-be-predicted day using the similarity prediction model to obtain a prediction similarity;
[0038] A determination module is used to determine similar days according to the predicted similarity.
[0039] The present invention adopts the above technical solution, and the beneficial effects that can be achieved include:
[0040] The present invention provides a method and device for selecting similar days for short-term load forecasting. The method comprises obtaining historical data on load and meteorological factors and obtaining a training sample set based on the historical data; training a machine learning model using the training sample set to obtain a similarity prediction model; the similarity prediction model is used to represent the relationship between sample characteristics and load similarity; using the similarity prediction model, the similarity between historical data for a preset number of days before the day to be predicted and pre-acquired forecast data for the day to be predicted is calculated to obtain a predicted similarity; and determining a similar day based on the predicted similarity. The technical solution provided by the present invention is a data-driven model constructed based on a machine learning algorithm, which simplifies the calculation of similar days, improves forecast accuracy, and achieves better forecast results. 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 following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0042] Figure 1 Schematic diagram of the steps of the similar day selection method for short-term load forecasting according to the present invention;
[0043] Figure 2 It is a structural schematic diagram of the similar day selection device for short-term load forecasting of the present invention. DETAILED DESCRIPTION
[0044] To make the objectives, technical solutions, and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other implementations obtained by those of ordinary skill in the art without inventive effort are within the scope of protection of the present invention.
[0045] The following describes a specific similar day selection method and device for short-term load forecasting provided in an embodiment of the present application in conjunction with the accompanying drawings.
[0046] like Figure 1 As shown, the similar day selection method for short-term load forecasting provided in the embodiment of the present application includes:
[0047] S101, obtaining historical data of load and meteorological factors and obtaining a training sample set based on the historical data;
[0048] S102: training a machine learning model using the training sample set to obtain a similarity prediction model; the similarity prediction model is used to represent the relationship between sample features and load similarity;
[0049] S103, using the similarity prediction model, respectively calculating similarities between historical data of a first preset number of days before the to-be-predicted day and pre-acquired prediction data of the to-be-predicted day, to obtain prediction similarities;
[0050] S104: Determine similar days according to the predicted similarity.
[0051] The working principle of the similar day selection method for short-term load forecasting is as follows: first, obtain historical data on load and meteorological factors and obtain a training sample set based on the historical data; use the training sample set to train the machine learning model to obtain a similarity prediction model; the similarity prediction model is used to represent the relationship between sample characteristics and load similarity; calculate the similarity between the historical daily data of the first preset number of days before the day to be predicted and the pre-acquired forecast data of the day to be predicted through the similarity prediction model to obtain the forecast similarity; determine the similar day based on the forecast similarity. Among them, the load similarity is defined as the relative deviation value of the daily 96-point load curve of two days, and the formula is as follows
[0052]
[0053] in:
[0054] d1 represents date 1, d2 represents date 2;
[0055] T represents the number of daily periods, such as 24, 96, etc.;
[0056] Load d1,t represents the load on date 1 during period t;
[0057] Load d2,t represents the load on date 2 during period t;
[0058] Preferably, the meteorological factors include:
[0059] Average temperature, maximum temperature, minimum temperature, humidity, and weather type.
[0060] Preferably, constructing a training sample set by exchanging features and constructing unbiased samples based on the historical data includes:
[0061] Selecting historical days that are a second preset number of days before the day to be predicted as a first set, and selecting a first date from the first set;
[0062] Selecting historical days that are a third preset number of days before the first date as a second set, and selecting a second date from the second set;
[0063] Each first date in the first set and the corresponding second date in the second set constitutes a sample, wherein the sample includes a sample feature and a sample target value;
[0064] Traversing the first set in a manner of constructing unbiased samples to obtain unbiased samples and constructing a supplementary sample for each date in the first set in a manner of feature exchange;
[0065] The unbiased samples and the supplementary samples constitute a training sample set.
[0066] It is understandable that the present application reads historical data of load and meteorological factors, as well as meteorological forecast data for the day to be predicted, and relevant factors include average temperature, maximum temperature, minimum temperature, humidity, weather type, etc.
[0067] Preferably, the feature exchange is to interchange the features of the first date with the features of the second date to form a new sample to expand the sample; wherein the sample formed by each first date in the first set and the corresponding second date in the second set and the new sample obtained by the feature exchange constitute the supplementary sample;
[0068] The method of constructing the unbiased sample is to obtain the third date from the first set and obtain the third date again, and the third date and the third date are constructed into the unbiased sample.
[0069] Specifically, construct a training sample set for the machine learning model: each training sample E i =(X i ,y i ) contains two parts, one is the sample feature X i , and the second is the sample target value g i ;
[0070] a. Select N1 historical days before the predicted day as the set S 1 , from S 1 Select a date d, and then select N2 historical days before date d as a set Depend on The date d′ in the data is combined with the date d to form a sample. Each d′ and d can form two samples E1 = (X1, y1) and E2 = (X2, y2). The sample characteristics and target value are calculated as follows:
[0071] y i =s d′,d ;
[0072] y i =s d,d′ ;
[0073] X represents the characteristics of the sample, that is, the set of characteristics of the two dates; y represents the target value of the sample, that is, the similarity between the two dates.
[0074] Among them, the date features include the following table
[0075]
[0076] b. Traverse the set S according to the above steps 1 A total of 2*N1*N2 unbiased samples can be constructed; in this way, X1 and X2 constitute two samples by exchanging features, which can double the original samples and expand the samples.
[0077] c, for the set S 1 For each date within , construct N1 supplementary samples E = (X, y) as follows
[0078] X = [features of date d, features of date d], y = s d,d =0;
[0079] Specifically, in this application, a date is first obtained, and then the same date is taken out. The two dates constitute an unbiased sample, so that the features of the two different dates can be displayed even if they are very small, thereby improving the accuracy of the model.
[0080] d. The unbiased samples and supplementary samples constitute the training sample set.
[0081] Preferably, the method of using the training sample set to train the machine learning model to obtain a similarity prediction model includes:
[0082] Divide the training sample set into training set and test set;
[0083] Using the training set to train a machine learning model and using the test set to perform parameter optimization on the machine learning model to determine hyperparameters of the machine learning model;
[0084] Get the similarity prediction model.
[0085] Specifically, this application trains the similarity prediction model M, and the specific process is as follows:
[0086] Divide the training samples into training set and test set;
[0087] Use the xgboost machine learning model to train on similarity samples and perform parameter optimization on the test set to determine the model hyperparameters and obtain the similarity prediction model M. Input sample features into the model M to obtain the predicted similarity.
[0088] In some embodiments, the similarity prediction model is used to calculate the similarity between the historical daily data of the first preset number of days before the day to be predicted and the pre-acquired prediction data of the day to be predicted to obtain the prediction similarity, including:
[0089] Selecting a plurality of historical days from a first preset number of days before the day to be predicted and the day to be predicted to form sample features, and constructing a first prediction sample set;
[0090] Inputting the first prediction sample set into a similarity prediction model to obtain first prediction similarity results for multiple historical days and the day to be predicted;
[0091] The to-be-predicted day and a plurality of historical days selected from the to-be-predicted day and the historical days a first preset number of days before the to-be-predicted day form sample features to construct a second prediction sample;
[0092] Inputting the second prediction sample set into the similarity prediction model to obtain second prediction similarity results between the to-be-predicted day and a plurality of historical days;
[0093] The first prediction similarity result and the second prediction similarity result of the day to be predicted and multiple historical days are averaged to obtain a final prediction similarity result.
[0094] It is understandable that, if multiple historical days are selected, the predicted similarities between multiple historical days and the day to be predicted can be obtained, so multiple predicted similarities can be obtained. For example, the historical data of the first preset number of days before the day to be predicted is taken as a, and the pre-acquired predicted data of the day to be predicted is taken as b. In this application, the similarity between a and b is first calculated, and then the similarity between b and a is calculated. The average of the two similarities is then taken as the final similarity between the two.
[0095] Preferably, determining the similar day according to the predicted similarity includes:
[0096] The date with the highest prediction similarity is determined as the similar day to the day to be predicted.
[0097] Specifically, the steps for calculating the similarity between a historical day and a day to be predicted are: selecting a historical day from the N1 historical days before the day to be predicted and the day to be predicted d predict Combine features together to construct prediction samples, historical day d and day d to be predicted predict The combined features are as follows
[0098]
[0099]
[0100] Send X1 and X2 into the prediction model M to obtain the predicted similarities S1 and S2, and take the average of the two As d and d predict similarity;
[0101] Similar days are selected based on the predicted similarity.
[0102] Select N1 historical days before the day to be predicted in sequence, calculate the similarity between the historical day and the day to be predicted according to the above steps, and select the date with the highest similarity as the similar day to the day to be predicted.
[0103] The similar day prediction model in the technical solution provided by this application is a data-driven model based on machine learning algorithms, which provides more accurate and stable prediction results. In addition, the construction of supplementary samples is added to the training sample construction to ensure the stability of the model.
[0104] like Figure 2 As shown, an embodiment of the present application provides a similar day selection device for short-term load forecasting, comprising:
[0105] An acquisition module 201 is configured to acquire historical data of load and meteorological factors and obtain a training sample set based on the historical data;
[0106] The training module 202 is used to train the machine learning model using the training sample set to obtain a similarity prediction model; the similarity prediction model is used to represent the relationship between sample features and load similarity;
[0107] The calculation module 203 is configured to calculate the similarity between the historical data of the first preset number of days before the to-be-predicted day and the pre-acquired prediction data of the to-be-predicted day using the similarity prediction model to obtain a prediction similarity;
[0108] The determination module 204 is configured to determine similar days according to the predicted similarity.
[0109] The working principle of the similar day selection device for short-term load forecasting provided in the embodiment of the present application is as follows: the acquisition module 201 acquires historical data of load and meteorological factors and obtains a training sample set based on the historical data; the training module 202 uses the training sample set to train the machine learning model to obtain a similarity prediction model; the similarity prediction model is used to represent the relationship between sample characteristics and load similarity; the calculation module 203 calculates the similarity between the historical day data of the first preset number of days before the day to be predicted and the pre-acquired prediction data of the day to be predicted through the similarity prediction model to obtain the prediction similarity; the determination module 204 determines the similar day based on the prediction similarity.
[0110] An embodiment of the present application provides a computer device, comprising a processor, and a memory connected to the processor;
[0111] The memory is used to store a computer program, and the computer program is used to execute the similar day selection method for short-term load forecasting provided by any of the above embodiments;
[0112] The processor is used to call and execute computer programs in the memory.
[0113] In summary, the present invention provides a method and device for selecting similar days for short-term load forecasting, the method comprising obtaining historical data on load and meteorological factors and obtaining a training sample set based on the historical data; using the training sample set to train a machine learning model to obtain a similarity prediction model; the similarity prediction model is used to represent the relationship between sample characteristics and load similarity; using the similarity prediction model to calculate the similarity between the historical day data of the first preset number of days before the day to be predicted and the pre-acquired forecast data of the day to be predicted, to obtain a predicted similarity; and determining a similar day based on the predicted similarity. The technical solution provided by the present invention is a data-driven model constructed based on a machine learning algorithm, which makes the calculation of similar days simpler, improves the prediction accuracy, and achieves better prediction results.
[0114] It can be understood that the method embodiment provided above corresponds to the device embodiment above, and the corresponding specific contents can be referenced to each other and will not be repeated here.
[0115] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) that contain computer-usable program code.
[0116] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0117] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction method, which is implemented in the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0118] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0119] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A similar day selection method for short-term load forecasting, characterized in that: include: Obtaining historical data of load and meteorological factors and constructing a training sample set based on the historical data by exchanging features and constructing unbiased samples; The machine learning model is trained using the training sample set to obtain a similarity prediction model; the similarity prediction model is used to represent the relationship between sample characteristics and load similarity; Calculating the similarity between the historical data of the first preset number of days before the day to be predicted and the pre-acquired prediction data of the day to be predicted by the similarity prediction model, and obtaining the prediction similarity; determining a similar day according to the predicted similarity; The method of training the machine learning model using the training sample set to obtain a similarity prediction model includes: Divide the training sample set into training set and test set; Using the training set to train a machine learning model and using the test set to perform parameter optimization on the machine learning model to determine hyperparameters of the machine learning model; Obtain a similarity prediction model; Calculating the similarity between the historical day data of a first preset number of days before the to-be-predicted day and the pre-acquired forecast data of the to-be-predicted day by using the similarity prediction model includes: Selecting a plurality of historical days from a first preset number of days before the day to be predicted and the day to be predicted to form sample features, and constructing a first prediction sample set; Inputting the first prediction sample set into a similarity prediction model to obtain first prediction similarity results for multiple historical days and the day to be predicted; The to-be-predicted day and a plurality of historical days selected from the to-be-predicted day and the historical days a first preset number of days before the to-be-predicted day form sample features to construct a second prediction sample; Inputting the second prediction sample set into the similarity prediction model to obtain second prediction similarity results between the to-be-predicted day and a plurality of historical days; The first prediction similarity result and the second prediction similarity result of the day to be predicted and multiple historical days are averaged to obtain a final prediction similarity result.
2. The method according to claim 1, characterized in that The meteorological factors include: Average temperature, maximum temperature, minimum temperature, humidity, and weather type.
3. The method according to claim 1, characterized in that The constructing of a training sample set by exchanging features and constructing unbiased samples based on the historical data includes: Selecting historical days that are a second preset number of days before the day to be predicted as a first set, and selecting a first date from the first set; Selecting historical days that are a third preset number of days before the first date as a second set, and selecting a second date from the second set; Each first date in the first set and the corresponding second date in the second set constitutes a sample, wherein the sample includes a sample feature and a sample target value; Traversing the first set in a manner of constructing unbiased samples to obtain unbiased samples and constructing a supplementary sample for each date in the first set in a manner of feature exchange; The unbiased samples and the supplementary samples constitute a training sample set.
4. The method according to claim 3, characterized in that The feature swapping is to swap the features of the first date with the features of the second date to form a new sample to expand the sample; wherein, the sample formed by each first date in the first set and the corresponding second date in the second set and the new sample obtained by feature swapping constitute the supplementary sample; The method of constructing the unbiased sample is to obtain the third date from the first set and obtain the third date again, and the third date and the third date are constructed into the unbiased sample.
5. The method according to claim 1, wherein The determining of the similar day according to the predicted similarity includes: The date with the highest prediction similarity is determined as the similar day to the day to be predicted.
6. A similar day selection device for short-term load forecasting, characterized in that: The similar day selection method for short-term load forecasting according to any one of claims 1 to 5, wherein the similar day selection device for short-term load forecasting comprises: An acquisition module, configured to acquire historical data of load and meteorological factors and obtain a training sample set based on the historical data; A training module, configured to train a machine learning model using the training sample set to obtain a similarity prediction model; the similarity prediction model is configured to represent a relationship between sample features and load similarity; A calculation module, configured to calculate the similarity between the historical daily data of a first preset number of days before the to-be-predicted day and the pre-acquired prediction data of the to-be-predicted day using the similarity prediction model, to obtain a prediction similarity; A determination module is used to determine similar days according to the predicted similarity.
Citation Information
Patent Citations
Short-term load prediction method based on parameter adaptive similar day method
CN112001554A
Sentence vector model training method
CN113553824A