Two-stage daily maximum load forecasting method, system and storage medium based on optimized feature generation
A two-stage prediction method, which uses genetic algorithms to select feature subsets and cosine similarity to recall similar samples, solves the problem of predicting daily maximum load when historical data is insufficient, improves prediction accuracy and generalization ability, and is applicable to the field of electricity demand forecasting.
Patent Information
- Application Number
- CN202511263752.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-09-05
AI Technical Summary
Existing technologies for predicting daily maximum load suffer from poor generalization and practicality, and are not very effective at extracting value from scarce data in scenarios with insufficient historical data.
A two-stage prediction method based on optimized feature generation is adopted. First, the most influential feature subset is selected by genetic algorithm, and similar historical samples are recalled by cosine similarity for preliminary prediction. Then, the preliminary prediction value is used as a derived feature and combined with the original feature, and input into the regression prediction model for refined prediction.
It significantly improves the prediction capability for small samples, enhances prediction accuracy and generalization ability, reduces root mean square error and mean absolute percentage error, and achieves efficient prediction in scenarios where available data is scarce.
Smart Images

Figure CN120767818B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of power demand prediction, and particularly relates to a two-stage daily maximum load prediction method based on optimized feature generation, especially suitable for scenarios with insufficient historical data, a system and a computer readable storage medium. BACKGROUND
[0002] As a core monitoring and dispatching indicator in power grid operation, the accurate prediction of daily maximum load is a key link to ensure the safe and stable operation of the power system, optimize energy dispatching planning, and promote the process of green, low-carbon and high-quality development. To meet this demand, machine learning methods based on artificial intelligence theory have become the mainstream technical path in the current power load prediction field, especially the deep learning series methods with large-scale parameter neural networks as the typical architecture. With its powerful nonlinear fitting capability, this method can effectively learn the hidden patterns that affect daily maximum load, so it often performs well in scenarios with sufficient historical load data and sufficient data.
[0003] However, one inherent limitation of this series of methods is that their performance is highly dependent on large-scale, high-quality data sets to support the effective updating and convergence of their network parameters. In many practical application scenarios, such as new regional power grids, specific industrial users, or situations where historical data is discontinuous due to the replacement of metering equipment, there is often a challenge of coarse granularity and insufficient data of historical daily maximum load. In such small sample scenarios, the above deep learning series methods are prone to overfitting when learning the action patterns of various influencing factors on daily maximum load, i.e., the model over-learns the noise and accidental features in the training data without mastering the universal law, resulting in poor generalization ability and weak practicality of the final generated prediction model.
[0004] On the other hand, the existing other prediction methods in the field are mostly optimized from the perspective of the prediction modeling model itself, such as adjusting the internal structure of the prediction model or combining multiple models to participate in prediction. However, these methods to some extent ignore the full exploitation and optimization of the value contained in the data itself. In machine learning series prediction methods, data quality fundamentally determines the upper limit of the application effect of the prediction algorithm, and the improvement and optimization of the model itself only further approaches this performance upper limit determined by the data quality.
[0005] Therefore, in the context of scarce historical accumulated data, how to improve the utilization rate of limited data value and build a prediction model that can guarantee prediction accuracy and good generalization is a technical problem that needs to be solved in the current technical field. SUMMARY
[0006] The present application aims to solve the problems of poor generalization and practicability and low value mining of scarce data in the prior art of daily maximum load prediction method in the scenario of insufficient historical data.
[0007] To achieve the above-mentioned purpose, the present application provides a two-stage daily maximum load prediction method based on optimized feature generation, comprising the following steps:
[0008] S1. Obtain a historical sample set, each historical sample in the historical sample set comprising a set of original features composed of time features and weather features, and a true daily maximum load value corresponding to the original features;
[0009] S2. For a target sample to be predicted, perform a first-stage preliminary prediction to generate a preliminary prediction value, the first-stage preliminary prediction comprising:
[0010] S2.1. Select one or more features from the original features to form a feature subset by a genetic algorithm;
[0011] S2.2. Based on the feature subset and the cosine similarity, recall k similar historical samples for the target sample from the historical sample set, wherein k is a positive integer;
[0012] S2.3. Calculate the preliminary prediction value according to the cosine similarity of each of the k similar historical samples and the true daily maximum load value corresponding to each of the k similar historical samples;
[0013] S3. Perform a second-stage refined prediction to generate a final daily maximum load prediction result, the second-stage refined prediction comprising:
[0014] S3.1. Take the preliminary prediction value generated in S2 as a derived feature;
[0015] S3.2. Combine the derived feature with the original features of the target sample to form a final feature vector, and input the final feature vector into a pre-trained regression prediction model to output the final daily maximum load prediction result.
[0016] Preferably, in step S2.1, the fitness function of the genetic algorithm is configured to be determined based on the reciprocal of the mean square error between the preliminary prediction value and the true daily maximum load value of all historical samples calculated using the feature subset corresponding to the individual gene code.
[0017] Preferably, in step S2.3, the preliminary prediction value is calculated by taking the average of the true daily maximum load values of the k similar historical samples. the cosine similarity of each of the similar historical samples is normalized to obtain a respective weighting coefficient, and the weighting coefficients are used to weight the real daily maximum load values of the similar historical samples.
[0018] Preferably, in step S1, the weather features include at least one of daily maximum temperature, daily minimum temperature, daily maximum apparent temperature, daily minimum apparent temperature, daily average wind speed, daily average relative humidity, daily average ground pressure, and daily cumulative precipitation.
[0019] Preferably, the regression prediction model is a model.
[0020] In a second aspect, the present application provides a two-stage daily maximum load prediction system based on optimized feature generation, comprising:
[0021] a data acquisition module configured to acquire a historical sample set and weather forecast data, each historical sample in the historical sample set including a set of original features composed of time features and weather features, and a real daily maximum load value corresponding to the original features;
[0022] a preliminary prediction module connected to the data acquisition module and configured to perform a first-stage preliminary prediction for a target sample to be predicted, the module being configured to:
[0023] select a feature subset from the original features by using a genetic algorithm;
[0024] based on the feature subset and the cosine similarity, recall K similar historical samples for the target sample from the historical sample set;
[0025] and calculate a preliminary prediction value according to the K similar historical samples;
[0026] a fine prediction module connected to the preliminary prediction module and configured to perform a second-stage fine prediction, the module being configured to:
[0027] use the preliminary prediction value as a derived feature;
[0028] combine the derived feature with the original features of the target sample into a final feature vector, and input the final feature vector into a regression prediction model to output a final daily maximum load prediction result.
[0029] Preferably, the fitness function of the genetic algorithm in the preliminary prediction module is configured to be determined based on the reciprocal of the mean square error between the preliminary predicted values of all historical samples calculated using the feature subset corresponding to the individual gene encoding and the actual daily maximum load value.
[0030] Preferably, the preliminary prediction module is further configured to calculate the preliminary prediction value in the following manner:
[0031] The The cosine similarity of each of the similar historical samples is normalized to obtain their respective weighting coefficients, and then the weighting coefficients are used to adjust the weighting coefficients of the samples. The true daily maximum load values of similar historical samples are weighted and summed.
[0032] Preferably, the regression prediction model in the refined prediction module is: Model.
[0033] Thirdly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements the two-stage daily maximum load prediction method based on optimized feature generation as described in the first aspect.
[0034] Compared with existing technologies, the "two-stage prediction method based on optimized feature generation" proposed in this invention, through the combination of "improved genetic algorithm + cosine similarity recall," deeply mines the utilization value hidden in limited data, thereby significantly improving the prediction capability for small samples. The preliminary prediction value obtained in the first stage based on the similarity day method is introduced into the second stage as a highly condensed and information-rich "derived feature." This derived feature is essentially a condensation of prior knowledge of similar day loads, providing an extremely robust benchmark for the final model and greatly improving the generalization ability and prediction accuracy of the prediction algorithm in scenarios with scarce available data.
[0035] Based on this, the present invention hierarchically transforms the daily maximum load prediction process through a two-stage prediction. The first stage performs preliminary trend prediction, and the second stage refines the prediction based on the first stage, unifying the generation process of preliminary prediction and derived features, thus making the improvement of the final prediction accuracy orderly and stable.
[0036] Particularly, the improved genetic algorithm adopted by the present application ensures the efficiency and global optimality of the feature subset screening process through its unique two-stage selection strategy and elite preservation mechanism, laying a solid foundation for generating high-quality derived features. Finally, the second stage effectively integrates the prior information of similar days and the global information of the past overall, significantly improving the prediction accuracy while also considering the robustness of the prediction algorithm. Experimental data show that the root mean square error (RMSE) and mean absolute percentage error (MAPE) indicators of the present application method are significantly optimized compared to the baseline model. BRIEF DESCRIPTION OF DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, a brief introduction will be given below to the drawings needed to be used in the embodiment or prior art description.
[0038] Figure 1 is a step flow chart of the method of the present application;
[0039] Figure 2 is a comparison diagram of the application results of the method of the present application and the original method. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solutions and advantages of the present application clearer and more complete, the present application will be described in detail below in conjunction with the drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and do not constitute any form of limitation on the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
[0041] Embodiment One:
[0042] This embodiment details a two-stage daily maximum load prediction method based on optimized feature generation, which aims to solve the technical problems of weak generalization ability and low prediction accuracy of existing technologies in handling scenarios with insufficient historical load data. The overall technical concept of this method is to use a hierarchical two-stage prediction framework to first generate a highly condensed preliminary prediction value using an optimized feature selection and similar day weighting method, and then input this preliminary prediction value as a derived feature into a powerful regression prediction model along with the original features, thereby achieving accurate prediction of the daily maximum load. The core of this design idea is that it does not simply use historical similar information as an additional input to the model, but rather transforms it into a single, high-quality feature with clear predictive significance and prior knowledge attributes, thereby fundamentally improving the learning efficiency and generalization performance of the model in small sample data environments.
[0043] The specific execution flow of the method starts from the comprehensive acquisition and arrangement of historical data, i.e., step S1, which aims to construct a structured, high-quality historical sample set that can be called by subsequent algorithms. This step requires obtaining historical power load data and historical weather data strictly corresponding to the historical load data in the time dimension from one or more data sources, such as the dispatch automation system database of a power company, a weather information service platform, etc. The obtained power load data takes a natural day as the minimum statistical unit, and the maximum load value of each day is extracted, usually in megawatts. The obtained time characteristics at least include the corresponding Gregorian year, month, and day information of each natural day, which are the basis for judging macro trends such as seasonality and monthly periodicity. At the same time, the obtained weather characteristics are the key external factors affecting the daily maximum load change. In this embodiment, these weather characteristics comprehensively include daily maximum temperature, daily minimum temperature, daily maximum apparent temperature, daily minimum apparent temperature, daily average wind speed, daily average relative humidity, daily average ground pressure, and daily cumulative precipitation, etc. The introduction of these multi-dimensional weather characteristics can comprehensively depict the climate environment of the day to which the maximum load belongs from multiple angles such as temperature, humidity, air pressure, wind speed, and precipitation, providing a solid data foundation for subsequent similarity measurement.
[0044] After all the original data is collected, a series of data preprocessing work needs to be done, including data cleaning, which aims to identify and process missing values, outliers or error records; data alignment, which ensures that each daily maximum load record can be accurately matched to the time characteristics and all weather characteristics of the same day; and data formatting, which integrates all data into a unified historical sample set. In this sample set, each record, i.e., each historical sample, contains a set of original feature vectors composed of the aforementioned time and weather characteristics, as well as a real daily maximum load value corresponding to it as a supervised learning label. In this embodiment, the total number of records in this historical sample set, i.e., the total number of historical samples, is denoted as N, and the construction quality of this historical sample set is directly related to the upper limit of the accuracy of all subsequent prediction steps.
[0045] After the construction of the historical sample set is completed, the method enters its core two-stage prediction process. First, for a given target sample with original features to be predicted, step S2, i.e., the first-stage preliminary prediction, is executed, which generates a preliminary prediction value with high reference value and prior information attribute.
[0046] The execution of this stage begins with step S2.1, which uses an improved genetic algorithm to intelligently select the optimal subset of features that has the greatest influence on the predicted daily maximum load from the original feature set containing numerous time and meteorological characteristics. As a global optimization search algorithm that simulates natural selection and genetic mechanisms, the genetic algorithm is particularly suitable for solving such complex combinatorial optimization problems. In this embodiment, the standard genetic algorithm has been specifically adapted and improved to better serve the specific scenario of load forecasting.
[0047] The algorithm execution begins with population initialization, which first requires encoding the features. Here, a binary encoding scheme is used to create a feature vector of the same length as the original feature vector. Equal individual encoding strings, i.e., chromosomes. This represents the individual solution. In mathematics, it is defined as a binary encoded vector: In this encoded vector, the individual Each gene in the vector corresponds one-to-one with each feature in the feature vector based on the element position. ;use Represents an individual The positions of elements in the binary encoded vector and the feature vector. In this encoded string, each gene value is either 1 or 0, representing whether the original feature at the corresponding position is selected or not in this similarity calculation.
[0048] To improve the algorithm's convergence efficiency and the quality of the initial population, the initialization process is not entirely random. For example, a set of initial populations containing... Population size of each individual, optionally, This can be set to 100. First, a single individual is forcibly generated with all its genetic code set to 1, representing the initial consideration of all feature combinations. This ensures the search space is complete in the initial stages. For the remaining individuals in the population... Each individual, and each gene locus of each individual, generates a region... random numbers within This determines its value. It is a real number specified by the user to set the ratio of 0 and 1 values in the feature bit encoding, and its value range is... For example, set it to 0.3. When When the value is greater than or equal to 0.5, the gene locus is encoded as 1; otherwise, it is encoded as 0. Its mathematical expression can be represented as:
[0049] ;
[0050] in, Represents the position in the feature vector Characteristics of individuals in the current population the gene encoding value in the individual, After the initial population is generated, it is necessary to check the entire population to avoid the algorithm falling into local optimum or producing meaningless feature combinations. The checking contains two constraints:
[0051] First, for any feature bit , the gene encoding value in the entire population cannot be all 0 or all 1.
[0052] Second, for any individual, the gene encoding value cannot be all 0.
[0053] Specifically, the checking is performed by the following constraints:
[0054] ;
[0055] ;
[0056] ;
[0057] If any of the above constraints is not satisfied, the gene encoding value of the feature bit or the individual needs to be reinitialized until the entire population satisfies the constraints, thereby ensuring the effectiveness and diversity of the initial population.
[0058] Next, the core of the genetic algorithm is to evaluate the goodness of the feature subset represented by each individual through the fitness function. In the present embodiment, the fitness function is designed closely around the ultimate goal of the prediction task, i.e., minimizing the prediction error. Specifically, for the feature subset determined by the binary encoding vector of the individual , first, a preliminary prediction value is calculated for each sample in the historical sample set using the subset by the similar day recall and weighting calculation method to be described later . Then, the mean square error between all these preliminary prediction values and their corresponding true daily maximum load values is calculated . This error serves as the optimization objective function of the binary encoding vector of the individual , whose expression is:
[0059] .
[0060] Since the goal of the genetic algorithm is to maximize the fitness, and our optimization objective is to minimize the mean square error, the fitness function is designed as the inverse of the optimization objective function, i.e.,
[0061] ;
[0062] wherein, is the encoding of the th individual in the population. Such design ensures that the smaller the mean square error of an individual, the higher its fitness value, and thus the higher its survival probability in the subsequent selection operation.
[0063] After the fitness of all individuals in the population is calculated, a series of genetic operations such as selection, crossover and mutation are performed to iteratively produce a better offspring population. In the selection operation, the present embodiment is also improved by adopting a two-stage hybrid selection strategy to balance the global search and local optimization capabilities.
[0064] When a total of individuals need to be selected into the next generation mating pool, first, in the first stage, a number of individuals are selected in a with-replacement manner, for example, can be set to 70. This stage tends to select good individuals with high fitness. Its selection probability can be calculated by the following formula:
[0065] ;
[0066] The exponential form can effectively avoid the monopoly of a single excellent individual, enhance the diversity of the excellent population, and make the algorithm find the global optimal solution faster.
[0067] Subsequently, in the second stage, a number of individuals are randomly selected from the original population in a with-replacement manner with equal probability, where , for example, can be set to 30. The purpose of this stage is to maintain the diversity of the population and prevent the algorithm from converging to a local optimal solution too early. Its selection probability is: .
[0068] To further improve the performance of the algorithm, an elite reservation strategy is also introduced. If the individual with the highest fitness is always not selected in the selection process, the number of different individuals with the highest fitness is counted, and all selected individuals are sorted in ascending order according to their fitness values.
[0069] If is greater than 1, the first worse individuals after sorting in ascending order of fitness values are replaced by the top excellent individuals with the highest fitness;
[0070] If If the fitness value is equal to 1, then use the following formula to sort the results from the top of the fitness values in ascending order. One of the poorer individuals is selected to replace the best individual with the highest fitness:
[0071] ;
[0072] in, Indicates the preceding Among the poorer individuals The probability of being selected. Here, we will discuss... and Set them to 70 and 30 respectively. The value is 3.
[0073] Crossover aims to generate new offspring by exchanging gene segments from parent individuals. Two individuals are randomly selected from the mating pool without replacement to serve as parents. The resulting values range from [value range missing]. random numbers within ,when Less than or equal to the set value At that time, the gene loci are traversed sequentially, and when two individuals have the same gene locus... If the encoded values are the same, the processing operation for that encoded bit will end directly.
[0074] When two individuals are at the same gene locus When the encoded values are different, a range of values is generated. random numbers within ,when Less than or equal to the set crossover probability If the current genomic bit encoding values of the two individuals are swapped, then no operation is performed.
[0075] when Greater than At that time, a range is generated in random integers The two individuals' genes are located in All subsequent encoded values are swapped position by position. This process is repeated until all individuals have been extracted. If the initial population size is odd, then only one individual remains in the final step; this individual is not processed, and the process ends. Here, we will... Set to 0.7, It is 0.3.
[0076] The mutation operation involves sequentially traversing the gene loci for each individual in the population, and at each gene locus... Generate a range of values within random numbers within .
[0077] When the gene bit encoding value is 1, if is less than or equal to the set mutation probability , then the encoding value is set to 0, otherwise no operation is performed;
[0078] When the gene bit encoding value is 0, if is less than or equal to the set mutation probability , then the encoding value is set to 1, otherwise no operation is performed. Here, and are set to 0.05 and 0.1 respectively.
[0079] The above processes of fitness calculation, selection, crossover and mutation are repeated until a preset maximum number of iterations , which is set to 200 in this embodiment, or the overall fitness of the population no longer improves significantly over consecutive generations is reached. When the algorithm terminates, the individual with the highest fitness in the population, whose gene encoding determines the feature combination, is considered to be the optimal feature subset for daily maximum load prediction. The completion of this process marks the end of step S2.1.
[0080] Next, the method proceeds to step S2.2, which recalls similar historical samples for the target sample to be predicted based on the optimal feature subset selected in the previous step. The core of this step is to measure the similarity between samples. This embodiment uses cosine similarity as the measurement standard because it can effectively measure the difference between two vectors in direction without being affected by their absolute size, which is particularly effective for handling mixed features with different dimensions. The specific operation is as follows:
[0081] For the target sample to be predicted , only the values of those feature dimensions included in the optimal feature subset are retained to form the feature subset vector . Similarly, for each historical sample in the historical sample set, its corresponding feature subset vector is also extracted. Wherein, and are mathematically expressed as follows:
[0082] ;
[0083] ;
[0084] wherein, and are the values of sample and sample on the original feature , is the binary coded vector of the best individual th position whose coding value is 1, indicates that the feature is selected by the best feature subset, satisfying:
[0085] ;
[0086] ;
[0087] ;
[0088] ;
[0089] Then, the cosine similarity between the target sample and each historical sample is calculated. .
[0090] After calculating the similarity of all historical samples, the similarity scores are ranked in descending order, and the top historical samples with the highest scores are selected as the top similar historical samples to the target sample. The selection of the value is a hyperparameter, which can be determined by cross-validation according to the size and characteristics of the actual data set, for example can take values of 5 or 10.
[0091] After successfully recalling similar historical samples, the method enters step S2.3, that is, the preliminary prediction value of the target sample is calculated according to the information of the similar samples. The logical basis of this step is that the true daily maximum load value of the historical day most similar to the target day's features has the highest reference value for predicting the target day's load, and the higher the similarity, the greater the reference value. Therefore, this embodiment adopts a weighted average method to integrate the load information of these similar samples.
[0092] First, the weight of each similar sample needs to be calculated, which directly comes from their cosine similarity. In order to make the sum of all weights equal to 1, the cosine similarity of these similar samples needs to be normalized to get their respective weighting coefficients . The calculation formula is:
[0093] ;
[0094] where the summation term is the sum of the cosine similarities of all similar samples.
[0095] In obtaining each similar sample Weighting coefficients Then, compare it with the actual daily maximum load value corresponding to the similar sample. Multiply. Finally, combine this... The summation of the weighted load values yields the target sample. Preliminary forecast value The calculation formula is as follows: .
[0096] Through this series of calculations, the first stage of preliminary prediction is completed, generating a highly condensed preliminary prediction value for the target sample that integrates historical similarity information and prior knowledge. .
[0097] At this point, the focus of the method shifts to step S3, which involves performing the second-stage refined forecast. The goal of this stage is to generate a more accurate final daily maximum load forecast based on the preliminary forecast from the first stage and incorporating more comprehensive information. This stage begins with step S3.1, which uses the preliminary forecast value obtained through complex calculations in S2. This is a completely new and singular "derived feature." This derived feature is not the original observation data, but rather a product obtained through in-depth processing and intelligent extraction of historical data. It inherently contains strong signals and prior knowledge about the load level of the target sample. It condenses historical load information from multiple similar days into a single value through a non-linear, highly correlated weighting method, greatly reducing information redundancy while retaining the most crucial predictive clues.
[0098] Next, in step S3.2, this derived feature will be used to construct the final prediction model input. Specifically, a final feature vector needs to be constructed. This vector consists of two parts:
[0099] The first part is the target sample to be predicted. All original features, i.e., the unfiltered complete time and meteorological feature vectors defined in S1. ;
[0100] The second part consists of the derived features just generated in S3.1. , as the first vector Each dimension. At this point, the individual... The final feature vector is represented as:
[0101] ;
[0102] in = .
[0103] After the construction of this enhanced final feature vector containing the derived feature, the vector is input into a pre-trained regression prediction model. In the present embodiment, the regression prediction model is preferably a model.
[0104] That is, extreme gradient boosting, is an efficient, flexible and scalable implementation based on the gradient boosting decision tree (GBDT) algorithm. It builds multiple decision trees in series, and each new tree is committed to fitting the prediction residual of the previous tree, so as to continuously and finely correct the prediction result. The reason why it is particularly suitable for the second stage of the present embodiment is that:
[0105] Firstly, it has strong ability to capture the non-linear relationship and interaction of features, and can deeply understand the complex correlation between the derived feature and the original feature;
[0106] Secondly, it has built-in and regularization terms, which can effectively prevent the model from overfitting on small sample data, and is highly consistent with the technical problems to be solved in the present embodiment;
[0107] Finally, it has high execution efficiency and can quickly process data and generate predictions. This model needs to be pre-trained using a historical sample set. The training process is as follows:
[0108] For each sample in the historical sample set, repeat the steps of S2 and S3.1 to generate their respective derived features and construct the final feature vector. Then, use these final feature vectors containing the derived features as training input , and use their corresponding true daily maximum load values as training labels , to train the regression model.
[0109] The trained model has learned how to comprehensively use the original features and the valuable derived features to make the most accurate predictions. When the final feature vector of the target sample to be predicted is input into the trained model, the single numerical value output by the model is the final daily maximum load prediction result of the target sample.
[0110] To verify the technical effects of the method described in the embodiment, comparative experiments were conducted on a real regional power grid data set. The two-stage prediction method proposed in the embodiment and the standard method using only the original features as a benchmark were applied to predict the daily maximum load for the next 7 consecutive days. The experimental results were objectively recorded in Table 1 and Figure 2. Figure 1
[0111] Table 1. Comparison of prediction effect indicators
[0112]
[0113] In the above table, RMSE represents the root mean square error, and MAPE represents the average absolute percentage error, both of which are commonly used indicators to measure prediction error, and the smaller the value, the higher the prediction accuracy. From the data in Table 1, it can be clearly seen that the prediction method proposed in the embodiment has a significant advantage in both key error indicators. Its RMSE value is reduced from 74.6 of the benchmark model to 27.4, with a decrease of more than 63%; its MAPE value is also reduced from 0.0346 to 0.0122, with a decrease of nearly 65%.
[0114] Further, please refer to Figure 1 , which is a comparison diagram of the application method and the original method application results. In the coordinate system shown in Figure 1 , the horizontal axis represents the prediction time number, from 0 to 6, corresponding to the next 7 consecutive prediction days; the vertical axis represents the relative error, i.e. the ratio of the absolute value of the difference between the predicted value and the true value to the true value. By observing Figure 1 directly, it can be found that during the entire 7-day prediction period, the curve representing the method of the embodiment has a clear and significant lower relative error value at each prediction time point than the curve representing the original method. This shows that the method of the embodiment not only performs better in overall average error, but also has higher consistency and stability in single-point prediction of each day.
[0115] In summary, the method disclosed in the embodiment successfully solves the problem of daily maximum load prediction in the scenario of insufficient historical data volume through its unique two-stage prediction architecture and derived feature generation mechanism. It not only theoretically constructs a more reasonable and efficient data value utilization paradigm, but also proves its significant technical progress and beneficial effects over existing mainstream methods through quantifiable data and intuitive charts in practical applications, with high practical value and promotion prospects.
[0116] Embodiment Two:
[0117] The embodiment provides a daily maximum load prediction system and a computer readable storage medium storing a corresponding computer program on the basis of the method in embodiment one. The system can be a dedicated hardware device or a logical functional entity formed by running a specific software program on a general computing device (such as a server, a workstation or an embedded system). The core purpose is to solidify the foregoing method process into a stable and efficient physical or logical functional unit to provide an automated daily maximum load prediction service.
[0118] Specifically, the daily maximum load prediction device mainly includes three core functional modules in structure: a data acquisition module, a preliminary prediction module and a refined prediction module. The three modules can be physically deployed in different processor cores or memory areas of the same server and communicate through an internal high-speed data bus; or can be deployed on different nodes of a distributed computing environment and interact through a network interface and a predefined application programming interface (API).
[0119] First, the data acquisition module is the data input end of the whole device, which can be physically composed of a network interface card, a storage controller and corresponding drivers and software services. The module is responsible for stable and reliable connection with external power load history databases, meteorological data service platforms and the like. It is configured to periodically or according to instructions to trigger the data acquisition, cleaning, alignment and formatting operations described in S1 step of embodiment one, and finally build and maintain a historical sample set in the internal memory (such as RAM or solid state disk) of the device, which can be accessed by other modules at any time. The module provides the historical sample set processed by it to the preliminary prediction module through an internal data bus or shared memory mechanism.
[0120] Second, the preliminary prediction module is the core execution unit for realizing the first stage prediction function in embodiment one. The module can be logically regarded as a complex computing engine, and its function is realized by program code running on a central processing unit (CPU) or a special computing chip (such as FPGA). It is electrically connected or logically coupled with the data acquisition module to receive the historical sample set and the target sample information to be predicted. The preliminary prediction module can be further divided into multiple sub-units. For example, a genetic algorithm engine sub-unit is specially responsible for performing the feature selection process described in S2.1 step of embodiment one, including initialization verification, two-stage selection, crossover and mutation and the like, and the output is the information of the optimal feature subset. Another similarity calculation and recall sub-unit calculates and recalls the similar historical samples based on the cosine similarity according to the feature subset output by the genetic algorithm engine, and the output is the information of the similar historical samples. A weighted prediction value calculation sub-unit receives the information of the similar historical samples output by the similarity calculation and recall sub-unit, and calculates the weighted prediction value of the target sample to be predicted according to the information of the similar historical samples. The preliminary prediction module is responsible for the first stage of the prediction process. It receives the target sample and its similarity from the data acquisition module, and performs the weighted summation calculation as described in S2.3, finally generating a preliminary prediction value. After completing its complex calculation task, the preliminary prediction module passes this single but information-rich preliminary prediction value to the refinement prediction module through internal bus or API call.
[0121] Finally, the refinement prediction module is the final output of the system, responsible for the second stage of the refinement prediction. This module is also closely connected with the preliminary prediction module. It receives the preliminary prediction value from the preliminary prediction module and takes it as the derived feature defined in S3.1. Meanwhile, it also acquires the complete original features of the target sample from the data acquisition module or a shared data buffer. A feature combiner unit inside the module is responsible for splicing the original features and the derived features into the final feature vector defined in S3.2.
[0122] Subsequently, the final feature vector is sent to a pre-trained regression prediction model executor. This executor has the preferred model in embodiment one embedded inside. After receiving the final feature vector, the model executor quickly completes the forward propagation calculation and outputs a single numerical value, which is the final daily maximum load prediction result. The refinement prediction module can then send this prediction result to the power dispatching system, data visualization platform or system administrator through its output interface (such as network interface or display controller).
[0123] In addition, the embodiment also provides a computer-readable storage medium, such as a non-volatile solid state disk, hard disk drive, optical disc, or volatile random access memory. A series of computer program instructions are stored on the storage medium. When a computing device, such as the processor of the aforementioned device, reads and executes these program instructions, the device will automatically complete all method steps from S1 to S3 described in detail in embodiment one, thereby becoming the daily maximum load prediction system described in the embodiment in terms of function.
[0124] The system provided by the embodiment inherits all the technical advantages at the method level, and can provide a reliable, accurate and especially suitable intelligent prediction tool for small sample data scenarios for the power system. Its running effect is completely consistent with that described in embodiment one, and can also achieve the significant performance improvement compared with the prior art as shown in Table 1 and Figure 1 has strong engineering implementation value and application prospect.
Claims
1. A two-stage daily maximum load prediction method based on optimized feature generation, characterized in that, Includes the following steps: S1. Obtain a historical sample set, wherein each historical sample in the historical sample set includes a set of original features composed of time features and meteorological features, and the actual daily maximum load value corresponding to the original features; S2. For a target sample to be predicted, perform a first-stage prediction to generate a preliminary prediction value, wherein the first-stage prediction includes: S2.
1. Select one or more features from the original features using a genetic algorithm to form a feature subset; S2.
2. Based on the feature subset and cosine similarity, recall the target sample from the historical sample set. Several similar historical samples, among which It is a positive integer; S2.
3. According to the above The preliminary predicted value is calculated by taking the cosine similarity of each of the similar historical samples and their corresponding real daily maximum load values. S3. Perform the second-stage forecast to generate a final day's maximum load forecast, which includes: S3.
1. The preliminary predicted value generated in S2 is used as a derived feature; S3.
2. Combine the derived features with the original features of the target sample to form a final feature vector, and input the final feature vector into a pre-trained regression prediction model to output the final daily maximum load prediction result.
2. The two-stage daily maximum load prediction method based on optimized feature generation according to claim 1, characterized in that, In step S2.1, the fitness function of the genetic algorithm is configured to be determined based on the reciprocal of the mean square error between the preliminary predicted values of all historical samples calculated using the feature subset corresponding to the individual gene encoding and the actual daily maximum load value.
3. The two-stage daily maximum load prediction method based on optimized feature generation according to claim 1 or 2, characterized in that, In step S2.3, the preliminary predicted value is calculated as follows: [The text abruptly ends here, likely due to an incomplete sentence or missing information.] The cosine similarity of each of the similar historical samples is normalized to obtain their respective weighting coefficients, and then the weighting coefficients are used to adjust the weighting coefficients of the samples. The true daily maximum load values of similar historical samples are weighted and summed.
4. The two-stage daily maximum load prediction method based on optimized feature generation according to claim 1, characterized in that, In step S1, the meteorological characteristics include at least one of the following: daily maximum temperature, daily minimum temperature, daily maximum perceived temperature, daily minimum perceived temperature, daily average wind speed, daily average relative humidity, daily average surface air pressure, and daily cumulative precipitation.
5. The two-stage daily maximum load prediction method based on optimized feature generation according to claim 1, characterized in that, The regression prediction model is: Model.
6. A two-stage daily maximum load prediction system based on optimized features, characterized in that, include: The data acquisition module is used to acquire a historical sample set and meteorological forecast data. Each historical sample in the historical sample set includes a set of original features composed of time features and meteorological features, as well as the actual daily maximum load value corresponding to the original features. The preliminary prediction module, connected to the data acquisition module, is used to perform a first-stage preliminary prediction for a target sample to be predicted. This module is configured as follows: A subset of features is selected from the original features using a genetic algorithm; Based on the feature subset and cosine similarity, the target sample is recalled from the historical sample set. A number of similar historical samples; And according to the above A preliminary prediction value is obtained by calculating from similar historical samples; A refined prediction module, connected to the preliminary prediction module, is used to perform the second-stage refined prediction. This module is configured as follows: The preliminary predicted value is used as a derived feature; The derived features are combined with the original features of the target sample to form a final feature vector, and the final feature vector is input into a regression prediction model to output a final daily maximum load prediction result.
7. The two-stage daily maximum load prediction system based on optimized feature generation according to claim 6, characterized in that, The fitness function of the genetic algorithm in the preliminary prediction module is configured to be determined based on the reciprocal of the mean square error between the preliminary predicted values of all historical samples calculated using the feature subset corresponding to the individual gene encoding and the actual daily maximum load value.
8. The two-stage daily maximum load prediction system based on optimized feature generation according to claim 6 or 7, characterized in that, The preliminary prediction module is further configured to calculate the preliminary prediction value in the following manner: The The cosine similarity of each of the similar historical samples is normalized to obtain their respective weighting coefficients, and then the weighting coefficients are used to adjust the weighting coefficients of the samples. The true daily maximum load values of similar historical samples are weighted and summed.
9. The two-stage daily maximum load prediction system based on optimized feature generation according to claim 6, characterized in that, The regression prediction model in the refined prediction module is: Model.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the two-stage daily maximum load prediction method based on optimized feature generation as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Short-term Load Forecasting Method Based on TCN and IPSO-LSSVM Combined Model
AU2020104000A4
Electric power system short-term load prediction method based on GEP parameter optimization XGBoost
CN111340273A