Load prediction method and device based on SPM-LSTM and medium
By combining SPM and LSTM networks, the sequence pattern between microgrid load data and meteorological data is extracted, and a more efficient and accurate load prediction is achieved.
Patent Information
- Application Number
- CN202510105966.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-27
AI Technical Summary
Traditional prediction models in the prior art are difficult to capture the load fluctuation characteristics of microgrids, resulting in low load prediction accuracy.
Using the load prediction method based on SPM-LSTM, a data set is constructed and a subset of data is divided by obtaining historical load data and meteorological data, and a sequence pattern is extracted using SPM, and load prediction is performed in combination with the LSTM network.
Improves the accuracy and efficiency of load prediction, is suitable for larger data sets and a wider range of scenarios, and has higher accuracy with shorter training time and response time.
Smart Images

Figure CN120047000A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of microgrids, and particularly to a load forecasting method, device, and medium based on SPM-LSTM. Background Art
[0002] In recent years, distributed generation technologies such as solar energy and wind energy have developed vigorously. These energy sources have the advantages of high energy utilization efficiency, low environmental pollution, strong power supply flexibility, and low input cost. However, the single-unit grid connection of large-scale distributed power sources will impact the large power grid, and it has become a key issue to make up for the insufficient bearing capacity of the power system for the wide penetration of distributed power sources. In order to give full play to the advantages of distributed generation technologies, the concept of microgrids has emerged. Microgrids can mitigate the impact of large-scale distributed power sources on the large power grid and improve the stability and reliability of the power system.
[0003] In a microgrid, due to the randomness and intermittency of distributed generation from renewable energy sources, this has had an adverse impact on the safe and stable operation of the power grid to a certain extent. Therefore, load forecasting is of great significance for the energy management, supply-demand balance, and stable operation of microgrids.
[0004] However, many traditional forecasting models in the prior art, usually based on the assumption of stationary time series, are difficult to adapt to the complex change characteristics of microgrid loads. The randomness and intermittency of distributed power sources cause the microgrid load to fluctuate violently, and traditional models are difficult to capture these dynamic changes and cannot adapt to the rapid changes in load in a timely and accurate manner, resulting in a low accuracy rate for load forecasting. Summary of the Invention
[0005] Embodiments of this application provide a load forecasting method, device, and medium based on SPM-LSTM to solve the following technical problems: Many traditional forecasting models in the prior art are difficult to capture the load fluctuation characteristics of microgrids, thus making it difficult to adapt to the rapid changes in load in a timely and accurate manner, resulting in a low accuracy rate for load forecasting.
[0006] Embodiments of this application adopt the following technical solutions:
[0007] An embodiment of the present application provides a load forecasting method based on SPM-LSTM. It includes obtaining the input of historical load data and historical meteorological data corresponding to the microgrid, constructing a data set containing load time series data based on the historical load data and historical meteorological data, and dividing the data set into multiple data subsets based on time series periods; using the multiple data subsets as the input of the SPM, and determining relevant sequence patterns through the current data corresponding to the microgrid and the SPM; where the relevant sequence patterns are used to represent the correlation between load data and meteorological data; determining a reference data subset from the multiple data subsets based on the relevant sequence patterns; selecting a reference LSTM model from a preset LSTM model set according to the time series period corresponding to the reference data subset; and performing load forecasting on the microgrid based on the reference data subset and the reference LSTM model.
[0008] In an embodiment of the present application, by combining the SPM algorithm with the LSTM network, the SPM is used to extract sequence patterns, and the interval of future load is selected according to the relevant patterns. Then, the LSTM network is used to determine the accurate future load according to the selected patterns using the relevant LSTM. The extracted patterns are independent of the pattern length and are applicable to larger data sets and wider scenarios. Secondly, the embodiment of the present application has a higher accuracy rate under the condition of shorter training time and response time. The embodiment of the present application selects the historical data of the corresponding time sequence based on the result of the extracted pattern, reduces the number of input data to improve the prediction efficiency, and also improves the accuracy of load forecasting. In addition, the embodiment of the present application uses a large number of LSTM networks, and each LSTM network corresponds to the training data of different time series periods, so as to divide the historical data set into multiple data sets, reduce the number of training data sets for each network, reduce the training time, and improve the prediction accuracy rate at the same time.
[0009] In an implementation manner of the present application, using the multiple data subsets as the input of the SPM, and determining relevant sequence patterns through the current data corresponding to the microgrid and the SPM specifically includes: using the multiple data subsets as the input of the SPM, and determining all sequence patterns corresponding to the microgrid through the SPM; obtaining the current load data and current meteorological data corresponding to the microgrid; and performing matching in all sequence patterns based on the current load data and current meteorological data to determine relevant sequence patterns.
[0010] In an implementation manner of the present application, using the multiple data subsets as the input of the SPM, and determining all sequence patterns corresponding to the microgrid through the SPM specifically includes: based on the function:
[0011]
[0012] Determining all sequence patterns corresponding to the microgrid; where min_sup is the support threshold; DS is the input data subset; φ is an empty set; PS (min_sup) is all the extracted sequence patterns; Prefixspan is a sequence pattern mining algorithm.
[0013] In an implementation manner of the present application, based on the current load data and the current meteorological data, matching is performed among all the sequence patterns to determine relevant sequence patterns, specifically including: based on the function:
[0014]
[0015] Determine relevant sequence patterns; where E Target is the current data corresponding to the microgrid; is the relevant sequence pattern; P S (min_sup) is all the extracted sequence patterns; ValidPattern is to separate the relevant sequence patterns in all the sequence patterns according to the target event.
[0016] In an implementation manner of the present application, based on the relevant sequence patterns, a reference data subset is determined from multiple data subsets, specifically including: determining the first time series period corresponding to the relevant sequence patterns; and determining the second time series periods corresponding to the multiple data subsets respectively; matching the first time series period with the second time series periods, and based on the matching result, determining the reference data subset from the multiple data subsets.
[0017] In an implementation manner of the present application, before selecting a reference LSTM model from a preset LSTM model set according to the time series period corresponding to the reference data subset, the method further includes: constructing multiple training sets based on the multiple data subsets; respectively training multiple LSTM models based on the multiple training sets; where the multiple LSTM models have the same basic structure; constructing a preset LSTM model set based on the trained multiple LSTM models.
[0018] In an implementation manner of the present application, based on the reference data subset and the reference LSTM model, load forecasting is performed on the microgrid, specifically including: determining the time corresponding to each data in the reference data subset; sequentially inputting each data in the reference data subset into the reference LSTM model according to the chronological order; where the data output of the reference LSTM model corresponding to the previous time is used as the data input for the next time; based on the final output result of the reference LSTM, obtaining the load forecasting result of the microgrid.
[0019] In an implementation manner of the present application, based on the reference data subset and the reference LSTM model, load forecasting is performed on the microgrid, specifically including: based on the function:
[0020] f t = σ(Wfx ·X t +W fh ·H t-1 +B f )
[0021] Determine the proportion of previous information to be retained in each time period by referring to the forget gate in the LSTM model; based on the function:
[0022] i t = σ(W ix ·X t +W ih ·H t-1 +B i )
[0023] Determine the proportion of new information to be combined with the previous information by referring to the input gate in the LSTM model; based on the function:
[0024] C t = f t *C t-1 + i t *tanh(W cx ·X t +W ch ·H t-1 +B c )
[0025] Determine the storage cell state of the new information; based on the function:
[0026] o t = σ(W ox ·X t +W oh ·H t-1 +B o )
[0027] Determine the proportion of the combined new information by referring to the output gate in the LSTM model; based on the function:
[0028] H t = o t *tanh(C t )
[0029] Define the final output as the hidden state; where, σ(x) is the sigmoid function tanh(x) is the tanh function X t is the input at time t; f t is the output of the forget gate at time t; i t is the output of the input gate at time t; o t is the output of the output gate at time t; Ct is the storage cell state at time t, C t-1 is the storage cell state at time t-1, H t is the hidden state at time t; H t-1 is the hidden state at time t-1; W fx is the first weight matrix, W fh is the second weight matrix, W ix is the third weight matrix, W ih is the fourth weight matrix, W cx is the fifth weight matrix, W ch is the sixth weight matrix, W ox is the seventh weight matrix, W oh is the eighth weight matrix, B f is the first bias vector, B i is the second bias vector, B c is the third bias vector, B o is the fourth bias vector.
[0030] An embodiment of the present application provides a load prediction device based on SPM-LSTM, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable 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: obtain historical load data and historical meteorological data inputs corresponding to a microgrid, construct a data set containing load time series data based on the historical load data and historical meteorological data, and divide the data set into multiple data subsets based on a time series period; use the multiple data subsets as inputs to the SPM, and determine relevant sequence patterns through the current data corresponding to the microgrid and the SPM; wherein, the relevant sequence patterns are used to represent the association relationship between load data and meteorological data; determine a reference data subset from the multiple data subsets based on the relevant sequence patterns; select a reference LSTM model from a preset LSTM model set according to the time series period corresponding to the reference data subset; and perform load prediction on the microgrid based on the reference data subset and the reference LSTM model.
[0031] A non-volatile computer storage medium provided by an embodiment of the present application stores computer-executable instructions, and the computer-executable instructions are set as follows: Obtain the input of historical load data and historical meteorological data corresponding to a microgrid, construct a data set containing load time-series data based on the historical load data and historical meteorological data, and divide the data set into multiple data subsets based on time-series time periods; Use the multiple data subsets as the input of the SPM, and determine relevant sequence patterns through the current data corresponding to the microgrid and the SPM; wherein the relevant sequence patterns are used to represent the correlation between load data and meteorological data; Determine a reference data subset from the multiple data subsets based on the relevant sequence patterns; Select a reference LSTM model from a preset set of LSTM models according to the time-series time period corresponding to the reference data subset; Based on the reference data subset and the reference LSTM model, perform load forecasting on the microgrid.
[0032] The above at least one technical solution adopted by the embodiment of the present application can achieve the following beneficial effects: By combining the SPM algorithm with the LSTM network, the embodiment of the present application uses SPM to extract sequence patterns, selects the interval of future load according to the relevant patterns, and then uses the LSTM network to determine the accurate future load according to the selected patterns using the relevant LSTM. The extracted patterns are independent of the pattern length and are applicable to larger data sets and wider scenarios. Secondly, the embodiment of the present application has higher accuracy under shorter training time and response time. The embodiment of the present application selects historical data corresponding to the corresponding time series based on the result of the extracted pattern, reduces the number of input data to improve the prediction efficiency, and also improves the accuracy of load forecasting. In addition, the embodiment of the present application uses a large number of LSTM networks, and each LSTM network corresponds to the training data of different time-series time periods, so as to divide the historical data set into multiple data sets, reduce the number of training data sets for each network, reduce the training time, and improve the prediction accuracy at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to these drawings. In the drawings:
[0034] Figure 1 It is a flowchart of a load forecasting method based on SPM-LSTM provided by an embodiment of the present application;
[0035] Figure 2 It is a schematic diagram of a hybrid SPM-LSTM model provided by an embodiment of the present application;
[0036] Figure 3 A schematic diagram of an LSTM network provided by an embodiment of the present application;
[0037] Figure 4 A schematic structural diagram of a load forecasting device based on SPM-LSTM provided by an embodiment of the present application.
[0038] Reference numerals:
[0039] 200: Load forecasting device based on SPM-LSTM, 201: Processor, 202: Memory. Detailed implementation manners
[0040] An embodiment of the present application provides a load forecasting method, device and medium based on SPM-LSTM.
[0041] In order to enable those skilled in the art to better understand the technical solutions in the present application, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0042] The technical solutions proposed in the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0043] Figure 1 A flowchart of a load forecasting method based on SPM-LSTM provided by an embodiment of the present application, as Figure 1 shown, the load forecasting method based on SPM-LSTM includes the following steps:
[0044] S101. Obtain the input of historical load data and historical meteorological data corresponding to the microgrid. Based on the historical load data and historical meteorological data, construct a data set containing load time series data, and divide the data set into multiple data subsets based on the time series period.
[0045] In an embodiment of the present application, the obtained historical load data and historical meteorological data corresponding to the microgrid are input, where the meteorological data includes temperature, humidity, wind speed and weather data.
[0046] Further, the obtained historical load data and historical meteorological data are integrated to form a data set containing multiple features. The data set is organized into time series data in chronological order, and the data set is divided into multiple data subsets based on the time series period, where the length of the time series period corresponding to each data subset is the same.
[0047] S102. Use multiple data subsets as the input of the SPM, and determine the relevant sequence patterns through the current data corresponding to the microgrid and the SPM.
[0048] In an embodiment of the present application, use multiple data subsets as the input of the SPM, and determine all the sequence patterns corresponding to the microgrid through the SPM. Obtain the current load data and current meteorological data corresponding to the microgrid. Based on the current load data and current meteorological data, perform matching among all the sequence patterns to determine the relevant sequence patterns.
[0049] Specifically, use the multiple data subsets obtained by dividing based on the time series period as the input of the SPM. Each data subset contains the load time series data and the corresponding meteorological data within a specific time period. Use the SPM algorithm to analyze these data subsets to discover the potential sequence patterns between the load data and the meteorological data. Among them, these sequence patterns describe the change trends and periodic laws of the load data under different meteorological conditions. Obtain the current load data in real time from the monitoring system of the microgrid. These data usually include information such as real-time load values and load change trends. Obtain the current meteorological data from a meteorological monitoring station or a meteorological data provider. These data include elements such as temperature, humidity, wind speed, and precipitation. Match the current load data and meteorological data with all the sequence patterns mined previously. By comparing the load change trends and meteorological conditions in the current data with those in the sequence patterns, determine which sequence patterns are most relevant to the current situation. Output the set of sequence patterns that are most relevant to the current load data and meteorological data through matching.
[0050] Furthermore, the embodiment of the present application uses a time series pattern mining algorithm to extract patterns independent of the fixed pattern length. These patterns reveal all the available relationships between data resources and are a new method for load forecasting in the presence of meteorological data. After extracting all the sequence patterns, perform load forecasting by matching the last behavior of the microgrid load, that is, the current data of the microgrid and all the available patterns, and select the relevant sequence patterns through future load forecasting. Since the SPM algorithm is applicable to discrete inputs, the relevant sequence patterns can only predict the range of future loads.
[0051] Furthermore, Figure 2 The following is a schematic diagram of a hybrid SPM-LSTM model provided by the embodiment of the present application, as Figure 2As shown, to achieve load forecasting, four stages of data discretization, dataset partitioning, time series pattern mining, and LSTM network tuning are required. The data discretization stage is to convert a large amount of continuous data into typical finite values. The methods of discretization include quantile or equal frequency, range or equal width, entropy-based, merge-based, and Kmeans clustering-based discretization. In microgrid load forecasting, temperature, humidity, wind speed, and load data are discretized. After this stage, all historical data in the dataset can be used in a suitable way for pattern mining in the subsequent stages. The dataset partitioning stage is to divide the dataset into a typical small amount of data. In this stage, the load dataset is divided into multiple parts, and each part only contains load data for a specific time period.
[0052] The time series pattern mining stage is to use the time series pattern mining algorithm (SPM) to extract time series patterns for the detection of future events in load forecasting.
[0053] Specifically, based on the function:
[0054]
[0055] All sequence patterns corresponding to the microgrid are determined;
[0056] Among them, min_sup is the support threshold, and the size of the support threshold is determined according to the size and data distribution of the dataset; DS is the input data subset; φ is the empty set; P S (min_sup) is all the extracted sequence patterns; Prefixspan is the sequence pattern mining algorithm.
[0057] Based on the function:
[0058]
[0059] Relevant sequence patterns are determined;
[0060] Among them, E Target is the current data corresponding to the microgrid; is the relevant sequence pattern; P S (min_sup) is all the extracted sequence patterns; ValidPattern is to separate the relevant sequence patterns from all the sequence patterns according to the target event.
[0061] At the end of this SPM algorithm, a set of effective patterns that can be used for future load forecasting is obtained. The pattern attributes are discrete, and the predicted load is also a discrete value. In the next stage, the LSTM network is used to perform non-discretized prediction on the load.
[0062] S103. Determine the reference data subset based on the relevant sequence patterns in multiple data subsets.
[0063] In one embodiment of the present application, a first time series period corresponding to a relevant sequence pattern is determined, and second time series periods corresponding to multiple data subsets are determined. The first time series period is matched with the second time series periods, and a reference data subset is determined from the multiple data subsets based on the matching result.
[0064] Specifically, after determining the sequence pattern most relevant to the current load data and meteorological data through sequence pattern mining (SPM), the time period corresponding to this sequence pattern in the original dataset is found, which is the first time series period. According to the criteria used for dividing data subsets based on time series periods before, the time period corresponding to each data subset is determined, which is the second time series period. The first time series period is compared one by one with the second time series periods of the multiple data subsets to find the data subset that is closest to or coincides with the first time series period. According to the matching result, the data subset that is closest to or coincides with the first time series period is selected as the reference data subset.
[0065] S104. Select a reference LSTM model from a preset set of LSTM models according to the time series period corresponding to the reference data subset.
[0066] In one embodiment of the present application, multiple training sets are constructed based on multiple data subsets. Multiple LSTM models are respectively trained based on the multiple training sets; among them, the multiple LSTM models have the same basic structure. A preset set of LSTM models is constructed based on the trained multiple LSTM models.
[0067] Specifically, multiple training sets are constructed based on multiple data subsets, and the data in different training sets respectively correspond to different time series periods. Secondly, the embodiments of the present application design LSTM models with the same basic structure. These models are consistent in aspects such as the number of layers, the number of LSTM units in each layer, and the activation function to ensure their comparability. These LSTM models are respectively trained using different training sets. For example, one training set can be used to train one LSTM model, so that the multiple trained LSTM models are respectively obtained by different training sets. A preset set of LSTM models is constructed based on the trained multiple LSTM models.
[0068] In one embodiment of the present application, a query is made in a preset set of LSTM models according to the time series period corresponding to the reference data subset to determine an LSTM model that matches the time series period corresponding to this reference data subset as the reference LSTM model.
[0069] S105. Perform load forecasting on the microgrid based on the reference data subset and the reference LSTM model.
[0070] In one embodiment of the present application, the times corresponding to the respective data in the reference data subset are determined. Based on the chronological order of the times, the respective data in the reference data subset are sequentially input into the reference LSTM model. Among them, the data output corresponding to the previous time of the reference LSTM model is used as the data input for the next time. Based on the final output result corresponding to the reference LSTM, the load prediction result for the microgrid is obtained.
[0071] Specifically, before inputting the reference data subset into the LSTM model, it is first necessary to ensure that each data point has a clear timestamp. The timestamp is used to identify the collection time of the data point and is an indispensable piece of information in time series analysis. According to the chronological order of the timestamps, the data in the reference data subset are sequentially input into the reference LSTM model. That is, the data at an earlier time point will be input first, and the data at a later time point will be input subsequently. In the LSTM model, the data output of the previous time point, also known as the hidden state or memory, is used as the data input for the next time point. This mechanism enables the LSTM model to capture long-term dependencies in time series data. After all the data in the reference data subset have been input into the LSTM model, the model will output a final result. This result is the load prediction value for one or more future time points.
[0072] In the LSTM network tuning stage, the appropriate network is selected according to the patterns extracted in the time series pattern mining stage to determine the predicted load. Figure 3 The following is a schematic diagram of an LSTM network provided by an embodiment of the present application, as Figure 3 shown, each neural network consists of two LSTM hidden layers and a dense neural network. The LSTM has three gates, including the forget gate, the input gate, and the output gate.
[0073] Specifically, based on the function:
[0074] f t = σ(W fx ·X t + W fh ·H t-1 + B f )
[0075] Through the forget gate in the reference LSTM model, the proportion of the previous information that needs to be retained in each time period is determined;
[0076] Based on the function:
[0077] i t = σ(W ix ·X t + W ih ·H t-1 + B i )
[0078] Determine the proportion of new information that needs to be combined with previous information by referring to the input gate in the LSTM model;
[0079] Based on the function:
[0080] C t = f t * C t-1 + i t * tanh(W cx · X t + W ch · H t-1 + B c )
[0081] Determine the storage cell state of the new information;
[0082] Based on the function:
[0083] o t = σ(W ox · X t + W oh · H t-1 + B o )
[0084] Determine the proportion of the combined new information by referring to the output gate in the LSTM model;
[0085] Based on the function:
[0086] H t = o t * tanh(C t )
[0087] Define the final output as the hidden state;
[0088] where σ(x) is the sigmoid function tanh(x) is the tanh function X t is the input at time t; f t is the output of the forget gate at time t; i t is the output of the input gate at time t; o t is the output of the output gate at time t; C t is the storage cell state at time t, C t-1 is the storage cell state at time t - 1, H t is the hidden state at time t; H t-1 is the hidden state at time t - 1; W fx is the first weight matrix, W fh is the second weight matrix, Wix is the third weight matrix, W ih is the fourth weight matrix, W cx is the fifth weight matrix, W ch is the sixth weight matrix, W ox is the seventh weight matrix, W oh is the eighth weight matrix, B f is the first bias vector, B i is the second bias vector, B c is the third bias vector, B o is the fourth bias vector.
[0089] Use the trained LSTM network for load forecasting, extract appropriate patterns, and select the corresponding network according to the extracted patterns to determine the finally predicted load.
[0090] The embodiments of the present application construct an advanced and available prediction model in the industry. The energy management system is responsible for managing the efficient, stable, and economic operation of the microgrid. The embodiments of the present application provide an accurate load forecasting method for the microgrid energy management system. Secondly, the embodiments of the present application innovatively combine the SPM algorithm with the LSTM network and propose a hybrid SPM-LSTM method. SPM is applicable to discrete data but can only find repeated patterns; LSTM can be used for both discrete data and continuous data, but for large datasets, LSTM has the problem of overfitting. This method uses SPM to extract sequence patterns, selects the interval of future load according to the relevant patterns, and then uses the LSTM network to determine the accurate future load according to the selected patterns using the relevant LSTM. The extracted patterns are independent of the pattern length and are applicable to larger datasets and wider scenarios. In addition, the embodiments of the present application have more efficient and accurate prediction results compared with other mainstream prediction methods. Compared with methods such as LSTM, LSTM-ANN, and CNN-GA, the SPM-LSTM method has a higher accuracy rate with shorter training time and response time. The embodiments of the present application segment the training data based on the results of the extracted patterns and use a large number of LSTM networks at the same time, reducing the training time and improving the prediction accuracy rate. In addition, the embodiments of the present application have high adaptability and flexibility and can be deployed and run on terminal devices such as servers and edge workstations in the form of a program product, applicable to various Internet of Things and microgrid application scenarios, and can better meet the load forecasting requirements of the energy management system, providing a new method for microgrid energy management and operation.
[0091] Figure 4 is the structural schematic diagram of a load forecasting device based on SPM-LSTM provided by the embodiments of the present application. As Figure 4As shown in the figure, the load forecasting device 200 based on SPM-LSTM includes: at least one processor 201; and a memory 202 communicatively connected to the at least one processor 201; wherein, the memory 202 stores instructions executable by the at least one processor 201, and the instructions are executed by the at least one processor 201 to enable the at least one processor 201 to: obtain the input of historical load data and historical meteorological data corresponding to the microgrid, construct a data set containing load time series data based on the historical load data and historical meteorological data, and divide the data set into multiple data subsets based on the time series period; use the multiple data subsets as the input of the SPM, and determine the relevant sequence patterns through the current data corresponding to the microgrid and the SPM; wherein, the relevant sequence patterns are used to represent the correlation between the load data and the meteorological data; determine the reference data subset from the multiple data subsets based on the relevant sequence patterns; select the reference LSTM model from the preset LSTM model set according to the time series period corresponding to the reference data subset; and perform load forecasting on the microgrid based on the reference data subset and the reference LSTM model.
[0092] A non-volatile computer storage medium provided by an embodiment of the present application stores computer-executable instructions, and the computer-executable instructions are set to: obtain the input of historical load data and historical meteorological data corresponding to the microgrid, construct a data set containing load time series data based on the historical load data and historical meteorological data, and divide the data set into multiple data subsets based on the time series period; use the multiple data subsets as the input of the SPM, and determine the relevant sequence patterns through the current data corresponding to the microgrid and the SPM; wherein, the relevant sequence patterns are used to represent the correlation between the load data and the meteorological data; determine the reference data subset from the multiple data subsets based on the relevant sequence patterns; select the reference LSTM model from the preset LSTM model set according to the time series period corresponding to the reference data subset; and perform load forecasting on the microgrid based on the reference data subset and the reference LSTM model.
[0093] The embodiments in the present application are all described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the device, equipment, and non-volatile computer storage medium, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0094] The above description is only for the embodiments of the present application and is not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the embodiments of the present application. These modifications or substitutions do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A load forecasting method based on SPM-LSTM, characterized in that: The method comprises: Obtain historical load data and historical meteorological data input corresponding to the microgrid, construct a data set including load time series data based on the historical load data and the historical meteorological data, and divide the data set into multiple data subsets based on time series time periods; Using the plurality of data subsets as inputs of the SPM, determining a related sequence pattern through current data corresponding to the microgrid and the SPM; wherein the related sequence pattern is used to represent the correlation relationship between the load data and the meteorological data; Determining a reference data subset from the plurality of data subsets based on the related sequence pattern; Selecting a reference LSTM model from a preset LSTM model set according to the time series time period corresponding to the reference data subset; Based on the reference data subset and the reference LSTM model, load forecasting is performed on the microgrid.
2. According to the load forecasting method based on SPM-LSTM in claim 1, it is characterized in that: The method of using the plurality of data subsets as inputs of the SPM and determining a related sequence pattern through current data corresponding to the microgrid and the SPM specifically includes: Using the plurality of data subsets as inputs to the SPM, and determining all sequence patterns corresponding to the microgrid through the SPM; Obtaining current load data and current meteorological data corresponding to the microgrid; Based on the current load data and the current meteorological data, matching is performed among all the sequence patterns to determine the relevant sequence pattern.
3. The load forecasting method based on SPM-LSTM according to claim 2 is characterized in that: The method of using the plurality of data subsets as inputs of the SPM and determining all sequence patterns corresponding to the microgrid through the SPM specifically includes: Function-based: Determine all sequence modes corresponding to the microgrid; Among them, min_sup is the support threshold; DS is the input data subset; φ is the empty set; P S (min_sup) is the total sequence patterns extracted; Prefixspan is the sequence pattern mining algorithm.
4. The load forecasting method based on SPM-LSTM according to claim 2 is characterized in that: The matching among all the sequence patterns based on the current load data and the current meteorological data to determine the relevant sequence pattern specifically includes: Function-based: determining the relevant sequence pattern; Among them, E Target is the current data corresponding to the microgrid; is the correlation sequence pattern; P S (min_sup) is all the extracted sequence patterns; ValidPattern is the relevant sequence patterns separated from all the sequence patterns according to the target event.
5. The load forecasting method based on SPM-LSTM according to claim 1 is characterized in that: Determining a reference data subset from the plurality of data subsets based on the related sequence pattern specifically includes: Determining a first time sequence time period corresponding to the relevant sequence pattern; and determining second time series time periods corresponding to the plurality of data subsets respectively; The first time series time period is matched with the second time series time period, and the reference data subset is determined from the plurality of data subsets based on the matching result.
6. The load forecasting method based on SPM-LSTM according to claim 1, characterized in that: Before selecting a reference LSTM model from a preset LSTM model set according to the time series time period corresponding to the reference data subset, the method further includes: Based on the plurality of data subsets, construct a plurality of training sets; Based on the multiple training sets, multiple LSTM models are trained respectively; wherein the multiple LSTM models have the same basic structure; Based on the trained multiple LSTM models, the preset LSTM model set is constructed.
7. The load forecasting method based on SPM-LSTM according to claim 1 is characterized in that: The performing load forecasting on the microgrid based on the reference data subset and the reference LSTM model specifically includes: Determine the time corresponding to each data in the reference data subset; Based on the time sequence, each data in the reference data subset is sequentially input into the reference LSTM model; The data output of the previous time corresponding to the reference LSTM model is used as the data input of the next time; Based on the final output result corresponding to the reference LSTM, a load prediction result for the microgrid is obtained.
8. The load forecasting method based on SPM-LSTM according to claim 1, characterized in that: The performing load forecasting on the microgrid based on the reference data subset and the reference LSTM model specifically includes: Function-based: f t =σ(W fx ·X t +W fh ·H t-1 +B f ) Determine the proportion of previous information that needs to be retained in each time period through the forget gate in the reference LSTM model; Function-based: i t =σ(W ix ·X t +W ih ·H t-1 +B i ) Determining, through an input gate in the reference LSTM model, a proportion of new information that needs to be combined with the previous information; Function-based: C t =f t *C t-1 +i t *tanh(W cx ·X t +W ch ·H t-1 +B c ) Determining a storage unit state of the new information; Function-based: o t =σ(W ox ·X t +W oh ·H t-1 +B o ) Determining the proportion of the combined new information through the output gate in the reference LSTM model; Function-based: H t =o t *tanh(C t ) Define the final output as the hidden state; Where σ(x) is the sigmoid function tanh(x) is the tanh function X t is the input at time t; f t is the output of the forget gate at time t; i t is the output of the input gate at time t; o t is the output of the output gate at time t; C t is the state of the memory cell at time t, C t-1 is the state of the memory cell at time t-1, H t is the hidden state at time t; H t-1 is the hidden state at time t-1; W fx is the first weight matrix, W fh is the second weight matrix, W ix is the third weight matrix, W ih is the fourth weight matrix, W cx is the fifth weight matrix, W ch is the sixth weight matrix, W ox is the seventh weight matrix, W oh is the eighth weight matrix, B f is the first deviation vector, B i is the second deviation vector, B c is the third deviation vector, B o is the fourth deviation vector.
9. A load forecasting device based on SPM-LSTM, characterized in that: The device comprises a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to execute the method according to any one of claims 1 to 8.
10. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions can execute the method according to any one of claims 1 to 8.
Citation Information
Cited By
Power supply insurance trend prediction method based on deep learning
CN121011990A