Micro-grid load supply and demand combination prediction method and device and electronic equipment

By adopting the load prediction model of multi-task learning and single-task learning models in the microgrid, the coupling relationship between loads is extracted and non-linear fusion is performed, the problem of combining prediction of power supply and demand of microgrid is solved, and the multivariate with high accuracy is achieved Load forecast.

CN119443349APending Publication Date: 2025-02-14BEIJING SMARTCHIP MICROELECTRONICS TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411377668.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The prior art cannot effectively realize the combination prediction of power supply and demand for microgrids, especially in the combination prediction of multiple loads.

Method used

A load prediction model based on a multi-task learning model and a single-task learning model is adopted. By obtaining multiple types of loads to be predicted, it is input to the prediction model to generate load prediction results. The model includes a parameter sharing layer, an attention mechanism layer and a fusion layer to extract the coupling relationship between loads, weighted computational features and timing information, and perform nonlinear fusion to improve prediction accuracy.

Benefits of technology

High accuracy prediction of multi-load of microgrids is achieved, and the advantages of multi-task learning and single-task learning models are fully utilized, and the problem of combining prediction of power supply and demand of microgrids is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119443349A_ABST
    Figure CN119443349A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a microgrid load supply and demand combination prediction method and device and electronic equipment, and belongs to the technical field of microgrids. The method comprises the following steps: acquiring multiple types of to-be-predicted loads of the micro-grid; inputting the plurality of types of to-be-predicted loads into a load prediction model to obtain load prediction results of all types of to-be-predicted loads output by the load prediction model; wherein the load prediction model is constructed based on a prediction layer and a fusion layer, and the prediction layer comprises a multi-task learning model and a single-task learning model and is used for predicting the to-be-predicted loads of the multiple types to obtain a first prediction value sequence and a second prediction value sequence, and the fusion layer is used for carrying out nonlinear fusion on the first predicted value sequence and the second predicted value so as to obtain load prediction results of all types of loads to be predicted. The embodiment of the invention is used for solving the defect that the existing method cannot realize micro-grid-oriented electric energy supply and demand combination prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of microgrid technology, and in particular to a method for predicting a combination of supply and demand of a microgrid load, a device for predicting a combination of supply and demand of a microgrid load, an electronic device, a machine-readable storage medium, and a computer program product. Background Art

[0002] Microgrid refers to a small power generation and distribution system composed of distributed power sources, energy storage devices, energy conversion devices, related loads, and monitoring and protection devices. Currently, research on load forecasting and new energy power forecasting is relatively common, but most of them are aimed at the dispatching of 110kV large power grids. There is still a gap in the forecasting of power supply and demand combinations for microgrids, that is, there is still a gap in the forecasting of multiple types of load combinations for microgrids. Summary of the invention

[0003] The purpose of the embodiments of the present invention is to provide a microgrid load supply and demand combination prediction method, a microgrid load supply and demand combination prediction device, an electronic device, a machine-readable storage medium and a computer program product to solve the defect that the existing methods cannot realize the combined prediction of electric energy supply and demand for microgrids.

[0004] In order to achieve the above object, an embodiment of the present invention provides a microgrid load supply and demand combination prediction method, comprising:

[0005] Obtain multiple types of loads to be predicted of the microgrid;

[0006] Inputting the multiple types of loads to be predicted into a load prediction model to obtain load prediction results of all types of loads to be predicted output by the load prediction model;

[0007] Among them, the load forecasting model is trained based on multiple types of sample loads, the prediction result label of each sample load and the sample meteorological characteristics corresponding to each sample load; the load forecasting model is constructed based on the prediction layer and the fusion layer, the prediction layer includes a multi-task learning model and a single-task learning model, which are used to predict the multiple types of loads to be predicted respectively to obtain a first prediction value sequence and a second prediction value, and the fusion layer is used to perform nonlinear fusion on the first prediction value sequence and the second prediction value to obtain the load forecasting results of all types of loads to be predicted.

[0008] Optionally, the multi-task learning model includes a parameter sharing layer and a first fully connected layer, the parameter sharing layer is used to extract the coupling relationship between the multiple types of loads to be predicted based on the shared underlying parameters, and the first fully connected layer is used to perform load prediction based on the coupling relationship to obtain the first prediction value sequence; the first prediction value sequence includes the prediction values ​​of all types of loads to be predicted.

[0009] Optionally, the parameter sharing layer is constructed based on any one of the models of a long short-term memory network, a gated recurrent unit, and a bidirectional long short-term memory network.

[0010] Optionally, the single-task learning model includes an attention mechanism layer, a feature extraction layer and a second fully connected layer, the attention mechanism layer is used to perform weighted calculation on the multiple types of loads to be predicted to obtain the attention weights of all types of loads to be predicted at all set times, the feature extraction layer is used to perform feature extraction based on the attention weights of all types of loads to be predicted at all set times to obtain a target feature combination, and the second fully connected layer is used to predict the target feature combination to obtain the second prediction value.

[0011] Optionally, the attention mechanism layer includes a feature attention layer and a temporal attention layer;

[0012] The feature attention layer is used to input the input feature vector into the multilayer perceptron to obtain the feature attention weight vector output by the multilayer perceptron; normalize the feature attention weight vector; and multiply the normalized feature attention weight vector with the input feature vector to obtain a feature weight vector; wherein the input feature vector is constructed based on the multiple types of loads to be predicted; the feature attention weight vector includes feature attention weight coefficients corresponding to all types of loads to be predicted;

[0013] The temporal attention layer is used to input the feature weighted vector into a multilayer perceptron to obtain a temporal attention weight vector output by the multilayer perceptron; normalize the temporal attention weight vector; and multiply the normalized temporal attention weight vector by the feature weighted vector to obtain a feature temporal weighted vector; wherein the temporal attention weight vector includes the temporal attention weight coefficients corresponding to all types of loads to be predicted at all set times, and the feature temporal weighted vector serves as the attention weights of all types of loads to be predicted at all set times.

[0014] Optionally, the load forecasting model is trained through the following steps:

[0015] Acquire multiple types of historical load data sets of the microgrid, prediction result labels of historical loads in all the historical load data sets, and historical meteorological characteristics corresponding to the historical loads;

[0016] Based on the correlation between multiple types of historical load data sets and the correlation between all types of historical loads and historical meteorological characteristics, the multiple types of historical load data sets are screened to obtain multiple types of sample load data sets, prediction result labels of sample loads in all types of sample load data sets, and sample meteorological characteristics corresponding to the sample loads;

[0017] Repeat the following training steps until the preset end condition is reached:

[0018] Inputting multiple types of sample loads and sample meteorological features corresponding to each of the sample loads into the multi-task learning model to obtain a first sample prediction value sequence output by the multi-task learning model; the first prediction value sequence includes prediction values ​​of all types of sample loads;

[0019] Inputting a plurality of types of sample loads, sample meteorological features corresponding to each of the sample loads, and the first sample prediction value sequence into the single-task learning model to obtain a second sample prediction value output by the single-task learning model;

[0020] Nonlinearly fusing the first sample prediction value sequence and the second sample prediction value through the fusion layer to obtain sample load prediction results of all types of sample loads;

[0021] Calculate the loss function based on the predicted result labels of all sample loads and the sample load prediction results of all types of sample loads;

[0022] Model parameters of the load forecasting model are adjusted based on the loss function.

[0023] Optionally, based on the correlation between multiple types of historical load data sets and the correlation between all types of historical loads and historical meteorological features, the multiple types of historical load data sets are screened to obtain multiple types of sample load data sets, prediction result labels of sample loads in all types of sample load data sets, and sample meteorological features corresponding to the sample loads, including:

[0024] Calculating a first correlation coefficient between the plurality of types of historical load data sets by using a Spearman correlation coefficient method, and calculating a second correlation coefficient between all types of the historical loads and the historical meteorological characteristics;

[0025] Determine multiple types of target historical load data sets corresponding to the first correlation coefficient and / or the second correlation coefficient that is greater than or equal to a set correlation threshold as multiple types of sample load data sets, determine prediction result labels of historical loads in all types of target historical load data sets as prediction result labels of all sample loads, and determine historical meteorological characteristics of historical loads in all types of target historical load data sets as sample meteorological characteristics corresponding to all sample loads.

[0026] Optionally, the multi-task learning model is trained by the following steps:

[0027] Inputting multiple types of sample loads and sample meteorological features corresponding to each of the sample loads into the multi-task learning model to obtain a first sample prediction value sequence output by the multi-task learning model; the first prediction value sequence includes prediction values ​​of all types of sample loads;

[0028] Calculating a forward propagation loss function based on the first sample prediction value sequence and the prediction result labels of all types of sample loads;

[0029] Back-propagating the forward propagation loss function to determine the actual gradient of the multi-task learning model;

[0030] Constructing a gradient loss function based on the actual gradient and the target gradient;

[0031] The partial derivatives of different task weights of the multi-task learning model are calculated based on the gradient loss function, and the task weights of different tasks of the multi-task learning model are updated based on the partial derivative calculation results.

[0032] On the other hand, an embodiment of the present invention further provides a microgrid load supply and demand combined prediction device, comprising:

[0033] An acquisition module, used for acquiring multiple types of loads to be predicted of the microgrid;

[0034] A prediction module, used for inputting the multiple types of loads to be predicted into a load prediction model, and obtaining load prediction results of all types of loads to be predicted output by the load prediction model;

[0035] Among them, the load forecasting model is trained based on multiple types of sample loads, the prediction result label of each sample load and the sample meteorological characteristics corresponding to each sample load; the load forecasting model is constructed based on the prediction layer and the fusion layer, the prediction layer includes a multi-task learning model and a single-task learning model, which are used to predict the multiple types of loads to be predicted respectively to obtain a first prediction value sequence and a second prediction value, and the fusion layer is used to perform nonlinear fusion on the first prediction value sequence and the second prediction value to obtain the load forecasting results of all types of loads to be predicted.

[0036] On the other hand, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned microgrid load supply and demand combination prediction method when executing the program.

[0037] On the other hand, the present invention also provides a machine-readable storage medium having a computer program stored thereon, which implements the above-mentioned microgrid load supply and demand combination prediction method when executed by a processor.

[0038] On the other hand, the present invention also provides a computer program product, including a computer program, which implements the above-mentioned microgrid load supply and demand combination prediction method when executed by a processor.

[0039] Through the above technical solution, the load prediction model constructed based on the multi-task learning model and the single-task learning model in the embodiment of the present invention realizes multiple types of microgrid load prediction, and nonlinearly fuses the various prediction results of the multi-task learning model and the single-task learning model through the fusion layer. The embodiment of the present invention makes full use of the respective advantages of the multi-task learning model and the single-task learning model to realize multivariate load prediction of the microgrid.

[0040] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:

[0042] Figure 1 It is one of the flow charts of the microgrid load supply and demand combination prediction method provided by the present invention;

[0043] Figure 2 It is a structural schematic diagram of the multi-task learning model provided by the present invention;

[0044] Figure 3It is a structural schematic diagram of the single-task learning model provided by the present invention;

[0045] Figure 4 yes Figure 3 Schematic diagram of the structure of the feature attention layer;

[0046] Figure 5 This is the second flow chart of the microgrid load supply and demand combination prediction method provided by the present invention;

[0047] Figure 6 It is a structural schematic diagram of a microgrid load supply and demand combined prediction device provided by the present invention;

[0048] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0049] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.

[0050] Method Embodiment

[0051] Please refer to Figure 1 The embodiment of the present invention provides a method for forecasting a combined supply and demand of a microgrid load, comprising:

[0052] Step 100: Obtain multiple types of loads to be predicted in the microgrid.

[0053] The electronic device obtains multiple types of loads to be predicted of the microgrid. The multiple types of loads to be predicted may be multiple loads to be predicted of the microgrid. For example, the multiple types of loads to be predicted may be user loads, wind power generation loads, photovoltaic power generation loads, and other types of loads in the microgrid.

[0054] Step 200: Input the multiple types of loads to be predicted into a load prediction model to obtain load prediction results of all types of loads to be predicted output by the load prediction model.

[0055] The electronic device inputs multiple types of loads to be predicted into the load prediction model, and obtains load prediction results of all types of loads to be predicted output by the load prediction model.

[0056] Wherein, the load forecasting model is trained based on multiple types of sample loads, the prediction result label of each of the sample loads, and the sample meteorological features corresponding to each of the sample loads. The multiple types of sample loads can be sample user loads in a microgrid, sample wind power generation loads, sample photovoltaic power generation loads, and other types of sample loads. The prediction result label of each of the sample loads is the true value of the future load corresponding to each sample load. The sample meteorological features are the meteorological features corresponding to each sample load. Wherein, the meteorological features include wind speed, wind direction, precipitation, relative humidity, solar radiation, temperature and other data. For example, if the sample load is the sample photovoltaic power generation load on February 1, then the sample meteorological features are the wind speed, wind direction, precipitation, relative humidity, solar radiation, temperature and other data corresponding to the sample photovoltaic power generation load on February 1.

[0057] The load forecasting model is constructed based on the forecasting layer and the fusion layer. Figure 2 The prediction layer includes a multi-task learning model 30 and a single-task learning model 40, which are used to predict the multiple types of loads to be predicted respectively to obtain a first prediction value sequence and a second prediction value, and the fusion layer is used to nonlinearly fuse the first prediction value sequence and the second prediction value to obtain the load prediction results of all types of loads to be predicted. The multi-task learning model 30 and the single-task learning model 40 can both be constructed based on a long short-term memory network. The fusion layer can be constructed using a fully connected layer.

[0058] The embodiment of the present invention uses a fully connected layer to nonlinearly fuse the first prediction value sequence and the second prediction value calculated by the multi-task learning model 30 and the single-task learning model 40 respectively to obtain the final prediction result. The single-task learning prediction value is obtained by filtering out a large amount of noise interference and considering future time series information, while the multi-task learning prediction value is obtained by considering the coupling relationship of multiple loads. The embodiment of the present invention uses a fully connected layer to fuse the useful information of the two prediction results of the multi-task learning model 30 and the single-task learning model 40, making full use of the respective advantages of the two models to obtain the final prediction value.

[0059] The load prediction model constructed based on the multi-task learning model 30 and the single-task learning model 40 in the embodiment of the present invention realizes multiple types of microgrid load prediction, and nonlinearly fuses the various prediction results of the multi-task learning model 30 and the single-task learning model 40 through the fusion layer. The embodiment of the present invention makes full use of the respective advantages of the multi-task learning model 30 and the single-task learning model 40 to realize multivariate load prediction of the microgrid.

[0060] For other aspects of the embodiments of the present invention, please refer to Figure 3The multi-task learning model 30 includes a parameter sharing layer 31 and a first fully connected layer 32. The parameter sharing layer 31 is used to extract the coupling relationship between the multiple types of loads to be predicted based on the shared underlying parameters. The first fully connected layer 32 is used to perform load prediction based on the coupling relationship to obtain the first prediction value sequence; the first prediction value sequence includes the prediction values ​​of all types of loads to be predicted.

[0061] Among them, the following Figure 3 As shown, the multi-task learning model 30 in the embodiment of the present invention uses the multi-task learning model 30 based on the long short-term memory network for prediction. That is, the parameter sharing layer 31 can be constructed based on the long short-term memory network. In other aspects of the embodiment of the present invention, the parameter sharing layer 31 can also be constructed based on any one of the gated recurrent unit and the bidirectional long short-term memory network.

[0062] The electronic device inputs the power load, wind power load and photovoltaic power load into the multi-task learning model 30 after data preprocessing and fusion, and outputs the prediction results of the power load, wind power load and photovoltaic load. The multi-task learning model 30 based on the long short-term memory network enables each prediction model to mine the coupling relationship that is difficult to extract by the traditional single prediction model by sharing the underlying features during long-term operation. At the same time, since the long short-term memory network has been widely used in prediction fields such as power load prediction and new energy power prediction, it can learn the periodicity and trend changes of power supply and demand, and capture the long-term and short-term dependence between supply and demand.

[0063] The embodiment of the present invention predicts the multiple loads of the microgrid as a whole, and simultaneously inputs multiple data such as power load, wind power generation load, photovoltaic power generation load, etc., fully considering the data characteristics shared by the multiple loads, and mining the coupling relationship between the multiple loads. At the same time, the prediction results of multiple loads such as power load, wind power generation load, photovoltaic power generation load, etc. are output, thereby improving the accuracy of the prediction of the multiple loads of the microgrid.

[0064] In other aspects of the embodiments of the present invention, the multi-task learning model 30 is trained by the following steps:

[0065] Step 11: Input multiple types of sample loads and sample meteorological features corresponding to each of the sample loads into the multi-task learning model 30 to obtain a first sample prediction value sequence output by the multi-task learning model 30.

[0066] In order to enable the multi-task learning model 30 to fully explore the coupling relationship between multiple loads, and fully explore the coupling relationship between multiple loads and meteorological characteristics, the embodiment of the present invention inputs multiple types of sample loads and sample meteorological characteristics corresponding to each of the sample loads as training samples into the multi-task learning model 30 to obtain the first sample prediction value sequence output by the multi-task learning model 30. The first prediction value sequence includes the prediction values ​​of all types of sample loads. For example, the sample loads are the sample wind power generation load and the sample photovoltaic power generation load on February 1. Then the sample meteorological characteristics include the wind speed, wind direction, precipitation, relative humidity, solar radiation, and temperature corresponding to the sample wind power generation load on February 1; and the wind speed, wind direction, precipitation, relative humidity, solar radiation, and temperature corresponding to the sample photovoltaic power generation load on February 1.

[0067] Step 12: Calculate the forward propagation loss function based on the first sample prediction value sequence and the prediction result labels of all types of sample loads.

[0068] The prediction result label of the sample load refers to the future load true value of the sample load. The forward propagation loss function can be calculated based on the first sample prediction value sequence and the future load true values ​​of all types of sample loads.

[0069] Since the loss function predicted by the multi-task learning model 30 is the sum of the loss functions of the prediction targets of multiple tasks, the multi-task learning model 30 has the following problems: First, the gradients of different tasks are different, which causes the model to over-focus on tasks with larger gradients and ignore other tasks; second, the convergence speeds of different tasks in multi-task learning are inconsistent. When one task has converged but other tasks have not, continuing training will cause the already converged tasks to overfit.

[0070] The embodiment of the present invention can use the GradNorm algorithm to dynamically adjust the weight of the loss function to balance the gradient size between different tasks. It is necessary to establish a loss function through the actual gradient size and the ideal gradient size, that is, the gradient loss function, and then calculate the gradient loss function for different task weights w i The partial derivative of , thereby updating the task weight w i .

[0071] The formula for calculating the forward propagation loss function is as follows:

[0072]

[0073] Among them, L i (t) represents the loss function of task i, L(t) represents the sum of the loss functions of all tasks, that is, the loss function of forward propagation; w i (t) is the loss function weight of task i.

[0074] Step 13: Back-propagate the forward propagation loss function to determine the actual gradient of the multi-task learning model 30.

[0075] Step 14: construct a gradient loss function based on the actual gradient and the target gradient.

[0076] The embodiment of the present invention uses a gradient loss function to balance the magnitude and convergence speed of loss functions of different tasks. The formula is as follows:

[0077]

[0078] Among them, L grad is the gradient loss function; is the actual gradient norm (i.e., actual gradient), which is the L2 norm of the partial derivative of the weighted single-task loss on the neural network parameter W that needs to be updated; For all tasks average; and To balance L i (t) is too large. Greater than So L grad will be larger, in order to reduce L grad , the model will reduce w i ; represents the reverse training speed of the i-th task, The larger the loss function L is, the i The larger (t) is, the slower the task training is; r i (t) is the relative reverse training speed of the ith task. i (t)] α To balance the training speed of each loss function, when a task is trained too fast, [r i (t)] α will become smaller, resulting in w i The role of α is to balance the hyperparameter of training speed. The larger α is, the stronger the balancing effect on training will be. In summary, L grad middle and Used to balance the gradient size of different tasks, r i (t) is used to balance the convergence speed of different tasks.

[0079] Step 15: Calculate partial derivatives of different task weights of the multi-task learning model 30 based on the gradient loss function, and update the task weights of different tasks of the multi-task learning model 30 based on the partial derivative calculation results.

[0080] The embodiment of the present invention calculates the gradient loss function Lgrad The loss function weights w for different tasks i The partial derivative of and the loss function L of task i i (t) Partial derivative of the neural network parameter W, update w according to the partial derivative calculation result i and W, the formula is as follows:

[0081]

[0082] In order to decouple the gradient normalization from the global learning rate, the embodiment of the present invention performs weight normalization on the loss function of each task each time so that the sum of the weights is equal to the number of tasks T. The loss function w of the normalized task is finally used. i , the formula is as follows:

[0083]

[0084] The multi-task learning model 30 of the embodiment of the present invention is trained based on multiple types of sample loads and sample meteorological features corresponding to each of the sample loads, fully exploring the coupling relationship between multiple loads, and fully exploring the coupling relationship between multiple loads and meteorological features, so as to improve the accuracy of multiple load prediction. The embodiment of the present invention also dynamically adjusts the weights of different task loss functions through the GradNorm algorithm to balance the gradient size between different tasks.

[0085] For other aspects of the embodiments of the present invention, please refer to Figure 2 and Figure 4 The single-task learning model 40 includes an attention mechanism layer 41, a feature extraction layer 42 and a second fully connected layer 43. The attention mechanism layer 41 is used to perform weighted calculation on the multiple types of loads to be predicted to obtain the attention weights of all types of loads to be predicted at all set times. The feature extraction layer 42 is used to perform feature extraction based on the attention weights of all types of loads to be predicted at all set times to obtain a target feature combination. The second fully connected layer 43 is used to predict the target feature combination to obtain the second prediction value.

[0086] Since different features have different degrees of association with the prediction target, the traditional time series prediction model uses indifferent compression processing on the input features, which may cause problems such as low convergence efficiency, information loss, and low prediction accuracy due to the presence of more input noise. The embodiment of the present invention introduces the attention mechanism layer 41, which can adaptively assign weights to input features, amplify important information and ignore irrelevant information; it can also assign weights to different time series information to strengthen the influence of critical moments on task targets.

[0087] Specifically, in one embodiment, the attention mechanism layer 41 includes a feature attention layer 411 and a temporal attention layer 412. Figure 4 As shown, in one embodiment, the single-task learning model 40 includes an input layer, a feature attention layer 411, a temporal attention layer 412, a long short-term memory network layer (feature extraction layer 42) and a fully connected layer (a second fully connected layer 43). Multiple types of loads to be predicted are sequentially passed through the feature attention layer 411 and the temporal attention layer 412, and weighted calculation is performed through the attention mechanism to obtain the weight of each feature at each moment for this prediction, and the weighted information is input into the long short-term memory network layer, h i Represents the latent vector output by the hidden layer. Finally, the prediction result of single-task learning is obtained through the fully connected layer.

[0088] The feature attention layer 411 is used to input the input feature vector constructed by the multiple types of loads to be predicted into the multilayer perceptron to obtain the feature attention weight vector output by the multilayer perceptron; normalize the feature attention weight vector; and multiply the normalized feature attention weight vector with the input feature vector to obtain a feature weight vector. The feature attention weight vector includes feature attention weight coefficients corresponding to all types of loads to be predicted.

[0089] Among them, the structure of the feature attention layer 411 is as follows Figure 5 shown.

[0090] At the tth time step For example, As the input feature vector of feature attention layer 411, Represents the first input feature at the tth time step, and M is the dimension of the input. The feature attention weight coefficient is obtained through the multi-layer perceptron, and the feature attention weight coefficient is normalized by the Softmax function. The calculation formula of the feature attention weight coefficient and its normalization is as follows:

[0091]

[0092] in, is the feature attention weight vector corresponding to the input feature at time step t; W e is the trainable parameter matrix of the neural network; b e For calculation The bias vector at ; It is the feature attention weight vector normalized by the Softmax function.

[0093] Multiply the input feature vector by the corresponding element of the normalized feature attention weight vector to obtain the feature weight vector Its expression is as follows:

[0094]

[0095] Among them: feature weight vector is the feature attention layer 411 output at the t-th time step.

[0096] The temporal attention layer 412 is used to input the feature weighted vector into a multilayer perceptron to obtain a temporal attention weight vector output by the multilayer perceptron; normalize the temporal attention weight vector; and multiply the normalized temporal attention weight vector by the feature weighted vector to obtain a feature temporal weighted vector; wherein the temporal attention weight vector includes the temporal attention weight coefficients corresponding to all types of loads to be predicted at all set times, and the feature temporal weighted vector serves as the attention weights of all types of loads to be predicted at all set times.

[0097] The temporal attention layer 412 takes the feature weighted vectors output by the feature attention layer 411 at multiple time steps The input matrix that constitutes the temporal attention layer

[0098]

[0099] Where b is the length of the time window.

[0100] The temporal attention weight coefficient is obtained through the multi-layer perceptron, and the temporal attention weight coefficient is normalized by the softmax function. The calculation formula is as follows:

[0101]

[0102] Among them: B represents the temporal attention weight vector; l b represents the temporal attention weight corresponding to the b-th time step; β B for l B The result after normalization by the softmax function.

[0103] The feature weight vector of the input of the temporal attention layer 412 and the normalized temporal attention weight vector β B Multiply them together to get the output of the temporal attention layer 412 The expression is

[0104]

[0105] The embodiment of the present invention can adaptively assign weights to input features through the feature attention layer 411, amplify important information and ignore irrelevant information, and can assign weights to different time series information through the time series attention layer 412, thereby strengthening the influence of key moments on task objectives. Therefore, the embodiment of the present invention increases the attention to features and time series, and improves the accuracy of multivariate load prediction of the microgrid.

[0106] For other aspects of the embodiments of the present invention, please refer to Figure 2 , the load forecasting model is trained by the following steps:

[0107] Step 21: Acquire multiple types of historical load data sets of the microgrid, prediction result labels of historical loads in all the historical load data sets, and historical meteorological characteristics corresponding to the historical loads.

[0108] The electronic device obtains multiple types of historical load data sets of the microgrid, prediction result labels of the historical loads in all the historical load data sets, and historical meteorological characteristics corresponding to the historical loads. The multiple types of historical load data sets may include user load data sets, wind power generation load data sets, and photovoltaic power generation load data sets of the microgrid in the past period of time (for example, the past year). The prediction result label of the historical load refers to the true value of the future load of the historical load. The historical meteorological characteristics include wind speed, wind direction, precipitation, relative humidity, solar radiation, temperature, etc. corresponding to the historical load.

[0109] It should be noted that multiple types of historical load data sets, the prediction result labels of historical loads in all the historical load data sets, and the historical meteorological characteristics corresponding to the historical loads, need to be screened for useless data or empty data through data analysis and data preprocessing. After data analysis and data preprocessing, the data sequence is normalized to obtain training data used as training samples.

[0110] Step 22: Based on the correlation between multiple types of historical load data sets and the correlation between all types of historical loads and historical meteorological characteristics, the multiple types of historical load data sets are screened to obtain multiple types of sample load data sets, prediction result labels of sample loads in all types of sample load data sets, and sample meteorological characteristics corresponding to the sample loads.

[0111] The electronic device can analyze the correlation between multiple types of historical load data sets based on the correlation analysis method, and analyze the correlation between all types of historical loads and historical meteorological features. Multiple types of historical load data sets with certain correlation are used as multiple types of sample load data sets, and historical loads and historical meteorological features with certain correlation are used as sample loads and sample meteorological features.

[0112] Repeat the following training steps until the preset end condition is reached:

[0113] Step 23: input multiple types of sample loads and sample meteorological features corresponding to each of the sample loads into the multi-task learning model 30 to obtain a first sample prediction value sequence output by the multi-task learning model 30; the first prediction value sequence includes prediction values ​​of all types of sample loads;

[0114] Step 24: inputting a plurality of types of sample loads, sample meteorological features corresponding to each of the sample loads, and the first sample prediction value sequence into the single-task learning model 40 to obtain a second sample prediction value output by the single-task learning model 40;

[0115] Step 25: nonlinearly fuse the first sample prediction value sequence and the second sample prediction value through the fusion layer to obtain sample load prediction results of all types of sample loads;

[0116] Step 26: Calculate the loss function based on the prediction result labels of all sample loads and the sample load prediction results of all types of sample loads;

[0117] Step 27: Adjust model parameters of the load forecasting model based on the loss function.

[0118] The electronic device of the embodiment of the present invention divides multiple types of sample load data sets into training sets, test sets, and validation sets. Among them, in the model training stage, the multi-task learning model 30 inputs include multiple types of sample loads and sample meteorological features corresponding to each of the sample loads; the single-task learning model 40 includes multiple types of sample loads and sample meteorological features corresponding to each of the sample loads and the first sample prediction value sequence output by the multi-task model. Since the prediction value of the multi-task learning model 30 needs to be used as the input of the single-task learning model 40, each model needs to use data sets from different periods to avoid the situation where the training set is used for actual prediction. The parameter settings of each model are determined based on comparative experiments, including the selection of model core parameters such as the number of layers, the number of neural units, and the time step of the model.

[0119] The embodiment of the present invention establishes a multi-task learning model 30 based on a long short-term memory network, and the multi-task learning model 30 gives a first sample prediction value sequence. The embodiment of the present invention also establishes a single-task learning model 40 based on a dual-attention long short-term memory network, and combines the first sample prediction value sequence of the remaining loads except the load to be predicted with the sample meteorological characteristics as the input features of the single-task learning to obtain the second sample prediction value. The two prediction values ​​are then nonlinearly fused through a fully connected layer (fusion layer) and the results are denormalized to obtain the final prediction result. The prediction value of the single-task learning model 40 is obtained by filtering out a large amount of noise interference and considering future time series information, while the prediction value of the multi-task learning model 30 is obtained by considering the coupling relationship of multiple loads. Finally, the fully connected layer is used to fuse the useful information of the two prediction results, and the advantages of the two models are fully utilized to obtain the final prediction value.

[0120] In addition, in the model testing phase of the load forecasting model of the embodiment of the present invention, the available forecast error evaluation indicators include the root mean square error R MSE , mean absolute percentage error M APE And the comprehensive mean absolute percentage error W MAPE As shown in the following formula:

[0121]

[0122] Where: y i and y' i is the true value and predicted value of the i-th sample load; N is the number of samples; M is the load of the J-th sample APE ; α J M is the J-type load APE The weights are divided according to the importance of multiple loads according to their numerical values, and are set as 0.3 (electricity load), 0.5 (wind power load, photovoltaic load), and 0.2 (adjustable resources such as energy storage).

[0123] In other aspects of the embodiment of the present invention, step 22, based on the correlation between multiple types of historical load data sets and the correlation between all types of historical loads and historical meteorological characteristics, the multiple types of historical load data sets are screened to obtain multiple types of sample load data sets, prediction result labels of sample loads in all types of sample load data sets, and sample meteorological characteristics corresponding to the sample loads, including:

[0124] Step 221: Calculate the first correlation coefficients between the multiple types of historical load data sets by using the Spearman correlation coefficient method, and calculate the second correlation coefficients between all types of historical loads and the historical meteorological characteristics.

[0125] Step 222: determine multiple types of target historical load data sets corresponding to the first correlation coefficient and / or the second correlation coefficient that are greater than or equal to the set correlation threshold value as multiple types of sample load data sets, determine the prediction result labels of the historical loads in all types of target historical load data sets as the prediction result labels of all sample loads, and determine the historical meteorological characteristics of the historical loads in all types of target historical load data sets as the sample meteorological characteristics corresponding to all sample loads.

[0126] In the embodiment of the present invention, the Spearman correlation coefficient method is used to analyze the correlation between multiple loads and between multiple loads and meteorological characteristics, and the sensitivity differences of environmental factors to changes in multiple loads and the differences in coupling strength between multiple loads are studied through the correlation analysis results.

[0127] Among them, the calculation formula of the Spearman correlation coefficient method is as follows:

[0128]

[0129] Where: d t is the rank difference between Xt and Yt (arrange the two sets of time series data X and Y in ascending order, and the rank of a number is the position of this number in the set of sequences); where Xt is the time series data of Class A historical load, and Yt is the time series data of Class B historical load. Or Xt is the time series data of Class A historical load, and Yt is the time series data of historical meteorological characteristics corresponding to Class A historical load. n is the number of samples. p is the correlation coefficient, and -1≤p≤1, p>0 indicates positive correlation, p<0 indicates negative correlation, the closer to 1 and -1, the stronger the correlation, and p=0 indicates that Y has no trend when X changes.

[0130] The first correlation coefficient between the multiple types of historical load data sets is calculated by the Spearman correlation coefficient method, and the second correlation coefficient between all types of historical loads and the historical meteorological characteristics is calculated. It is convenient to screen the historical sample loads and historical meteorological characteristics that are greater than or equal to the set correlation threshold (for example, 0.95). For example, if the correlation coefficient between the historical user load data set and the historical wind power generation load data set calculated by the Spearman correlation coefficient method is 0.96, then the historical user load data set is used as a sample user load data set for training, and the historical wind power generation load data set is used as a sample wind power generation load data set for training. For another example, if the correlation coefficient between the historical user load data set and the meteorological feature data set corresponding to the historical user load data set is 0.96 calculated by the Spearman correlation coefficient method, then the historical user load data set and the meteorological feature data set corresponding to the historical user load data set are used as sample user load data sets and sample meteorological features for training.

[0131] The embodiment of the present invention uses the Spearman correlation coefficient method to screen out multiple types of sample load data sets and sample meteorological characteristics with strong correlation from multiple types of historical load data sets and historical meteorological characteristics, so as to facilitate the subsequent multi-task learning model 30 and the single-task learning model 40 to fully explore the coupling relationship between multiple loads, and fully explore the coupling relationship between multiple loads and meteorological characteristics, thereby improving the accuracy of multi-load prediction of the microgrid.

[0132] Device Embodiment

[0133] Please refer to Figure 6 On the other hand, an embodiment of the present invention further provides a microgrid load supply and demand combination prediction device, comprising:

[0134] An acquisition module 601 is used to acquire multiple types of loads to be predicted of the microgrid;

[0135] A prediction module 602, configured to input the multiple types of loads to be predicted into a load prediction model, and obtain load prediction results of all types of loads to be predicted output by the load prediction model;

[0136] Among them, the load forecasting model is trained based on multiple types of sample loads, the prediction result label of each sample load and the sample meteorological characteristics corresponding to each sample load; the load forecasting model is constructed based on the prediction layer and the fusion layer, the prediction layer includes a multi-task learning model and a single-task learning model, which are used to predict the multiple types of loads to be predicted respectively to obtain a first prediction value sequence and a second prediction value, and the fusion layer is used to perform nonlinear fusion on the first prediction value sequence and the second prediction value to obtain the load forecasting results of all types of loads to be predicted.

[0137] Optionally, the multi-task learning model includes a parameter sharing layer and a first fully connected layer, the parameter sharing layer is used to extract the coupling relationship between the multiple types of loads to be predicted based on the shared underlying parameters, and the first fully connected layer is used to perform load prediction based on the coupling relationship to obtain the first prediction value sequence; the first prediction value sequence includes the prediction values ​​of all types of loads to be predicted.

[0138] Optionally, the parameter sharing layer is constructed based on any one of the models of a long short-term memory network, a gated recurrent unit, and a bidirectional long short-term memory network.

[0139] Optionally, the single-task learning model includes an attention mechanism layer, a feature extraction layer and a second fully connected layer, the attention mechanism layer is used to perform weighted calculation on the multiple types of loads to be predicted to obtain the attention weights of all types of loads to be predicted at all set times, the feature extraction layer is used to perform feature extraction based on the attention weights of all types of loads to be predicted at all set times to obtain a target feature combination, and the second fully connected layer is used to predict the target feature combination to obtain the second prediction value.

[0140] Optionally, the attention mechanism layer includes a feature attention layer and a temporal attention layer;

[0141] The feature attention layer is used to input the input feature vector into the multilayer perceptron to obtain the feature attention weight vector output by the multilayer perceptron; normalize the feature attention weight vector; and multiply the normalized feature attention weight vector with the input feature vector to obtain a feature weight vector; wherein the input feature vector is constructed based on the multiple types of loads to be predicted; the feature attention weight vector includes feature attention weight coefficients corresponding to all types of loads to be predicted;

[0142] The temporal attention layer is used to input the feature weighted vector into a multilayer perceptron to obtain a temporal attention weight vector output by the multilayer perceptron; normalize the temporal attention weight vector; and multiply the normalized temporal attention weight vector by the feature weighted vector to obtain a feature temporal weighted vector; wherein the temporal attention weight vector includes the temporal attention weight coefficients corresponding to all types of loads to be predicted at all set times, and the feature temporal weighted vector serves as the attention weights of all types of loads to be predicted at all set times.

[0143] Optionally, the load forecasting model is trained through the following steps:

[0144] Acquire multiple types of historical load data sets of the microgrid, prediction result labels of historical loads in all the historical load data sets, and historical meteorological characteristics corresponding to the historical loads;

[0145] Based on the correlation between multiple types of historical load data sets and the correlation between all types of historical loads and historical meteorological characteristics, the multiple types of historical load data sets are screened to obtain multiple types of sample load data sets, prediction result labels of sample loads in all types of sample load data sets, and sample meteorological characteristics corresponding to the sample loads;

[0146] Repeat the following training steps until the preset end condition is reached:

[0147] Inputting multiple types of sample loads and sample meteorological features corresponding to each of the sample loads into the multi-task learning model to obtain a first sample prediction value sequence output by the multi-task learning model; the first prediction value sequence includes prediction values ​​of all types of sample loads;

[0148] Inputting a plurality of types of sample loads, sample meteorological features corresponding to each of the sample loads, and the first sample prediction value sequence into the single-task learning model to obtain a second sample prediction value output by the single-task learning model;

[0149] Nonlinearly fusing the first sample prediction value sequence and the second sample prediction value through the fusion layer to obtain sample load prediction results of all types of sample loads;

[0150] Calculate the loss function based on the predicted result labels of all sample loads and the sample load prediction results of all types of sample loads;

[0151] Model parameters of the load forecasting model are adjusted based on the loss function.

[0152] Optionally, based on the correlation between multiple types of historical load data sets and the correlation between all types of historical loads and historical meteorological features, the multiple types of historical load data sets are screened to obtain multiple types of sample load data sets, prediction result labels of sample loads in all types of sample load data sets, and sample meteorological features corresponding to the sample loads, including:

[0153] Calculating a first correlation coefficient between the plurality of types of historical load data sets by using a Spearman correlation coefficient method, and calculating a second correlation coefficient between all types of the historical loads and the historical meteorological characteristics;

[0154] Determine multiple types of target historical load data sets corresponding to the first correlation coefficient and / or the second correlation coefficient that is greater than or equal to a set correlation threshold as multiple types of sample load data sets, determine prediction result labels of historical loads in all types of target historical load data sets as prediction result labels of all sample loads, and determine historical meteorological characteristics of historical loads in all types of target historical load data sets as sample meteorological characteristics corresponding to all sample loads.

[0155] Optionally, the multi-task learning model is trained by the following steps:

[0156] Inputting multiple types of sample loads and sample meteorological features corresponding to each of the sample loads into the multi-task learning model to obtain a first sample prediction value sequence output by the multi-task learning model; the first prediction value sequence includes prediction values ​​of all types of sample loads;

[0157] Calculating a forward propagation loss function based on the first sample prediction value sequence and the prediction result labels of all types of sample loads;

[0158] Back-propagating the forward propagation loss function to determine the actual gradient of the multi-task learning model;

[0159] Constructing a gradient loss function based on the actual gradient and the target gradient;

[0160] The partial derivatives of different task weights of the multi-task learning model are calculated based on the gradient loss function, and the task weights of different tasks of the multi-task learning model are updated based on the partial derivative calculation results.

[0161] The microgrid load supply and demand combination prediction device includes a processor and a memory. The acquisition module 601 and the prediction model 602 are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.

[0162] The processor includes a kernel, which calls the corresponding program unit from the memory. There can be one or more kernels.

[0163] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0164] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7As shown, the electronic device may include: a processor (processor) 710, a communication interface (Communications Interface) 720, a memory (memory) 730 and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other through the communication bus 740. The processor 710 can call the logic instructions in the memory 730 to execute the microgrid load supply and demand combined prediction method, which includes: obtaining multiple types of loads to be predicted in the microgrid; inputting the multiple types of loads to be predicted into the load prediction model to obtain the load prediction results of all types of loads to be predicted output by the load prediction model; wherein the load prediction model is trained based on multiple types of sample loads, the prediction result label of each of the sample loads, and the sample meteorological characteristics corresponding to each of the sample loads; the load prediction model is constructed based on a prediction layer and a fusion layer, the prediction layer includes a multi-task learning model and a single-task learning model, which are used to predict the multiple types of loads to be predicted respectively, and obtain a first prediction value sequence and a second prediction value, and the fusion layer is used to perform nonlinear fusion on the first prediction value sequence and the second prediction value to obtain the load prediction results of all types of loads to be predicted.

[0165] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0166] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a machine-readable storage medium. When the computer program is executed by a processor, the computer can execute a microgrid load supply and demand combined prediction method, which includes: obtaining multiple types of loads to be predicted in the microgrid; inputting the multiple types of loads to be predicted into a load prediction model to obtain load prediction results of all types of loads to be predicted output by the load prediction model; wherein the load prediction model is trained based on multiple types of sample loads, prediction result labels of each sample load, and sample meteorological characteristics corresponding to each sample load; the load prediction model is constructed based on a prediction layer and a fusion layer, and the prediction layer includes a multi-task learning model and a single-task learning model, which are used to predict the multiple types of loads to be predicted respectively to obtain a first prediction value sequence and a second prediction value, and the fusion layer is used to perform nonlinear fusion on the first prediction value sequence and the second prediction value to obtain load prediction results of all types of loads to be predicted.

[0167] On the other hand, the present invention also provides a machine-readable storage medium having a computer program stored thereon, which is implemented when the processor executes a method for combined prediction of supply and demand of loads in a microgrid, the method comprising: obtaining multiple types of loads to be predicted in the microgrid; inputting the multiple types of loads to be predicted into a load prediction model, and obtaining load prediction results of all types of loads to be predicted output by the load prediction model; wherein the load prediction model is trained based on multiple types of sample loads, prediction result labels of each of the sample loads, and sample meteorological characteristics corresponding to each of the sample loads; the load prediction model is constructed based on a prediction layer and a fusion layer, the prediction layer includes a multi-task learning model and a single-task learning model, which are used to predict the multiple types of loads to be predicted respectively, and obtain a first prediction value sequence and a second prediction value, and the fusion layer is used to perform nonlinear fusion on the first prediction value sequence and the second prediction value to obtain load prediction results of all types of loads to be predicted.

[0168] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0169] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0170] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A combined forecasting method for microgrid load supply and demand, characterized in that: include: Obtain multiple types of loads to be predicted of the microgrid; Inputting the multiple types of loads to be predicted into a load prediction model to obtain load prediction results of all types of loads to be predicted output by the load prediction model; Among them, the load forecasting model is trained based on multiple types of sample loads, the prediction result label of each sample load and the sample meteorological characteristics corresponding to each sample load; the load forecasting model is constructed based on the prediction layer and the fusion layer, the prediction layer includes a multi-task learning model and a single-task learning model, which are used to predict the multiple types of loads to be predicted respectively to obtain a first prediction value sequence and a second prediction value, and the fusion layer is used to perform nonlinear fusion on the first prediction value sequence and the second prediction value to obtain the load forecasting results of all types of loads to be predicted.

2. The microgrid load supply and demand combined forecasting method according to claim 1 is characterized in that: The multi-task learning model includes a parameter sharing layer and a first fully connected layer. The parameter sharing layer is used to extract the coupling relationship between the multiple types of loads to be predicted based on the shared underlying parameters. The first fully connected layer is used to perform load prediction based on the coupling relationship to obtain the first prediction value sequence; the first prediction value sequence includes the prediction values ​​of all types of loads to be predicted.

3. The microgrid load supply and demand combined forecasting method according to claim 2 is characterized in that: The parameter sharing layer is constructed based on any one of the models of a long short-term memory network, a gated recurrent unit, and a bidirectional long short-term memory network.

4. The microgrid load supply and demand combined forecasting method according to claim 1 is characterized in that: The single-task learning model includes an attention mechanism layer, a feature extraction layer and a second fully connected layer. The attention mechanism layer is used to perform weighted calculation on the multiple types of loads to be predicted to obtain the attention weights of all types of loads to be predicted at all set times. The feature extraction layer is used to perform feature extraction based on the attention weights of all types of loads to be predicted at all set times to obtain a target feature combination. The second fully connected layer is used to predict the target feature combination to obtain the second prediction value.

5. The microgrid load supply and demand combined forecasting method according to claim 4 is characterized in that: The attention mechanism layer includes a feature attention layer and a temporal attention layer; The feature attention layer is used to input the input feature vector into the multilayer perceptron to obtain the feature attention weight vector output by the multilayer perceptron; normalize the feature attention weight vector; and multiply the normalized feature attention weight vector with the input feature vector to obtain a feature weight vector; wherein the input feature vector is constructed based on the multiple types of loads to be predicted; the feature attention weight vector includes feature attention weight coefficients corresponding to all types of loads to be predicted; The temporal attention layer is used to input the feature weighted vector into a multilayer perceptron to obtain a temporal attention weight vector output by the multilayer perceptron; normalize the temporal attention weight vector; and multiply the normalized temporal attention weight vector by the feature weighted vector to obtain a feature temporal weighted vector; wherein the temporal attention weight vector includes the temporal attention weight coefficients corresponding to all types of loads to be predicted at all set times, and the feature temporal weighted vector serves as the attention weights of all types of loads to be predicted at all set times.

6. The microgrid load supply and demand combined forecasting method according to claim 1 is characterized in that: The load forecasting model is trained by the following steps: Acquire multiple types of historical load data sets of the microgrid, prediction result labels of historical loads in all the historical load data sets, and historical meteorological characteristics corresponding to the historical loads; Based on the correlation between multiple types of historical load data sets and the correlation between all types of historical loads and historical meteorological characteristics, the multiple types of historical load data sets are screened to obtain multiple types of sample load data sets, prediction result labels of sample loads in all types of sample load data sets, and sample meteorological characteristics corresponding to the sample loads; Repeat the following training steps until the preset end condition is reached: Inputting multiple types of sample loads and sample meteorological features corresponding to each of the sample loads into the multi-task learning model to obtain a first sample prediction value sequence output by the multi-task learning model; the first prediction value sequence includes prediction values ​​of all types of sample loads; Inputting a plurality of types of sample loads, sample meteorological features corresponding to each of the sample loads, and the first sample prediction value sequence into the single-task learning model to obtain a second sample prediction value output by the single-task learning model; Nonlinearly fusing the first sample prediction value sequence and the second sample prediction value through the fusion layer to obtain sample load prediction results of all types of sample loads; Calculate the loss function based on the predicted result labels of all sample loads and the sample load prediction results of all types of sample loads; Model parameters of the load forecasting model are adjusted based on the loss function.

7. The microgrid load supply and demand combined forecasting method according to claim 6 is characterized in that: The method comprises the following steps: screening the historical load data sets based on the correlation between the multiple types of historical load data sets and the correlation between all types of historical loads and historical meteorological characteristics to obtain multiple types of sample load data sets, prediction result labels of sample loads in all types of sample load data sets, and sample meteorological characteristics corresponding to the sample loads, including: Calculating a first correlation coefficient between the plurality of types of historical load data sets by using a Spearman correlation coefficient method, and calculating a second correlation coefficient between all types of the historical loads and the historical meteorological characteristics; Determine multiple types of target historical load data sets corresponding to the first correlation coefficient and / or the second correlation coefficient that is greater than or equal to a set correlation threshold as multiple types of sample load data sets, determine prediction result labels of historical loads in all types of target historical load data sets as prediction result labels of all sample loads, and determine historical meteorological characteristics of historical loads in all types of target historical load data sets as sample meteorological characteristics corresponding to all sample loads.

8. The microgrid load supply and demand combined forecasting method according to claim 6, characterized in that: The multi-task learning model is trained by the following steps: Inputting multiple types of sample loads and sample meteorological features corresponding to each of the sample loads into the multi-task learning model to obtain a first sample prediction value sequence output by the multi-task learning model; the first prediction value sequence includes prediction values ​​of all types of sample loads; Calculating a forward propagation loss function based on the first sample prediction value sequence and the prediction result labels of all types of sample loads; Back-propagating the forward propagation loss function to determine the actual gradient of the multi-task learning model; Constructing a gradient loss function based on the actual gradient and the target gradient; The partial derivatives of different task weights of the multi-task learning model are calculated based on the gradient loss function, and the task weights of different tasks of the multi-task learning model are updated based on the partial derivative calculation results.

9. A microgrid load supply and demand combined prediction device, characterized in that: include: An acquisition module, used for acquiring multiple types of loads to be predicted of the microgrid; A prediction module, used for inputting the multiple types of loads to be predicted into a load prediction model, and obtaining load prediction results of all types of loads to be predicted output by the load prediction model; Among them, the load forecasting model is trained based on multiple types of sample loads, the prediction result label of each sample load and the sample meteorological characteristics corresponding to each sample load; the load forecasting model is constructed based on the prediction layer and the fusion layer, the prediction layer includes a multi-task learning model and a single-task learning model, which are used to predict the multiple types of loads to be predicted respectively to obtain a first prediction value sequence and a second prediction value, and the fusion layer is used to perform nonlinear fusion on the first prediction value sequence and the second prediction value to obtain the load forecasting results of all types of loads to be predicted.

10. The device for combined prediction of microgrid load supply and demand according to claim 9, characterized in that: The multi-task learning model includes a parameter sharing layer and a first fully connected layer. The parameter sharing layer is used to extract the coupling relationship between the multiple types of loads to be predicted based on the shared underlying parameters. The first fully connected layer is used to perform load prediction based on the coupling relationship to obtain the first prediction value sequence; the first prediction value sequence includes the prediction values ​​of all types of loads to be predicted.

11. The device for combined prediction of microgrid load supply and demand according to claim 10, characterized in that: The parameter sharing layer is constructed based on any one of the models of a long short-term memory network, a gated recurrent unit, and a bidirectional long short-term memory network.

12. The device for combined prediction of microgrid load supply and demand according to claim 9, characterized in that: The single-task learning model includes an attention mechanism layer, a feature extraction layer and a second fully connected layer. The attention mechanism layer is used to perform weighted calculation on the multiple types of loads to be predicted to obtain the attention weights of all types of loads to be predicted at all set times. The feature extraction layer is used to perform feature extraction based on the attention weights of all types of loads to be predicted at all set times to obtain a target feature combination. The second fully connected layer is used to predict the target feature combination to obtain the second prediction value.

13. The device for combined prediction of microgrid load supply and demand according to claim 12, characterized in that: The attention mechanism layer includes a feature attention layer and a temporal attention layer; The feature attention layer is used to input the input feature vector into the multilayer perceptron to obtain the feature attention weight vector output by the multilayer perceptron; normalize the feature attention weight vector; and multiply the normalized feature attention weight vector with the input feature vector to obtain a feature weight vector; wherein the input feature vector is constructed based on the multiple types of loads to be predicted; the feature attention weight vector includes feature attention weight coefficients corresponding to all types of loads to be predicted; The temporal attention layer is used to input the feature weighted vector into a multilayer perceptron to obtain a temporal attention weight vector output by the multilayer perceptron; normalize the temporal attention weight vector; and multiply the normalized temporal attention weight vector by the feature weighted vector to obtain a feature temporal weighted vector; wherein the temporal attention weight vector includes the temporal attention weight coefficients corresponding to all types of loads to be predicted at all set times, and the feature temporal weighted vector serves as the attention weights of all types of loads to be predicted at all set times.

14. The device for combined prediction of microgrid load supply and demand according to claim 9, characterized in that: The load forecasting model is trained by the following steps: Acquire multiple types of historical load data sets of the microgrid, prediction result labels of historical loads in all the historical load data sets, and historical meteorological characteristics corresponding to the historical loads; Based on the correlation between multiple types of historical load data sets and the correlation between all types of historical loads and historical meteorological characteristics, the multiple types of historical load data sets are screened to obtain multiple types of sample load data sets, prediction result labels of sample loads in all types of sample load data sets, and sample meteorological characteristics corresponding to the sample loads; Repeat the following training steps until the preset end condition is reached: Inputting multiple types of sample loads and sample meteorological features corresponding to each of the sample loads into the multi-task learning model to obtain a first sample prediction value sequence output by the multi-task learning model; the first prediction value sequence includes prediction values ​​of all types of sample loads; Inputting a plurality of types of sample loads, sample meteorological features corresponding to each of the sample loads, and the first sample prediction value sequence into the single-task learning model to obtain a second sample prediction value output by the single-task learning model; Nonlinearly fusing the first sample prediction value sequence and the second sample prediction value through the fusion layer to obtain sample load prediction results of all types of sample loads; Calculate the loss function based on the predicted result labels of all sample loads and the sample load prediction results of all types of sample loads; Model parameters of the load forecasting model are adjusted based on the loss function.

15. The device for combined prediction of microgrid load supply and demand according to claim 14, characterized in that: The method comprises the following steps: screening the historical load data sets based on the correlation between the multiple types of historical load data sets and the correlation between all types of historical loads and historical meteorological characteristics to obtain multiple types of sample load data sets, prediction result labels of sample loads in all types of sample load data sets, and sample meteorological characteristics corresponding to the sample loads, including: Calculating a first correlation coefficient between the plurality of types of historical load data sets by using a Spearman correlation coefficient method, and calculating a second correlation coefficient between all types of the historical loads and the historical meteorological characteristics; Determine multiple types of target historical load data sets corresponding to the first correlation coefficient and / or the second correlation coefficient that is greater than or equal to a set correlation threshold as multiple types of sample load data sets, determine prediction result labels of historical loads in all types of target historical load data sets as prediction result labels of all sample loads, and determine historical meteorological characteristics of historical loads in all types of target historical load data sets as sample meteorological characteristics corresponding to all sample loads.

16. The device for combined prediction of microgrid load supply and demand according to claim 9, characterized in that: The multi-task learning model is trained by the following steps: Inputting multiple types of sample loads and sample meteorological features corresponding to each of the sample loads into the multi-task learning model to obtain a first sample prediction value sequence output by the multi-task learning model; the first prediction value sequence includes prediction values ​​of all types of sample loads; Calculating a forward propagation loss function based on the first sample prediction value sequence and the prediction result labels of all types of sample loads; Back-propagating the forward propagation loss function to determine the actual gradient of the multi-task learning model; Constructing a gradient loss function based on the actual gradient and the target gradient; The partial derivatives of different task weights of the multi-task learning model are calculated based on the gradient loss function, and the task weights of different tasks of the multi-task learning model are updated based on the partial derivative calculation results.

17. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the microgrid load supply and demand combination prediction method described in any one of claims 1 to 8 is implemented.

18. A machine-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the microgrid load supply and demand combination prediction method described in any one of claims 1 to 8 is implemented.

19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the microgrid load supply and demand combination prediction method described in any one of claims 1 to 8 is implemented.