A peak load prediction method and device based on multi-task learning
By using a multi-task learning framework and a shared-layer LSTM network, the problem of insufficient noise cancellation in data from different regions in existing technologies is solved, improving the accuracy of peak load prediction and the generalization ability of the model, making it suitable for high-level operation of power systems.
Patent Information
- Application Number
- CN202210653345.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-09
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2042-06-09
AI Technical Summary
Existing load forecasting methods are usually trained on data from only one region, which can easily lead to overfitting. Furthermore, the noise in data from different regions cannot be effectively canceled out, affecting the generalization ability of the model and the accuracy of peak load forecasting.
A multi-task learning framework is adopted. Two regions with strong positive spatiotemporal correlation are selected by Pearson correlation coefficient. A multi-task learning model is constructed, and the task sharing layer and LSTM network in the multi-task learning model are used for parallel training to achieve peak load prediction for the two regions.
It improves the accuracy of peak load prediction in different regions, reduces model training time, and enhances the model's generalization ability by learning knowledge through a shared layer, providing technical support for the high-level operation of the power grid.
Smart Images

Figure CN115033563B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power system operation analysis and planning, and particularly relates to a peak load prediction method and device based on multi-task learning. BACKGROUND
[0002] Day peak load prediction is an important tool for power system operation planning and decision-making. As a kind of medium-term load prediction, day peak load prediction can be used as an important basis for evaluating power system reserve capacity, daily load rate and formulating peak-valley electricity price. The research direction of peak load prediction can be roughly divided into mixed prediction and two-stage prediction. Mixed prediction refers to studying the peak value point and the non-peak value point as independent research objects respectively, and two-stage prediction refers to further correcting the peak value under the condition of mining the overall load data fluctuation rule. The existing load prediction method usually only trains on the data of a certain region, which is easy to cause overfitting. If the spatio-temporal correlation of similar regions can be considered, and a model is trained in parallel with the data of two regions, the noise of different region data can be offset, the generalization of the model can be improved, and the accuracy of peak load prediction can be improved, so that an efficient and low-cost way can be provided for high-level power grid planning. SUMMARY
[0003] The present application provides a peak load prediction method and device based on multi-task learning to overcome the defects of the prior art.
[0004] In order to achieve the above application purposes, the technical solutions adopted by the present application are as follows:
[0005] A peak load prediction method based on multi-task learning, comprising:
[0006] Step one, obtaining historical peak load data of each region, removing outliers, selecting the daily load maximum value as the daily peak load data, and constructing a peak load sequence.
[0007] Step two, calculating the correlation of historical peak load sequences of each region by Pearson correlation coefficient, and selecting two regions with strong positive spatio-temporal correlation according to the correlation criterion.
[0008] Step three, preprocessing the historical peak load data of the two regions with strong positive spatio-temporal correlation selected, and dividing the data set into a training set and a test set;
[0009] Step four, regarding the peak load prediction of each region as a task, and constructing a multi-task learning model;
[0010] Step five, initializing each parameter of the multi-task learning model, inputting the training data sets of the two regions into the multi-task learning model for iterative training in a parallel manner;
[0011] Step six, the trained multi-task learning model is tested with a test data set.
[0012] Further, in the step three, for the selected two regions with strong positive correlation of historical peak load data, the maximum minimum linear normalization method is used for data processing, and the sample is constructed according to the feature selection rule.
[0013] Further, in the step four, the peak load prediction of region 1 is regarded as task 1, and the peak load prediction of region 2 is regarded as task 2, and the multi-task learning model comprises: task 1 linear layer 1, task 1 linear layer 4, task 1 linear layer 6, task 2 linear layer 2, task 2 linear layer 5, task 2 linear 7, task sharing linear layer 3 and task sharing single-layer LSTM network.
[0014] Part of the features in the task 1 data sample are input into the task 1 linear layer 1, and part of the features in the task 2 data sample are input into the task 2 linear layer 2, respectively, to obtain a linear layer 1 output vector and a linear layer 2 output vector. The complete features of the task 1 and task 2 samples are input into the shared linear layer 3 after splicing processing, and the shared linear layer 3 output vector is obtained after linear processing. The shared linear layer 3 output vector is input into the task sharing single-layer LSTM network to obtain a shared single-layer LSTM network output vector. The linear layer 1 output vector and the shared single-layer LSTM network output vector are spliced and input into the task 1 linear layer 4 to obtain a linear layer 4 output vector. The linear layer 2 output vector and the shared single-layer LSTM network output vector are spliced and input into the task 2 linear layer 5 to obtain a linear layer 5 output vector. The linear layer 4 output vector is input into the task 1 linear layer 6 to obtain the final output of the task 1. The linear layer 5 output vector is input into the task 2 linear layer 7 to obtain the final output of the task 2.
[0015] Further, in the step five, the parameters of the multi-task learning model are randomly initialized, the maximum number of iterations epochs is set, the learning rate lr is set, the loss function is MAE, the training data sets of the two regions are input into the multi-task learning model for iteration and parallel training, which specifically includes forward propagation to calculate the predicted value and to calculate the prediction error according to the loss function to update the model parameters in reverse, until the maximum number of iterations is reached.
[0016] Further, in the step six, the trained multi-task learning model is tested with a test data set.
[0017] The application also discloses a peak load prediction device based on multi-task learning, which comprises a data acquisition module, a region screening module, a data preprocessing and division module, a multi-task learning model construction module, a model training module and a prediction module.
[0018] Data acquisition module: used for acquiring historical power load data of each region and processing into peak load sequence, and sending the processing result to the region screening module;
[0019] Region screening module: the correlation of historical peak load sequences of each region is calculated by Pearson correlation coefficient, and two regions with strong positive correlation in time and space are screened out according to the correlation criterion;
[0020] Data preprocessing and division module: for the historical peak load data of the two regions with strong positive correlation in time and space, the maximum and minimum linear normalization method is used for data processing, and the sample is constructed according to the feature selection rule. The data set after preprocessing is divided into training set and test set.
[0021] Multi-task learning model construction module: the peak load prediction of region 1 is regarded as task 1, and the peak load prediction of region 2 is regarded as task 2, the multi-task learning model includes task 1 linear layer 1, task 1 linear layer 4, task 1 linear layer 6, task 2 linear layer 2, task 2 linear layer 5, task 2 linear 7, task sharing linear layer 3 and task sharing single-layer LSTM network. Part of the features in the task 1 data sample is input into the task 1 linear layer 1, and part of the features in the task 2 data sample is input into the task 2 linear layer 2, respectively to obtain the linear layer 1 output vector and the linear layer 2 output vector. The complete features of the task 1 and task 2 samples are input into the shared linear layer 3 after splicing processing, and the shared linear layer 3 output vector is obtained after linear processing. The shared linear layer 3 output vector is input into the task sharing single-layer LSTM network to obtain the shared single-layer LSTM network output vector. The linear layer 1 output vector and the shared single-layer LSTM network output vector are spliced and input into the task 1 linear layer 4 to obtain the linear layer 4 output vector. The linear layer 2 output vector and the shared single-layer LSTM network output vector are spliced and input into the task 2 linear layer 5 to obtain the linear layer 5 output vector. The linear layer 4 output vector is input into the task 1 linear layer 6 to obtain the task 1 final output. The linear layer 5 output vector is input into the task 2 linear layer 7 to obtain the task 2 final output.
[0022] Model training module: randomly initialize each parameter of the multi-task learning model, set the maximum number of iterations epochs and the learning rate lr, use MAE as the loss function, input the training data set of the two regions into the multi-task learning model for iteration and parallel training, which specifically includes forward propagation to calculate the predicted value and to calculate the prediction error according to the loss function to update the model parameters in reverse, until the maximum number of iterations is reached.
[0023] Prediction module: the trained multi-task learning model is tested by the test data set.
[0024] On the other hand, the application also discloses a terminal, comprising:
[0025] At least one processor and a memory connected in communication with the at least one processor, wherein the memory stores instructions executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the aforementioned peak load prediction method based on multi-task learning.
[0026] In another aspect, the present application provides a computer readable storage medium storing computer instructions for causing a computer to perform the aforementioned peak load prediction method based on multi-task learning.
[0027] Compared with the prior art, the present application has the following advantages:
[0028] Taking the peak point as an independent research object makes it easier to study the time-varying characteristics of the peak load. Based on the multi-task learning framework, one model is used to complete the peak load prediction tasks of two spatiotemporally similar regions, so that the data noise of different regions cancels out each other, and one task learns the knowledge of another task through the shared layer during learning, thereby improving the prediction accuracy of the single task. Meanwhile, using one model to solve the originally separately trained tasks reduces the overall training time of the model, and makes the model more maintainable, thereby providing important technical support for high-level operation of the power grid. BRIEF DESCRIPTION OF DRAWINGS
[0029] Figure 1 The flowchart of the peak load prediction method based on multi-task learning of the embodiment of the present application is shown in the figure.
[0030] Figure 2 The structural block diagram of the peak load prediction model based on multi-task learning of the embodiment of the present application is shown in the figure.
[0031] Figure 3 The structural diagram of the multi-task learning shared layer LSTM neuron of the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical scheme and advantages of the present application clearer and more apparent, the present application is further described in detail below according to the drawings and examples.
[0033] As shown in the figure, the implementation steps of the peak load prediction method based on multi-task learning include: Figure 1
[0034] 1. Process introduction
[0035] Step 1: Obtain historical peak load data of each region
[0036] including:
[0037] Step 101: Obtain historical load 24-point amplitude data of each region
[0038] Step 102: Remove outliers in data: according to the load value of the adjacent two time, if the difference exceeds a certain threshold, it is judged as abnormal data, according to the continuity of load curve, it is replaced by the average value of adjacent data;
[0039] Step 103: Select the highest daily load as the peak load data of the day, and form the peak load sequence.
[0040] Step two, calculate the correlation of historical peak load of each region by Pearson correlation coefficient and select two regions with strong positive correlation in space and time;
[0041] Including:
[0042] Step 201: In the peak data of multiple regions, the peak load correlation of each two regions is calculated by Pearson correlation coefficient, and the Pearson correlation coefficient calculation formula is as follows:
[0043]
[0044] Where X, Y represent the peak load sequence of two regions, n is the length of the peak load sequence, respectively represent the peak load average value of two regions.
[0045] Step 202: For two regions with Pearson correlation coefficient greater than 0.7, they can be considered as strong positive correlation, and can be used as the combination of regions included in the multi-task learning framework.
[0046] Step three, pre-process the historical peak load data of the two regions selected with strong positive correlation in space and time, and divide the data set into training set and test set;
[0047] Including:
[0048] 301: In order to train the data of two regions in parallel, it is necessary to eliminate the situation that the data dimension is not unified. The maximum and minimum linear normalization method is adopted to process the selected two regions historical peak data, and the original data is mapped to the range of [0, 1], and the normalization formula is:
[0049]
[0050] P is the original data, P' is the normalized data, P min , P max are the minimum and maximum values of the data set respectively.
[0051] After the model predicts the result, it also needs to be denormalized to the normal value interval, so as to observe the experimental results. The denormalization formula is:
[0052] P=P'*(Pmax - P min )+ P min
[0053] P is the data after inverse normalization, and P' is the result of the model output.
[0054] 302: According to the normalized data, a sample data set Z={(x i ,y i )|x i ∈X,y i ∈Y} and Z'={(x i ',y i ')|x i ∈X',y i ∈Y'} are respectively constructed according to certain feature selection rules. Wherein:
[0055] Z and Z' are respectively the sample sets of region 1 and region 2, X and X' are respectively the sample feature sets of region 1 and region 2, each sample feature contains the peak load of the 28th day, the 21st day, the 14th day, the 7th day, the 3rd day, the 2nd day, and the 1st day before the day to be predicted. Y and Y' are respectively the sample label sets, and each sample label is the peak load of the day to be predicted. Since the peak load of the 28th day is required as a feature, the label day starts from the 29th peak load. The final sample construction takes region 1 as an example, as shown in Table 1.
[0056] Table 1 Construction table of sample set of region 1
[0057] Sample No. Label Features 1 (x0,x 7, x 14 ,x 21 ,x 25 ,x 26 ,x 27 )]]> x 28 ]]> 2 (x1,x 8, x 15 ,x 22 ,x 26 ,x 27 ,x 28 )]]> x 29 ]]> ... ... ... i (x i-28 ,x i-21 ,x i-14 ,x i-7 ,x i-3 ,x i-2 ,x i-1 )]]> x i ]]>
[0058] 303: The data sets of the two regions are divided by year, and the first year is taken as a training set and the second year is taken as a test set.
[0059] Step four, each region peak load prediction is regarded as a task, and a multi-task learning model is constructed. Compared with single task learning, multi-task learning puts multiple tasks together to learn, can realize parameter sharing of multiple tasks in the learning process, thereby realizing common learning of multiple tasks. The multi-task learning model structure diagram proposed by the present application is shown in Figure 2 .
[0060] The multi-task learning model regards the peak load prediction of region 1 as task 1 and the peak load prediction of region 2 as task 2, and the multi-task learning model includes an input layer, a task 1 linear layer 1, a task 1 linear layer 4, a task 1 linear layer 6, a task 2 linear layer 2, a task 2 linear layer 5, a task 2 linear 7, a task sharing linear layer 3, a task sharing single-layer LSTM network, and an output layer.
[0061] 401: After the multi-task learning model obtains the input data, the data is input into the input layer. The input data can be a training sample or task data in actual operation. When the multi-task learning model is trained, the input layer is used to obtain the training sample. When the multi-task learning model is used for prediction, the input layer is used to obtain the task data of the task to be executed.
[0062] 402: In the present application, in order to extract the high-dimensional features of the recent peak load, the input layer inputs the features of the recent three days in the task 1 data sample into the task 1 linear layer 1, and inputs the recent three days of data in the task 2 data sample into the task 2 linear layer 2. The linear layer is also called a full connection layer, each neuron of which is connected with all the neurons of the previous layer to realize linear transformation of the previous layer. After linear transformation such as y = Ax + b, the input data is mapped into a high-dimensional space to obtain a linear layer 1 output vector and a linear layer 2 output vector, respectively.
[0063] 403: In the present application, in order to better grasp the long-term time-varying characteristic law of the peak load of the two regions, a shared task layer is used to learn the long feature sequence. First, the complete sample features representing the fluctuations of the two regions in the recent one month are spliced into a long vector
[0064] (x i-28 ,x i-21 ,x i-14, x i-7 ,x i-3 ,x i-2 ,x i-1 ,x i-28 ′,x i-21 ′,x i-14 ′,x i-7 ′,x i-3 ′,x i-2 ′,x i-1 ′), and the vector is input into the shared linear layer 3 to further extract high-dimensional features.
[0065] 404: Considering that the peak load sequence has strong time sequence characteristics, the load demand at the previous moment has a great influence on the next moment load prediction, therefore, an LSTM neural network with memory characteristics is used to build a shared learning layer. The output vector processed by the shared linear layer 3 is input into the shared network layer LSTM. The LSTM adds a forgetting gate, an input gate and an output gate in each neuron, and increases a information flow representing long-term memory, and the neuron structure is as shown in Figure 3 The specific calculation process is as follows:
[0066] forgetting gate:
[0067] f t =σ(W f ·[h t-1 ,xt ]+b f )
[0068] Input gate:
[0069]
[0070]
[0071] i t = σ(W i · [h t-1 , x t ]+b i )
[0072] Output gate:
[0073] o t = σ(W o · [h t-1 , x t ]+b o )
[0074] h t = o t · tanh(C t )
[0075] When the input enters the LSTM network layer, it first passes through the forget gate f t mapped to the interval [0, 1] through the sigmoid activation function, then passes through the input gate f t selectively retains the long-term memory information C t-1 , while adding new information to get the current time cell state. Finally, through the output gate o t get the hidden layer output value h t .
[0076] 405: The output vector of task 1 linear layer 1 and the output of task-shared single-layer LSTM network layer are spliced to form a complete feature input, which is input to task 1 linear layer 4, linearly transformed and reduced to a low-dimensional space, and then the output vector is input to task 1 linear layer 6 to get the final output of task 1.
[0077] 406: The output vector of task 2 linear layer 2 and the output of task-shared single-layer LSTM network layer are spliced to form a complete feature input, which is input to task 2 linear layer 5, linearly transformed and reduced to a low-dimensional space, and then the output vector is input to task 2 linear layer 7 to get the final output of task 2.
[0078] Step five, initialize the parameters of the multi-task learning model, including:
[0079] 501: initialize the input and output number of each network layer of the model, the number of hidden layer neurons, the maximum number of iterations epoch, the learning rate lr, the loss function adopts the mean absolute error MAE, and the formula is as follows:
[0080]
[0081] y i y represents the true value, y represents the predicted value, and n represents the number of samples. When the MAE value is smaller, the prediction error of the model is smaller.
[0082] Since the model proposed in the application has multiple training tasks, considering the convergence characteristics of the model and the similarity between tasks, the application adopts an average weighted manner to process the loss function, that is:
[0083] MAE = 0.5 * MAE1 + 0.5 * MAE2
[0084] 502: input the two regional training data sets into the initialized multi-task learning model for parallel iterative training, and use the Adam optimization algorithm to optimize the network parameters, input the multi-dimensional feature vector into the model for bottom-up training of the network until the preset number of iterations is reached.
[0085] Step six, test the trained multi-task learning model with the test data set, convert the model output to normal value after inverse normalization, and display the prediction result in a visual manner.
[0086] A peak value prediction device based on multi-task learning, comprising:
[0087] A data acquisition module is configured to acquire historical power load data of each region and process the historical power load data into a peak load sequence, and send the processing result to a region screening module.
[0088] The region screening module calculates the correlation of the historical peak load sequences of each region by using the Pearson correlation coefficient, and screens out two regions with strong positive correlation in time and space.
[0089] The data preprocessing and division module adopts a maximum and minimum linear normalization method to process the historical peak load data of the two regions with strong positive correlation in time and space, and constructs samples according to certain feature selection rules. The data set after preprocessing is divided into a training set and a test set.
[0090] The multi-task learning model construction module regards the peak load prediction of region 1 as task 1 and regards the peak load prediction of region 2 as task 2, and the multi-task learning model comprises an input layer, a task 1 linear layer 1, a task 1 linear layer 4, a task 1 linear layer 6, a task 2 linear layer 2, a task 2 linear layer 5, a task 2 linear layer 7, a task sharing linear layer 3, a task sharing single-layer LSTM network and an output layer. The input layer inputs part of the features of the task 1 sample into the task 1 linear layer 1 and inputs part of the features of the task 2 sample into the task 2 linear layer 2 to obtain an output vector of the linear layer 1 and an output vector of the linear layer 2 respectively. The complete sample features of the task 1 and the task 2 are input into the sharing linear layer 3 after being spliced, and the output vector of the sharing linear layer 3 is obtained after linear processing. The output vector of the sharing linear layer 3 is input into the task sharing single-layer LSTM network to obtain an output vector of the sharing single-layer LSTM network. The output vector of the linear layer 1 and the output vector of the sharing single-layer LSTM network are spliced and input into the task 1 linear layer 4 to obtain an output vector of the linear layer 4. The output vector of the linear layer 2 and the output vector of the sharing single-layer LSTM network are spliced and input into the task 2 linear layer 5 to obtain an output vector of the linear layer 5. The output vector of the linear layer 4 is input into the task 1 linear layer 6 to obtain the final output of the task 1. The output vector of the linear layer 5 is input into the task 2 linear layer 7 to obtain the final output of the task 2.
[0091] The model training module initializes the parameters of the multi-task learning model, sets the maximum number of iterations epochs and the learning rate lr, adopts the MAE as the loss function, inputs the training data sets of the two regions into the multi-task learning model for iterative parallel training, and specifically comprises the following steps: the forward propagation is calculated to obtain the predicted value, the prediction error is calculated according to the loss function, and the model parameters are updated in the reverse direction until the maximum number of iterations set is reached.
[0092] The prediction module tests the trained multi-task learning model by using the test data set.
[0093] The application further provides a computing device, which comprises at least one processor (for example, a CPU), at least one input / output interface, a memory and at least one communication bus for realizing the connection and communication among the components. The at least one processor is used for executing the computer instructions stored in the memory, so that the at least one processor can execute any one of the embodiments of the method of the application. The memory is a non-transitory memory, which can include a volatile memory such as a high-speed random access memory (RAM) and can also include a non-volatile memory such as at least one disk memory. The communication connection with at least one other device or unit is realized through the at least one input / output interface (which can be a wired or wireless communication interface).
[0094] In some embodiments, the memory stores a program and the processor executes the program to perform the content in any of the preceding embodiments of the method of the application.
[0095] The electronic device can exist in a variety of forms including, but not limited to:
[0096] (1) Mobile communication device: This type of device is characterized by mobile communication function, and the main target is to provide voice, data communication. This type of terminal includes: smart phone (such as iPhone), multimedia phone, functional phone, and low-end phone, etc.
[0097] (2) Ultra-mobile personal computer device: This type of device belongs to the category of personal computers, has computing and processing functions, and generally also has mobile Internet features. This type of terminal includes: PDA, MID and UMPC devices, etc., such as iPad.
[0098] (3) Portable entertainment device: This type of device can display and play multimedia content. This type of device includes: audio, video player (such as iPod), handheld game console, electronic book, and smart toy and portable car navigation device.
[0099] (4) Special server: A device that provides computing services. The server is composed of a processor, a hard disk, a memory, a system bus, etc. The server is similar in architecture to a general-purpose computer, but due to the need to provide high-reliability services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, manageability, etc.
[0100] (5) Other electronic devices with data interaction function.
[0101] Simulation conditions and evaluation indicators:
[0102] This embodiment is run on the Torch1.10.0 running platform under the Intel(R) Core(TM) i9-10900K CPU @ 3.70GHZ Ubuntu 18.04 system, 64G memory, and Python 3.7 environment.
[0103] The main evaluation indicators are:
[0104] Mean absolute percentage error:
[0105]
[0106] y i y represents the true value, y represents the predicted value, and n represents the number of samples. The closer the MAPE value is to 0, the higher the model prediction accuracy.
[0107] Simulation experiment content and results:
[0108] Simulation. Simulation of peak load prediction based on multi-task learning.
[0109] Data introduction: In this experiment, the hourly load data of a county in a city in northern China is used as the experimental object. First, the daily hourly load data is converted into daily peak data, and through Pearson correlation coefficient calculation, two regions with strong positive correlation are recorded as A and B.
[0110] After data preprocessing, the number of data set samples is divided into training set 365 and test set 365.
[0111] Comparative experiment: The peak load prediction method based on multi-task learning in the present application uses a single-layer LSTM network for the shared layer, and the comparative test is as follows:
[0112] 1) To test the effectiveness of the multi-task learning framework, the single-task LSTM model of the two regions is compared.
[0113] 2) To verify the effectiveness of the network structure design and exclude the influence of data volume increase on task optimization, a single model obtained by mixing the data of the two regions for training is compared.
[0114] 3) To verify the improvement effect of the hard sharing method used as the shared layer in the present application compared with the prior art, the prior art is compared.
[0115] The results of the comparative test are as follows:
[0116]
[0117]
[0118] From the above experimental results, it can be seen that the two-region multi-task learning framework considering the space-time correlation improves the single-task prediction accuracy, and the reason is that one task learns the knowledge of another task through the shared layer during training. Compared with the prior art, the hard sharing method is used to learn shared features, and a special layer is added to learn short-term individual features, so that the accuracy is further improved.
[0119] In addition, each functional module in the embodiment of the present application can be integrated in one processing unit, or each module can exist physically, or two or more modules can be integrated in one unit. The integrated unit can be realized in the form of hardware, or in the form of hardware plus software functional unit.
[0120] The integrated modules realized in the form of software function modules can be stored in a computer readable storage medium. The software function modules are stored in a storage medium and include a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute part of the steps of the method according to the embodiments of the present application.
[0121] It should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or can also be any conventional processor. The steps of the method disclosed in combination with the application can be directly embodied as execution completed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0122] The memory can include a high-speed RAM memory, and can also include a non-volatile storage NVM, for example, at least one disk memory, and can also be a U disk, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0123] The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.
[0124] The storage medium can be realized by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0125] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. Both the processor and the storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic device or host device.
[0126] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0127] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the implementation methods of the present invention, and should be understood that the scope of protection of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of the present invention.
Claims
1. A peak load prediction method based on multi-task learning, characterized in that, include: Step 1: Obtain historical peak load data for each region, remove outliers, select the highest daily load as the peak load data for that day, and construct a peak load sequence; Step 2: Calculate the correlation of historical peak load sequences for each region using the Pearson correlation coefficient, and select two regions with strong positive temporal and spatial correlation based on the correlation criteria. Step 3: Preprocess the historical peak load data of the two selected regions with strong positive spatiotemporal correlation, and divide the dataset into training set and test set; Step 4: Treat peak load forecasting for each region as a task and construct a multi-task learning model; In step four, peak load prediction for region 1 is considered as task 1, and peak load prediction for region 2 is considered as task 2. The multi-task learning model includes: task 1 linear layer 1, task 1 linear layer 4, task 1 linear layer 6, task 2 linear layer 2, task 2 linear layer 5, task 2 linear layer 7, task shared linear layer 3, and task shared single-layer LSTM network. Partial features from the data samples of Task 1 are input into linear layer 1 of Task 1, and partial features from the data samples of Task 2 are input into linear layer 2 of Task 2, yielding output vectors for linear layer 1 and linear layer 2 respectively. Complete features from the samples of Task 1 and Task 2 are concatenated and input into a shared linear layer 3, and after linear processing, an output vector for shared linear layer 3 is obtained. This output vector is then input into a shared single-layer LSTM network to obtain the output vector of the shared single-layer LSTM network. The output vector of linear layer 1 is concatenated with the output vector of the shared single-layer LSTM network and input into linear layer 4 of Task 1 to obtain the output vector of linear layer 4. The output vector of linear layer 2 is concatenated with the output vector of the shared single-layer LSTM network and input into linear layer 5 of Task 2 to obtain the output vector of linear layer 5. The output vector of linear layer 4 is input into linear layer 6 of Task 1 to obtain the final output of Task 1. The output vector of linear layer 5 is input into linear layer 7 of Task 2 to obtain the final output of Task 2. Step 5: Initialize the parameters of the multi-task learning model, and input the training datasets from the two regions into the multi-task learning model for iterative training in parallel. Step 6: Test the trained multi-task learning model using a test dataset.
2. The peak load prediction method based on multi-task learning according to claim 1, characterized in that: In step three, for the historical peak load data of the two selected regions with strong positive correlation in time and space, the maximum-minimum linear normalization method is used for data processing, and samples are constructed according to the feature selection rules. The preprocessed dataset is divided into two parts: a training set and a test set.
3. The peak load prediction method based on multi-task learning according to claim 1, characterized in that: In step five, the parameters of the multi-task learning model are randomly initialized, the maximum number of iterations (epochs) and the learning rate (lr) are set, and the loss function is MAE. The training datasets from the two regions are input into the multi-task learning model for iterative parallel training. Specifically, this includes forward propagation to calculate the predicted value and backpropagation to update the model parameters based on the prediction error calculated according to the loss function, until the maximum number of iterations is reached.
4. The peak load prediction method based on multi-task learning according to claim 1, characterized in that: In step six, the trained multi-task learning model is tested using a test dataset.
5. A peak load prediction device based on multi-task learning, characterized in that, include: The module includes: data acquisition module, region filtering module, data preprocessing and segmentation module, multi-task learning model construction module, model training module, and prediction module. Data acquisition module: used to acquire historical power load data of various regions and process it into peak load sequence, and send the processing results to the region filtering module; The region screening module calculates the correlation of historical peak load sequences for each region using the Pearson correlation coefficient and selects two regions with strong positive temporal and spatial correlation based on the correlation criteria. Data preprocessing and partitioning module: For the historical peak load data of the two selected regions with strong positive correlation in time and space, the maximum-minimum linear normalization method is used for data processing, and samples are constructed according to the feature selection rules; the preprocessed dataset is divided into two parts: training set and test set. Multi-task learning model construction module: Peak load prediction for region 1 is considered task 1, and peak load prediction for region 2 is considered task 2. The multi-task learning model includes task 1 linear layer 1, task 1 linear layer 4, task 1 linear layer 6, task 2 linear layer 2, task 2 linear layer 5, task 2 linear layer 7, task-shared linear layer 3, and task-shared single-layer LSTM network. Partial features from the task 1 data samples are input into task 1 linear layer 1, and partial features from the task 2 data samples are input into task 2 linear layer 2, yielding the output vectors of linear layer 1 and linear layer 2 respectively. The complete features of the task 1 and task 2 samples are then processed. After concatenation, the vector is input into the shared linear layer 3. After linear processing, the output vector of the shared linear layer 3 is obtained. The output vector of the shared linear layer 3 is input into the task shared single-layer LSTM network to obtain the output vector of the shared single-layer LSTM network. The output vector of the linear layer 1 is concatenated with the output vector of the shared single-layer LSTM network and input into the linear layer 4 of task 1 to obtain the output vector of the linear layer 4. The output vector of the linear layer 2 is concatenated with the output vector of the shared single-layer LSTM network and input into the linear layer 5 of task 2 to obtain the output vector of the linear layer 5. The output vector of the linear layer 4 is input into the linear layer 6 of task 1 to obtain the final output of task 1. Input the output vector of linear layer 5 into linear layer 7 of task 2 to obtain the final output of task 2; Model training module: Randomly initialize the parameters of the multi-task learning model, set the maximum number of iterations (epochs), learning rate (lr), and loss function (MAE). Input the training datasets from two regions into the multi-task learning model for iterative parallel training. Specifically, this includes forward propagation to calculate the predicted value and backpropagation to update the model parameters based on the prediction error calculated according to the loss function, until the maximum number of iterations is reached. Prediction module: Test the trained multi-task learning model using the test dataset.
6. A terminal, characterized in that, include: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions that are executed by the at least one processor to enable the at least one processor to perform the peak load prediction method based on multi-task learning as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions for causing a computer to perform the peak load prediction method based on multi-task learning as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Day-ahead transaction strategy method and system based on market supply and demand and regional meteorological prediction
CN112580901A
Summer peak load prediction method and system based on feature decoupling deep neural network model
CN113205174A