Virtual power plant load prediction method and device
By mapping the week number and intraday time number to continuous vectors on the unit circle and combining the prediction model trained by the multi-scale optimization algorithm, the challenges of periodic feature processing and hyperparameter optimization in virtual power plant load forecasting are solved, improving prediction accuracy and stability, and supporting real-time scheduling and clean energy management of virtual power plants.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-04-07
AI Technical Summary
Existing virtual power plant load forecasting methods suffer from endpoint fragmentation when dealing with periodic characteristics, and the hyperparameter optimization process struggles to balance the model's convergence speed and stability, impacting real-time scheduling and clean energy consumption efficiency.
A sine-cosine function is used to map the week number and intraday time series number to a continuous vector on the unit circle to construct multivariate time series input samples. A prediction model integrating bidirectional long short-term memory neural network, efficient self-attention mechanism and Kolmogorov-Arnold network is trained by multi-scale optimization algorithm. The model parameters are optimized by combining sliding window method and multi-scale optimization algorithm.
It effectively eliminates the endpoint fragmentation problem caused by traditional discrete coding, improves the accuracy of load forecasting and the robustness of the model, and enhances the application efficiency of virtual power plants in real-time dispatch and clean energy consumption.
Smart Images

Figure CN121809741A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of virtual power plant optimization scheduling, and in particular to a method and apparatus for virtual power plant load forecasting. Background Technology
[0002] Virtual power plants, as a core technology for the digital transformation of power systems, are widely used in distributed energy aggregation and flexible grid control. With the continuous increase in renewable energy penetration, load forecasting has become a key enabling technology for optimized dispatching of virtual power plants. Its technical system encompasses core aspects such as data acquisition, feature encoding, model training, and performance verification. Specifically, existing technologies typically employ the sliding window method to construct supervised learning samples and use time-series models such as BiLSTM for feature extraction. However, its technological evolution consistently faces two major challenges: periodic feature modeling and hyperparameter optimization. The weekly-daily dual-period nature of load data requires feature encoding to possess continuous expressive capabilities, while hyperparameter tuning of complex models relies on a hybrid strategy combining human experience and random search.
[0003] However, existing load forecasting methods suffer from systematic deficiencies in handling periodic characteristics. Specifically, traditional discrete coding techniques directly map week numbers to integer sequences of 0-6, leading to a break in the endpoints of the "Sunday → Monday" periodic transition, a problem that has not been effectively addressed in practical applications. Furthermore, the 24-hour equidistant discrete processing of intraday time series numbers ignores the nonlinear diurnal characteristics of load fluctuations and is not fully utilized in existing systems. More seriously, the hyperparameter optimization process of complex models typically employs a single-scale algorithm, and traditional methods have failed to establish exploratory operators. With Refined Operator The lack of a proper coordination mechanism makes it difficult to balance model convergence speed and stability. These technical bottlenecks directly restrict the application effectiveness of virtual power plants in key scenarios such as real-time scheduling and clean energy consumption. Summary of the Invention
[0004] The present invention aims to at least partially solve one of the technical problems in the related art.
[0005] Therefore, the first objective of this invention is to propose a virtual power plant load forecasting method.
[0006] Another objective of this invention is to provide a virtual power plant load forecasting device.
[0007] The third objective of this invention is to provide a computer device.
[0008] A fourth objective of this invention is to provide a non-transitory computer-readable storage medium.
[0009] To achieve the above objectives, a first aspect of the present invention provides a virtual power plant load forecasting method, comprising: S1, collect power load data and corresponding time series characteristics from the demand side of the virtual power plant; S2 maps the week number and intraday time number to a continuous vector on the unit circle through a sine-cosine function, achieving a seamless connection of periodic features; S3, based on the mapped periodic features and power load data, construct multivariate time series input samples, and divide the training set and test set according to a fixed ratio; S4 employs a multi-scale optimization algorithm to train a prediction model that integrates a bidirectional long short-term memory neural network, an efficient self-attention mechanism, and a Kolmogorov-Arnold network. The multi-scale optimization algorithm includes an exploration phase based on historical information and a refining phase that introduces an annealing mechanism, which are executed alternately to optimize the model parameters. S5 uses the trained prediction model to predict the load on the test set, and verifies the model accuracy by calculating the RMSE, MAE, and R² indices between the predicted and actual values.
[0010] In one embodiment of the present invention, S2 includes: S21, week number Through formula Mapped to a unit circle vector with a period of 7; S22, intraday time series data Through formula The mapping is a unit circle vector with a period of 96.
[0011] In one embodiment of the present invention, S3 includes: S31, a sliding window method is used to construct supervised learning samples, where the input feature matrix... Features of the past L time steps Composition, output Corresponding to the current moment The predicted value.
[0012] In one embodiment of the present invention, S4 includes: S41, output the primary BiLSTM layer With efficient self-attention mechanism output Feature fusion is performed through a concatenation operation to generate fused features. ,in .
[0013] In one embodiment of the present invention, S5 includes: S51, Formula used when calculating RMSE ; S52, Formula S52 is used when calculating R² ,in This represents the average actual load of the test set.
[0014] To achieve the above objectives, a second aspect of the present invention provides a virtual power plant load forecasting device, comprising: The data acquisition module is used to collect electricity load data and corresponding time series characteristics from the demand side of the virtual power plant. The periodic feature mapping module is used to map the week number and intraday time number to a continuous vector on the unit circle through a sine-cosine function, so as to achieve seamless connection of periodic features; The multivariate time series sample construction module is used to construct multivariate time series input samples based on the mapped periodic features and power load data, and divide the training set and test set according to a fixed ratio; The multi-scale optimization model training module is used to train a prediction model that integrates a bidirectional long short-term memory neural network, an efficient self-attention mechanism, and a Kolmogorov-Arnold network using a multi-scale optimization algorithm. The multi-scale optimization algorithm includes an exploration phase based on historical information and a refining phase that introduces an annealing mechanism, which are executed alternately to optimize the model parameters. The model accuracy verification module is used to perform load prediction on the test set using the trained prediction model, and to verify the model accuracy by calculating the RMSE, MAE and R² indices of the predicted values and the actual values.
[0015] The present invention provides a virtual power plant load forecasting method and apparatus that can effectively capture the periodic characteristics of power load, eliminate the endpoint fragmentation problem caused by traditional discrete coding, and improve the load forecasting accuracy and model robustness.
[0016] To achieve the above objectives, a third aspect of this application provides a computer device comprising a processor and a memory; wherein the processor runs a program corresponding to the executable program code stored in the memory to implement a virtual power plant load forecasting method as described in the first aspect embodiment.
[0017] To achieve the above objectives, a fourth aspect of this application provides a non-transitory computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements a virtual power plant load forecasting method as described in the first aspect.
[0018] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0019] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart of a virtual power plant load forecasting method according to an embodiment of the present invention; Figure 2 This is a COM encoding diagram of week sequence numbers and intraday time sequence numbers according to an embodiment of the present invention; Figure 3 This is a conceptual block diagram of a virtual power plant load forecasting model according to an embodiment of the present invention; Figure 4 This is a diagram showing the virtual power plant load forecast results according to an embodiment of the present invention; Figure 5 This is a structural diagram of a virtual power plant load forecasting device according to an embodiment of the present invention; Figure 6 It is a computer device according to an embodiment of the present invention. Detailed Implementation
[0020] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0021] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0022] The following description, with reference to the accompanying drawings, describes a virtual power plant load forecasting method and apparatus according to an embodiment of the present invention.
[0023] Example 1 Figure 1 This is a flowchart of a virtual power plant load forecasting method according to an embodiment of the present invention, such as... Figure 1 As shown, it includes: S1 collects power load data and corresponding time series characteristics from the demand side of the virtual power plant.
[0024] Specifically, the core of the step of collecting demand-side power load data and corresponding time-series features from a virtual power plant lies in obtaining high-quality, high-resolution time-series data to support the subsequent feature encoding and training process of the model. In some implementations, power load data is typically indexed by timestamps and collected at a fixed sampling frequency (such as 15 minutes or 1 hour) to form a time-series sequence. ,in This represents the load value at time n, where N is the total sample length. The collected data must meet the time-series format requirements of power system standards, such as the ISO 8601 time format, and ensure data integrity and consistency to avoid missing or outlier values interfering with model training.
[0025] Furthermore, this step is typically deployed within the intelligent monitoring system of a virtual power plant, collecting load data in real time through SCADA systems, smart meters, or edge computing devices, and extracting weekly and daily time series data by combining timestamp information. The collected data needs to be standardized, such as through normalization or unit unification, to ensure the stability and comparability of the model input.
[0026] Furthermore, it provides structured, periodically defined multivariate time-series input samples for subsequent COM encoding and model training. Its form is:
[0027] in, Let be the load value at time t. and These are the COM-encoded week sequence number and the intraday time sequence number, respectively. This step enables the model to effectively identify the temporal periodicity of load changes, laying a data foundation for improving forecast accuracy.
[0028] S2 maps the week number and intraday time number to a continuous vector on the unit circle using a sine-cosine function, achieving a seamless connection of periodic features.
[0029] Specifically, in this invention, COM encoding is used to encode the features of weekly ordinal numbers and intraday time series numbers. Its core principle is to map discrete time series numbers to continuous vectors on a unit circle, thereby achieving seamless integration of periodic features. This method parameterizes the time dimension using sine-cosine functions, enabling the model to naturally perceive the periodic changes in time and avoiding the fragmentation problem at the endpoints of the time series caused by traditional discrete encoding methods.
[0030] Furthermore, the week number This represents the position of a date within a week, with values ranging from [1, 7], expressed by the formula. This is mapped to a two-dimensional unit vector. Similarly, intraday time series numbers... This indicates the sampling time within a single day, typically with a 15-minute sampling interval. There are a total of 96 time points in a day, therefore the formula is used. Encoding is performed. This encoding method maps time points to coordinates on a unit circle, ensuring continuity between adjacent time points in the vector space. At the same time, periodic boundaries (such as the 7th day of the week and the 1st day of the week) can also be connected naturally, avoiding the discontinuity at periodic boundaries in traditional encoding.
[0031] Furthermore, the key parameters of this encoding method include the period length (e.g., 7 days, 96 time points) and the parameter form of the mapping function. In this invention, the frequencies of the sine and cosine functions are respectively... and This ensures that time points are uniformly distributed on the unit circle. The encoded vector has a dimension of 2, which is suitable for subsequent input processing of the model, while preserving the periodic structure information of time.
[0032] Furthermore, this encoding method is widely applicable to time-series tasks with obvious periodic characteristics, such as power load forecasting and traffic flow forecasting. In this invention, COM encoding is embedded into the input features of the virtual power plant load forecasting model, forming a multivariate time-series input sample together with the power load data. This provides structured temporal context information for the BiLSTM-Att-KAN model.
[0033] Furthermore, by mapping discrete time points to continuous vectors, the model's ability to perceive periodic features is significantly enhanced, improving the accuracy and stability of load forecasting. Compared to traditional One-Hot or integer encoding, COM encoding not only reduces the risk of dimensionality explosion but also enhances the model's robustness and generalization ability by providing dual representation of time points through orthogonal functions.
[0034] Furthermore, S2 includes: S21, week number Through formula It is mapped to a unit circle vector with a period of 7.
[0035] Specifically, this invention proposes a COM encoding method for week number encoding. Feature encoding, at its core, involves mapping discrete week numbers to unit circle vectors with a period of 7, thereby achieving a continuous representation of time-period features. This step is technically based on the periodicity of trigonometric functions, achieved through formulas... , week number Convert to two-dimensional vector form, where This represents the date position within a week, with a value range of [1, 7], corresponding to Monday through Sunday.
[0036] Furthermore, this encoding method utilizes the orthogonality of sine and cosine functions on the unit circle, ensuring that each cycle number has a unique vector representation in two-dimensional space, and that the vector distance between adjacent cycle numbers remains continuous on the unit circle. This avoids the "endpoint splitting" problem at cycle boundaries encountered by traditional discrete encoding methods (such as One-Hot encoding). Furthermore, this encoding method is used to construct the input features of a virtual power plant load forecasting model, in conjunction with power load... and intraday time series Together they form multivariate time series input samples Using the sliding window method, the model at each time step... Receive past Feature matrix at each time step This includes COM-encoded week sequence information, thereby effectively capturing the periodic variation patterns of load data during the training process.
[0037] Furthermore, by mapping the week number to a unit circle vector, the model can more accurately identify the load variation trend within a week, improving prediction accuracy. At the same time, this encoding method possesses favorable mathematical properties, facilitating subsequent model processing and enhancing the robustness and generalization ability of the overall prediction system.
[0038] S22, intraday time series data Through formula The mapping is a unit circle vector with a period of 96.
[0039] Specifically, in some implementations, intraday time series data Through formula The mapping is done to unit circle vectors with a period of 96. The step aims to encode discrete intraday time points into continuous vectors with periodic semantics, thereby enhancing the model's ability to perceive time periodic features.
[0040] Furthermore, the period length of this mapping function is 96, corresponding to a sampling frequency of 15 minutes per day. The encoded output is a two-dimensional vector with a fixed dimension, facilitating unified processing by subsequent models. Moreover, this encoding method does not require the introduction of additional learnable parameters, relying only on numerical calculations at time points, thus exhibiting good interpretability and computational efficiency.
[0041] Furthermore, this step is primarily used in the input feature preprocessing stage of the virtual power plant load forecasting model. By performing COM encoding on intraday time points, the model can more accurately capture the periodic fluctuations of load throughout the day, such as typical patterns like morning and evening peaks and midday troughs. This encoding method is suitable for multivariate time-series input samples constructed using a sliding window. , and the week number after COM encoding Together, they serve as temporal feature inputs to the model, providing structured temporal context information for the BiLSTM-Att-KAN model.
[0042] Furthermore, by mapping discrete time points to unit circle vectors, the endpoint fragmentation problem at periodic boundaries in traditional discrete coding methods is effectively solved, enabling the model to naturally understand the periodic nature of time. Moreover, this coding method provides the model with continuous, smooth, and periodically invariant feature representations, which helps improve the accuracy and stability of load forecasting, especially demonstrating significant advantages when processing highly periodic power load data.
[0043] S3 constructs multivariate time-series input samples based on the mapped periodic features and power load data, and divides the training set and test set according to a fixed ratio.
[0044] Specifically, multivariate time-series input samples are constructed based on the periodic characteristics of COM-encoded data and the original power load data. A sliding window method is then used to construct supervised learning samples. Subsequently, the training and test sets are divided according to a fixed ratio. Technically, this step first involves converting the COM-encoded week sequence data into a single data set. With intraday time series With power load Multivariate fusion is performed along the time dimension to form multidimensional time-series input samples. Specifically, the input sample at each time point t consists of three parts: the power load value. COM encoded week number and intraday time series data after COM encoding Its structure can be represented as:
[0045] When constructing supervised learning samples, a sliding window method is used, with the window length set to [value missing]. The model at time point The input is past Feature matrix at each time step The output is the load value at the current time point. In this way, the model can learn dynamic patterns of load changes from historical time series.
[0046] Furthermore, the length of the sliding window It is an important parameter affecting the model's input dimension and ability to capture temporal dependencies, and is usually set according to the data sampling frequency and load change cycle. For example, at a sampling frequency of 15 minutes, It can be set to 96, corresponding to the length of a day's time series. Training set length. ,in The total number of samples, The ratio for splitting the training set and the test set is typically set to 0.8 or 0.75 to ensure that the model is trained with a sufficient amount of data while retaining an independent test set for evaluating generalization ability.
[0047] Furthermore, this step is applicable to short- to medium-term demand-side load forecasting tasks in virtual power plants. By combining the COM-encoded periodic characteristics with load data, the model can more accurately identify load variation patterns in weekly and daily cycles, making it particularly suitable for scenarios where loads exhibit significant seasonality and daily fluctuations. The introduction of the sliding window method enables the model to model continuous time series, making it suitable for real-time or near-real-time forecasting systems.
[0048] Furthermore, this step enhances the model's ability to perceive multi-dimensional temporal features by constructing structured input samples, providing high-quality input data for the subsequent training of the BiLSTM-Att-KAN model. Simultaneously, dividing the training and test sets into fixed proportions ensures the objectivity and stability of model evaluation, providing clear performance feedback for the multi-scale optimization algorithm, thereby improving overall prediction accuracy and robustness.
[0049] Furthermore, S3 includes: S31, a sliding window method is used to construct supervised learning samples, where the input feature matrix... Features of the past L time steps Composition, output Corresponding to the current moment The predicted value.
[0050] Specifically, in this invention, a sliding window method is used to construct supervised learning samples. This method divides a continuous time series into multiple samples with time dependencies, thereby providing structured training data for the BiLSTM-Att-KAN model.
[0051] Furthermore, in the specific implementation, the model at any given time... Input feature matrix From the past The features of each time step, namely ,in Indicates at time The structure of the multivariate time-series input samples is as follows:
[0052] in, For power load data, The week number after COM encoding. This represents the intraday time series data after COM encoding. Through a sliding window mechanism, the model can extract local time series patterns from historical load data, providing a foundation for subsequent BiLSTM layers to capture short-term dependencies. Output Corresponding to the current moment The predicted value, i.e., the model's prediction value. The target for prediction at any given time.
[0053] Furthermore, the length of the sliding window This is a key parameter in this step, and its value directly affects the model's perception range of temporal features. In this invention, The settings need to be adjusted according to the periodicity and fluctuation characteristics of the load data, and the typical value range is [value range missing]. The time step is suitable for load forecasting tasks at the hourly or minute level. Additionally, the training set length... From the total sample length With division ratio Decision, that is ,in Typically set to This is to ensure that the model has enough training data.
[0054] Furthermore, this step is widely applied in short-term load forecasting scenarios for virtual power plants, particularly in systems requiring high-precision time-series forecasting, such as power dispatching, energy storage management, and market transactions. Using the sliding window method, the model can extract multi-dimensional time-series features from historical load, weekly time series, and intraday time series, providing structured input to the BiLSTM-Att-KAN model, thereby improving the accuracy and stability of the forecast.
[0055] Furthermore, the introduction of the sliding window method significantly enhances the model's ability to model time-series data, enabling the BiLSTM-Att-KAN model to effectively fuse local and global features. This step provides a standardized input and output format for model training and is a fundamental step in achieving multi-scale optimization and improving model generalization ability, possessing significant engineering practical value.
[0056] S4 employs a multi-scale optimization algorithm to train a prediction model that integrates a bidirectional long short-term memory neural network, an efficient self-attention mechanism, and a Kolmogorov-Arnold network. The multi-scale optimization algorithm includes an exploration phase based on historical information and a refining phase that introduces an annealing mechanism, which are executed alternately to optimize the model parameters.
[0057] Specifically, a multi-scale optimization algorithm is used to train a prediction model that integrates a bidirectional long short-term memory neural network (BiLSTM), an efficient self-attention mechanism, and a Kolmogorov-Arnold network (KAN). This algorithm effectively balances global search and local optimization by alternately executing an exploration phase based on historical information and a refinement phase that introduces an annealing mechanism, thereby improving the convergence performance and stability of the model in a complex non-convex optimization space.
[0058] Furthermore, the multi-scale optimization algorithm first defines the set of hyperparameters to be optimized. ,in The learning rate for the Adam optimizer. and These represent the number of neurons in the primary and secondary BiLSTM layers, respectively. The dropout rate of the Dropout layer. and For the number of heads and head dimension of the self-attention mechanism, The number of neurons in the KAN layer. For grid size, Let the order be the order of the spline function. This is the activation function type. The objective function is... This is typically the model's prediction error on the training set, such as mean squared error (MSE) or negative log-likelihood (NLL).
[0059] Furthermore, the algorithm utilizes historical information Generate exploratory parameter increments Its update formula is:
[0060] in, To explore the operator, new candidate parameters are generated based on the objective function value and historical iteration trajectory to expand the search range and avoid getting trapped in local optima. Then, in the refinement stage, the algorithm introduces random perturbations at a smaller scale. An annealing mechanism is used to control the probability of perturbation acceptance.
[0061]
[0062] in, The scaling parameter decays with the number of iterations and is used to control the intensity of exploration and refinement during the optimization process. This mechanism encourages extensive exploration of the parameter space in the early stages of model training, while gradually focusing on fine-tuning local optima in the later stages, thereby improving the model's generalization ability and prediction accuracy.
[0063] Furthermore, this algorithm is applicable to power load forecasting tasks with complex temporal characteristics in virtual power plants, and performs particularly well in handling multi-cycle, multi-scale load fluctuations. By alternately executing exploration and refinement operations, the model can extract local and global features of load data at different time scales, achieving high-precision modeling and forecasting of power load.
[0064] Furthermore, a multi-scale optimization strategy significantly improves the training efficiency and prediction performance of the BiLSTM-Att-KAN model. Experimental results show that this method outperforms traditional single optimization strategies in terms of RMSE, MAE, and R^2, validating its practical value and innovation in virtual power plant load forecasting.
[0065] Furthermore, S4 includes: S41, output the primary BiLSTM layer With efficient self-attention mechanism output Feature fusion is performed through a concatenation operation to generate fused features. ,in .
[0066] Specifically, the output of the primary BiLSTM layer With efficient self-attention mechanism output Feature fusion is performed through a concatenation operation to generate fused features. The specific technical implementation is as follows: In the feature extraction stage of the model, the primary BiLSTM layer is responsible for capturing short-term dependencies and local temporal features in the input sequence, and the output is... ,in Indicates the first The local feature vectors at each time step. The efficient self-attention mechanism extracts global dependencies by calculating the attention weights between time steps in the sequence, and the output is... ,in Indicates the first The global feature vectors at each time step. During the feature fusion stage, a concatenation operation is used to concatenate the two feature sequences along their feature dimensions to obtain the fused features. ,Right now ,in Indicates the first The fused feature vectors at each time step.
[0067] Furthermore, this splicing operation is typically performed along the feature dimension, assuming... and The feature dimensions are respectively and Then the feature dimension after fusion is In practical applications, this step is typically deployed within deep learning frameworks (such as TensorFlow or PyTorch), where feature dimensions are concatenated by setting `axis=1` or `dim=1`. Furthermore, this step requires parameter co-optimization with subsequent secondary BiLSTM layers during model training to ensure that the fused features are effectively integrated and utilized.
[0068] Furthermore, this feature fusion step is widely used in virtual power plant load forecasting models, especially when processing power load data with multi-scale time-series characteristics. By concatenating local and global features, the model can more comprehensively understand the dynamic patterns of load changes, thereby improving prediction accuracy. This step is typically located between the primary BiLSTM layer and the secondary BiLSTM layer, serving as a key connection module in the model structure.
[0069] Furthermore, by fusing local temporal features extracted by BiLSTM with global dependency features extracted by the self-attention mechanism, the model can more accurately model the complex temporal structure of load sequences. This fusion approach not only enhances the model's expressive power but also provides richer input information for subsequent secondary BiLSTM layers, helping to improve the model's robustness and generalization ability in virtual power plant load forecasting tasks.
[0070] S5 uses the trained prediction model to predict the load on the test set, and verifies the model accuracy by calculating the RMSE, MAE, and R² indices between the predicted and actual values.
[0071] Specifically, load forecasting is performed based on a test set using a pre-trained BiLSTM-Att-KAN prediction model. The core of this method is to infer the feature data of the test set through the model and evaluate the prediction accuracy of the model based on the difference between the prediction results and the actual load values.
[0072] Furthermore, after the model training is complete, the test set feature data will be... The input is fed into the BiLSTM-Att-KAN model for inference. Test set feature data. Week number including COM encoding With intraday time series and raw load data Multivariate time-series input samples were constructed using the sliding window method. The model output is the predicted load value. Then, the predicted values are compared with the target output of the test set. Compare the three performance metrics: RMSE, MAE, and R².
[0073] Furthermore, the following metrics are used to evaluate the model's prediction accuracy: Root Mean Square Error (RMSE): Measures the square root of the mean square error between the predicted and actual values. The formula is...
[0074] Mean Absolute Error (MAE): Reflects the average absolute value of prediction error, and its formula is...
[0075] Coefficient of determination (R²): Evaluates the model's ability to explain the target variable; the formula is...
[0076] in, This represents the mean of the actual load values in the test set. All the above metrics are based on the sample size of the test set. Normalization calculations were performed to ensure that the evaluation results were statistically representative.
[0077] Furthermore, this step is applicable to virtual power plant operation and scheduling systems to verify the model's predictive capabilities in real-world scenarios. The test set typically consists of untrained portions of historical load data, with a time span and sampling frequency consistent with the training set to ensure the model's adaptability across different time scales. In practical deployments, the test set can be drawn from different seasons, holidays, or typical load curves to comprehensively evaluate the model's stability and accuracy under varying operating conditions.
[0078] Furthermore, quantitative evaluation using RMSE, MAE, and R² can intuitively reflect the model's prediction error distribution and goodness of fit on the test set. RMSE is sensitive to large errors and is suitable for measuring the overall prediction bias of the model; MAE focuses more on the absolute magnitude of the error and is suitable for scenarios with low error tolerance; R² evaluates the model's ability to capture load change trends from an overall fit perspective. Combining these three indicators provides a multi-dimensional evaluation basis for model performance, thereby supporting subsequent model deployment and optimization decisions. In this invention, test results show that the model's RMSE on the test set is 139.558, MAE is 105.285, and R² is 0.963, demonstrating high prediction accuracy and good fitting ability.
[0079] Furthermore, S5 includes: S51, Formula used when calculating RMSE
[0080] Specifically, RMSE provides an intuitive measure of model prediction accuracy by quantifying the difference between the predicted output and the actual output. Its calculation formula is as follows:
[0081] in, Indicates the first test set The actual load value at each moment This represents the model's predicted output at that moment. The number of test set samples is given. This formula calculates the square root of the mean square of the prediction error, ensuring the error unit remains consistent with the original load data for easy and intuitive interpretation.
[0082] Furthermore, the RMSE calculation is typically performed after the model has completed its predictions on the test set. The specific steps include: first, inputting the test set into the feature data... Input a pre-trained BiLSTM-Att-KAN model, and the model outputs a predicted value. Subsequently, the predicted values are compared with the target output of the test set. A point-by-point comparison is performed to calculate the squared prediction error at each time step. Finally, the average of all squared errors is taken and the square root is obtained to obtain the final RMSE value.
[0083] Furthermore, the smaller the RMSE value, the closer the model's prediction is to the true value. In this invention, the RMSE value for the test set is 139.558, which needs to be evaluated in conjunction with the unit of the load data. For example, if the load unit is kW, the RMSE value should be controlled within a reasonable range to ensure that the prediction error is acceptable in engineering applications. In addition, the calculation of RMSE depends on the sample size of the test set. Its value is determined by the ratio of the training set to the test set. Decision, that is ,in This represents the total number of samples.
[0084] Furthermore, RMSE is widely used in the performance evaluation of time series forecasting models, especially in power systems, where it serves as an important basis for model tuning, model selection, and the reliability analysis of forecast results. In this invention, RMSE, along with other indicators (such as MAE and R^2), constitutes a model validation system to measure the stability and generalization ability of the BiLSTM-Att-KAN model in virtual power plant load forecasting.
[0085] Furthermore, the introduction of RMSE provides a quantifiable evaluation criterion for model performance, which helps to achieve automatic hyperparameter tuning in multi-scale optimization algorithms. By minimizing RMSE, the optimization algorithm can effectively improve the model's ability to fit load fluctuations, thereby enhancing the decision reliability of virtual power plants in load scheduling and resource optimization.
[0086] S52, Formula S52 is used when calculating R² ,in This represents the average actual load of the test set.
[0087] Specifically, during the model validation phase, the formula for calculating the coefficient of determination R^2 is:
[0088] in, Indicates the first test set The actual load value at each moment This represents the model's predicted output value at that moment. The mean of all actual load values in the test set. This represents the number of samples in the test set. This formula measures the goodness of fit between the model's predicted values and the actual values; the closer the value is to 1, the stronger the model's predictive ability.
[0089] Furthermore, during model validation, the input feature data of the test set is first... Input a pre-trained BiLSTM-Att-KAN model, and the model outputs the corresponding predicted load value. The calculation process is performed automatically during the verification phase, without the need to introduce any external models or algorithms.
[0090] The virtual power plant load forecasting method based on multi-scale optimization and COM encoding in this invention can effectively capture the periodic characteristics of power load and achieve automatic hyperparameter optimization, significantly improving the accuracy and stability of virtual power plant load forecasting.
[0091] Example 2 In yet another example, this invention proposes a virtual power plant load forecasting method based on multi-scale optimization and BiLSTM-Att-KAN fusion, comprising the following steps: S101. Collect the power load on the demand side of the virtual power plant; S201. Use COM encoding to perform feature encoding on week ordinal numbers and intraday time series numbers; S301. Divide the training set and the test set according to a fixed ratio; S401. Train the BiLSTM-Att-KAN prediction model based on the training set and using a multi-scale optimization algorithm; S501. Validate based on the test set and using the pre-trained load prediction model.
[0092] Specifically, step S201 above includes the following sub-steps: For the collected power load Y=[Y1, Y2, ..., Y] on the demand side of the virtual power plant... N ], where Y nLet N represent the nth load sample, and N be the total length of the samples. Since load fluctuations exhibit significant regularity across both long and short time series scales, this invention proposes a COM encoding method to ensure the model fully captures and utilizes the periodicity of load data and avoids the endpoint fragmentation problem caused by traditional discrete encoding methods. With intraday time series Perform feature encoding to obtain the encoded week number. With intraday time series , This represents the i-th sample in the week sequence. This represents the j-th sample in the intraday time series. This represents the i-th sample after encoding, in the week sequence. This represents the j-th sample of the intraday time series after encoding. This method maps discrete time points, such as week numbers and intraday time series, to continuous variables on the unit circle, achieving seamless integration of periodic features. The specific working principle is summarized as follows:
[0093]
[0094] In the formula, This is a cyclic ordinal mapping encoding function; This is the week number, indicating the date's position within the week; It is a sine function that captures the phase of a time point within a period; For cosine functions, it provides orthogonal supplementary information about the phase; This represents the time series number within a single day, indicating the sampling time within that day.
[0095] Specifically, step S301 above includes the following sub-steps: based on COM encoding and the acquired time-series characteristics at time t. , and power load Y t Construct multivariate time-series input samples X t Supervised learning samples are constructed using the sliding window method. Let the window length be L, then the model input at time t is the feature matrix I of the past L time steps. t ;O t The output of the model at time t; obtain the input feature data I=[I1, I2, ..., I... g ] and output data O=[O1, O2, ..., O g ], I g This represents the g-th feature matrix of the input feature data, O g This represents the g-th output matrix; the load data obtained using a sliding window is divided into training and test sets according to a fixed ratio;
[0096]
[0097]
[0098]
[0099]
[0100] In the formula, t For the multivariate time series input sample at time t; Let be the electrical load at time t; The COM-encoded week number at time t; The intraday time series number after COM encoding at time t; is the input of the model at time t; g is the length of the training set; The total length of the sample; The ratio of the training set to the test set; For training set; This is the test set.
[0101] Specifically, S401 above includes the following sub-steps: The virtual power plant load forecasting model is a combined model based on a bidirectional long short-term memory neural network, an efficient self-attention mechanism, and KAN. First, the input training set feature data I... tr =[I1, I2, ..., I g After passing through a primary BiLSTM layer, the primary BiLSTM layer captures short-term dependencies and local features in the sequence, resulting in the output Y of the primary BiLSTM layer. a =[Y a1 Y a2 , ..., Y ag Subsequently, the output Y of the primary BiLSTM layer is... a =[Y a1 Y a2 , ..., Y ag The input is fed into an efficient self-attention mechanism, which focuses on global relationships in the sequence, establishes long-distance dependencies, provides a global view and structured understanding of the sequence, and yields the output Y of the efficient self-attention mechanism. b =[Y b1 Y b2 , ..., Y bg ]; The output Y of the BiLSTM layer a =[Y a1 Y a2 , ..., Y ag[The output Y of the efficient self-attention mechanism] b =[Y b1 Y b2 , ..., Y bg Feature fusion is performed to obtain the feature fusion output Y. c =[Y c1 Y c2 , ..., Y cg The output Y of this fusion feature c =[Y c1 Y c2 , ..., Y cg By further integrating temporal information through a secondary BiLSTM layer, the model can effectively capture the dynamic features of the fused information changing over time, providing highly refined and context-aware temporal features for the final prediction decision, resulting in the output Y of the secondary BiLSTM layer. d =[Y d1 Y d2 , ..., Y dg Finally, the output Y of the secondary BiLSTM layer is... d =[Y d1 Y d2 , ..., Y dg The input to the KAN layer undergoes nonlinear mapping. Leveraging the expressive efficiency and function approximation ability of KAN, the complex temporal features extracted and refined by all the above layers are transformed into target predicted values. Output. I g Y represents the g-th feature matrix of the input data. ag Y is the g-th sample output from the primary BiLSTM layer. bg Y is the g-th sample output by the efficient self-attention mechanism. cg Y is the g-th sample output by feature fusion. dg This is the g-th sample output from the secondary BiLSTM layer. The g-th sample is the output of the target predicted value.
[0102] In the process of parameter optimization for complex non-convex problems, a single optimization strategy often struggles to simultaneously address global exploration and local refinement. The core of the optimization algorithm is to find the parameters that minimize the objective function. The formula is as follows:
[0103]
[0104] In the formula, The optimal solution for the parameters. To explore space, Let be the objective function. For the parameters that need to be optimized, , , , , , , , , , These represent the learning rate of the Adam optimizer, the number of neurons in the primary BiLSTM layer, the number of neurons in the secondary BiLSTM layer, the dropout rate of the Dropout layer, the number of efficient self-attention mechanism heads, the dimension of the efficient self-attention mechanism heads, the number of neurons in the KAN layer, the grid size of the KAN layer, the order of the spline function of the KAN layer, and the activation function of the grid's fundamental function in the KAN layer.
[0105] Furthermore, this invention proposes a multi-scale optimization algorithm. This method introduces a phased search mechanism to explore and update based on historical information at a larger scale, thereby quickly identifying potential optimal solution regions. The formula is as follows:
[0106] In the formula, For the new parameter values in the (k+1)th iteration, This refers to the exploratory parameter increment added to the parameters in the k-th iteration. As an exploratory operator, it is responsible for generating exploratory parameter increments. Let be the objective function. This is historical information, recording historical data from all previous iterations.
[0107] Subsequently, a refinement operator was introduced at a smaller scale. The candidate solutions are refined step by step to improve convergence accuracy and stability. The formula is as follows:
[0108]
[0109] In the formula, For the new parameter values in the (k+1)th iteration, For the parameter values in k iterations, For the k-th iteration, a random perturbation is added to the parameters in the k-th iteration. The probability of accepting a disturbance, and Proportional Let be the change in the objective function value of the (k+1)th iteration compared to the value of the kth iteration. This is a scaling parameter that gradually decays with iteration.
[0110] Finally, the multi-scale exploration optimization method is obtained, and the formula is as follows:
[0111] In the formula, The optimal solution for the parameters. Let be the objective function. To explore space, The number of iterations required. To refine the operators, Explore operators, These are the initial parameters.
[0112] In one embodiment of the present invention, the COM encoding method is used to perform feature encoding on the week sequence number and daily time sequence number of the virtual power plant load data; the training set and test set are divided according to a fixed ratio; to verify the feasibility of the present invention, the RMSE and feature encoding between the load prediction value and the actual value obtained by the prediction model are calculated, and COM encoding is used to encode the week sequence number. With intraday time series Perform feature encoding to obtain the encoded week number. With intraday time series , This represents the i-th sample in the week sequence. This represents the j-th sample in the intraday time series. This represents the i-th sample after encoding, in the week sequence. This represents the j-th sample of the intraday time series after encoding. This method maps discrete time points, such as week numbers and intraday time series, to continuous variables on a unit circle, achieving seamless connection of periodic features. It effectively solves the endpoint fragmentation problem existing in traditional discrete encoding methods, allowing periodic features to be fully presented. The encoded week numbers and intraday time series are as follows: Figure 2 As shown.
[0113] In one embodiment of the present invention, the virtual power plant load forecasting model includes: This invention constructs a BiLSTM-Att-KAN prediction model that integrates a bidirectional long short-term memory neural network, an efficient self-attention mechanism, and a Kolmogorov-Arnold network. The model first captures local temporal features of the raw workload data in the temporal space through a primary BiLSTM layer. Given that the efficient self-attention mechanism is more efficient and accurate than BiLSTM in handling global features and long-distance dependencies, this mechanism is subsequently introduced to provide a global view of the sequence and fuse it with the local features extracted by BiLSTM. The fused feature sequence is further integrated through a secondary BiLSTM layer to improve the model's feature capture capability for temporal data. Finally, the model uses a Kolmogorov-Arnold network (KAN) instead of the traditional fully connected layer, which enhances the model's nonlinear fitting ability and interpretability, and effectively transforms complex temporal features into prediction results. Its conceptual diagram is shown below. Figure 3 As shown.
[0114] In one embodiment of the present invention, virtual power plant load forecasting and model hyperparameter optimization include: Using training set The model is trained and its hyperparameters are optimized using a multi-scale optimization algorithm. The hyperparameters to be optimized by the multi-scale optimization algorithm include: the learning rate of the Adam optimizer, the number of neurons in the primary BiLSTM layer, the number of neurons in the secondary BiLSTM layer, the dropout rate of the Dropout layer, the number of efficient self-attention mechanism heads, the dimension of the efficient self-attention mechanism heads, the number of neurons in the KAN layer, the grid size of the KAN layer, the order of the spline function of the KAN layer, and the activation function of the fundamental function of the KAN layer grid. (Test set...) The model performance was tested, and the results were evaluated using RMSE, MAE, and R... 2 The model prediction results are evaluated using performance metrics. Table 1 shows the hyperparameter values obtained from the multi-scale optimization algorithm, and Table 2 shows the model performance metrics. Figure 4 Based on the overall prediction results of the model proposed in this invention, and combined with the above charts, it can be concluded that the prediction model of this invention has improved the overall performance indicators in virtual power plant power load prediction.
[0115] Table 1 Hyperparameter values
[0116] Table 2 Performance Indicators
[0117] The virtual power plant load forecasting device of this invention can effectively capture the periodic characteristics of power load, eliminate the endpoint fragmentation problem caused by traditional discrete coding, and improve the load forecasting accuracy and model robustness.
[0118] Example 3 To achieve the above embodiments, such as Figure 5 As shown, this embodiment also provides a virtual power plant load forecasting device 10, including: The data acquisition module 100 is used to collect power load data and corresponding time series characteristics from the demand side of the virtual power plant. The periodic feature mapping module 200 is used to map the week number and the intraday time number to a continuous vector on the unit circle through a sine-cosine function, so as to achieve seamless connection of periodic features; The multivariate time series sample construction module 300 is used to construct multivariate time series input samples based on the mapped periodic features and power load data, and divide the training set and test set according to a fixed ratio; The multi-scale optimization model training module 400 is used to train a prediction model that integrates a bidirectional long short-term memory neural network, an efficient self-attention mechanism, and a Kolmogorov-Arnold network using a multi-scale optimization algorithm. The multi-scale optimization algorithm includes an exploration phase based on historical information and a refining phase that introduces an annealing mechanism, which are executed alternately to optimize the model parameters. The model accuracy verification module 500 is used to perform load prediction on the test set using the trained prediction model, and to verify the model accuracy by calculating the RMSE, MAE and R² indices of the predicted values and the actual values.
[0119] Furthermore, the periodic feature mapping module 200 is also used for: Week number Through formula Mapped to a unit circle vector with a period of 7; intraday time series Through formula The mapping is a unit circle vector with a period of 96.
[0120] Furthermore, the multivariate time series sample construction module 300 is also used for: Supervised learning samples are constructed using the sliding window method, where the input feature matrix... Features of the past L time steps Composition, output Corresponding to the current moment The predicted value.
[0121] The virtual power plant load forecasting device of this invention can effectively capture the periodic characteristics of power load, eliminate the endpoint fragmentation problem caused by traditional discrete coding, and improve the load forecasting accuracy and model robustness.
[0122] Example 4 To implement the methods of the above embodiments, the present invention also provides a computer device, such as... Figure 6 As shown, the computer device 600 includes a memory 601 and a processor 602; wherein, the processor 602 reads the executable program code stored in the memory 601 to run a program corresponding to the executable program code, so as to implement the various steps of the virtual power plant load forecasting method described above.
[0123] Example 5 To implement the above embodiments, this application also proposes a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a virtual power plant load forecasting method as described in the foregoing embodiments.
[0124] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0125] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
Claims
1. A virtual power plant load forecasting method, characterized in that, include: S1, collect power load data and corresponding time series characteristics from the demand side of the virtual power plant; S2 maps the week number and intraday time number to a continuous vector on the unit circle through a sine-cosine function, achieving a seamless connection of periodic features; S3, based on the mapped periodic features and power load data, construct multivariate time series input samples, and divide the training set and test set according to a fixed ratio; S4 employs a multi-scale optimization algorithm to train a prediction model that integrates a bidirectional long short-term memory neural network, an efficient self-attention mechanism, and a Kolmogorov-Arnold network. The multi-scale optimization algorithm includes an exploration phase based on historical information and a refining phase that introduces an annealing mechanism, which are executed alternately to optimize the model parameters. S5 uses the trained prediction model to predict the load on the test set, and verifies the model accuracy by calculating the RMSE, MAE, and R² indices between the predicted and actual values.
2. The virtual power plant load forecasting method based on multi-scale optimization and COM encoding as described in claim 1, characterized in that, S2 further includes: S21, week number Through formula Mapped to a unit circle vector with a period of 7; S22, intraday time series data Through formula The mapping is a unit circle vector with a period of 96.
3. The virtual power plant load forecasting method based on multi-scale optimization and COM encoding as described in claim 1, characterized in that, S3 further includes: S31, a sliding window method is used to construct supervised learning samples, where the input feature matrix... Features of the past L time steps Composition, output Corresponding to the current moment The predicted value.
4. The virtual power plant load forecasting method based on multi-scale optimization and COM encoding as described in claim 1, characterized in that, S4 further includes: S41, output the primary BiLSTM layer With efficient self-attention mechanism output Feature fusion is performed through a concatenation operation to generate fused features. ,in .
5. The virtual power plant load forecasting method based on multi-scale optimization and COM encoding as described in claim 1, characterized in that, The S5 also includes: S51, Formula used when calculating RMSE ; S52, Formula S52 is used when calculating R² ,in This represents the average actual load of the test set.
6. A virtual power plant load forecasting device, characterized in that, include: The data acquisition module is used to collect electricity load data and corresponding time series characteristics from the demand side of the virtual power plant. The periodic feature mapping module is used to map the week number and intraday time number to a continuous vector on the unit circle through a sine-cosine function, so as to achieve seamless connection of periodic features; The multivariate time series sample construction module is used to construct multivariate time series input samples based on the mapped periodic features and power load data, and divide the training set and test set according to a fixed ratio; The multi-scale optimization model training module is used to train a prediction model that integrates a bidirectional long short-term memory neural network, an efficient self-attention mechanism, and a Kolmogorov-Arnold network using a multi-scale optimization algorithm. The multi-scale optimization algorithm includes an exploration phase based on historical information and a refining phase that introduces an annealing mechanism, which are executed alternately to optimize the model parameters. The model accuracy verification module is used to perform load prediction on the test set using the trained prediction model, and to verify the model accuracy by calculating the RMSE, MAE and R² indices of the predicted values and the actual values.
7. The apparatus as claimed in claim 6, characterized in that, The periodic feature mapping module is also used for: Week number Through formula Mapped to a unit circle vector with a period of 7; intraday time series Through formula The mapping is a unit circle vector with a period of 96.
8. The apparatus as claimed in claim 6, characterized in that, The multivariate time series sample construction module is also used for: Supervised learning samples are constructed using the sliding window method, where the input feature matrix... Features of the past L time steps Composition, output Corresponding to the current moment The predicted value.
9. A computer device, characterized in that, Including processor and memory; The processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement a virtual power plant load forecasting method as described in any one of claims 1-5.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements a virtual power plant load forecasting method as described in any one of claims 1-5.