Machine learning virtual power plant load prediction method based on multi-factor fusion
Through the multi-head attention mechanism and cross-modal learning technology combined with LSTM and CNN, a multi-scale load prediction model is constructed, which solves the multi-variable factors and multi-scale problems of load prediction in virtual power plants, and achieves high-precision and adaptive load prediction. Improved operational support for virtual power plants.
Patent Information
- Application Number
- CN202411285942.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-01-03
AI Technical Summary
Traditional load prediction methods are difficult to deal with the variable influencing factors of complex virtual power plants, especially nonlinear relationships and multi-factor data fusion, limited timing feature extraction capabilities, and lack a unified multi-scale prediction framework, resulting in insufficient prediction accuracy and complex model maintenance.
Multi-factor fusion model is constructed using multi-head attention mechanism and cross-modal learning technology, combined with LSTM and CNN to achieve timing feature extraction, introduce time step adaptive mechanism, build a multi-scale load prediction model, and train it through multi-scale prediction model. Conduct power load prediction.
It realizes load prediction with high accuracy, strong adaptability and good interpretability, can effectively deal with complex and variable factors, has the ability to continuously learn, and improves the load prediction accuracy and operational support of virtual power plants.
Smart Images

Figure CN119250269A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of power system and artificial intelligence, and relates to a load forecasting method applied to a virtual power plant. Background Art
[0002] As a new type of power system operation mode, virtual power plants integrate a large number of distributed energy sources, controllable loads and energy storage devices. Accurate load forecasting is crucial for the efficient operation of virtual power plants. However, due to the complex and changeable influencing factors involved in virtual power plants, traditional load forecasting methods often cannot meet their high-precision forecasting needs.
[0003] At present, the commonly used load forecasting methods in the power industry include time series analysis, regression analysis, artificial neural network, etc. The autoregressive integrated moving average model (ARIMA) in the time series analysis method performs well when processing linear and stationary time series. However, in practical applications, such as a smart grid project in a certain city, the ARIMA model often has large errors when predicting sudden load increases caused by emergencies. This is mainly because ARIMA has difficulty in handling nonlinear relationships and multi-factor influences.
[0004] Regression analysis methods, such as multivariate linear regression, can take into account multiple influencing factors, such as temperature, humidity, etc. In a virtual power plant pilot in an industrial park, the multivariate linear regression model took into account factors such as working days, temperature and humidity, but its ability to fit complex nonlinear relationships (such as load changes under extreme weather conditions) was limited, resulting in insufficient prediction accuracy.
[0005] Artificial neural network methods, such as BP neural network, have strong nonlinear fitting capabilities. In a virtual power plant consisting of a wind farm and a photovoltaic power station, the BP neural network performs well in short-term load forecasting. However, the model is prone to fall into local optimality and has poor interpretability, making it difficult to provide operators with a clear basis for decision-making.
[0006] These traditional methods generally have some shortcomings when dealing with complex load forecasting problems in virtual power plants. First, they are difficult to effectively integrate multiple heterogeneous data sources. Virtual power plants involve a wide range of data types, including historical load data, meteorological data, social activity data, etc. For example, in a large-scale virtual power plant project across provinces, it is necessary to consider factors such as meteorological conditions, holiday arrangements, and large-scale events in different regions at the same time. Traditional methods are difficult to effectively integrate these heterogeneous data, resulting in limited prediction accuracy.
[0007] Secondly, these methods have limited ability to extract time series features. The load of a virtual power plant has obvious time series characteristics, including intraday fluctuations, weekly cycles, seasonal changes, etc. Traditional methods often have difficulty capturing these complex time series patterns. In a virtual power plant containing a large number of electric vehicle charging stations, the load pattern is strongly affected by people's travel habits and presents complex time series characteristics, which poses a huge challenge to traditional methods.
[0008] In addition, existing methods lack a unified processing framework for forecasts at different time scales. The operation of a virtual power plant requires simultaneous consideration of short-term (hourly), medium-term (daily), and long-term (monthly) load forecasts. Traditional methods usually require the establishment of independent models for forecasts at different time scales and lack a unified processing framework. This not only increases the complexity of model maintenance, but also makes it difficult to fully utilize the correlation information between forecasts at different time scales. Summary of the invention
[0009] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a machine learning virtual power plant load forecasting method based on multi-factor fusion, which can not only effectively handle complex and changeable influencing factors, but also has high-precision prediction and strong adaptability.
[0010] The objective of the present invention is achieved through the following technical solution: A machine learning virtual power plant load forecasting method based on multi-factor fusion, comprising the following steps:
[0011] S1. Collect multi-source heterogeneous data, including historical load data, meteorological data, calendar information, and social activity data, and pre-process the historical load data and meteorological data;
[0012] S2. Use multi-head attention mechanism and cross-modal learning technology to build a multi-factor fusion model;
[0013] S3. Combine LSTM and CNN to extract time series features, introduce time step adaptive mechanism to build a multi-scale load forecasting model, and build a training set for the multi-scale forecasting model;
[0014] S4. train the multi-scale prediction model using the training set to obtain a trained multi-scale prediction model;
[0015] S5. Perform power load forecasting based on the trained multi-scale prediction model.
[0016] The beneficial effects of the present invention are: combining advanced technologies such as deep learning technology, multimodal data fusion, time series feature extraction and multi-scale prediction, aiming to solve the key challenges in virtual power plant load forecasting. The method of the present invention can not only effectively handle complex and variable influencing factors, but also has high-precision prediction, strong adaptability, good interpretability and continuous learning ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a flow chart of the method of the present invention;
[0018] Figure 2 It is the structure diagram of the multi-factor fusion model;
[0019] Figure 3 Schematic diagram of time series feature extraction and multi-scale prediction. DETAILED DESCRIPTION
[0020] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings, but the protection scope of the present invention is not limited to the following.
[0021] A virtual power plant load forecasting method based on machine learning and multi-factor fusion includes the following steps:
[0022] S1. Collect multi-source heterogeneous data, including historical load data, meteorological data, calendar information, and social activity data, and pre-process the historical load data and meteorological data;
[0023] The step S1 comprises:
[0024] S101.Data collection:
[0025] a) Record the historical calendar information within a specified time length M (usually 3 years or 2 years) to obtain a calendar information set C = {c1, c2, ..., c t}, where t represents the total number of data points of historical calendar information, c1, c2, ..., c t Represents the calendar data of the 1st to tth historical calendar data points, with a time interval of Δt; the calendar data ci of the i-th historical calendar data point, i = 1, 2, ..., t is recorded as:
[0026] ci=(is workday ,is weekend ,is holiday )
[0027] If the current historical calendar data point is a working day, then is workday Take 1, otherwise is workday Take 0;
[0028] If the current historical calendar data point is a weekend, then is weekend Take 1, otherwise is weekend Take 0;
[0029] If the current historical calendar data point is a holiday, then is holiday Take 1, otherwise is holiday Take 0;
[0030] b) Collect historical social activity data within a specified time length M, and obtain a social activity data set S = {s1, s2, ..., s t}, where t represents the total number of historical social activity data points, s1, s2, ..., s t represents the social activity data of the 1st to tth historical social activity data points, with a time interval of Δt; the social activity data s of the ith historical social activity data point i , i=1,2,…,t is denoted as s i =(event type ,event scale );
[0031] event type Represents the type of event, with 1 representing a sporting event, 2 representing a concert, 3 representing a festival, 4 representing a political rally, and 5 representing a commercial exhibition;
[0032] event scale Characterizing the scale of activity
[0033] When it is 1, it means small, with less than 1000 participants;
[0034] When the value is 2, it represents medium-sized, 1000≤number of participants<5000;
[0035] When the value is 3, it means large-scale, 5000≤number of participants<10000;
[0036] When the value is 4, it means super large, with ≥10,000 participants;
[0037] If the i-th historical social activity data point has no social activity, then event type ,event scale All are taken as 0.
[0038] c) Collect the load history data of the virtual electric field within the specified time length M, and obtain the load history data set L = {l1,l2,...,l tL}, where tL represents the total number of data points in the load history, l1,l2,...,l tL Represents the load data of the 1st to tLth load historical data points, and the time interval between two adjacent load historical data points is δ;
[0039] d) Collect the meteorological historical data within the specified time length M to obtain the meteorological historical data set W = {w1, w2, ..., w tW}, where tw represents the total number of historical meteorological data points, w1,w2,...,w tWrepresents the meteorological data of 1 to tw meteorological historical data points, the time interval between two adjacent meteorological historical data points is ε, and the meteorological data of each meteorological historical data point includes temperature information, humidity information, wind speed information and precipitation information;
[0040] S102. Considering that when the load historical data and meteorological historical data are collected, the data sources are different, so the time intervals may be different from the calendar information and social activity data. Therefore, the sets L and W are time-aligned and the interpolation method is used to ensure that the two sets of data have the same time interval Δt and data point number t, and the set L is obtained. * and the set W * ;
[0041] The interpolation method steps are as follows
[0042] A1. Determine the target time series:
[0043] Determine the time interval Δt;
[0044] Create a new time series, starting from the earliest data point and ending at the latest data point, with an interval of Δt and t number of data points;
[0045] A2. Processing load historical data set L:
[0046] A21. For each new data point, find its position in the original load data:
[0047] If it matches the original data point exactly, use that value directly;
[0048] If it falls between two original data points, do the following:
[0049] A22. Find the original data points closest to the new time point on both sides, and record them as (t1, L1) and (t2, L2).
[0050] A23. Calculate interpolation:
[0051] L new =L1+(t new -t1)*(L2-L1) / (t2-t1)
[0052] Among them, t new It’s a new time point, L new is the new load value to be calculated;
[0053] A24, calculate the L new Add to the new load data series;
[0054] After each new data point is processed, a new load data set is obtained, denoted as L *;
[0055] A3. Processing of meteorological historical data set W:
[0056] For each variable in W, i.e., temperature, humidity, wind speed, precipitation, repeat the following steps:
[0057] A31. For each new data point, find its position in the original meteorological data;
[0058] A32. If it matches the original data point exactly, use this value directly;
[0059] A33. If the time point falls between two original data points:
[0060] Find the two nearest original data points, recorded as (t1, W1) and (t2, W2);
[0061] The new value is calculated using the same linear interpolation formula as for the load data:
[0062] W new =W1+(t new -t1)*(W2-W1) / (t2-t1)
[0063] A34. The calculated W new Add to new weather data series;
[0064] For each variable, after processing each new data point, a new meteorological data set is obtained, denoted as W * ;
[0065] In some embodiments, when processing precipitation, the accumulated precipitation is first converted into precipitation rate (precipitation per hour).
[0066] Linear interpolation of precipitation rates;
[0067] The interpolated precipitation rate is reconverted into cumulative precipitation;
[0068] When processing load data L and meteorological data W, for the start and end parts of the time series, the difference cannot be performed due to the lack of data points on one side; if there is no exact match to the original data point, the nearest valid data point is directly used;
[0069] In some embodiments, data verification can also be performed
[0070] Check whether the interpolated data is within a reasonable range, that is, the load value should be non-negative, and the temperature, humidity, and wind speed should be within the preset range;
[0071] If an outlier value is found that is no longer within a reasonable range, choose to use an adjacent valid value instead;
[0072] Timestamp alignment, ensuring that all interpolated load and meteorological variable data series use the same timestamp;
[0073] After verification, all data series have the same length to ensure that there are no missing values or that all missing values have been properly handled;
[0074] S103. For the set L * The load data in is normalized:
[0075] Use Min-Max normalization to map values to the [0,1] interval:
[0076] l' i =(l i * -min(L * )) / (max(L * )-min(L * ));
[0077] Among them, l i * Represents the set L * The load data of the i-th load data point, min(L * ) indicates L * The minimum value in max(L * ) indicates L * The maximum value in l' i Indicates l i * The data obtained after standardization, i=i=1,2,…,K,L * After all data points in are processed, a standardized load data set will be obtained, which is recorded as L'.
[0078] S2. Use multi-head attention mechanism and cross-modal learning technology to build a multi-factor fusion model.
[0079] The step S2 comprises:
[0080] S201. Multi-factor fusion model input layer design:
[0081] Input: load data set L', meteorological data set W * , calendar information: C, social activity data: S
[0082] step:
[0083] a) Calculate the embedding vector E based on the load data set L' L :
[0084] E L =WL ·L'+b L
[0085] Among them, W L Indicates the preset load data weight, b L Indicates the preset load data bias;
[0086] b) Based on the meteorological data set W * , calculate the embedding vector E W :
[0087] E W =W W ·W * +b W
[0088] Among them, W L Indicates the preset meteorological data weight, b L Indicates the preset meteorological data bias;
[0089] c) Calculate the embedding vector E based on the calendar information C C :
[0090] E C =W C ·C+b C
[0091] Among them, W C Indicates the preset calendar information weight, b L Indicates the preset calendar information offset;
[0092] d) Calculate the embedding vector E based on social activity data S :
[0093] Output: E S =W S ·S+b S
[0094] Among them, W S represents the preset social activity data weight, b S Indicates the preset social activity data bias;
[0095] Data concatenation to obtain the output X of the input layer:
[0096] X=Concat(E L ,E W ,E C ,E S )
[0097] Concat means that at each load data point, E L ,E W ,E C,E S The elements in are concatenated; the concatenation results in vectors X and E L The number of data points is the same, but each data point after splicing contains the E at the time of the data point. L ,E W ,E C ,E S information;
[0098] S202. Multi-head attention mechanism:
[0099] a) First, perform a linear transformation on the output X of the input layer to obtain the query Q, key K, and value V:
[0100] Q=W Q ·X
[0101] K=W K ·X
[0102] V=W V ·X
[0103] b) Use the multi-head attention mechanism algorithm to process the query Q, key K and value V to obtain the processing result Y, which is used to represent the global context sequence representation.
[0104] Global context: The data at each time point is not only related to its own features, but also to other time points in the entire sequence, so it is necessary to consider the sequence representation of the global context. Therefore, we use a multi-head attention mechanism to process X and obtain the sequence Y;
[0105] Specifically, the attention score is calculated as:
[0106] Input: Q, K
[0107] Output: A = softmax((Q·K T ) / √dk)
[0108] Attention output calculation:
[0109] Input:A,V
[0110] Output: O = A·V
[0111] d) Multi-head attention:
[0112] Input: X
[0113] Process: Repeat steps ac for h times to get h outputs O1, O2, ..., O h
[0114] Output: MultiHead(X)=Concat(O1,O2,...,O h)·W O
[0115] (shape:[batch_size,sequence_length,d_model])
[0116] Final output:
[0117] Y=MultiHead(X)(shape:[batch_size,sequence_length,d_model])
[0118] The output Y of the multi-head attention mechanism captures the long-range dependencies and complex patterns between data of different modalities.
[0119] S203. Cross-modal learning fusion
[0120] Connect all embedding vectors and multi-head attention outputs to obtain a cross-modal fusion vector:
[0121] X_concat=Concat(E L ,E W ,E C ,E S ,Y)
[0122] Concat means that at each load data point, E L ,E W ,E C ,E S , concatenate the elements in Y; concatenate to get vectors X and E L The number of data points is the same, but each data point after splicing contains the time E at which the data point is located. L ,E W ,E C ,E S , element information in Y;
[0123] By applying the shared hidden layer, we can obtain the hidden layer output vector, which is the cross-modal fusion vector H of historical load data, meteorological data, calendar information, and social activity data:
[0124] H = ReLU(W H X_concat+b H )in:
[0125] W H is the weight matrix;
[0126] b H is the bias vector;
[0127] ReLU is the activation function.
[0128] S3. Combined with LSTM, specifically using a bidirectional long short-term memory (Bi-LSTM) network and CNN to extract time series features, introducing a time step adaptive mechanism to build a multi-scale load forecasting model, and building a training set for the multi-scale forecasting model;
[0129] The step S3 comprises:
[0130] In step S3, the prediction span of the short-term prediction model, the medium-term prediction model and the long-term prediction model is set to T, and a multi-scale load prediction model is constructed based on the LSTM network and the CNN neural network. The construction of a training set for the multi-scale prediction model includes:
[0131] S301. Construct a short-term prediction model based on the CNN neural network and construct a training set for the short-term prediction model. The construction process includes:
[0132] A1. Randomly extract T+1 consecutive data points from vector H, use the data of the first T data points as sample features, and the data of the T+1th data point as sample labels, thereby constructing a training sample;
[0133] A2. Repeat step A1 multiple times to obtain multiple training samples, add them to the same set, and form a training set for the short-term prediction model.
[0134] S302. Construct a medium-term prediction model based on the LSTM network and construct a training set for the medium-term prediction model. The construction process includes:
[0135] B1. Given that the time length of the medium-term forecast is K1 times that of the short-term forecast, the elements in the vector H are grouped starting from the first element. The number of elements in each group is K1. If the number of elements in the last group is less than K1, they are discarded. Then, the elements in each group are accumulated, and the accumulated elements are used to construct the vector H1.
[0136] Randomly extract T+1 consecutive data points from vector H1, use the data of the first T data points as sample features, and the data of the T+1th data point as sample labels, thereby constructing a training sample;
[0137] B2. Repeat step B1 multiple times to obtain multiple training samples, add them to the same set, and form a training set for the medium-term prediction model;
[0138] S303. Build a long-term prediction model based on the LSTM network and build a training set for the long-term prediction model. The building process includes:
[0139] C1. Given that the time length of the long-term forecast is K2 times that of the medium-term forecast, the elements in the vector H1 are grouped starting from the first element. The number of elements in each group is K2. If the number of elements in the last group is less than K2, they are discarded. Then, the elements in each group are accumulated, and the accumulated elements are used to construct the vector H2.
[0140] Randomly extract T+1 consecutive data points from vector H2, use the data of the first T data points as sample features, and the data of the T+1th data point as sample labels, thereby constructing a training sample;
[0141] C2. Repeat step C1 multiple times to obtain multiple training samples, add them to the same set, and form a training set for the long-term prediction model.
[0142] The process of determining the CNN receptive field size and the LSTM time step in step S3 includes:
[0143] (1) For the short-term prediction model, determine the size of the CNN receptive field:
[0144] Set the upper limit of CNN's receptive field to max_kernelsize to prevent the receptive field from being too large, which will lead to a surge in computational complexity.
[0145] Determine the CNN receptive field size: CNN_kernelsize = max(3, min(T, max_kernelsize)), where 3 in the formula is used to make the receptive field size not less than 3, ensuring that the CNN can at least capture short-term patterns;
[0146] (2) For the medium-term forecast model, determine the LSTM time step:
[0147] The upper limit of the time step of the LSTM network is set to maxsteps to maintain a balance between prediction accuracy and computational efficiency;
[0148] Determine the time step of the LSTM network: LSTMsteps = max(1, min(T, maxsteps)). The 1 in the formula is used to ensure that at least 1 time step is used to prevent invalid values.
[0149] S4. train the multi-scale prediction model using the training set to obtain a trained multi-scale prediction model;
[0150] The step S4 comprises:
[0151] The short-term prediction model of the training set of the short-term prediction model is used for training to obtain a trained short-term prediction model; during the training process, for each sample in the training set of the short-term prediction model, the sample feature is used as input and the label is used as the expected output for training, and the training is completed when all samples are trained; since the training of the CNN neural network is a mature and well-known scheme, it will not be described here;
[0152] The medium-term prediction model of the training set of the medium-term prediction model is used for training to obtain a trained medium-term prediction model; during the training process, for each sample in the training set of the medium-term prediction model, the sample feature is used as input and the label is used as the expected output for training. When all samples are trained, the training is completed; since the training of the LSTM neural network is a mature common sense, it will not be described here;
[0153] The long-term prediction model of the training set of the long-term prediction model is used for training to obtain a trained long-term prediction model. During the training process, for each sample in the training set of the long-term prediction model, the sample feature is used as input and the label is used as the expected output for training. When all samples are trained, the training is completed. Since the training of the CNN neural network is a mature common sense, it will not be described here.
[0154] S5. Perform power load forecasting based on the trained multi-scale prediction model.
[0155] Use the last T data in H to form a vector as the sample feature, input the trained short-term prediction model, and obtain the prediction result of a future short-term data point;
[0156] Use the last K1*T data in H to divide into T groups, each group has K1 data, accumulate the data in each group, and finally get T data as the composition vector. As the sample feature, input the trained medium-term prediction model to get the prediction result of a future medium-term data point;
[0157] Use the last K2*K1*T data in H to divide it into T groups, each with K2*K1 data. Accumulate the data in each group and finally get T data as the constituent vector. Use it as sample features and input it into the trained long-term prediction model to get the prediction result of a future long-term data point.
[0158] The prediction results need to be processed as follows to restore them to load data:
[0159] 1. The activation function result of the model output layer is reconstructed into an estimate of the original concatenated feature vector through reverse calculation and back propagation of the fully connected layer.
[0160] 2. The reconstructed feature vector is parsed and de-embedded to extract the embedded representation related to the load data, and then converted back to the load value in the standardized space through inverse transformation.
[0161] 3. Using the pre-saved original data statistical information (such as maximum and minimum values), the extracted load values are de-normalized and mapped back to the original data scale to obtain the final actual load forecast results.
[0162] The machine learning virtual power plant load forecasting method also includes: after obtaining the forecast results of short-term data points, medium-term data points and long-term data points, visually displaying the short-term, medium-term and long-term forecast results.
[0163] The machine learning virtual power plant load forecasting method is as follows: the short-term forecasting model, the medium-term forecasting model and the long-term forecasting model are trained and updated at set intervals.
[0164] By executing all the above steps, we finally get a model system capable of multi-scale load forecasting. The system can output short-term (1-24 hours), medium-term (1-7 days) and long-term (1-12 months) load forecast values, as well as the corresponding confidence intervals;
[0165] In the data collection and preprocessing stage, the present invention systematically collects multi-source heterogeneous data. Historical load data is collected at intervals of 15 minutes, and records of the past three years are collected; meteorological data includes temperature, humidity, wind speed, precipitation, etc., which are collected once every hour; calendar information includes working days, weekends, holidays, etc.; social activity data covers information such as large-scale events and competitions. Data preprocessing uses linear interpolation to fill in missing data. Min-Max normalization is then performed to map the values to the [0,1] interval.
[0166] The multi-factor fusion model uses a multi-head attention mechanism and cross-modal learning technology. The input layer of the model designs independent embedding layers for different types of data such as load, weather, and calendar. The attention layer uses 8 attention heads, each with a dimension of 64, and calculates the attention score by scaling the dot product attention. The cross-modal fusion layer designs a shared 256-dimensional hidden layer to map the features of different modalities to the same representation space.
[0167] The temporal feature extraction module combines the advantages of LSTM and CNN. Specifically, a two-layer bidirectional LSTM is used, with 128 hidden units in each layer, to capture long-term dependencies. The CNN part contains three 1D convolutional layers with kernel sizes of 3, 5, and 7, respectively, and 64 filters in each layer, to extract multi-scale local features. The time step adaptive mechanism is introduced to dynamically adjust the time step of LSTM and the receptive field size of CNN according to the prediction time scale.
[0168] Multi-scale prediction adopts a hierarchical multi-task learning framework. Short-term prediction (1-24 hours) uses a fully connected layer to output 24 prediction values; medium-term prediction (1-7 days) uses the short-term prediction results as input and uses an LSTM network to predict the daily load for the next 7 days; long-term prediction (1-12 months) is based on the medium-term prediction results, using an LSTM network) to predict the monthly load. In terms of model training and optimization, mean square error (MSE), mean absolute percentage error (MAPE) and negative log likelihood (NLL) are used as loss functions for predictions of different time scales. In an embodiment of the present application, the Adam optimizer is used, the initial learning rate is 0.001, and the cosine annealing strategy is used to dynamically adjust the learning rate. L2 regularization (weight decay coefficient is 0.0001) and Dropout (ratio is 0.3) are introduced to prevent overfitting.
[0169] In the embodiment of the present application, the prediction result visualization and interpretation system is developed based on the Web. The Plotly.js library is used to draw interactive load forecast curves, supporting operations such as zooming and panning. The SHAP (SHapley AdditiveexPlanations) library is used to calculate and visualize feature importance.
[0170] In an embodiment of the present application, an incremental learning algorithm can also be designed with a continuous learning and updating mechanism. A fixed-size circular buffer is maintained to store the latest historical data, and incremental training is performed every 24 hours to update model parameters. Performance monitoring is performed by calculating the prediction error within the sliding window, and a full retraining is triggered when the MAPE exceeds a preset threshold (such as 5%). During the retraining process, the soft labels of the old model are used as additional training targets using knowledge distillation technology to retain historical knowledge.
[0171] The method of the present invention can be effectively applied to virtual power plant scenarios to achieve high-precision, multi-scale load forecasting, and has continuous learning and adaptive capabilities. This method improves prediction accuracy, enhances model interpretability and adaptability, and provides strong support for the intelligent operation of virtual power plants. This technical solution has good scalability and can be adjusted and optimized according to specific application scenarios. It should be understood that the above embodiments are only used to illustrate the principles of the present invention and should not be regarded as limiting the scope of protection of the present invention. Under the enlightenment of the present invention, those skilled in the art can also make various modifications and improvements without departing from the scope of protection of the claims of the present invention, and these modifications and improvements should also be regarded as the scope of protection of the present invention.
Claims
1. A virtual power plant load forecasting method based on machine learning and multi-factor fusion, characterized by: The following steps are involved: S1. Collect multi-source heterogeneous data, including historical load data, meteorological data, calendar information, and social activity data, and pre-process the historical load data and meteorological data; S2. Use multi-head attention mechanism and cross-modal learning technology to build a multi-factor fusion model and calculate the fusion vector of historical load data, meteorological data, calendar information and social activity data; S3. Based on the LSTM network and CNN neural network, a multi-scale load forecasting model is constructed, a training set is constructed for the multi-scale forecasting model, and the CNN receptive field size and LSTM time step are determined; S4. train the multi-scale prediction model using the training set to obtain a trained multi-scale prediction model; S5. Perform power load forecasting based on the trained multi-scale prediction model.
2. According to claim 1, a machine learning virtual power plant load forecasting method based on multi-factor fusion is characterized by: The step S1 comprises: S101.Data collection: a) Record the historical calendar information within the specified time length M, and obtain the calendar information set C = {c1, c2, ..., c t }, where t represents the total number of data points of historical calendar information, c1, c2, ..., c t Represents the calendar data of the 1st to tth historical calendar data points, with a time interval of Δt; b) Collect historical social activity data within a specified time length M, and obtain a social activity data set S = {s1, s2, ..., s t }, where t represents the total number of historical social activity data points, s1, s2, ..., s t Represents the social activity data of the 1st to tth historical social activity data points, with a time interval of Δt; c) Collect the load history data of the virtual electric field within the specified time length M, and obtain the load history data set L = {l1,l2,...,l tL }, where tL represents the total number of data points in the load history, l1,l2,...,l tL Represents the load data of the 1st to tLth load historical data points, and the time interval between two adjacent load historical data points is δ; d) Collect the meteorological historical data within the specified time length M to obtain the meteorological historical data set W = {w1, w2, ..., w tW }, where tw represents the total number of historical meteorological data points, w1,w2,...,w tW represents the meteorological data of 1 to tw meteorological historical data points, the time interval between two adjacent meteorological historical data points is ε, and the meteorological data of each meteorological historical data point includes temperature information, humidity information, wind speed information and precipitation information; S102. Perform time alignment processing on sets L and W, using interpolation methods to ensure that the two sets of data have the same time interval Δt and number of data points t, and obtain set L * and the set W * ; S103. For set L * The load data in is standardized: Use Min-Max normalization to map values to the [0,1] interval: L' i =(l i * -min(L * )) / (max(L * )-min(L * )); Among them, l i * Represents the set L * The load data of the i-th load data point, min(L * ) indicates L * The minimum value in max(L * ) indicates L * The maximum value in l' i Indicates l i * The data obtained after standardization, i=i=1,2,…,K,L * After all data points in are processed, a standardized load data set will be obtained, which is recorded as L'.
3. The method for virtual power plant load forecasting based on machine learning and multi-factor fusion according to claim 1 is characterized by: The step S2 comprises: S201. Multi-factor fusion model input layer design: Input: load data set L', meteorological data set W * , calendar information: C, social activity data: S step: a) Calculate the embedding vector E based on the load data set L' L : E L =W L ·L'+b L Among them, W L Indicates the preset load data weight, b L Indicates the preset load data bias; b) Based on the meteorological data set W * , calculate the embedding vector E W : HAVE BEEN W =W W ·W * +b W Among them, W L Indicates the preset meteorological data weight, b L Indicates the preset meteorological data bias; c) Calculate the embedding vector E based on the calendar information C C : E C =W C ·C+b C Among them, W C Indicates the preset calendar information weight, b L Indicates the preset calendar information offset; d) Calculate the embedding vector E based on social activity data S : Output: E S =W S ·S+b S Among them, W S represents the preset social activity data weight, b S Indicates the preset social activity data bias; Data concatenation to obtain the output X of the input layer: X=Concat(E L ,AND W ,AND C ,AND S ) Concat means that at each load data point, E L ,E W ,E C ,E S The elements in are concatenated; the concatenation results in vectors X and E L The number of data points is the same, but each data point after splicing contains the E at the time of the data point. L ,E W ,E C ,E S information; S202. Multi-head attention mechanism: a) First, perform a linear transformation on the output X of the input layer to obtain the query Q, key K, and value V: Q=W Q ·X K=W K ·X V=W V ·X b) Use the multi-head attention mechanism algorithm to process the query Q, key K and value V to obtain the processing result Y, which is used to represent the sequence representation considering the global context; S203. Cross-modal learning fusion Connect all embedding vectors and multi-head attention outputs to obtain a cross-modal fusion vector: X_concat=Concat(E L ,AND W ,AND C ,AND S ,Y) Concat means that at each load data point, E L ,E W ,E C ,E S , concatenate the elements in Y; concatenate to get vectors X and E L The number of data points is the same, but each data point after splicing contains the time E at which the data point is located. L ,E W ,E C ,E S , element information in Y; Applying the shared hidden layer, we get the hidden layer output vector, which is the fusion vector H of historical load data, meteorological data, calendar information and social activity data: H = ReLU(W H X_concat+b H )in: W H is the weight matrix; b H is the bias vector; ReLU is the activation function.
4. The method for virtual power plant load forecasting based on machine learning and multi-factor fusion according to claim 1 is characterized by: In step S3, the prediction span of the short-term prediction model, the medium-term prediction model and the long-term prediction model is set to T, and a multi-scale load prediction model is constructed based on the LSTM network and the CNN neural network. The construction of a training set for the multi-scale prediction model includes: S301. Construct a short-term prediction model based on the CNN neural network and construct a training set for the short-term prediction model. The construction process includes: A1. Randomly extract T+1 consecutive data points from vector H, use the data of the first T data points as sample features, and the data of the T+1th data point as sample labels, thereby constructing a training sample; A2. Repeat step A1 multiple times to obtain multiple training samples, add them to the same set, and form a training set for the short-term prediction model. S302. Construct a medium-term prediction model based on the LSTM network and construct a training set for the medium-term prediction model. The construction process includes: B1. Given that the time length of the medium-term forecast is K1 times that of the short-term forecast, the elements in the vector H are grouped starting from the first element. The number of elements in each group is K1. If the number of elements in the last group is less than K1, they are discarded. Then, the elements in each group are accumulated, and the accumulated elements are used to construct the vector H1. Randomly extract T+1 consecutive data points from vector H1, use the data of the first T data points as sample features, and the data of the T+1th data point as sample labels, thereby constructing a training sample; B2. Repeat step B1 multiple times to obtain multiple training samples, add them to the same set, and form a training set for the medium-term prediction model; S303. Build a long-term prediction model based on the LSTM network and build a training set for the long-term prediction model. The building process includes: C1. Given that the time length of the long-term forecast is K2 times that of the medium-term forecast, the elements in the vector H1 are grouped starting from the first element. The number of elements in each group is K2. If the number of elements in the last group is less than K2, they are discarded. Then, the elements in each group are accumulated, and the accumulated elements are used to construct the vector H2. Randomly extract T+1 consecutive data points from vector H2, use the data of the first T data points as sample features, and the data of the T+1th data point as sample labels, thereby constructing a training sample; C2. Repeat step C1 multiple times to obtain multiple training samples, add them to the same set, and form a training set for the long-term prediction model.
5. The method for virtual power plant load forecasting based on machine learning and multi-factor fusion according to claim 4 is characterized in that: The process of determining the CNN receptive field size and the LSTM time step in step S3 includes: (1) For the short-term prediction model, determine the size of the CNN receptive field: Set the upper limit of CNN's receptive field to max_kernelsize to prevent the receptive field from being too large, which will lead to a surge in computational complexity. Determine the CNN receptive field size: CNN_kernelsize = max(3, min(T, max_kernelsize)), where 3 in the formula is used to make the receptive field size not less than 3, ensuring that the CNN can at least capture short-term patterns; (2) For the medium-term forecast model, determine the LSTM time step: The upper limit of the time step of the LSTM network is set to maxsteps to maintain a balance between prediction accuracy and computational efficiency; Determine the time step of the LSTM network: LSTMsteps = max(1, min(T, maxsteps)). The 1 in the formula is used to ensure that at least 1 time step is used to prevent invalid values.
6. The method for virtual power plant load forecasting based on machine learning and multi-factor fusion according to claim 1 is characterized by: The step S4 comprises: Using the short-term prediction model of the training set of the short-term prediction model for training, to obtain a trained short-term prediction model; Using the medium-term prediction model of the training set of the medium-term prediction model for training, to obtain a trained medium-term prediction model; The long-term prediction model of the training set of the long-term prediction model is used for training to obtain a trained long-term prediction model.
7. The method for virtual power plant load forecasting based on machine learning and multi-factor fusion according to claim 1 is characterized by: The step S5 comprises: Use the last T data in H to form a vector as the sample feature, input the trained short-term prediction model, and obtain the prediction result of a future short-term data point; Use the last K1*T data in H to divide into T groups, each group has K1 data, accumulate the data in each group, and finally get T data as the composition vector. As the sample feature, input the trained medium-term prediction model to get the prediction result of a future medium-term data point; Use the last K2*K1*T data in H to divide it into T groups, each with K2*K1 data. Accumulate the data in each group and finally get T data as the constituent vector. Use it as sample features and input it into the trained long-term prediction model to get the prediction result of a future long-term data point.
8. The method for virtual power plant load forecasting based on machine learning and multi-factor fusion according to claim 7 is characterized by: The machine learning virtual power plant load forecasting method also includes: after obtaining the forecast results of short-term data points, medium-term data points and long-term data points, visually displaying the short-term, medium-term and long-term forecast results.
9. The method for virtual power plant load forecasting based on machine learning and multi-factor fusion according to claim 7 is characterized by: The machine learning virtual power plant load forecasting method is as follows: the short-term forecasting model, the medium-term forecasting model and the long-term forecasting model are trained and updated at set intervals.
Citation Information
Cited By
Multi-source energy storage self-power-supply method and system for iron tower, equipment and storage medium
CN120497922A
Multi-source energy storage self-powering methods, systems, equipment, and storage media for iron towers
CN120497922B
Photovoltaic power generation prediction system and method for virtual power plant
CN120579669A
Virtual power plant user incentive generation method and system based on deep user portrait
CN120707207A
Training method and device of load prediction model, prediction method and device and electronic equipment
CN120744514A
