Load prediction method based on time sequence library and time sequence model
Through the power load prediction method based on the timing library and Seq2Seq model, the data storage and processing challenges of deep learning in power load prediction are solved, accurate prediction and real-time scheduling of power loads are achieved, and the stability and cost of power system are improved. benefit.
Patent Information
- Application Number
- CN202410935040.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-11-01
AI Technical Summary
The existing power load prediction methods are difficult to effectively utilize deep learning, and face challenges such as data storage and processing, model selection and parameter optimization, and cannot fully explore the internal laws and dynamic changes of power load.
Using load prediction methods based on timing library and timing model, the historical power timing data is obtained for preprocessing and reconstruction, and the prediction model is generated using distributed storage technology and Seq2Seq time series prediction model, and data storage is combined with InfluxDB timing library and Seq2Seq model. and prediction.
Accurate prediction of power loads is achieved, prediction accuracy and real-time performance is improved, nonlinear characteristics and long-term dependencies of load data can be better fitted, and has good scalability, reducing energy waste and equipment overload, and optimized The operating cost of the power system.
Smart Images

Figure CN118889392A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electric power technology, and in particular to a load forecasting method based on a time series library and a time series model. Background Art
[0002] Thanks to the continuous development of big data, computing power and artificial intelligence algorithms, the new generation of artificial intelligence has been widely used in the fields of power system optimization operation, prediction, fault diagnosis, etc. Power load forecasting is an important part of smart grid management, and is of great significance to the stable operation of the power system, energy dispatch, energy conservation and emission reduction, and sustainable development of the power system. Traditional load forecasting methods are mainly based on statistical models, such as linear regression and support vector machines. These methods usually only consider the simple statistical characteristics of historical load data and cannot capture the inherent laws and dynamic change characteristics of load data. In recent years, deep learning has achieved remarkable results in the field of time series forecasting. By constructing complex neural network models, it can automatically learn nonlinear features and long-term dependencies in data. However, the application of deep learning to power load forecasting still faces challenges such as data storage and processing, model selection, and parameter optimization.
[0003] Time series data is data collected in chronological order, and has characteristics such as trend, periodicity, seasonality, random volatility, autocorrelation, stationarity, and hysteresis. With the rapid development of smart grids, accurate prediction of power load has become an important means to ensure stable power supply. Traditional load forecasting methods are mainly based on statistical models, which cannot fully explore the inherent laws and dynamic change characteristics of power load. In recent years, deep learning has achieved remarkable results in the field of time series forecasting, but how to apply deep learning to power load forecasting still faces challenges such as data storage and processing, model selection, and parameter optimization.
[0004] Currently, no effective solution has been proposed for the problems in the related technologies. Summary of the invention
[0005] In view of this, the present invention provides a load forecasting method based on a time series library and a time series model to solve the above-mentioned challenges of how to apply deep learning to power load forecasting, such as data storage and processing, model selection and parameter optimization.
[0006] In order to solve the above problems, the specific technical solutions adopted by the present invention are as follows:
[0007] A load forecasting method based on a time series library and a time series model, the load forecasting method based on the time series library and the time series model comprises the following steps:
[0008] S1. Acquire historical power time series data of the power system, process the historical power time series data according to a preset data conversion processing algorithm, and obtain a sample data set, wherein the historical power time series data includes power load data and environmental observation data;
[0009] S2. Using the principle of distributed storage technology, the sample data set is deployed and stored in the time series library;
[0010] S3, obtain a sample data set from the time series library, and use the time series prediction model to perform algorithm training to generate a prediction model for power load;
[0011] S4. Use the trained prediction model to predict the load of the power system and formulate a power dispatch strategy based on the prediction results.
[0012] Preferably, obtaining historical power time series data of the power system, processing the historical power time series data according to a preset data conversion processing algorithm, and obtaining a sample data set includes the following steps:
[0013] S11, preprocessing the acquired historical power time series data, the preprocessing including missing value processing, noise removal and outlier processing;
[0014] S12, reconstructing the preprocessed historical power time series data to obtain a load demand interval sequence;
[0015] S13. Use the support vector machine algorithm to build a conversion network model, perform a benchmark conversion on the load demand interval sequence, and establish a sample data set based on the conversion results.
[0016] Preferably, the preprocessed historical power time series data is subjected to data reconstruction processing to obtain a load demand interval sequence, which includes the following steps:
[0017] S121, decomposing the preprocessed historical power time series data into different power equipment according to the type of power equipment;
[0018] S122, converting the decomposed historical power time series data into a binary form according to a preset time interval to obtain a binary load demand sequence; the binary load demand sequence is a sequence consisting of 0 and 1, where 1 indicates load demand and 0 indicates no load demand;
[0019] S123, performing sequence conversion on the obtained binary load demand sequence, deleting 0 in the binary load demand sequence, and obtaining a continuous sequence with load demand intervals.
[0020] Preferably, using a support vector machine algorithm to construct a conversion network model, benchmarking the load demand interval sequence, and establishing a sample data set based on the conversion result includes the following steps:
[0021] S131, performing correlation analysis on the power load data and environmental observation data in the historical power time series data, and selecting environmental impact factor data that meets the preset correlation;
[0022] S132. For each sample in the power load data, calculate the factor change amount between the environmental impact factor data of each sample and the reference environmental impact factor data;
[0023] S133, constructing and training a conversion network model based on a support vector machine algorithm, taking a load demand interval sequence and a factor variation as inputs of the conversion network model, and setting the output of the conversion network model as demand information under a target benchmark environment;
[0024] S134, using the trained conversion network model to convert the actual load demand interval sequence of each sample into a load demand sequence under a reference environment;
[0025] S135. Construct a sample data set based on the converted benchmark environmental requirement information and the corresponding environmental factor data.
[0026] Preferably, the expression of the conversion network model is:
[0027]
[0028] In the formula, F(x) represents the expression of the conversion network model;
[0029] x represents the input feature vector, including the load demand interval sequence and the change of environmental factors;
[0030] x i represents the support vector;
[0031] b i Positive weights for data points representing support vectors;
[0032] b i * Negative weights for data points representing support vectors;
[0033] k(x,x i ) represents the kernel function;
[0034] c represents the offset amount.
[0035] Preferably, utilizing the principle of distributed storage technology, deploying and storing the sample data set in the time series library includes the following steps:
[0036] S21, compressing the sample data set using a revolving door compression algorithm;
[0037] S22, dividing the compressed sample data set into blocks according to a preset data size, and writing the block data into data nodes in sequence through a queue response method based on a preset data pipeline;
[0038] S23, creating an index structure for the block data according to a preset index strategy;
[0039] S24. After the block data is successfully written to all data nodes, update the metadata of the file, including the file size, modification time and the storage location of the block data;
[0040] S25. Integrate the load demand sequence under the reference environment and the corresponding environmental factor data, and store them in a time series database.
[0041] Preferably, compressing the sample data set using the revolving door compression algorithm comprises the following steps:
[0042] S211, initializing compression parameters, including setting a threshold value and a minimum storage time interval of a revolving door algorithm;
[0043] S212, reading data points in the sample data set, and dynamically adjusting the storage interval time according to the magnitude of the value change of the data points based on the adaptive variable frequency data storage strategy;
[0044] S213. In each storage time interval, the revolving door algorithm is used to compress the data, and data points outside the parallelogram are selected as key points for storage.
[0045] Preferably, obtaining a sample data set from a time series library and using a time series prediction model for algorithm training to generate a prediction model for power load includes the following steps:
[0046] S31, dividing the sample data set into a training set, a validation set and a test set according to a preset ratio;
[0047] S32. Build a Seq2Seq time series prediction model based on the training set and train the model using the back propagation algorithm and gradient descent optimizer;
[0048] S33, using the validation set to validate the Seq2Seq time series prediction model, and adjusting the model parameters according to the validation results;
[0049] S34. Use the test set to evaluate the performance of the Seq2Seq time series prediction model and generate a power load prediction model.
[0050] Preferably, constructing a Seq2Seq time series prediction model, and training the model based on the training set by back propagation algorithm and gradient descent optimizer comprises the following steps:
[0051] S321, constructing a structure of a Seq2Seq time series prediction model, the structure including an encoder and a decoder;
[0052] S322, randomly initialize the parameters of the Seq2Seq time series prediction model, including the weights and biases of the encoder and decoder;
[0053] S323. Based on the training set data, the Seq2Seq time series prediction model is trained and parameter optimized through the back propagation algorithm.
[0054] Preferably, based on the training set data, training and parameter optimization of the Seq2Seq time series prediction model by back propagation algorithm includes the following steps:
[0055] S3231, extracting the load demand sequence and the corresponding environmental factor data under the benchmark environment from the training set, and obtaining the prediction result through the Seq2Seq time series prediction model;
[0056] S3232, comparing the predicted result with the true label, and calculating the loss function value;
[0057] S3233. Calculate the gradient of the loss function with respect to the parameters of the Seq2Seq time series prediction model according to the chain rule;
[0058] S3234. Update the Seq2Seq time series prediction model parameters by using a stochastic gradient descent optimization algorithm according to the obtained gradient;
[0059] S3235. Repeat steps S3232 to S3234 until a preset number of iterations is reached.
[0060] The beneficial effects of the present invention are:
[0061] 1. The present invention realizes accurate prediction of power load by combining InfluxDB time series library and Seq2Seq time series model, and improves the quality of load data and observation data through data preprocessing, thereby improving prediction accuracy; improves data processing efficiency and the ability to extract dynamic characteristics of data by optimizing data storage and query schemes; and improves prediction accuracy by introducing Seq2Seq network structure, its advanced encoder-decoder structure, gated recurrent unit and attention mechanism.
[0062] 2. The present invention realizes distributed storage and efficient query of large-scale historical load data and meteorological observation data by using the InfluxDB time series library. The time series library is optimized for time series data, provides efficient storage, query and analysis capabilities, and improves the real-time and efficiency of data processing. Due to the use of efficient storage and query solutions and parallel computing technology, the present invention can quickly respond to real-time load data and make timely predictions, which is conducive to real-time scheduling and optimized operation of the power system and meets the needs of stable power supply.
[0063] 3. The present invention adopts the Seq2Seq model, which can capture the inherent laws and dynamic change characteristics of load data, thereby improving the prediction accuracy. Compared with traditional statistical models, the prediction method of the present invention can better fit the nonlinear characteristics and long-term dependencies of actual load data, and has good scalability. As the amount of data increases, the processing capacity of the system can be expanded by adding storage nodes or adjusting model parameters. At the same time, the Seq2Seq model itself has good scalability and can be used in combination with other advanced models to further improve the prediction accuracy.
[0064] 4. The present invention protects the stability and reliability of the entire prediction system by ensuring the accuracy and consistency of data preprocessing, the stability of model training and the reliability of prediction results, which is crucial for the safe and stable operation of the power system. By improving the prediction accuracy and real-time performance, the present invention can help the power system reduce unnecessary energy waste and equipment overload, thereby reducing operating costs. At the same time, by optimizing the data processing process, it can reduce manual intervention and computing resource consumption, further reducing costs.
[0065] 5. The present invention converts data into a format that is easier for the model to understand and process through data reconstruction processing, especially converting time series data into a binary load demand sequence, and further obtaining a load demand interval sequence, which helps the model capture the periodicity and volatility of the power load. Through correlation analysis, environmental influencing factor data that meets the preset correlation is selected, and the factor change amount is calculated, so that the model can take into account the impact of environmental factors on the power load, thereby improving the accuracy of the prediction. The support vector machine algorithm is used to construct a conversion network model, and the load demand interval sequence is benchmarked, so that the model can predict the power load demand under a specific benchmark environment, which is helpful to formulate a more scientific and reasonable power dispatching strategy. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0067] Figure 1 is a flow chart of a load forecasting method based on a time series library and a time series model according to an embodiment of the present invention;
[0068] Figure 2 It is a schematic diagram of storing time series data in InfluxDB in a load forecasting method based on a time series library and a time series model according to an embodiment of the present invention;
[0069] Figure 3 is a schematic diagram of an encoder-decoder structure in a load prediction method based on a time series library and a time series model according to an embodiment of the present invention;
[0070] Figure 4 is a schematic diagram of an RNN network structure in a load forecasting method based on a time series library and a time series model according to an embodiment of the present invention;
[0071] Figure 5 1 is a schematic diagram of the network structure of LSTM in a load forecasting method based on a time series library and a time series model according to an embodiment of the present invention;
[0072] Figure 6 is a schematic diagram of the network structure of a GRU in a load forecasting method based on a time series library and a time series model according to an embodiment of the present invention;
[0073] Figure 7 is a structural schematic diagram of an attention mechanism layer in a load forecasting method based on a time series library and a time series model according to an embodiment of the present invention;
[0074] Figure 8 It is a structural schematic diagram of a Seq2Seq network model in a load forecasting method based on a time series library and a time series model according to an embodiment of the present invention;
[0075] Fig. 9 is a flow chart of the operation of a load forecasting method based on a time series library and a time series model according to an embodiment of the present invention;
[0076] Fig.10 It is a schematic diagram of test set error comparison in a load forecasting method based on a time series library and a time series model according to an embodiment of the present invention;
[0077] Fig.11It is a schematic diagram of prediction results of using the Attention_LSTM algorithm for a test set in a load prediction method based on a time series library and a time series model according to an embodiment of the present invention;
[0078] Fig.12 It is a schematic diagram of prediction results of using the GRU algorithm for a test set in a load prediction method based on a time series library and a time series model according to an embodiment of the present invention;
[0079] Fig.13 It is a schematic diagram of prediction results of using the GRU-FCN algorithm for a test set in a load prediction method based on a time series library and a time series model according to an embodiment of the present invention;
[0080] Fig.14 It is a schematic diagram of prediction results of using Seq2Seq algorithm for a test set in a load prediction method based on a time series library and a time series model according to an embodiment of the present invention. DETAILED DESCRIPTION
[0081] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0082] According to an embodiment of the present invention, a load forecasting method based on a time series library and a time series model is provided.
[0083] The present invention is further described with reference to the accompanying drawings and specific embodiments. Figure 1 As shown, according to the load forecasting method based on the time series library and the time series model according to an embodiment of the present invention, the load forecasting method based on the time series library and the time series model includes the following steps:
[0084] S1. Acquire historical power time series data of the power system, process the historical power time series data according to a preset data conversion processing algorithm, and obtain a sample data set, wherein the historical power time series data includes power load data and environmental observation data;
[0085] It should be noted that the historical load data obtained from the power system and the environmental information collected from the meteorological department (such as temperature, humidity, air pressure, rainfall, wind speed, sunshine time, etc.)
[0086] As a preferred implementation, obtaining historical power time series data of the power system, processing the historical power time series data according to a preset data conversion processing algorithm, and obtaining a sample data set includes the following steps:
[0087] S11, preprocessing the acquired historical power time series data, the preprocessing including missing value processing, noise removal and outlier processing;
[0088] It should be noted that preprocessing the acquired historical power time series data is an important step in data analysis and model training, because it can ensure the integrity and accuracy of the data, thereby improving the accuracy of subsequent predictions or analysis.
[0089] Missing value processing includes: first, scanning the data set to see which values are missing. These values are usually specially marked or displayed as blank. If the missing value ratio is small and has little impact on the overall data analysis, you can choose to delete the samples or features containing missing values. If the missing values have an impact on the overall data analysis, use the mean, median, mode, etc. to fill in the numerical data, or use the most frequently occurring category to fill in the categorical data.
[0090] Noise removal involves first identifying noise, which usually appears as values that are significantly different from the surrounding data. Then, a filter (such as a mean filter or a median filter) is used to smooth the data to reduce the effect of the noise, or a threshold is set, and values below or above the threshold are considered noise and removed.
[0091] Outlier processing includes: if the number of outliers is small and has little impact on the overall data analysis, you can choose to delete the outliers. Or use appropriate values (such as mean, median, mode, etc.) to replace the outliers.
[0092] S12, reconstructing the preprocessed historical power time series data to obtain a load demand interval sequence;
[0093] As a preferred implementation, the preprocessed historical power time series data is subjected to data reconstruction processing to obtain a load demand interval sequence, which includes the following steps:
[0094] S121, decomposing the preprocessed historical power time series data into different power equipment according to the type of power equipment;
[0095] It should be noted that decomposing the pre-processed historical power time series data according to the type of power equipment is a key step in data analysis and equipment performance evaluation. Power equipment mainly includes two categories: power generation equipment and power supply equipment. Power generation equipment mainly includes power station boilers, steam turbines, gas turbines, turbines, generators, transformers, etc.; power supply equipment mainly includes transmission lines of various voltage levels, mutual inductors, contactors, etc.
[0096] For generators, the time series data such as power generation, operating time, efficiency, etc. of each generator can be decomposed. For transformers, the time series data such as load rate, oil temperature, operating voltage, etc. of each transformer can be decomposed. For turbines, steam turbines, etc., the time series data related to their operating status can also be decomposed, such as speed, flow, temperature, etc. For transmission lines, the time series data such as voltage, current, power factor, etc. of each line can be decomposed.
[0097] For the mutual inductor, the voltage and current of the primary and secondary sides can be decomposed into timing data. For the contactor, the switching state, operation times and other timing data can be decomposed into timing data.
[0098] S122, converting the decomposed historical power time series data into a binary form according to a preset time interval to obtain a binary load demand sequence; the binary load demand sequence is a sequence consisting of 0 and 1, where 1 indicates load demand and 0 indicates no load demand;
[0099] It should be noted that converting the decomposed historical power time series data into a binary load demand sequence specifically includes the following steps:
[0100] Determine a preset time interval, which will be used to divide the power time series data. The choice of time interval depends on the specific application requirements and data characteristics. For example, you can choose every minute, every hour, every day, etc. as the time interval;
[0101] For each preset time interval, the power time series data within the time interval needs to be aggregated, and the aggregation method can be summation, averaging or other statistical methods;
[0102] Set a threshold to determine whether there is load demand in each time interval. This threshold can be a statistical value based on historical data (such as average, median, etc.) or a fixed value set according to actual demand. The setting of the threshold will directly affect the generation of the binary load demand sequence;
[0103] A binary load demand sequence is generated based on the aggregated power data in each time interval and the set threshold. If the power data in a certain time interval exceeds (or is equal to, depending on the specific requirements) the set threshold, then the binary load demand sequence corresponding to the time interval is marked as 1, indicating that there is load demand; otherwise, it is marked as 0, indicating that there is no load demand.
[0104] S123, performing sequence conversion on the obtained binary load demand sequence, deleting 0 in the binary load demand sequence, and obtaining a continuous sequence with load demand intervals.
[0105] It should be noted that starting from the start position of the binary load demand sequence, the elements in the sequence are traversed one by one. When the first 1 is encountered, its position is recorded as the starting point of the continuous load demand interval. Then continue to traverse until 0 is encountered. At this time, the previous position of the 0 is recorded as the end point of the continuous load demand interval. If the sequence ends with 1, make sure to record the position of this 1 as the end point of the last continuous load demand interval. Using the recorded start and end points, create a new sequence representing the continuous load demand interval.
[0106] S13. Use the support vector machine algorithm to build a conversion network model, perform a benchmark conversion on the load demand interval sequence, and establish a sample data set based on the conversion results.
[0107] As a preferred implementation, a conversion network model is constructed using a support vector machine algorithm, a load demand interval sequence is converted to a benchmark, and a sample data set is established based on the conversion result, including the following steps:
[0108] S131, performing correlation analysis on the power load data and environmental observation data in the historical power time series data, and selecting environmental impact factor data that meets the preset correlation;
[0109] It should be noted that the following steps are involved in performing correlation analysis on the power load data and environmental observation data in the historical power time series data and selecting environmental impact factor data that meets the preset correlation:
[0110] Since the units and dimensions of power load data and environmental observation data are different, in order to eliminate the impact of these differences on correlation analysis, the data are standardized or normalized;
[0111] The Pearson correlation coefficient method is used to calculate the correlation between the power load data and each environmental influencing factor in the environmental observation data;
[0112] According to business needs or expert experience, one or more preset correlation thresholds are set, and environmental influencing factors that have a significant correlation with the power load data are screened out based on the calculated correlation and the preset correlation threshold.
[0113] S132. For each sample in the power load data, calculate the factor change amount between the environmental impact factor data of each sample and the reference environmental impact factor data;
[0114] It should be noted that the ratio of the environmental impact factor data of each sample to the baseline environmental impact factor data is calculated as the factor change amount.
[0115] S133, constructing and training a conversion network model based on a support vector machine algorithm, taking a load demand interval sequence and a factor variation as inputs of the conversion network model, and setting the output of the conversion network model as demand information under a target benchmark environment;
[0116] It should be noted that building and training a conversion network model based on a support vector machine algorithm includes the following steps:
[0117] Select radial basis function as kernel function and set the parameters of the conversion network model, such as penalty coefficient C, kernel function parameters, etc.
[0118] The load demand interval sequence and the calculated factor changes are combined into an input feature vector, and the conversion network model is trained. During the training process, the model will learn how to map the input feature vector to the demand information under the target baseline environment.
[0119] Specifically, the expression of the conversion network model is:
[0120]
[0121] In the formula, F(x) represents the expression of the conversion network model;
[0122] x represents the input feature vector, including the load demand interval sequence and the change of environmental factors;
[0123] x i represents the support vector;
[0124] b i Positive weights for data points representing support vectors;
[0125] b i * Negative weights for data points representing support vectors;
[0126] k(x,x i ) represents the kernel function;
[0127] c represents the offset amount.
[0128] S134, using the trained conversion network model to convert the actual load demand interval sequence of each sample into a load demand sequence under a reference environment;
[0129] It should be noted that for each sample in the power load data set, its actual load demand interval sequence and the corresponding factor change are extracted, and the actual load demand interval sequence and factor change of each sample are input into the conversion network model, and the model will output the load demand sequence under the benchmark environment.
[0130] S135. Construct a sample data set based on the converted benchmark environmental requirement information and the corresponding environmental factor data.
[0131] S2. Using the principle of distributed storage technology, the sample data set is deployed and stored in the time series library;
[0132] It should be noted that the time series library is InfluxDB, which is an open source distributed time series, event and indicator database written in Go language for storing and analyzing time series data. Its features include: built-in HTTP interface, easy to use; data can be marked, flexible query; SQL-like query statements; simple installation and management, efficient reading and writing of data; real-time query, data can be immediately found after being indexed when written. Its data model consists of Measurement, Point, Fields, Tags, Time and Series.
[0133] To test the access performance of the InfluxDB time series database, we conducted a verification on the public power load data set, which contains load data and various variables related to the power system, such as date and time, power load, weather conditions, etc. These variables can be used to predict future power load. The data is recorded hourly and covers a time span of several years. Figure 2 shown.
[0134] As a preferred implementation, using the principle of distributed storage technology, deploying and storing the sample data set in the time series library includes the following steps:
[0135] S21, compressing the sample data set using a revolving door compression algorithm;
[0136] As a preferred implementation, compressing the sample data set using the revolving door compression algorithm includes the following steps:
[0137] S211, initializing compression parameters, including setting a threshold value and a minimum storage time interval of a revolving door algorithm;
[0138] It should be noted that in the revolving door compression algorithm, the threshold value is an important parameter used to determine which data points should be retained as key points. When the change of a data point exceeds this threshold value, the point will be regarded as a key point and saved. The size of the threshold value directly affects the compression rate and the accuracy of data reconstruction. The threshold value is usually set based on the range of data changes and the required compression rate. A smaller threshold value will retain more data points, improve reconstruction accuracy but reduce the compression rate; conversely, a larger threshold value will improve the compression rate but may sacrifice a certain degree of reconstruction accuracy. You can start with the standard deviation of the data set or a fixed percentage of the data range, and then adjust it according to the actual effect.
[0139] The minimum storage time interval refers to the minimum time interval between two consecutive stored data points. This parameter is set to ensure that even if the data change does not exceed the threshold value, a data point will be stored after a certain time interval to avoid losing too much information during data reconstruction. The setting of the minimum storage time interval requires a trade-off between the time resolution and storage efficiency of the data. If the time resolution of the data set is very high (that is, the sampling frequency is fast), a shorter minimum storage time interval can be set to ensure the capture of key information. If the time resolution of the data set is low, or the real-time requirement is not high, a longer minimum storage time interval can be set to reduce the storage amount.
[0140] S212, reading data points in the sample data set, and dynamically adjusting the storage interval time according to the magnitude of the value change of the data points based on the adaptive variable frequency data storage strategy;
[0141] It should be noted that reading the data points in the sample data set and dynamically adjusting the storage interval time according to the numerical variation of the data points based on the adaptive variable frequency data storage strategy includes the following steps:
[0142] Traverse the sample data set and read the data points one by one. Each data point usually contains a timestamp and a corresponding value;
[0143] At the beginning, a default initial storage interval is set (e.g., a fixed time interval such as 1 minute, 5 minutes, etc.);
[0144] For each data point read, calculate the magnitude of the change in value from the last stored point. This is usually done by taking the difference or relative rate of change between the two values;
[0145] Compare the calculated value change with a preset threshold. This threshold can be set based on the fluctuation of the data and the required accuracy. If the change exceeds the threshold, it indicates that the data point contains important information changes and should be stored;
[0146] If the change of data points is small and does not reach the threshold, the storage interval can be extended to reduce the number of stored data points and improve the compression rate. If the change of data points is large and exceeds the threshold, the storage interval should be shortened to ensure that key information is not missed;
[0147] For each data point that meets the storage condition (i.e., the data point whose change amplitude exceeds the threshold), record its timestamp and value as the key point that needs to be stored;
[0148] Repeat the above steps to continue reading the remaining data points in the data set and dynamically adjust the storage interval according to the magnitude of the value change.
[0149] S213. In each storage time interval, the revolving door algorithm is used to compress the data, and data points outside the parallelogram are selected as key points for storage.
[0150] It should be noted that the set of data points to be processed currently is determined according to the previously dynamically adjusted storage interval time;
[0151] Set the two initial gates (i.e. two lines) of the revolving door algorithm, which will form a parallelogram (or trapezoid). The two lines represent the upper and lower bounds of the data respectively; the width of the initial gate (i.e. the vertical distance between the two lines) is usually determined by the threshold value mentioned above;
[0152] Starting from the first data point of the current storage time interval, traverse all data points in the interval one by one;
[0153] For each data point, check whether it is within the currently formed parallelogram (composed of two gate lines); if the data point is within the parallelogram, it means that the change between it and the previous key point is within an acceptable range, so it does not need to be saved; if the data point is outside the parallelogram, it means that it represents a significant change and needs to be saved as a key point;
[0154] Whenever a key point is encountered, the two lines of the revolving door need to be updated so that they start from the new key point and continue to compress the data; when updating the door line, keep the width of the door (that is, the vertical distance between the two lines) unchanged, but move the start and end points of the door to the new key point.
[0155] All data points (i.e. key points) outside the parallelogram are saved; these key points will represent the main change trends of the data within the current storage time interval.
[0156] In addition, with the advent of the Internet of Things and the 5G era, the amount of data that needs to be collected and stored in the real world is increasing, and the cost of data storage is also increasing. For time series data storage, the compression storage ratio is very important. Generally, a good time series database can achieve about 10:1 (or even higher). The present invention can also use the Gorilla algorithm to first perform a targeted time series compression, and then use the block compression Snappy algorithm to further compress the result of the time series compression.
[0157] The core idea of the Gorilla algorithm is to optimize the storage and query efficiency of time series data through data sharding technology and shard containers. Shards are fixed-length array structures that calculate hash values based on the tags of the time series data and distribute them to the corresponding shards through modulo operations. Each shard uses a map structure internally, using the hash value of the tag as the key to store multiple time series data chunks associated with the tag. Chunks are an array structure that represents a complete time series data. It contains multiple chunks, each of which stores a continuous segment of data in the time series. The number of chunks is determined based on the ratio of the length of time the data is stored in memory to the length of time a single chunk can store data, so that the time series data is reasonably divided and stored in different shards and chunks, thereby optimizing the storage and query efficiency of the data.
[0158] Compared to zip, Snappy has faster compression and decompression rates and a reasonable compression ratio, and does not take up a lot of CPU. On a single Intel Core i7 processor core, it can achieve a compression rate of at least 250MB per second and a decompression rate of 500MB per second, making it particularly suitable for situations where large amounts of data are moved.
[0159] For example, taking the residential electricity load forecast as an example, the residential electricity consumption is relatively stable in most time periods, stable near a certain value, with only occasional fluctuations; for this data feature, differential encoding can be used to achieve effective data compression, and at the same time, a layer of general compression can be done on this basis to further improve the compression rate. Among them, the historical load data and environmental collection data are both floating-point data. The Gorilla algorithm is used to perform targeted time series compression first, and then the block compression Snappy algorithm is used to further compress the results of the time series compression.
[0160] S22, dividing the compressed sample data set into blocks according to a preset data size, and writing the block data into data nodes in sequence through a queue response method based on a preset data pipeline;
[0161] It should be noted that the compressed sample data set is divided into blocks according to the preset data size, and the block data is sequentially written into the data node through the queue response method based on the preset data pipeline, including the following steps:
[0162] Determine the chunk size based on the preset data size (e.g., the maximum number of bytes or data points per chunk); this size should be weighed against factors such as storage capacity, data transfer efficiency, and query performance;
[0163] The compressed sample data set is divided into multiple data blocks according to the determined block size;
[0164] Set up one or more data pipelines to transmit block data; the data pipeline can be a message queue, data stream or other data transmission mechanism, which should be able to support reliable data transmission and parallel processing. And configure the parameters of the data pipeline, such as buffer size, transmission speed limit, etc., to ensure efficient data transmission;
[0165] Implement a queue acknowledgment mechanism in the data pipeline; this means that when a data block is written to the data pipeline, an acknowledgment signal is generated to confirm the successful writing of the data; through the acknowledgment mechanism, the data transmission status can be monitored to ensure that each data block is correctly sent to the next processing stage or data node;
[0166] Data blocks are transmitted to each data node through the data pipeline. Each data node is responsible for storing a portion of the data blocks to achieve distributed storage of data; when writing to data nodes, replication strategies (such as the three-copy strategy) can be used to improve data reliability and fault tolerance; this means that each data block will be replicated to multiple data nodes to prevent data loss caused by single point failures.
[0167] S23, creating an index structure for the block data according to a preset index strategy;
[0168] It should be noted that an index structure is a data structure that allows for quick search and retrieval of data. Indexes optimize query operations by reducing the search scope and increasing retrieval speed.
[0169] In addition, the data stored in the time series library includes the default timestamp index of the time series library itself. The index you set yourself is generally a String (a data type used to store text information) type and does not change frequently. For example, taking the residential electricity load forecast as an example, each community or residential building can be set as an index for easy query.
[0170] S24. After the block data is successfully written to all data nodes, update the metadata of the file, including the file size, modification time and the storage location of the block data;
[0171] S25. Integrate the load demand sequence under the reference environment and the corresponding environmental factor data, and store them in a time series database.
[0172] In addition, when the sample data set is deployed and stored in the time series library using the principle of distributed storage technology, the sample data set can also be encrypted using data transmission encryption and data existence encryption.
[0173] Among them, data transmission encryption uses end-to-end encryption technology to ensure that data is always encrypted during transmission, and only the recipient can decrypt and read the data. For remote access or cloud storage services, ensure that data is transmitted through a secure VPN (virtual private network) connection to add an extra layer of protection.
[0174] Data storage encryption is to apply database encryption technology to database storage, encrypt sensitive fields or the entire database to ensure that even if the database file is stolen, the sensitive information cannot be easily obtained. Public key encryption algorithms can be used to encrypt using public keys and decrypt using private keys, and a combination of symmetric encryption and asymmetric encryption technology can achieve an encryption scheme that is both efficient and secure. For example, asymmetric encryption is used to exchange symmetric encryption keys during data transmission, and then symmetric encryption technology is used to encrypt and transmit data. Other security measures, such as access control, data backup and recovery, can also be used in combination to further improve data security and reliability.
[0175] S3, obtain a sample data set from the time series library, and use the time series prediction model to perform algorithm training to generate a prediction model for power load;
[0176] Specifically, the time series prediction model adopts the Seq2Seq model (neural network model). The Seq2Seq model adopts the Encoder-Decoder architecture, uses the GRU network as the encoder, and introduces the Attention mechanism. By learning long-term dependency information and short-term dependency information, it captures the inherent laws and dynamic change characteristics of historical load data and environmental observation data. During the training process, the model parameters are optimized through the back-propagation algorithm and gradient descent optimizer to improve the prediction accuracy.
[0177] Among them, encoder-decoder architecture: Seq2Seq model usually consists of two parts, encoder and decoder, such as Figure 3 As shown in Figure 1, the encoder is responsible for reading and understanding the input sequence and converting it into a fixed-length context vector, and the decoder uses this context vector to generate the target sequence.
[0178] Recurrent Neural Network (RNN): In the Seq2Seq model, the encoder and decoder are usually recurrent neural networks. RNN can process input sequences of different lengths and maintain the state information of the sequence in its hidden layer. One of its key points is that it can connect previous information to the current task. However, when the interval between the relevant information and the current predicted position continues to increase, RNN will lose its connection ability. During backpropagation, RNN will face the problem of gradient vanishing and gradient exploding. Because the gradient is used to update the weight value of the neural network (new weight = old weight - learning rate * gradient), the gradient will continue to decrease over time, and when the gradient value becomes very small, it will not continue to learn. In the recurrent neural network, the layer that obtains a small gradient update will stop learning, and the RNN will forget what it has seen before in a longer sequence, so the RNN only has a short-term memory. The increasing difficulty of calculation will lead to gradient explosion. In response to the long-term dependency problem in RNN, GRU networks (a variant of LSTM networks) are introduced as encoders. They can better capture the long-term dependencies in the sequence, thereby solving the problem of gradient vanishing and gradient exploding. The network structures of RNN, LSTM and GRU are as follows Figure 4-6 shown.
[0179] All RNNs have the form of a chain of repeating neural network modules, represented by tanh layers, which help regulate the values flowing through the network so that they are always constrained between -1 and 1.
[0180] The repeating module in LSTM (Long Short-Term Memory) consists of four interacting layers, three Sigmoid (used to generate gating signals) and one tanh (used to generate new candidate state values), which interact in a very special way. Sigmoid compresses values between 0-1, remembering the important and forgetting the insignificant. The "memory" of LSTM is called cells. These "cells" decide which previous information and states need to be retained / remembered and which to be erased. This method can effectively preserve the relevant information from a long time ago. LSTM has the ability to remove or add information to the cell state through a structure called a "gate". A "gate" is a method of selectively passing information. They include a sigmoid neural network layer and a pointwise multiplication nonlinear operation. LSTM has three types of gate structures: forget gate, input gate and output gate to protect and control the cell state.
[0181] GRU (Gated Recurrent Unit) merges the forget gate and input gate of LSTM into an update gate to help the model decide how much past information needs to be retained in the current state. It determines how much past information needs to be forgotten by resetting the gate, and also mixes the cell state and hidden state. The final model is simpler than the standard LSTM model because it has fewer parameters. Its advantage is that it can process long sequence data more efficiently and alleviate the problem of gradient disappearance.
[0182] Attention mechanism: The attention mechanism is introduced to improve the Seq2Seq model, such as Figure 7 The attention mechanism adds a layer of "wrapping" to the Seq2Seq structure, calculates weights through the score function, and weights the hidden layer state of the encoder recurrent neural network unit to obtain the attention vector, thereby adding additional information to the decoder recurrent neural network unit, so that the network has a more complete information flow to improve performance.
[0183] The final Seq2Seq network model is as follows Figure 8 shown.
[0184] As a preferred implementation, a sample data set is obtained from a time series library, and a time series prediction model is used for algorithm training to generate a prediction model for power load, including the following steps:
[0185] S31, dividing the sample data set into a training set, a validation set and a test set according to a preset ratio;
[0186] It should be noted that the preset ratio is 70% training set, 20% validation set, and 10% test set.
[0187] S32. Build a Seq2Seq time series prediction model based on the training set and train the model using the back propagation algorithm and gradient descent optimizer;
[0188] As a preferred embodiment, a Seq2Seq time series prediction model is constructed, and model training is performed based on a training set and through a back propagation algorithm and a gradient descent optimizer, including the following steps:
[0189] S321, constructing a structure of a Seq2Seq time series prediction model, the structure including an encoder and a decoder;
[0190] It should be noted that the role of the encoder in the field of time series is to understand and encode the historical data of the input sequence, which specifically includes the following steps:
[0191] 1) Processing time series input, the encoder receives time series data;
[0192] 2) Feature extraction: Through the temporal push structure of the GRU network, the encoder can capture the intrinsic features and temporal dependencies of the time series;
[0193] 3) Context vector, the encoder outputs a context vector, which is a compressed representation of the input time series and contains the understanding and summary of past data.
[0194] The role of the decoder in the time series field is to predict future time series data based on the information provided by the encoder. The specific process includes the following steps:
[0195] 1) Initial state and input, the initial state of the decoder is usually set by the final state of the encoder. The first input of the decoder may be the last observation of the sequence or a special token;
[0196] 2) Step-by-step prediction: at each time step, the decoder generates a prediction for the next time point based on the current state and the predicted output (or initial input) of the previous step;
[0197] 3) Iterative update, the output of the decoder is used to update its state and serve as the input for the next time step. This process is repeated during the generation of the entire prediction sequence;
[0198] 4) Sequence generation: This process continues until a prediction sequence of a predetermined length is generated.
[0199] In addition, for input x=(x 1 ,x 2 ,...,x t ) and output y=(y 1 ,y 2 ,...,y t )
[0200] The GRU encoder receives the encoding of the input at the current time point and the hidden state at the previous time point, and outputs the hidden state at the current time point:
[0201] h t =GRU enc (x t ,h t-1 );
[0202] The GRU decoder receives the encoding of the predicted target at the previous time point and the hidden state at the previous time point, and outputs the hidden state at the current time point:
[0203] s t =GRU dec (y t-1 ,s t-1 );
[0204] A score is calculated by the hidden state of the decoder, the hidden state of the encoder and a weight matrix:
[0205] e t =score(s t ,h t )=s t W a h t ;
[0206] The weight corresponding to the hidden state of each encoder within a certain time range:
[0207]
[0208] The attention vector is obtained by taking a weighted average of the hidden state output by the encoder:
[0209] c t =∑a t h t ;
[0210] Concatenate the attention vector and the decoder hidden state:
[0211]
[0212] The final output probability is calculated by softmax:
[0213]
[0214] In the formula, input x t is a length of n i (n input ), the column vector of the hidden layer h t is a length of n h (n hidden ), output y t is a length of n o (n outpou ) column vector; where n i 、n h 、n o They are all set manually, i represents input, h represents hidden layer, and o represents output; GRU enc represents the GRU encoder, GRU dec represents the GRU decoder; s t Represents the hidden state at the current time point t.
[0215] The score can be calculated by three methods: Dot, General and Concat. Dot is the inner product of vectors, while General is calculated by multiplying the weight matrix W. a Calculate (W a Yes h ,n h ] size matrix). Generally, the General method is better than the Dot method; t Indicates the score.
[0216] a t represents the weight, c t represents the attention vector; represents the decoder state with attention mechanism added; Wc represents the fully connected matrix; concat(c t ,h t ) means concatenating ct and ht.
[0217] y t Indicates that the final output probability is calculated through softmax; W ho Represents the weight matrix from the hidden layer to the output layer.
[0218] S322, randomly initialize the parameters of the Seq2Seq time series prediction model, including the weights and biases of the encoder and decoder;
[0219] It should be noted that weights are usually randomly initialized to start the training process to break the symmetry and introduce sufficient randomness. Common initialization methods include using Gaussian distribution (normal distribution) or uniform distribution to randomly initialize weights.
[0220] Bias can usually be initialized to zero, but can also be initialized with random values. Bias initialization is also often important for models such as recurrent neural networks (RNNs) and long short-term memory networks (LSTMs).
[0221] S323. Based on the training set data, the Seq2Seq time series prediction model is trained and parameter optimized through the back propagation algorithm.
[0222] As a preferred implementation, based on the training set data, the Seq2Seq time series prediction model is trained and parameter optimized by the back propagation algorithm, including the following steps:
[0223] S3231, extracting the load demand sequence and the corresponding environmental factor data under the benchmark environment from the training set, and obtaining the prediction result through the Seq2Seq time series prediction model;
[0224] S3232, comparing the predicted result with the true label, and calculating the loss function value;
[0225] S3233. Calculate the gradient of the loss function with respect to the parameters of the Seq2Seq time series prediction model according to the chain rule;
[0226] It should be noted that the chain rule is a fundamental concept in calculus, used to calculate the derivatives of composite functions. In deep learning, the network is usually composed of multiple layers of nested functions, each layer depends on the output of the previous layer. The chain rule allows the calculation of the gradient of the loss function with respect to any parameter in the network.
[0227] The Seq2Seq model usually consists of two parts: an encoder and a decoder. The encoder processes the input sequence and generates a context vector (or a series of vectors), and the decoder uses this context vector (or vector sequence) and the previous output (or starting symbol) to generate the target sequence.
[0228] The steps to calculate the gradient include forward propagation and back propagation;
[0229] The forward pass includes:
[0230] The input sequence is passed through the encoder, which generates a context vector.
[0231] The context vector is passed to the decoder, which generates a prediction sequence.
[0232] Calculate the loss function value between the predicted sequence and the true label.
[0233] Backward Pass includes:
[0234] Starting from the loss function, we calculate the gradient of the loss function with respect to the output of the last layer of the decoder.
[0235] Apply the chain rule to calculate the gradient of the loss function with respect to the parameters of each layer of the decoder.
[0236] Back-propagate the gradient to the encoder and calculate the gradient of the loss function with respect to the parameters of each layer of the encoder.
[0237] S3234. Update the Seq2Seq time series prediction model parameters by using a stochastic gradient descent optimization algorithm according to the obtained gradient;
[0238] It should be noted that stochastic gradient descent (SGD) is a commonly used optimization algorithm for training model parameters. In the Seq2Seq model that processes time series data, SGD can help us minimize the loss function through iterative optimization, thereby obtaining a more accurate prediction model.
[0239] S3235. Repeat steps S3232 to S3234 until a preset number of iterations is reached.
[0240] S33, using the validation set to validate the Seq2Seq time series prediction model, and adjusting the model parameters according to the validation results;
[0241] S34. Use the test set to evaluate the performance of the Seq2Seq time series prediction model and generate a power load prediction model.
[0242] It should be noted that in order to test the effect and accuracy of Seq2Seq model load prediction, it is verified on the public data set of power system load, and some algorithms such as Attention_LSTM, GRU, GRU-FCN, etc. are selected as comparative experiments. The error results of the test set are compared. Fig.10 As shown, the prediction results are compared with Figure 11-14 shown, and Figure 11-Figure 14 The left side of the vertical line separator is the historical load data, and the right side is the predicted load data.
[0243] S4. Use the trained prediction model to predict the load of the power system and formulate a power dispatch strategy based on the prediction results.
[0244] Specifically, based on the results of power load forecasting (peak and valley, etc.), the operating mode and power output of the generator set and the operating status of the power network are adjusted to maximize the capacity of the power generation equipment. Simply put, when the load forecast is peak, that is, the power demand is large, the power output of the generator set is increased; when the load forecast is valley, that is, the power demand is small, the power output of the generator set is reduced.
[0245] In summary, with the help of the above technical solutions of the present invention, the present invention realizes accurate prediction of power load by combining InfluxDB time series library and Seq2Seq time series model, improves the quality of load data and observation data through data preprocessing, thereby improving prediction accuracy; by optimizing data storage and query schemes, improves data processing efficiency, and improves the ability to extract dynamic characteristics of data; by introducing Seq2Seq network structure, its advanced encoder-decoder structure, gated recurrent unit and attention mechanism, the prediction accuracy is improved. The present invention realizes distributed storage and efficient query of large-scale historical load data and meteorological observation data by using InfluxDB time series library. The time series library is optimized for time series data, provides efficient storage, query and analysis capabilities, improves the real-time and efficiency of data processing, and adopts efficient storage and query schemes, as well as parallel computing technology. The present invention can quickly respond to real-time load data and make predictions in a timely manner. This helps the real-time scheduling and optimized operation of the power system to meet the needs of stable power supply. The present invention adopts a Seq2Seq model, which can capture the inherent laws and dynamic change characteristics of load data, thereby improving the prediction accuracy. Compared with traditional statistical models, the prediction method of the present invention can better fit the nonlinear characteristics and long-term dependencies of actual load data, and has good scalability. With the increase of data volume, the processing capacity of the system can be expanded by adding storage nodes or adjusting model parameters. At the same time, the Seq2Seq model itself also has good scalability and can be used in combination with other advanced models to further improve the prediction accuracy. The present invention protects the stability and reliability of the entire prediction system by ensuring the accuracy and consistency of data preprocessing, the stability of model training and the reliability of prediction results, which is crucial for the safe and stable operation of the power system. By improving the prediction accuracy and real-time performance, the present invention can help the power system reduce unnecessary energy waste and equipment overload, thereby reducing operating costs. At the same time, by optimizing the data processing process, manual intervention and computing resource consumption can be reduced, further reducing costs. The present invention converts data into a format that is easier for the model to understand and process through data reconstruction processing. In particular, converting time series data into a binary load demand sequence and further obtaining a load demand interval sequence helps the model capture the periodicity and volatility of power load. Through correlation analysis, environmental influencing factor data that meets the preset correlation is selected, and the factor change amount is calculated, so that the model can take into account the impact of environmental factors on power load, thereby improving the accuracy of the prediction. The support vector machine algorithm is used to construct a conversion network model, and the load demand interval sequence is benchmarked, so that the model can predict the power load demand under a specific benchmark environment, which is helpful to formulate a more scientific and reasonable power dispatching strategy.
[0246] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program code.
[0247] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A load forecasting method based on a time series library and a time series model, characterized in that: The load forecasting method based on the time series library and the time series model includes the following steps: S1. Acquire historical power time series data of the power system, and process the historical power time series data according to a preset data conversion processing algorithm to obtain a sample data set, wherein the historical power time series data includes power load data and environmental observation data; S2. Using the principle of distributed storage technology, deploy and store the sample data set in a time series library; S3, obtaining a sample data set from the time series library, and using a time series prediction model to perform algorithm training to generate a prediction model for power load; S4. Use the trained prediction model to predict the load of the power system and formulate a power dispatch strategy based on the prediction results.
2. A load forecasting method based on a time series library and a time series model according to claim 1, characterized in that: The obtaining of historical power time series data of the power system and processing the historical power time series data according to a preset data conversion processing algorithm to obtain a sample data set comprises the following steps: S11, preprocessing the acquired historical power time series data, wherein the preprocessing includes missing value processing, noise removal and outlier processing; S12, reconstructing the preprocessed historical power time series data to obtain a load demand interval sequence; S13. Use the support vector machine algorithm to build a conversion network model, perform a benchmark conversion on the load demand interval sequence, and establish a sample data set based on the conversion results.
3. A load forecasting method based on a time series library and a time series model according to claim 2, characterized in that: The process of reconstructing the preprocessed historical power time series data to obtain a load demand interval sequence comprises the following steps: S121, decomposing the preprocessed historical power time series data into different power equipment according to the type of power equipment; S122, converting the decomposed historical power time series data into a binary form according to a preset time interval to obtain a binary load demand sequence; the binary load demand sequence is a sequence consisting of 0 and 1, where 1 indicates load demand and 0 indicates no load demand; S123, performing sequence conversion on the obtained binary load demand sequence, deleting 0 in the binary load demand sequence, and obtaining a continuous sequence with load demand intervals.
4. A load forecasting method based on a time series library and a time series model according to claim 2, characterized in that: The method of using the support vector machine algorithm to construct a conversion network model, benchmarking the load demand interval sequence, and establishing a sample data set based on the conversion result includes the following steps: S131, performing correlation analysis on the power load data and environmental observation data in the historical power time series data, and selecting environmental impact factor data that meets the preset correlation; S132. For each sample in the power load data, calculate the factor change amount between the environmental impact factor data of each sample and the reference environmental impact factor data; S133, constructing and training a conversion network model based on a support vector machine algorithm, taking a load demand interval sequence and a factor variation as inputs of the conversion network model, and setting the output of the conversion network model as demand information under a target benchmark environment; S134, using the trained conversion network model to convert the actual load demand interval sequence of each sample into a load demand sequence under a reference environment; S135. Construct a sample data set based on the converted benchmark environmental requirement information and the corresponding environmental factor data.
5. A load forecasting method based on a time series library and a time series model according to claim 4, characterized in that: The expression of the conversion network model is: In the formula, F(x) represents the expression of the conversion network model; x represents the input feature vector, including the load demand interval sequence and the change of environmental factors; x i represents the support vector; b i Positive weights for data points representing support vectors; b i * Negative weights for data points representing support vectors; k(x,x i ) represents the kernel function; c represents the offset amount.
6. A load forecasting method based on a time series library and a time series model according to claim 4, characterized in that: The method of deploying and storing the sample data set in a time series library by utilizing the principle of distributed storage technology includes the following steps: S21, compressing the sample data set using a revolving door compression algorithm; S22, dividing the compressed sample data set into blocks according to a preset data size, and writing the block data into data nodes in sequence through a queue response method based on a preset data pipeline; S23, creating an index structure for the block data according to a preset index strategy; S24. After the block data is successfully written to all data nodes, update the metadata of the file, including the file size, modification time and the storage location of the block data; S25. Integrate the load demand sequence under the reference environment and the corresponding environmental factor data, and store them in a time series database.
7. A load forecasting method based on a time series library and a time series model according to claim 6, characterized in that: The method of compressing the sample data set using the revolving door compression algorithm comprises the following steps: S211, initializing compression parameters, including setting a threshold value and a minimum storage time interval of a revolving door algorithm; S212, reading data points in the sample data set, and dynamically adjusting the storage interval time according to the magnitude of the value change of the data points based on the adaptive variable frequency data storage strategy; S213. In each storage time interval, the revolving door algorithm is used to compress the data, and data points outside the parallelogram are selected as key points for storage.
8. The load forecasting method based on a time series library and a time series model according to claim 1, characterized in that: The step of obtaining a sample data set from the time series library and using a time series prediction model for algorithm training to generate a prediction model for power load includes the following steps: S31, dividing the sample data set into a training set, a validation set and a test set according to a preset ratio; S32. Build a Seq2Seq time series prediction model based on the training set and train the model using the back propagation algorithm and gradient descent optimizer; S33, using the validation set to validate the Seq2Seq time series prediction model, and adjusting the model parameters according to the validation results; S34. Use the test set to evaluate the performance of the Seq2Seq time series prediction model and generate a power load prediction model.
9. A load forecasting method based on a time series library and a time series model according to claim 8, characterized in that: The construction of the Seq2Seq time series prediction model, based on the training set and performing model training through the back propagation algorithm and the gradient descent optimizer, comprises the following steps: S321, constructing a structure of a Seq2Seq time series prediction model, the structure including an encoder and a decoder; S322, randomly initialize the parameters of the Seq2Seq time series prediction model, including the weights and biases of the encoder and decoder; S323. Based on the training set data, the Seq2Seq time series prediction model is trained and parameter optimized through the back propagation algorithm.
10. A load forecasting method based on a time series library and a time series model according to claim 9, characterized in that: The training and parameter optimization of the Seq2Seq time series prediction model based on the training set data and through the back propagation algorithm includes the following steps: S3231, extracting the load demand sequence and the corresponding environmental factor data under the benchmark environment from the training set, and obtaining the prediction result through the Seq2Seq time series prediction model; S3232, comparing the predicted result with the true label, and calculating the loss function value; S3233. Calculate the gradient of the loss function with respect to the parameters of the Seq2Seq time series prediction model according to the chain rule; S3234. Update the Seq2Seq time series prediction model parameters by using a stochastic gradient descent optimization algorithm according to the obtained gradient; S3235. Repeat steps S3232 to S3234 until a preset number of iterations is reached.
Citation Information
Cited By
Environmental time series data processing method based on Transform model
CN119226710A
Power system time sequence data generation method and system
CN119740028A
