Two-stage daily maximum load prediction method and system based on optimization feature generation and storage medium

A two-stage prediction method using genetic algorithm to screen feature subsets and cosine similarity to recall similar historical samples solves the problem of daily maximum load prediction when the amount of historical data is insufficient, and achieves high-precision and stable prediction results.

CN120767818AActive Publication Date: 2025-10-10HEFEI ZHONGKEYOU CARBON INFORMATION TECH CO LTD

Patent Information

Application Number
CN202511263752.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-05
Publication Date
2025-10-10
Estimated Expiration
2045-09-05

AI Technical Summary

Technical Problem

In scenarios where the amount of historical data is insufficient, the existing technology's daily maximum load forecasting method has problems such as poor generalization and practicality, and a low degree of value mining of scarce data.

Method used

A two-stage prediction method based on optimized feature generation is adopted. Feature subsets are screened by genetic algorithm and similar historical samples are recalled using cosine similarity to generate preliminary prediction values, which are then input into the regression prediction model as derived features for refined prediction.

Benefits of technology

It significantly improves the small sample prediction ability, improves the prediction accuracy and generalization ability, and reduces the root mean square error and mean absolute percentage error.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120767818A_ABST
    Figure CN120767818A_ABST
Patent Text Reader

Abstract

The invention discloses a two-stage daily maximum load prediction method and system based on optimization feature generation and a storage medium, and belongs to the field of power demand prediction. The method aims to solve the problems of poor generalization of prediction models and insufficient data value mining under the scene of insufficient historical data volume. The method comprises the following steps: in a first stage, screening an optimal feature subset from original time and meteorological features by using an improved genetic algorithm, recalling a similar day based on the subset and cosine similarity, and carrying out weighted calculation on a real load value of the similar day to obtain a preliminary predicted value; in the second stage, the preliminary prediction value serves as a derivative feature, the derivative feature and the original feature jointly form a final feature vector, the final feature vector is input into a regression model for refined prediction, and a final result is obtained. The method effectively improves the prediction precision and robustness of a prediction algorithm in a small sample scene through generating the derivative features with concentrated information and adopting a two-stage hierarchical prediction framework.
Need to check novelty before this filing date? Find Prior Art

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 affecting daily maximum load, so it often performs superiorly in scenarios with sufficient historical load data accumulation and sufficient data volume.

[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 historical data discontinuity due to metering device replacement, there are often challenges of coarse granularity and insufficient data volume of historical daily maximum load data. 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, that is, 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 seeking optimization 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, under the background of insufficient historical accumulated data, how to improve the utilization rate of limited data value and build a prediction model with good generalization ability while ensuring prediction accuracy 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 inverse of the mean square error between the preliminary prediction 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 the respective weighting coefficients, and then the weighting coefficients are used to normalize the The weighted sum of the actual daily maximum load values ​​of similar historical samples is performed.

[0032] Preferably, the regression prediction model in the refined prediction module is Model.

[0033] In a third aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the two-stage daily maximum load forecasting method based on optimized feature generation as described in the first aspect is implemented.

[0034] Compared with existing technologies, the "two-stage prediction method based on optimized feature generation" proposed in this invention, through the technical combination of "improved genetic algorithm + cosine similarity recall", deeply explores the utilization value contained in limited data, thereby significantly improving the small sample prediction ability. The preliminary prediction value obtained based on the similar day method in the first stage is introduced into the second stage as a highly condensed and information-rich "derived feature". This derived feature is essentially a condensation of the prior knowledge of similar day loads, providing an extremely robust benchmark for the final model, 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 implements a two-stage forecasting process for daily maximum load prediction. The first stage performs a preliminary trend forecast, while the second stage refines and amends the previous stage. This unifies the initial forecast and the generation of derived features, resulting in an orderly and stable improvement in the final forecast accuracy.

[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] ​This phase begins with step S2.1, where an improved genetic algorithm intelligently selects an optimal subset of features that have the greatest impact on the predicted daily maximum load from the original feature set, which includes numerous temporal and meteorological features. As a global optimization search algorithm that mimics natural selection and heredity, the genetic algorithm is particularly well-suited for solving complex combinatorial optimization problems of this type. In this embodiment, a standard genetic algorithm has been specifically adapted and improved to better serve the specific scenario of load forecasting.

[0047] The execution of the algorithm begins with population initialization. First, the features need to be encoded. Here, a binary encoding scheme is used to create a feature vector with the same length as the original feature vector. Equal individual code strings, that is, chromosomes. This represents the individual solution Mathematically it is defined as a binary coded vector: In this encoding vector, the individual Each gene in the feature vector corresponds one-to-one with each feature according to the element position. ;use Represents an individual The position of elements in binary coded vectors and feature vectors, In this encoding string, the value of each gene is 1 or 0, which respectively represents whether the original feature of the corresponding position is selected or not selected in this similarity calculation.

[0048] In order to improve the convergence efficiency of the algorithm and the quality of the initial population, the initialization process is not completely random. For example, you can set a The population size of individuals, and optionally, It can be set to 100. First, an individual is generated whose gene code is all 1, which means that all combinations of features are considered at the beginning. This ensures that the search space is complete in the early stage. Each gene position of each individual is generated by generating a Random numbers within To determine its value. It is a real number specified by humans and is used to set the ratio of 0 and 1 in the feature bit encoding. The value range is , for example, set it to 0.3. When it is greater than or equal to 0.5, the gene bit is coded as 1, otherwise it is coded as 0. Its mathematical expression can be expressed as:

[0049] ;

[0050] in, Represents the position in the feature vector The 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 generate 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 it is equal to 1, then use the following formula to sort the top 100 cells in ascending order of fitness value. Select one of the poor individuals to replace it with the best individual with the highest fitness:

[0071] ;

[0072] in, Before Among the poor individuals The probability of being selected. and Set to 70 and 30 respectively, set is 3.

[0073] The crossover operation aims to generate new offspring individuals by exchanging gene fragments of parent individuals. Two individuals are randomly selected from the mating pool as parents without replacement. The generated value range is Random numbers within ,when Less than or equal to the set When traversing the gene position in order, when two individuals are at the same gene position If the code values ​​are the same, the processing operation at that code position is terminated directly;

[0074] When two individuals have the same gene When the encoding value is different, a value range is generated. Random numbers within ,when Less than or equal to the set crossover probability , execute the exchange of the gene bit encoding values ​​of the two individuals currently traversed, otherwise no operation is performed.

[0075] when Greater than When , a range is generated in Random integer , the two individual genes are located in All subsequent code values ​​are swapped in order of position. Repeat the above process until all individuals are taken out. If the initial population size is an odd number, then only one individual will be left at the last time. No operation will be performed on this individual and the link will end directly. Set to 0.7, is 0.3.

[0076] The mutation operation is to traverse the gene position of each individual in the population in order, Generate a value range in 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] After obtaining each similar sample The weighting coefficient Then, compare it with the actual daily maximum load value corresponding to the similar sample Finally, multiply this The weighted load values ​​are summed up, and the result is the target sample The initial forecast value of The calculation formula is as follows: .

[0096] Through this series of calculations, the preliminary prediction of the first stage is completed, and a highly condensed preliminary prediction value is generated 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 is to perform the second stage of refined forecasting. Its goal is to generate a more accurate final daily maximum load forecast result based on the preliminary forecast in the first stage and combining more comprehensive information. The starting point of this stage is step S3.1, which is to convert the preliminary forecast value obtained through complex calculations in S2 into a more accurate final daily maximum load forecast result. , as a new, single "derived feature." This derived feature is not raw observational data, but rather the product of deep processing and intelligent refinement of historical data. It inherently contains strong signals and prior knowledge about the target sample's load level. It condenses historical load information from multiple similar days into a single value using a nonlinear weighting method that is highly correlated with the target sample, significantly reducing information redundancy while retaining the most critical predictive clues.

[0098] Next, in step S3.2, the derived features 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, that is, the complete time and meteorological feature vector defined in S1 without filtering ;

[0100] The second part is the derived features just generated in S3.1 , as the first dimensions. At this point, the individual The final eigenvector of is expressed 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] In order to verify the technical effect of the method described in this embodiment, a comparative experiment was conducted on a real regional power grid data set. The experiment applied the two-stage prediction method proposed in this embodiment and the standard method using only original features as a benchmark. The method is used to predict the maximum daily load for the next 7 consecutive days. The experimental results are objectively recorded in Tables 1 and Figure 1 middle.

[0111] Table 1. Comparison of prediction effect indicators

[0112] In the table above, RMSE stands for root mean square error, and MAPE stands for mean absolute percentage error. Both are commonly used metrics for measuring forecast error; smaller values ​​indicate higher forecast accuracy. The data in Table 1 clearly demonstrates that the forecasting method proposed in this example demonstrates significant advantages in both key error metrics. Its RMSE value significantly decreased from 74.6 for the baseline model to 27.4, a decrease of over 63%. Its MAPE value also decreased from 0.0346 to 0.0122, a decrease of nearly 65%.

[0113] Further, see Figure 1 , the figure shows the difference between the method of the present invention and the original A comparative diagram of the results of the method application. Figure 1 In the coordinate system shown, the horizontal axis represents the forecast time sequence, from 0 to 6, corresponding to the next 7 consecutive forecast days; the vertical axis represents the relative error, that is, the ratio of the absolute value of the difference between the forecast value and the true value to the true value. Figure 1 It can be found that during the entire 7-day prediction period, the relative error value corresponding to the curve representing the method of this embodiment at each prediction time point is clearly and significantly lower than that representing the original This shows that the method of this embodiment not only performs better in terms of overall average error, but also has higher consistency and stability in single-point prediction on each day.

[0114] In summary, the method disclosed in this embodiment, through its unique two-stage forecasting architecture and derived feature generation mechanism, successfully solves the challenge of daily maximum load forecasting in scenarios with insufficient historical data. It not only theoretically establishes a more rational and efficient data value utilization paradigm, but also demonstrates its significant technological advancement and beneficial effects compared to existing mainstream methods in practical applications through quantifiable data and intuitive charts. It has high practical value and widespread application prospects.

[0115] Example 2:

[0116] 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.

[0117] 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).

[0118] 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.

[0119] 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 sample and its similarity are obtained, and the weighted summation calculation described in step S2.3 is performed, and finally a preliminary prediction value is generated. After completing its complex calculation task, the preliminary prediction module passes this single but information-rich preliminary prediction value to the refined prediction module through an internal bus or an API call.

[0120] Finally, the refined prediction module is the final output end of the device, responsible for performing the second-stage refined prediction. This module is also in close connection 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 step S3.1. At the same time, it also obtains the complete original features of the target sample to be predicted 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 step S3.2.

[0121] Subsequently, the final feature vector is sent to a pre-installed, well-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 refined 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 a network interface or display controller).

[0122] In addition, the present embodiment also provides a computer-readable storage medium, such as a non-volatile solid state disk, hard disk drive, optical disk, 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 present embodiment in terms of function.

[0123] The system provided by the present embodiment inherits all the technical advantages of 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 Tables 1 and Figure 1 2, has strong engineering implementation value and application prospect.

Claims

1. A two-stage daily maximum load forecasting method based on optimized feature generation is characterized by: The following steps are involved: S1. Obtain a historical sample set, wherein each historical sample in the historical sample set includes a set of original features consisting of time features and meteorological features, and a real 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. The first-stage prediction includes: S2.

1. Select one or more features from the original features by 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 Similar historical samples, among which is a positive integer; S2.

3. According to the The preliminary prediction value is calculated by calculating the cosine similarity of each similar historical sample and the corresponding real daily maximum load value; S3. Execute the second stage forecast to generate a final daily maximum load forecast result. The second stage forecast includes: S3.

1. Using the preliminary prediction value generated in S2 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 forecasting method based on optimized feature generation according to claim 1 is characterized in that: In step S2.1, the fitness function of the genetic algorithm is configured to be determined based on the inverse of the mean square error between the preliminary prediction 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 forecasting method based on optimized feature generation according to claim 1 or 2, characterized in that: In step S2.3, the calculation method of the preliminary prediction value is: The cosine similarity of each of the similar historical samples is normalized to obtain the respective weighting coefficients, and then the weighting coefficients are used to normalize the The weighted sum of the actual daily maximum load values ​​of similar historical samples is performed.

4. The two-stage daily maximum load forecasting method based on optimized feature generation according to claim 1 is characterized in that: In step S1, the meteorological characteristics include at least one of 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 accumulated precipitation.

5. The two-stage daily maximum load forecasting method based on optimized feature generation according to claim 1 is characterized in that: The regression prediction model is Model.

6. A two-stage daily maximum load forecasting system based on optimized feature generation is characterized by: include: a data acquisition module, configured to acquire a historical sample set and meteorological forecast data, wherein each historical sample in the historical sample set includes a set of original features consisting of time features and meteorological features, and a real daily maximum load value corresponding to the original features; The preliminary prediction module is connected to the data acquisition module and is used to perform a first-stage preliminary prediction for a target sample to be predicted. The module is configured as follows: Using a genetic algorithm, a feature subset is selected from the original features; Based on the feature subset and cosine similarity, recall the target sample from the historical sample set Similar historical samples; And according to the A preliminary forecast value is obtained by calculating similar historical samples; The refined prediction module is connected to the preliminary prediction module and is used to perform the second stage refined prediction. The module is configured to: using the preliminary predicted value as a derived feature; The derived features are combined with the original features of the target sample into 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 forecasting system based on optimized feature generation according to claim 6 is characterized in that: The fitness function of the genetic algorithm in the preliminary prediction module is configured to be determined based on the inverse of the mean square error between the preliminary prediction 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 forecasting 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 the respective weighting coefficients, and then the weighting coefficients are used to normalize the The weighted sum of the actual daily maximum load values ​​of similar historical samples is performed.

9. The two-stage daily maximum load forecasting system based on optimized feature generation according to claim 6 is 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 a processor, the two-stage daily maximum load forecasting method based on optimized feature generation according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Electric power system short-term load prediction method based on GEP parameter optimization XGBoost

    CN111340273A

  • Bus load short-term prediction method based on feature selection and combined prediction model

    CN116365512A

  • Energy load demand prediction method and device, computer equipment, readable storage medium and program product

    CN118839932A

  • Power system short-term load prediction method, device, equipment, medium and product

    CN119324451A

  • Communication load prediction method, and computer-readable storage medium

    WO2024001867A1

Cited By

  • Charging load prediction method and system based on comprehensive similarity similar day screening

    CN121076794A