Multi-factor load prediction method and device based on LSTM-TimeGAN neural network

Through a multi-factor load prediction method based on LSTM-TimeGAN neural network, combined with sliding window and data smoothing technology, the problem of insufficient factors in the existing power grid load prediction methods is solved, and the accuracy and stability of prediction are improved.

CN119134264APending Publication Date: 2024-12-13BEIJING UNIV OF POSTS & TELECOMM +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410847535.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The existing grid load prediction methods cannot effectively consider the influence of different factors, resulting in insufficient prediction accuracy and stability.

Method used

Using a multi-factor load prediction method based on LSTM-TimeGAN neural network, the final prediction results are generated by collecting and preprocessing load data, LSTM and TimeGAN models are trained, and combined with sliding windows and data smoothing technology.

Benefits of technology

It significantly improves the accuracy and stability of load prediction, and can better consider the influence of multiple factors and generate more accurate prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119134264A_ABST
    Figure CN119134264A_ABST
Patent Text Reader

Abstract

The invention provides a multi-factor load prediction method and device based on an LSTM-TimeGAN neural network, and the method comprises the steps: collecting to-be-analyzed load data, and carrying out the preprocessing of the to-be-analyzed load data, and generating the numerical data of a uniform format; performing normalization processing on the numerical data, dividing the data into a training set and a test set, and training an LSTM model and a TimeGAN model by using the training set until the models converge; the number of time points expected to be predicted is determined, data in a test set is used as a sample to be input into the LSTM model for prediction, a first prediction value is obtained, and after the first prediction value is input into the TimeGAN model, a second prediction value is output; and circulating the steps to generate a final prediction result. The prediction method provided by the invention can effectively improve the stability and accuracy of prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of neural networks. Specifically, the present application relates to a multi-factor load forecasting method and device based on LSTM-TimeGAN neural network. Background Art

[0002] With the development of science and technology, especially the popularization and use of various intelligent devices, the demand for power grid functions has continued to grow. However, the various loads generated by the power grid in the process of development have become an important part of the development of the power system. Therefore, load forecasting has become an important basic content in the power grid system.

[0003] In the prior art, many effective methods have been proposed for grid load forecasting, such as neural network method, regression analysis method, wavelet analysis method, time series method, etc. However, the current forecasting methods cannot well consider the impact of different factors on load forecasting, thereby reducing the accuracy and stability of the forecast. Summary of the invention

[0004] In order to solve the above technical problems, the present invention proposes a multi-factor load forecasting method and device based on LSTM-TimeGAN neural network, which can effectively improve the accuracy and stability of load forecasting.

[0005] In a first aspect, the present invention proposes a multi-factor load forecasting method based on an LSTM-TimeGAN neural network, the method comprising the following steps:

[0006] Step S1. Collect the load data to be analyzed, and generate numerical data in a unified format after preprocessing;

[0007] Step S2. The numerical data is normalized and divided into a training set and a test set, and the training set is used to train the LSTM model and the TimeGAN model until the model converges;

[0008] Step S3. Determine the number of time points expected to be predicted, use the data in the test set as samples to input the LSTM model into the prediction, obtain a first prediction value, input the first prediction value into the TimeGAN model, and then output a second prediction value;

[0009] Step S4: loop the above steps to generate the final prediction result.

[0010] In combination with the first aspect, in a possible implementation manner, the preprocessing in step S1 includes preprocessing missing values ​​and abnormal values ​​of the load data to be analyzed.

[0011] In combination with the first aspect, in a possible implementation manner, step S2 specifically includes:

[0012] Step S2.1: normalize the numerical data to generate a data set, divide the selected data set into a training set and a test set in a ratio of 8:2, and divide the training set and the test set into multiple samples based on the sliding window size after normalization;

[0013] Step S2.2: building an LSTM model, fitting the LSTM model, training the LSTM model and saving the trained model;

[0014] Step S2.3: Build a TimeGAN model, fit the TimeGAN model, train the TimeGAN model and save the trained model.

[0015] In combination with the first aspect, in a possible implementation, when training the TimeGAN model, the generator, the discriminator, the encoder, and the decoder are stored separately.

[0016] In combination with the first aspect, in a possible implementation manner, step S3 specifically includes:

[0017] Step S3.1: Input the test set as a sample into the trained LSTM model for prediction to obtain a corresponding first prediction value.

[0018] Step S3.2: inputting the first prediction value into the encoder in the TimeGAN model for encoding to obtain an encoded result, and inputting the encoded result into the discriminator for discrimination;

[0019] If the judgment is true, the first prediction value is used as the second prediction value;

[0020] If the judgment is false, the first prediction result and other values ​​in the window are put into smoother for data smoothing, and then the smoothed data is put into the discriminator for further judgment. If the data after data smoothing passes the authenticity judgment, the smoothed data is used as the second prediction result, otherwise the first prediction result is used as the second prediction result.

[0021] In a second aspect, the present invention proposes a multi-factor load forecasting device based on an LSTM-TimeGAN neural network, the device comprising:

[0022] The preprocessing module is used to collect the load data to be analyzed and generate numerical data in a unified format after preprocessing;

[0023] A first processing module is used to divide the numerical data into a training set and a test set after normalization, and use the training set to train the LSTM model and the TimeGAN model until the models converge;

[0024] The second processing module is used to determine the number of time points expected to be predicted, use the data in the test set as samples to input the LSTM model into the prediction, obtain a first prediction value, input the first prediction value into the TimeGAN model, and then output a second prediction value;

[0025] The output module is used to generate a final prediction result based on all the acquired second prediction values.

[0026] In conjunction with the second aspect, in a possible implementation manner, the first processing module includes:

[0027] Data partitioning submodule: used to generate a data set after normalizing the numerical data, divide the selected data set into a training set and a test set according to a ratio of 8:2, and divide the training set and the test set into multiple samples based on the sliding window size after normalizing;

[0028] The first training submodule is used to build an LSTM model, fit the LSTM model, train the LSTM model and save the trained model;

[0029] The second training submodule is used to build a TimeGAN model, fit the TimeGAN model, train the TimeGAN model and save the trained model.

[0030] In conjunction with the second aspect, in a possible implementation manner, the second processing module includes:

[0031] Prediction submodule: used to input the test set as a sample into the trained LSTM model for prediction, and obtain the corresponding first prediction value.

[0032] Encoder: used for inputting the first prediction value into the encoder of the TimeGAN model for encoding to obtain an encoded result, and putting the encoded result into the discriminator for discrimination;

[0033] The discriminator is used to discriminate the encoded result. If the judgment is true, the first prediction value is used as the second prediction value; if the judgment is false, the first prediction result and other values ​​in the window are put into smoother for data smoothing, and then the smoothed data is put into the discriminator for further judgment. If the data after data smoothing passes the authenticity judgment, the smoothed data is used as the second prediction result, otherwise the first prediction result is used as the second prediction result.

[0034] According to a third aspect, an electronic device is provided, including:

[0035] A memory on which application programs and an operating system are stored;

[0036] The processor is used to implement the multi-factor load forecasting method in the first aspect when executing the program or instruction.

[0037] In a fourth aspect, a readable storage medium is provided, on which an application program and an operating system are stored, characterized in that when the program or instruction is executed by a processor, the multi-factor load forecasting method in the first aspect is implemented.

[0038] The present invention proposes a multi-factor load forecasting method based on LSTM-TimeGAN neural network, including: collecting load data to be analyzed, generating numerical data with a unified format after preprocessing; dividing the numerical data into a training set and a test set after normalization, using the training set to train the LSTM model and the TimeGAN model until the model converges; determining the number of time points expected to be predicted, using the data in the test set as samples to input the LSTM model into the prediction, obtaining a first prediction value, inputting the first prediction value into the TimeGAN model and outputting a second prediction value; and looping the above steps to generate a final prediction result. The prediction method of the present invention can effectively improve the stability and accuracy of the prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A flowchart of a multi-factor load forecasting method based on an LSTM-TimeGAN neural network provided in an embodiment of the present application.

[0040] Figure 2 Schematic diagram of the algorithm model of LSMT in the multi-factor load forecasting method based on LSTM-TimeGAN neural network provided in an embodiment of the present application.

[0041] Figure 3 A flowchart of the LSTM_TimeGAN algorithm model in the multi-factor load forecasting method based on the LSTM-TimeGAN neural network provided in an embodiment of the present application.

[0042] Figure 4 A framework diagram of a multi-factor load forecasting device based on an LSTM-TimeGAN neural network provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] For ease of understanding, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0044] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0045] like Figure 1 As shown, the present invention proposes a multi-factor load forecasting method based on LSTM-TimeGAN neural network, which specifically includes the following steps:

[0046] Step S1: Collect the load data to be analyzed, and generate numerical data in a unified format after preprocessing.

[0047] In this embodiment, the load data to be analyzed in step S1 can be collected in real time, or it can be data collected periodically after a time period is defined in practice, and the prediction result is formed by obtaining specific load data. Since there may be many unstable factors in the collected data, the load data to be analyzed is preprocessed by preprocessing missing values ​​and abnormal values ​​to generate digitized data with a unified format. It should be noted that in this embodiment, only the format of the data needs to be unified, and the specific format unification can be processed in any way in the prior art, which is not protected by the present invention.

[0048] Step S2. The numerical data is normalized and divided into a training set and a test set, and the training set is used to train the LSTM model and the TimeGAN model until the model converges.

[0049] In this embodiment, the specific process of this step includes:

[0050] Step S2.1: normalize the numerical data to generate a data set, divide the selected data set into a training set and a test set in a ratio of 8:2, and divide the training set and the test set into multiple samples based on the sliding window size after normalization;

[0051] Step S2.2: Figure 2As shown, an LSTM model is built, in which each LSTM unit is used to retain past useful information and incorporate new information, and the final prediction result can be extracted from h_n. Fit the LSTM model, train the LSTM model and save the trained model;

[0052] Step S2.3: Build a TimeGAN model, fit the TimeGAN model, train the TimeGAN model and save the trained model.

[0053] It should be noted that the selected data set is divided into a training set, which can be recorded as train_data, and a test set, which can be recorded as test_data, in a ratio of 8:2, and normalized to (0,1); multiple samples are divided according to the size of the sliding window. At the same time, the fit method is usually used in machine learning to instruct the model to learn or fit the training data. It adjusts the weight coefficient according to the input training data and target label so that the model can classify the data. During the training process, the weights can be continuously adjusted in an iterative manner to minimize classification errors or minimize the loss function. Therefore, using the fit method when training the LSTM model and the TimeGAN model will effectively improve the training efficiency of the model. When training the TimeGAN model, the generator, discriminator, encoder, and decoder are stored separately.

[0054] Step S3. Determine the number of time points expected to be predicted, use the data in the test set as samples to input the LSTM model into the prediction, obtain a first prediction value, input the first prediction value into the TimeGAN model, and then output a second prediction value.

[0055] In this embodiment, if Figure 3 As shown, the above step S3 specifically includes:

[0056] Step S3.1: Input the test set as a sample into the trained LSTM model for prediction to obtain a corresponding first prediction value.

[0057] Step S3.2: input the first prediction value into the encoder (E) in the TimeGAN model for encoding to obtain an encoded result, the encoded result is discriminated by the discriminator (D), and the discriminated result is input into the container (R) and extracted to determine whether it is True or False;

[0058] If the judgment is true, the first predicted value is used as the second predicted value, that is, merge_result is output;

[0059] If the judgment is false, the first prediction result and other values ​​in the window are put into smoother for data smoothing, and then the smoothed data is put into the discriminator for further judgment. If the data after data smoothing passes the authenticity judgment, the smoothed data is used as the second prediction result, otherwise the first prediction result is used as the second prediction result.

[0060] In this embodiment, when the TimeGAN model is trained, the relevant models, such as the generator, the discriminator, the encoder, and the decoder, are stored separately, and the encoder, the discriminator, and the decoder of the trained TimeGAN model are extracted.

[0061] The test set is taken as a sample and put into the model_LSTM trained in S2.1 for prediction to obtain the corresponding first prediction result, which can actually be understood as a short-term prediction result. The corresponding short-term prediction result is put into the encoder in TimeGAN for encoding to obtain the encoded result. The purpose is to better extract the time feature and put the encoded result into the discriminator for discrimination.

[0062] If the judgment is true, the final result of the prediction is the value predicted by LSTM

[0063] If the judgment is false, the LSTM prediction result and other values ​​in the window are put into smoother for data smoothing, using linear regression and other methods. Then the smoothed data is put into the discriminator for further judgment. If the data after data smoothing passes the authenticity judgment, the final predicted data uses the smoothed data as the predicted data, otherwise the data generated in LSTM is used.

[0064] Step S4: loop the above steps to generate the final prediction result.

[0065] According to the purpose of the present invention, the present invention proposes a multi-factor load forecasting device based on LSTM-TimeGAN neural network, such as Figure 4 As shown, the device 40 includes:

[0066] The preprocessing module 41 is used to collect the load data to be analyzed and generate numerical data in a unified format after preprocessing;

[0067] A first processing module 42 is used to divide the numerical data into a training set and a test set after normalization, and use the training set to train the LSTM model and the TimeGAN model until the models converge;

[0068] The second processing module 43 is used to determine the number of time points expected to be predicted, use the data in the test set as samples to input the LSTM model into the prediction, obtain a first prediction value, input the first prediction value into the TimeGAN model, and then output a second prediction value;

[0069] The output module 44 is used to generate a final prediction result according to all the acquired second prediction values.

[0070] The first processing module 42 includes:

[0071] Data partitioning submodule 421: used to generate a data set after normalizing the numerical data, divide the selected data set into a training set and a test set according to a ratio of 8:2, and divide the training set and the test set into multiple samples based on the sliding window size after normalizing;

[0072] The first training submodule 422 is used to build an LSTM model, fit the LSTM model, train the LSTM model and save the trained model;

[0073] The second training submodule 423 is used to build a TimeGAN model, fit the TimeGAN model, train the TimeGAN model and save the trained model.

[0074] The second processing module 43 includes:

[0075] Prediction submodule 431: used to input the test set as a sample into the trained LSTM model for prediction, and obtain a corresponding first prediction value.

[0076] Encoder 432: used for inputting the first prediction value into the encoder in the TimeGAN model for encoding to obtain an encoded result, and putting the encoded result into the discriminator for discrimination;

[0077] The discriminator 433 is used to discriminate the encoded result. If the judgment is true, the first prediction value is used as the second prediction value; if the judgment is false, the first prediction result and other values ​​in the window are put into smoother for data smoothing, and then the smoothed data is put into the discriminator for further judgment. If the data after data smoothing passes the authenticity judgment, the smoothed data is used as the second prediction result, otherwise the first prediction result is used as the second prediction result.

[0078] An embodiment of the present application also provides an electronic device, which includes a memory and a processor, wherein the memory stores an application and an operating system; the processor is used to implement the steps of the above-mentioned multi-factor load forecasting method when executing the program or instructions.

[0079] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned multi-factor load forecasting method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0080] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0081] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0082] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0083] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A multi-factor load forecasting method based on LSTM-TimeGAN neural network, It is characterized in that The method comprises the following steps: Step S1. Collect the load data to be analyzed, and generate numerical data in a unified format after preprocessing; Step S2. The numerical data is normalized and divided into a training set and a test set, and the training set is used to train the LSTM model and the TimeGAN model until the model converges; Step S3. Determine the number of time points expected to be predicted, use the data in the test set as samples to input the LSTM model into the prediction, obtain a first prediction value, input the first prediction value into the TimeGAN model, and then output a second prediction value; Step S4: loop the above steps to generate the final prediction result.

2. The multi-factor load forecasting method according to claim 1, It is characterized in that The preprocessing in step S1 includes preprocessing missing values ​​and abnormal values ​​of the load data to be analyzed.

3. The multi-factor load forecasting method according to claim 1, It is characterized in that The step S2 specifically includes: Step S2.1: normalize the numerical data to generate a data set, divide the selected data set into a training set and a test set in a ratio of 8:2, and divide the training set and the test set into multiple samples based on the sliding window size after normalization; Step S2.2: building an LSTM model, fitting the LSTM model, training the LSTM model and saving the trained model; Step S2.3: Build a TimeGAN model, fit the TimeGAN model, train the TimeGAN model and save the trained model.

4. The multi-factor load forecasting method according to claim 3, It is characterized in that When training the TimeGAN model, the generator, discriminator, encoder, and decoder are stored separately.

5. The multi-factor load forecasting method according to claim 4, It is characterized in that The step S3 specifically includes: Step S3.1: Input the test set as a sample into the trained LSTM model for prediction to obtain a corresponding first prediction value. Step S3.2: inputting the first prediction value into the encoder in the TimeGAN model for encoding to obtain an encoded result, and inputting the encoded result into the discriminator for discrimination; If the judgment is true, the first prediction value is used as the second prediction value; If the judgment is false, the first prediction result and other values ​​in the window are put into smoother for data smoothing, and then the smoothed data is put into the discriminator for further judgment. If the data after data smoothing passes the authenticity judgment, the smoothed data is used as the second prediction result, otherwise the first prediction result is used as the second prediction result.

6. A multi-factor load forecasting device based on LSTM-TimeGAN neural network, It is characterized in that The device comprises: The preprocessing module is used to collect the load data to be analyzed and generate numerical data in a unified format after preprocessing; A first processing module is used to divide the numerical data into a training set and a test set after normalization, and use the training set to train the LSTM model and the TimeGAN model until the models converge; The second processing module is used to determine the number of time points expected to be predicted, use the data in the test set as samples to input the LSTM model into the prediction, obtain a first prediction value, input the first prediction value into the TimeGAN model, and then output a second prediction value; The output module is used to generate a final prediction result based on all the acquired second prediction values.

7. The multi-factor load forecasting device based on LSTM-TimeGAN neural network according to claim 6, It is characterized in that The first processing module comprises: Data partitioning submodule: used to generate a data set after normalizing the numerical data, divide the selected data set into a training set and a test set according to a ratio of 8:2, and divide the training set and the test set into multiple samples based on the sliding window size after normalizing; The first training submodule is used to build an LSTM model, fit the LSTM model, train the LSTM model and save the trained model; The second training submodule is used to build a TimeGAN model, fit the TimeGAN model, train the TimeGAN model and save the trained model.