Load prediction method and related equipment
By constructing a mean square error prediction model and combining it with a trend and shape similarity evaluation system, similar days are selected and load values are calculated. This solves the problems of insufficient accuracy and stability in existing load forecasting methods and achieves high-precision load forecasting.
Patent Information
- Application Number
- CN202511117102.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-12-12
AI Technical Summary
Existing load forecasting methods fail to fully capture load characteristics in complex load forecasting tasks and ignore the similarity of load change trends, resulting in insufficient accuracy and stability of forecasting results.
By constructing a load forecasting model based on mean square error and combining a two-dimensional evaluation system of trend similarity and shape similarity, the parameters of the day to be predicted are preprocessed and characterized, candidate days are screened and trend similarity is calculated, and the load value of the day to be predicted is determined based on the load value and mean square error value of similar days.
It achieves high-precision daily load forecasting, improves the quality of model input data, is suitable for complex and ever-changing power load scenarios, and enhances the accuracy and stability of forecasting.
Smart Images

Figure CN121119216A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power system load forecasting, and in particular to a load forecasting method and related equipment. BACKGROUND
[0002] Load forecasting is an important part of power system operation and planning, directly affecting power dispatching, energy distribution and economic benefits. Existing load forecasting methods are mainly divided into three categories according to technical characteristics: traditional statistical methods, machine learning methods and deep learning methods. Traditional statistical methods mine the statistical rules of historical load data, emphasize time series features and periodicity, are suitable for smooth load sequences, have the advantages of high computational efficiency and strong interpretability, but have poor adaptability to complex nonlinear load sequences. Machine learning methods capture the complex relationship between load and multi-dimensional external features through nonlinear models, can adapt to nonlinear and high-dimensional data, have better generalization ability than traditional methods, and common models include support vector machines, decision trees, random forests, gradient boosting trees, etc. In addition, deep learning methods use deep neural networks to automatically extract the spatiotemporal dependence features of load data, are good at handling high-noise, long-sequence prediction tasks, and typical models include recurrent neural networks, convolutional neural networks and their hybrid models, which are suitable for large-scale load data modeling. Although the above methods have their own advantages, they still have certain limitations in complex load forecasting tasks.
[0003] However, most of the existing methods only focus on the shape similarity of the load curve, ignore the similarity of the load change trend, and fail to fully capture the characteristic information of the load; in addition, the existing methods usually use simple weighted processing to handle the influence of historical load on the current prediction, lack systematic quantitative analysis and accurate modeling means, resulting in insufficient accuracy and stability of the prediction results. SUMMARY
[0004] Therefore, the purpose of the present application is to provide a load forecasting method and related equipment.
[0005] In order to achieve the above purpose, the present application provides a load forecasting method, comprising:
[0006] preprocessing and characterizing the parameters corresponding to the to-be-forecasted day to obtain feature data;
[0007] inputting the feature data into a trained mean square error prediction model to obtain a mean square error value corresponding to the to-be-forecasted day; the mean square error value is the mean square error between the to-be-forecasted day and each historical day;
[0008] determining a candidate day based on the mean square error value;
[0009] calculate a trend similarity between each of the candidate days and the day to be predicted, and determine at least one similar day based on the trend similarity;
[0010] determine the load value of the day to be predicted based on the load value of the similar day and the mean square error value.
[0011] In a possible implementation, the parameters include a weather type and a week type.
[0012] The preprocessing of the parameters corresponding to the day to be predicted includes:
[0013] map the weather type to a coded value; in response to a change in the weather type on the day to be predicted, take the maximum value of the coded value as the coded value of the day to be predicted;
[0014] encode the week type so that Monday to Friday are distinguished from Saturday and Sunday.
[0015] In a possible implementation, the determining of the candidate days based on the mean square error values includes:
[0016] sort the mean square error values in ascending order;
[0017] take the first quantity of the mean square error values, and take the historical days corresponding to the first quantity of the mean square error values as the candidate days.
[0018] In a possible implementation, the calculating of the trend similarity between each of the candidate days and the day to be predicted, and the determining of at least one similar day based on the trend similarity include:
[0019] obtain a first candidate load value of a second quantity of historical days of the day to be predicted;
[0020] obtain a second candidate load value of the second quantity of historical days of each of the candidate days;
[0021] calculate the trend similarity based on the first candidate load value and the second candidate load value;
[0022] sort the trend similarities in descending order, and take the candidate days corresponding to the first quantity of the trend similarities as the similar days; the third quantity is less than the first quantity.
[0023] In a possible implementation, the determining of the load value of the day to be predicted based on the load value of the similar day and the mean square error value includes:
[0024] determine a weight corresponding to the similar day according to the mean square error value corresponding to the similar day.
[0025] The 96-point load value of the day to be predicted is calculated based on the 96-point load value of each similar day and the weight corresponding to the similar day.
[0026] In one possible implementation, the mean squared error prediction model is trained through the following steps:
[0027] Obtain feature data for training;
[0028] Calculate the mean square error of the training load for each historical training data point with all other historical days, using 96 points.
[0029] The test feature data and the training load mean square error are input into the preset model. The greedy algorithm is used to train all decision trees one by one. The second-order Taylor expansion of the objective function is optimized to obtain the trained preset model.
[0030] The trained preset model is evaluated using the mean absolute percentage error. If the evaluation passes, the trained preset model is used as the mean squared error prediction model.
[0031] Based on the same inventive concept, embodiments of this application also provide a load forecasting device, including:
[0032] The feature module is configured to preprocess and characterize the parameters obtained for the day to be predicted, thereby obtaining feature data.
[0033] The prediction module is configured to input the feature data into a trained mean squared error prediction model to obtain the mean squared error value corresponding to the day to be predicted; the mean squared error value is the mean squared error between the day to be predicted and each historical day.
[0034] The candidate day determination module is configured to determine the candidate day based on the mean square error value;
[0035] The similarity day determination module is configured to calculate the trend similarity between each candidate day and the day to be predicted, and determine at least one similar day based on the trend similarity;
[0036] The load value determination module is configured to determine the load value of the day to be predicted based on the load values of the similar days and the mean square error value.
[0037] Based on the same inventive concept, embodiments of this application also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the load forecasting method as described in any of the above.
[0038] Based on the same inventive concept, embodiments of this application also provide a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute any of the load forecasting methods described above.
[0039] Based on the same inventive concept, embodiments of this application also provide a computer program product, which includes computer program instructions for causing the computer program product to execute any of the load forecasting methods described above.
[0040] As can be seen from the above, the load forecasting method and related equipment provided in this application preprocess and characterize the parameters obtained for the forecast date to obtain feature data; input the feature data into a trained mean square error (MSE) forecasting model to obtain the MSE value corresponding to the forecast date; the MSE value is the MSE between the forecast date and each historical day; candidate days are determined based on the MSE value; the trend similarity between each candidate day and the forecast date is calculated, and at least one similar day is determined based on the trend similarity; the load value of the forecast date is determined based on the load value of the similar day and the MSE value. This application achieves high-precision daily load forecasting by constructing a load forecasting model based on MSE and combining a two-dimensional evaluation system of trend similarity and shape similarity. By encoding the meteorological type and date characteristics of the forecast date, complex information is transformed into numerical features, and data normalization and feature engineering are combined to improve the quality of the model input data. This paper calculates the mean squared error (MSE) using historical load data to select candidate days, and further filters similar days based on trend and shape similarity, quantifying the similarity between similar days and the day to be predicted from multiple dimensions. Based on the MSE value, different weights are assigned to similar days, and a weighted average method is used to accurately calculate the 96-point load value for the day to be predicted. Furthermore, a greedy algorithm is used to optimize the objective function, and the mean absolute percentage error (MAPE) is used to evaluate the model performance, ensuring the model's accuracy in predicting the mean squared error (MSE). This application comprehensively considers the variability of historical data and the regularity of load changes, thereby improving the accuracy and stability of load forecasting and making it suitable for complex and variable power load scenarios. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a schematic flowchart of the load forecasting method according to an embodiment of this application;
[0043] Figure 2 This is a schematic diagram showing the shape similarity of an embodiment of this application;
[0044] Figure 3 This is a schematic diagram of trend similarity days in an embodiment of this application;
[0045] Figure 4 This is a schematic diagram of the load forecasting device according to an embodiment of this application;
[0046] Figure 5 This is a schematic diagram of the electronic device structure according to an embodiment of this application. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.
[0048] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0049] It is understood that before using the technical solutions of the various embodiments in this disclosure, users will be informed of the type, scope of use, and usage scenarios of the personal information involved in an appropriate manner, and user authorization will be obtained.
[0050] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose, based on the prompt message, whether to provide personal information to the software or hardware such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution.
[0051] As an optional but not limited implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0052] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0053] As described in the background section, load forecasting is a crucial aspect of power system operation and planning, directly impacting power dispatch, energy allocation, and economic efficiency. Existing load forecasting methods are mainly categorized into traditional statistical methods, machine learning methods, and deep learning methods. Traditional statistical methods, by mining statistical patterns from historical load data, emphasize time-series characteristics and periodicity, making them suitable for stationary load sequences. They offer advantages such as high computational efficiency and strong interpretability, but their adaptability to complex nonlinear load sequences is poor. Machine learning methods capture the complex relationships between load and multidimensional features through nonlinear models, enabling them to handle nonlinear and high-dimensional data. Commonly used models include support vector machines, decision trees, random forests, and gradient boosting trees, exhibiting superior generalization capabilities compared to traditional methods. Deep learning methods rely on deep neural networks to automatically extract the spatiotemporal dependency features of load data. They can handle high-noise and long-sequence tasks, making them suitable for large-scale load data modeling. Commonly used models include recurrent neural networks and convolutional neural networks. However, existing technologies often focus on the similarity of load curve shapes, neglecting the similarity of load change trends and failing to comprehensively capture load characteristics. In addition, existing methods generally use simple weighting to process the impact of historical loads on forecasts, lacking systematic quantitative analysis and accurate modeling, resulting in insufficient accuracy and stability of forecast results in complex load scenarios.
[0054] Based on the above considerations, this application proposes a load forecasting method. The method involves preprocessing and characterizing the parameters obtained for the forecast date to obtain feature data; inputting the feature data into a trained mean squared error (MSE) forecasting model to obtain the MSE value for the forecast date; the MSE value is the MSE between the forecast date and each historical day; candidate days are determined based on the MSE value; the trend similarity between each candidate day and the forecast date is calculated, and at least one similar day is determined based on the trend similarity; the load value of the forecast date is determined based on the load value of the similar day and the MSE value. This application achieves high-precision daily load forecasting by constructing a load forecasting model based on MSE and combining a two-dimensional evaluation system of trend similarity and shape similarity. By encoding the meteorological type and date characteristics of the forecast date, complex information is transformed into numerical features, and data normalization and feature engineering are combined to improve the quality of the model input data. This paper calculates the mean squared error (MSE) using historical load data to select candidate days, and further filters similar days based on trend and shape similarity, quantifying the similarity between similar days and the day to be predicted from multiple dimensions. Based on the MSE value, different weights are assigned to similar days, and a weighted average method is used to accurately calculate the 96-point load value for the day to be predicted. Furthermore, a greedy algorithm is used to optimize the objective function, and the mean absolute percentage error (MASE) index is used to evaluate model performance, ensuring the model's accuracy in predicting the MSE. This application comprehensively considers the variability of historical data and the regularity of load changes, thereby improving the accuracy and stability of load forecasting and making it suitable for complex and variable power load scenarios.
[0055] The technical solutions of the embodiments of this application will be described in detail below through specific examples.
[0056] refer to Figure 1 The load forecasting method of this application includes the following steps:
[0057] Step S101: Preprocess and feature the parameters obtained for the day to be predicted to obtain feature data;
[0058] Step S102: Input the feature data into the trained mean square error prediction model to obtain the mean square error value corresponding to the day to be predicted; the mean square error value is the mean square error between the day to be predicted and each historical day.
[0059] Step S103: Determine candidate days based on the mean square error value;
[0060] Step S104: Calculate the trend similarity between each candidate day and the day to be predicted, and determine at least one similar day based on the trend similarity;
[0061] Step S105: Determine the load value of the day to be predicted based on the load values of the similar days and the mean square error value.
[0062] First, the implementation of the method begins with the acquisition and preprocessing of parameters for the forecast day. The data for the forecast day includes features such as weather type, date, and load. Weather type is mapped to a coded value; when weather conditions change on the forecast day, for example, if multiple weather types occur within a single day, the highest coded value is used as the weather code value for that day. Similarly, the weekday type uses a coding rule that distinguishes between weekdays and rest days. The codes for Monday to Friday are relatively similar, while the codes for Saturday and Sunday differ significantly from those for weekdays, thus highlighting the special nature of rest days.
[0063] Next, the preprocessed characteristic data of the day to be predicted is input into a trained mean squared error (MSE) prediction model. This model calculates the MSE value by analyzing the 96-point load curves between the day to be predicted and each historical day. The MSE value, as an indicator of the degree of difference between the day to be predicted and historical days, directly reflects the similarity in load distribution between the two.
[0064] Based on the calculated mean squared error (MSE) values, the historical day data are sorted in ascending order, and several historical days with the smallest MSE values are selected as candidate days. The number of candidate days is set according to actual needs, usually selecting the top few historical days with the smallest error values to ensure high relevance of the candidate day data.
[0065] To further refine the selection of final similar days, the trend similarity between each candidate day and the day to be predicted is calculated. The trend similarity calculation is based on the load change curves of the day to be predicted and the candidate days several days prior. By comparing their trends, the similarity in load level changes is assessed. Based on the trend similarity calculation results, the trend similarities are sorted from highest to lowest, and the candidate days with the highest trend similarity are selected as the final similar days.
[0066] After obtaining the final similar days, the load data and mean squared error values of the similar days are used to calculate the load value of the day to be predicted. Specifically, the smaller the mean squared error value of the similar day, the greater its weight. The 96 load values of all similar days are combined by weighted averaging to finally obtain the 96-point load forecast value of the day to be predicted.
[0067] Specifically, regarding step S101, in some embodiments, the parameters include weather type and weekday type; the preprocessing of the parameters obtained for the day to be predicted includes: mapping the weather type to an encoded value; in response to a change in the weather type on the day to be predicted, taking the maximum value of the encoded value as the encoded value for the day to be predicted; and encoding the weekday type so that Monday to Friday are distinguished from Saturday and Sunday.
[0068] In this embodiment, historical load data needs to be collected during data acquisition, including date, province, and 96-point load curves. Relevant meteorological data is collected from meteorological websites: weather type, highest temperature, lowest temperature, average temperature, perceived temperature, wind speed, air pressure, humidity, visibility, and precipitation. Date data is also collected, including year, month, weekday, weekday / rest day, public holiday, and day of the year.
[0069] Furthermore, the data is preprocessed to remove missing values from the power load data, smooth out outliers in the 96-point load curve, and retain only the first data entry for duplicate values.
[0070] Weather types are coded, roughly dividing weather conditions into eight categories: sunny, cloudy, overcast, rain, snow, fog, severe convection, and others, corresponding to eight mapping values: 1, 2, 3, 4, 5, 6, 7, and 8, respectively. When weather conditions change throughout the day, the highest code value of that day is used. For example, "sunny turning to thunderstorms" includes codes 1 (sunny) and 4 (rain), resulting in a final code of 4. "Cloudy with light snow" includes codes 2 (cloudy) and 5 (snow), resulting in a final code of 5.
[0071] Encoding date data is crucial, as the weekday type plays a dominant role in short-term load forecasting. Therefore, its mapping range can be mapped to the [0.1, 3.2] range to amplify the effect of the weekday factor. The mapping values for Monday to Friday are very close, corresponding to 0.1, 0.2, 0.3, 0.4, and 0.5 respectively, while Saturday and Sunday are relatively close, corresponding to 3.1 and 3.2 respectively. There is a significant difference between these two groups. Because the weekly load curve drops significantly at the weekend and rises significantly during the week, the midweek and weekend periods need to be treated differently when setting the encoding.
[0072] Furthermore, the cleaned data is normalized to fall within the range of 0-1, facilitating subsequent model calculations. The formula is:
[0073]
[0074] Where L represents the load data, L min L represents the minimum value of the load data. max This indicates the maximum value of the load data.
[0075] Furthermore, for meteorological characteristics, temperature difference characteristics and average temperature characteristics are calculated based on the highest and lowest temperatures, and the previous day's highest temperature characteristics are calculated based on the date and the highest temperature. Temporal characteristics, such as year, month, day, whether it is a holiday, whether it is the day before a holiday, and which day of the year, are introduced to improve the accuracy of prediction.
[0076] This preprocessing method addresses the shortcomings of traditional methods in handling unstructured features by reasonably quantifying the changes in weather types and the differences in weekday types, while also laying a solid foundation for subsequent feature engineering and model training.
[0077] The training process of the model will be described next. During the model training process, the processing of feature data is the same as the steps mentioned above, and will not be repeated here.
[0078] In some embodiments, the mean squared error prediction model is trained through the following steps: acquiring training feature data; calculating the mean squared error of training loads for each historical data point and all other historical days (96 points); inputting the test feature data and the mean squared error of training loads into a preset model, training all decision trees one by one using a greedy algorithm, optimizing the second-order Taylor expansion of the objective function, and obtaining the trained preset model; evaluating the trained preset model using the mean absolute percentage error, and in response to passing the evaluation, using the trained preset model as the mean squared error prediction model.
[0079] During model training, the first step is to acquire feature data for training. Feature data includes historical load data, meteorological data, and date features. For example, load data includes 96-point load curves for each day; meteorological data includes maximum, minimum, and average temperatures, wind speed, and humidity; and date features include year, month, day of the week, and whether it is a holiday. Through data preprocessing and feature engineering, this data is encoded, normalized, and features extracted to construct a feature vector suitable for the model input.
[0080] Next, the 96-point mean squared error of load between each historical day and all other historical days is calculated. Specifically, for each day, the mean squared error value between its load curve and the load curves of all other historical days is calculated, and these mean squared errors are used as the label for that historical day. The mean squared error reflects the degree of difference in load curves between different historical days, providing target labels for training the model.
[0081] In this embodiment, a direct correlation is established between similarity evaluation and final prediction accuracy by introducing historical prediction error labels. For each historical day's load data, the 96-point mean squared error (MSE) of the load data compared to all other historical days is calculated. Assuming there are n days of historical load data, and the load data for day i is L... i The load data for day j is L. j The mean square error (MSE) on day i and day j is... ij The calculation formula is:
[0082]
[0083] Where m is the number of load sampling points in a day (m = 96 in 96-point load forecasting), L i,k Let L be the load value at the k-th sampling point on the i-th day. j,k Let be the load value at the k-th sampling point on day j. These mean squared errors are used as labels for the training model, reflecting the degree of difference between historical load data.
[0084] Then, the training feature data and mean squared error labels are input into the pre-defined model for training. XGBoost (eXtreme Gradient Boosting) is chosen as the base algorithm for the mean squared error prediction model. XGBoost is an efficient machine learning algorithm based on Gradient Boosting Decision Tree (GBDT), whose advantage lies in its ability to handle complex relationships between features and effectively prevent overfitting through regularization mechanisms. During training, a greedy algorithm is used to train each decision tree sequentially, and the objective function is optimized using a second-order Taylor expansion to maximize the fit to the training data and establish a mapping relationship between features and mean squared error.
[0085] Specifically, a comprehensive feature vector containing meteorological, date, and load characteristics is used as input, and the calculated mean squared error is used as the label. XGBoost is selected as the load prediction model. During training, the model parameters are continuously adjusted so that the model can learn the mapping relationship between input features and labels, thereby predicting the corresponding mean squared error based on the relevant features of the input day to be predicted. Then, combined with load data from similar days, a weighted averaging method is used, with weights determined based on the magnitude of the predicted mean squared error; the smaller the mean squared error, the greater the weight, resulting in 96 points of load prediction values for the day to be predicted. Details are as follows:
[0086] First, the dataset is divided into a training set and a test set.
[0087] Furthermore, the core idea of XGBoost is to progressively optimize the prediction results by integrating multiple weak learners (decision trees) and employ regularization to prevent overfitting. XGBoost uses an additive model, where the predicted value is obtained by summing the outputs of multiple base learners.
[0088]
[0089] in: For sample x i The predicted value, K is the number of decision trees, f k Let F be the prediction function of the k-th tree, and F be the space of all possible decision trees.
[0090] The objective function of XGBoost consists of a loss function and a regularization term:
[0091]
[0092] in, It is the prediction error (e.g., mean square error MSE), Ω(f) k ) is a regularization term used to control model complexity:
[0093]
[0094] Where T is the number of leaf nodes in the tree, w is the weight of the leaf nodes, and γ and λ are hyperparameters used to penalize complex models.
[0095] XGBoost uses a greedy algorithm to train tree by tree, optimizing the second-order Taylor expansion approximation of the objective function at each step:
[0096]
[0097] in: For the first-order gradient, This represents the second-order gradient. By optimizing this objective function, XGBoost can fit the data more efficiently and reduce the risk of overfitting.
[0098] After model training is complete, the mean absolute percentage error (MAPE) is used to evaluate model performance. MAPE measures the accuracy of predictions by comparing the model's predicted mean squared error with the actual mean squared error. If the MAPE value meets the preset accuracy requirements, the trained model is used as the final mean squared error prediction model.
[0099] In this embodiment, MAPE (Mean Absolute Percentage Error) is a metric for measuring forecast accuracy. It calculates the absolute value of the difference between the predicted and actual values and converts it into a percentage to represent the magnitude of the average error. MAPE provides an intuitive measure of error rate, helping to evaluate the accuracy of the daily maximum load forecasting model.
[0100] The formula for calculating MAPE is as follows:
[0101]
[0102] Where A t F represents the actual value at time point t. t This represents the predicted value at time point t, where n is the total number of observations.
[0103] Once the model training is complete, test data is input into the model, and predictions are made using the model. The MAPE is calculated using the predicted and actual values. The lower the MAPE value, the higher the accuracy of the prediction.
[0104] After the model is trained, in step S102, the processed feature data of the day to be predicted is input into the trained mean square error prediction model to obtain the mean square error value corresponding to the day to be predicted; the mean square error value is the mean square error between the day to be predicted and each historical day.
[0105] In this embodiment, after inputting the processed feature data of the day to be predicted into the trained mean squared error prediction model, the model can directly predict the mean squared error of the day to be predicted for each historical day. This can be constructed into a list.
[0106] It is important to note that the historical days corresponding to the preset number of smaller mean square error values obtained here can have a high degree of similarity in shape to the day to be predicted. This is the role of introducing the mean square error value into the prediction model.
[0107] refer to Figure 2 This is a schematic diagram of a shape similar to that of an embodiment of this application.
[0108] In some embodiments, shape similarity property refers to "vertical translation similarity," that is, the maximum degree of overlap between two curves when vertical translation is allowed only. For curves X and Y, n data points are taken to form a sequence (x1, x2, ..., x...). n ) and (y1,y2,...,y n If the shape similarity between the two days is..., then the "shape similarity" between the two days is...
[0109]
[0110] Furthermore, in step S103, candidate days are determined based on the mean square error value.
[0111] In some embodiments, determining a candidate day based on the mean square error value includes: sorting the mean square error values in ascending order; taking the first number of mean square error values and using the historical days corresponding to the first number of mean square error values as the candidate days.
[0112] In this embodiment, the calculated mean squared error (MSE) values are sorted in ascending order. Historical days with smaller MSE values are listed first in the sorted list. These top-ranked historical days are those most similar to the load curve of the day to be predicted. Therefore, based on actual needs, several historical days with the smallest error values are selected as candidate days from the sorted list. The number of candidate days can be adjusted according to the design of the prediction model; typically, the top few historical days with the smallest error values are selected to ensure high similarity to the day to be predicted.
[0113] This method successfully screened candidate days that most closely resembled the load curve of the day to be predicted. The data from these candidate days will play a crucial role in subsequent similarity analysis and forecast calculations. This method uses mean squared error (MSE) values to quantify and rank historical data, ensuring the high relevance and scientific validity of the candidate days, thus laying the foundation for building accurate load forecasting models. Furthermore, this data-driven screening approach is adaptable to different load forecasting scenarios, demonstrating strong adaptability and flexibility.
[0114] For step S104, calculate the trend similarity between each candidate day and the day to be predicted, and determine at least one similar day based on the trend similarity.
[0115] In some embodiments, calculating the trend similarity between each candidate day and the day to be predicted, and determining at least one similar day based on the trend similarity, includes: obtaining a first candidate load value for the second number of historical days preceding the day to be predicted; obtaining a second candidate load value for the second number of historical days preceding each candidate day; calculating the trend similarity based on the first candidate load value and the second candidate load value; sorting the candidate days according to the trend similarity from largest to smallest, and taking the candidate days corresponding to the third number of trend similarities as the similar days; the third number is less than the first number.
[0116] In this embodiment, trend similarity reflects the degree of similarity in load change patterns between the day to be predicted and candidate days. By comparing the load characteristics of the day to be predicted and several days prior with the load characteristics of candidate days and their corresponding time periods, the most similar days to the day to be predicted can be further selected. This method ensures further optimization of the selection results based on candidate days, thereby improving the accuracy of prediction.
[0117] Specifically, firstly, load data for the preceding several days is obtained to form a load characteristic sequence for the predicted date. Simultaneously, for each candidate date, load data for the preceding several days is also obtained to form a load characteristic sequence for that candidate date. The duration of the load characteristic sequence (i.e., the number of preceding days) is generally determined based on actual needs, typically ranging from 4 to 7 days, to capture short-term load change trends.
[0118] Next, the trend similarity between the day to be predicted and each candidate day is calculated. The trend similarity calculation is based on the load characteristic sequences of both days, obtaining a numerical result by comparing the similarity of their short-term load change patterns. The greater the trend similarity, the closer their load change patterns are. After calculation, the candidate days are sorted according to the trend similarity values, from largest to smallest, and the several candidate days with the highest trend similarity are selected as the final similar days. These final similar days will serve as key reference data sources in subsequent predictions.
[0119] refer to Figure 3 This is a schematic diagram of trend similarity days in an embodiment of this application.
[0120] In this embodiment, "trend similarity days" refers to two days and several days in their vicinity whose average load change curves are very similar in shape, indicating that the average load change patterns of the days surrounding these two days are very similar. Assume the load level sequences for days i and j and several days in their vicinity (let's say day K) are as follows: (K is generally taken as 4 to 7.) Let be the average load on day i. Then the "trend similarity" between days i and j is:
[0121]
[0122] Suppose we need to select the final similar day for a given forecast date. First, we calculate several candidate days based on historical data, such as candidate day A, candidate day B, and candidate day C. The load data for the four days preceding the forecast date are 100, 110, 120, and 130, forming the load characteristic sequence for the forecast date. Similarly, for candidate day A, the load data for the four days preceding it are 98, 108, 118, and 128; for candidate day B, the load data for the four days preceding it are 95, 105, 125, and 135; and for candidate day C, the load data for the four days preceding it are 90, 100, 110, and 120.
[0123] Trend similarity calculations show that the trend similarities between the day to be predicted and candidate days A, B, and C are 0.95, 0.90, and 0.85, respectively. Based on the trend similarity ranking from highest to lowest, candidate day A has the highest trend similarity, followed by candidate day B, and then candidate day C. Assuming that the model requires selecting the top two final similar days, candidate days A and B are chosen as the final similar days.
[0124] This application can further filter candidate days to identify the final similar day that most closely matches the load change pattern of the day to be predicted, thus providing higher-quality reference data for subsequent load forecasting. It not only emphasizes the overall similarity between the load curves of the day to be predicted and historical days, but also further stresses the consistency of short-term trends, providing strong support for building accurate load forecasting models. Furthermore, it is applicable to various load forecasting scenarios, exhibiting strong practicality and flexibility.
[0125] For step S105, the load value of the day to be predicted is determined based on the load values of the similar days and the mean square error value.
[0126] In some embodiments, determining the load value of the day to be predicted based on the load values of the similar days and the mean square error value includes: determining the weight corresponding to the similar days according to the mean square error value corresponding to the similar days; and calculating the 96-point load value of the day to be predicted based on the 96-point load value of each similar day and the weight corresponding to the similar days.
[0127] In this embodiment, the first step is to obtain the load values of 96 similar days selected in the final screening, along with their corresponding mean squared error (MSE) values. The MSE is an important indicator reflecting the degree of difference between the load curves of the day to be predicted and the similar days. The smaller the MSE, the closer the load curves of the similar days are to the day to be predicted, and therefore, the higher the reference value of the similar day for prediction. Based on this, a weight is assigned to each similar day, with the weight inversely proportional to the MSE value; the smaller the MSE, the larger the weight.
[0128] Next, using the load values of 96 similar days and their corresponding weights, a weighted average method is used to calculate the predicted load value for the day to be predicted. Specifically, for each time point, the load values of all similar days and their weights are combined and weighted to obtain the predicted value for that time point. In this way, the predicted load value of 96 points for the day to be predicted is finally obtained.
[0129] Suppose that after screening, two similar days are finally identified for a certain forecast date: similar day A and similar day B. The 96-point load values of similar day A and similar day B are respectively (L... A1 ,L A2 ,…,L A96 ) and (L B1 ,L B2 ,…,L B96 The corresponding mean squared errors are 0.02 and 0.03, respectively. First, the weights are calculated based on the mean squared error values. The smaller the mean squared error value, the greater the weight of the similar day. For example, the weights are calculated to be 0.6 and 0.4, respectively.
[0130] Based on this, the load value at each time point of the day to be predicted is calculated using a weighted average. Taking a certain time point t as an example, its predicted load value is the product of the load value of similar day A and its weight, plus the product of the load value of similar day B and its weight, i.e., P. t =0.6*(L At +0.4*L Bt The predicted values for 96 time points are calculated sequentially to obtain the complete 96-point load forecast for the day to be predicted.
[0131] This step fully utilizes historical load data from similar days and rationally allocates weights based on the mean square error value to accurately predict the load value for the day to be predicted. It comprehensively considers the quality of historical data from similar days and the degree of matching with the day to be predicted, achieving precise fitting of the load curve and providing a scientific basis for load management and dispatching in power systems. It also possesses strong practicality and scalability, applicable to various load forecasting scenarios and needs.
[0132] As can be seen from the above embodiments, the load forecasting method described in this application preprocesses and characterizes the parameters corresponding to the forecast date to obtain feature data; inputs the feature data into a trained mean squared error (MSE) forecasting model to obtain the MSE value corresponding to the forecast date; the MSE value is the MSE error between the forecast date and each historical day; candidate days are determined based on the MSE value; the trend similarity between each candidate day and the forecast date is calculated, and at least one similar day is determined based on the trend similarity; the load value of the forecast date is determined based on the load value of the similar day and the MSE value. This application embodiment, by preprocessing and characterizing the parameters of the forecast date, combined with a trained MSE forecasting model, accurately calculates the MSE value between the forecast date and historical days. By screening candidate days and similar days, and comprehensively considering the dual-dimensional evaluation of trend similarity and shape similarity, the load value of the forecast date is finally accurately determined based on the load value and MSE value of the similar day, thus improving the accuracy and reliability of load forecasting.
[0133] By encoding weather types and weekday types, the impact of different weather conditions and date characteristics on the load is fully utilized. Mapping and encoding weather types transforms complex meteorological information into numerical features, using the maximum encoded value to represent various weather changes, thus enhancing the ability to handle complex weather conditions. Simultaneously, refined encoding of weekday types distinguishes between weekdays and weekends, assigning specific numerical differences between them, improving the ability to differentiate date characteristics and providing high-quality input features for the model.
[0134] By sorting and filtering based on mean squared error values, a set of candidate days closest to the day to be predicted is quickly selected. Sort the mean squared error values in ascending order and select a certain number of historical days with the smallest error values as candidate days. This improves the efficiency of similar day filtering while ensuring a high matching degree between candidate days and the day to be predicted, laying a solid foundation for subsequent trend similarity and shape similarity calculations.
[0135] By calculating the trend similarity between candidate days and the day to be predicted, and further filtering similar days based on this trend similarity, the similarity of their changing patterns is quantified by using the load change trends of the day to be predicted and several days prior to it, and the candidate day and several days prior to it. Then, similar days that better match the trend characteristics of the day to be predicted are selected through ranking. This approach effectively incorporates the influence of short-term historical load change trends, further improving the accuracy of the filtering results.
[0136] By introducing weighted calculations based on mean squared error (MSE) values and combining them with load values from similar days, a weighted average method is used to calculate the load values for 96 points on the day to be predicted. The MSE value reflects the degree of matching between similar days; the smaller the error, the greater the weight, thus more accurately reflecting the contribution of highly similar historical days to the prediction results. This weighting mechanism can fully utilize the load characteristics of similar days to generate high-precision load prediction results.
[0137] By constructing a mean squared error (MSE) prediction model based on XGBoost, the model was trained using training feature data and historical load MSE. A greedy algorithm was used to train decision trees one by one, and a second-order Taylor expansion was applied to optimize the objective function, establishing a mapping relationship between features and MSE. Furthermore, MAPE was used to evaluate the model, ensuring its accurate prediction of the MSE for the predicted day, providing high-precision support for subsequent candidate day selection and load prediction.
[0138] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.
[0139] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0140] Based on the same inventive concept, corresponding to any of the above embodiments, this application also provides a load prediction device.
[0141] refer to Figure 4 The load forecasting device includes:
[0142] Feature module 41 is configured to preprocess and characterize the parameters obtained for the day to be predicted to obtain feature data;
[0143] Prediction module 42 is configured to input the feature data into a trained mean square error prediction model to obtain the mean square error value corresponding to the day to be predicted; the mean square error value is the mean square error between the day to be predicted and each historical day.
[0144] The candidate day determination module 43 is configured to determine a candidate day based on the mean square error value;
[0145] The similarity day determination module 44 is configured to calculate the trend similarity between each candidate day and the day to be predicted, and determine at least one similar day based on the trend similarity;
[0146] The load value determination module 45 is configured to determine the load value of the day to be predicted based on the load values of the similar days and the mean square error value.
[0147] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.
[0148] The apparatus of the above embodiments is used to implement the corresponding load forecasting method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0149] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the load forecasting method described in any of the above embodiments.
[0150] Figure 5 This embodiment illustrates a more specific hardware structure of an electronic device, which may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.
[0151] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0152] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0153] The input / output interface 1030 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.
[0154] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0155] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.
[0156] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0157] The electronic devices described above are used to implement the corresponding load forecasting methods in any of the foregoing embodiments and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0158] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the load forecasting method as described in any of the above embodiments.
[0159] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0160] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the load forecasting method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0161] Based on the same inventive concept, corresponding to the load forecasting method described in any of the above embodiments, this disclosure also provides a computer program product, which includes computer program instructions. In some embodiments, the computer program instructions can be executed by one or more processors of a computer to cause the computer and / or the processors to perform the load forecasting method. Corresponding to the execution entity for each step in each embodiment of the load forecasting method, the processor executing the corresponding step may belong to the corresponding execution entity.
[0162] The computer program products of the above embodiments are used to cause the computer and / or the processor to execute the load forecasting method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0163] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application (including the claims) is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in the details for the sake of brevity.
[0164] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this application, and this also takes into account the fact that the details of the implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application can be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0165] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0166] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.
Claims
1. A load forecasting method, characterized in that, include: The parameters obtained for the date to be predicted are preprocessed and characterized to obtain feature data; The feature data is input into the trained mean squared error prediction model to obtain the mean squared error value corresponding to the day to be predicted; the mean squared error value is the mean squared error between the day to be predicted and each historical day. Candidate days are determined based on the mean square error value; Calculate the trend similarity between each candidate day and the day to be predicted, and determine at least one similar day based on the trend similarity; The load value for the day to be predicted is determined based on the load values of the similar days and the mean square error value.
2. The method according to claim 1, characterized in that, The parameters include weather type and week type; The preprocessing of the parameters obtained for the date to be predicted includes: The weather type is mapped to a coded value; in response to a change in the weather type on the day to be predicted, the maximum value of the coded value is taken as the coded value for the day to be predicted. The weekday type is encoded so that Monday through Friday are distinguished from Saturday and Sunday.
3. The method according to claim 1, characterized in that, The process of determining candidate days based on the mean square error value includes: The mean square error values are sorted in ascending order. Take the first number of mean square error values and use the historical days corresponding to the first number of mean square error values as the candidate days.
4. The method according to claim 3, characterized in that, The step of calculating the trend similarity between each candidate day and the day to be predicted, and determining at least one similar day based on the trend similarity, includes: Obtain the first candidate load value of the second number of historical days preceding the date to be predicted; Obtain the second candidate load value for each candidate day that is the second number of historical days preceding the first candidate day; The trend similarity is calculated based on the first candidate load value and the second candidate load value; The similarity of the trends is sorted from largest to smallest, and the candidate days corresponding to the third largest number of trend similarities are taken as the similar days; the third largest number is less than the first largest number.
5. The method according to claim 4, characterized in that, Determining the load value of the day to be predicted based on the load values of similar days and the mean square error value includes: The weights corresponding to the similar days are determined based on the mean square error values corresponding to the similar days. The 96-point load value of the day to be predicted is calculated based on the 96-point load value of each similar day and the weight corresponding to the similar day.
6. The method according to claim 1, characterized in that, The mean squared error prediction model is trained through the following steps: Obtain feature data for training; Calculate the mean square error of the training load for each historical training data point with all other historical days, using 96 points. The test feature data and the training load mean square error are input into the preset model. The greedy algorithm is used to train all decision trees one by one. The second-order Taylor expansion of the objective function is optimized to obtain the trained preset model. The trained preset model is evaluated using the mean absolute percentage error. If the evaluation passes, the trained preset model is used as the mean squared error prediction model.
7. A load forecasting device, characterized in that, include: The feature module is configured to preprocess and characterize the parameters obtained for the day to be predicted, thereby obtaining feature data. The prediction module is configured to input the feature data into a trained mean squared error prediction model to obtain the mean squared error value corresponding to the day to be predicted; the mean squared error value is the mean squared error between the day to be predicted and each historical day. The candidate day determination module is configured to determine candidate days based on the mean square error value; The similarity day determination module is configured to calculate the trend similarity between each candidate day and the day to be predicted, and determine at least one similar day based on the trend similarity; The load value determination module is configured to determine the load value of the day to be predicted based on the load values of the similar days and the mean square error value.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 7.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 7.
10. A computer program product comprising computer program instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 6.
