Time series data prediction system and method

By combining the generative adversarial framework with the enzyme action optimization algorithm, the time series data prediction system solves the problems of insufficient adaptability and accuracy in time series data prediction, realizes efficient prediction of power, load and other data, and has the ability of rapid adaptation and high-precision feature extraction.

CN120611152BActive Publication Date: 2025-10-17SHANDONG JIANZHU UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511099374.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-07
Publication Date
2025-10-17
Estimated Expiration
2045-08-07

AI Technical Summary

Technical Problem

Existing time series data prediction methods have difficulty capturing the nonlinear characteristics and complex time series dependencies in power data, and suffer from problems of overfitting, insufficient accuracy, or low computational efficiency. In addition, the model's adaptability and robustness are insufficient, making it difficult to meet diverse detection needs.

Method used

A generative adversarial framework is used to build a prediction model. Through the mutual driving of the generator and the discriminator, a bidirectional long short-term memory neural network is combined with the transformer layer, and the enzyme action optimization algorithm is used to dynamically adjust the hyperparameters to perform adversarial training to improve model performance.

Benefits of technology

It improves the accuracy and adaptability of time series data prediction, can quickly adapt to different prediction task scenarios, has universal and efficient feature extraction capabilities, and avoids falling into local optimality during parameter optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120611152B_ABST
    Figure CN120611152B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of time series data prediction, in particular to a time series data prediction system and method, the system obtains target parameters and pre-processes through a data pre-processing module; an hyperparameter optimization module determines an optimal hyperparameter combination; a generator minimizes prediction error through adversarial training according to long-term forward and backward dependencies in time series data and the importance of different time steps, and receives feedback from a discriminator, so that the prediction result approximates the real data in the statistical distribution, and generates predicted fake data; the discriminator mixes real data and predicted fake data and outputs a "true / false" probability, and through adversarial training, maximizes the classification accuracy of real / fake data and minimizes the identification ability of the discriminator to the predicted data; the optimal hyperparameter combination and the alternating training of the generator module and the discriminator module are used to output the prediction result. Based on the concept of time series modeling and adversarial generation mechanism, the prediction accuracy and adaptability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of time series data prediction, and in particular to a time series data prediction system and method. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] Common time series data includes electricity consumption, load, product inventory, meteorological data, heart rate monitoring data, or sensor data. Taking electricity consumption forecasting as an example, traditional methods (such as autoregressive integrated moving average models and support vector machines) struggle to capture the nonlinear characteristics and complex time series dependencies in electricity consumption data, often suffering from overfitting, insufficient accuracy, and low computational efficiency. While time series modeling and adversarial generative mechanism models (such as long short-term memory neural networks and converters) have made significant progress in processing electricity consumption data, their hyperparameter tuning relies on manual experience, making the models prone to local optimality and lacking robustness. This results in suboptimal adaptability and prediction accuracy, making it difficult to meet the diverse detection needs of different scenarios. Summary of the Invention

[0004] In response to the problems raised in the background technology, the present invention provides a time series data prediction system and method, which takes multiple information including time steps in the time series data as input, builds a prediction model using a generative adversarial framework, and continuously improves the performance of each through the mutual driving of the generator and the discriminator during the adversarial process, thereby solving the problems of the current model's lack of adaptability and unsatisfactory prediction accuracy.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] A first aspect of the present invention provides a time series data prediction system, comprising:

[0007] The data preprocessing module is configured to: obtain historical parameter data of the target parameter and historical associated data associated with the historical parameter data according to the prediction task requirements, obtain features associated with the time tag through preprocessing, and form a data structure of input features and target features by time alignment; wherein the target parameter is power data;

[0008] The hyperparameter optimization module is configured to: use randomly generated initial sets of hyperparameters to train the preprocessed data, use the fitness function to evaluate the training error, retain the sets of hyperparameters with the highest fitness and generate new hyperparameters, and through repeated iterations, obtain the hyperparameter combination with the smallest error, which is the optimal hyperparameter combination;

[0009] The generator is configured to minimize the prediction error through adversarial training according to the long-term forward and backward dependencies and the importance of different time steps in the preprocessed data, and receive feedback from the discriminator to make the prediction result approach the statistical distribution of the real data and generate predicted fake data.

[0010] The discriminator is configured to mix the real data and the fake data predicted by the generator, extract sequence features and output a "true / false" probability, maximize the classification accuracy of real / fake data through adversarial training, and minimize the identification ability of the discriminator to the predicted data.

[0011] The prediction module is configured to output the prediction result by using the optimal hyperparameter combination and the alternating training of the generator and the discriminator.

[0012] Further, the hyperparameter optimization module determines the number of hidden layer units and the number of dropout layers of the bidirectional LSTM network through population initialization; constructs a hybrid predictor through an adaptive function, sorts the population in ascending order of fitness by selection and mutation, retains a number of individuals in the sorted order, and generates new individuals from the remaining individuals; through repeated iteration, output the individual parameter combination that minimizes the fitness, which is the optimal hyperparameter combination.

[0013] Further, the generator module performs linear transformation on the input features through a fully connected layer, activates the features through a rectified linear unit, and prevents overfitting based on the dropout method.

[0014] Further, the feature sequence processed to prevent overfitting is captured through a bidirectional recurrent neural network from both directions of the sequence to capture the time dependence, which is used to learn the long-term and short-term dynamic relationship of the input sequence in time.

[0015] Further, position encoding is added to the output of the bidirectional recurrent neural network to ensure that the model can understand the time order of the input.

[0016] Further, the feature sequence processed by the position encoding is further modeled through the transformer layer to further model the complex relationship between the input features, and the key features in the sequence are represented through the self-attention mechanism.

[0017] Further, normalization processing is performed to extract the result of the last time step as the final feature representation, and the vector shape is reshaped through a fully connected layer to obtain the predicted sequence, i.e., the predicted fake data.

[0018] Further, the real data and the fake data predicted by the generator are mixed and input into the discriminator, and are processed through flattening, a plurality of fully connected layers and activation functions in sequence, and the "true / false" probability of the generated prediction data compared with the real data is obtained through the discrimination score.

[0019] Further, the generator and the discriminator are alternately trained, and the optimal hyperparameter combination determined by the hyperparameter optimization module is combined to output a prediction result.

[0020] Further, the target parameter further includes load data or a sensor output signal.

[0021] The second aspect of the application provides a time series data prediction method, comprising the following steps:

[0022] According to the prediction task requirement, historical parameter data of a target parameter and historical associated data having an associated relationship with the historical parameter data are obtained, features associated with a time label are obtained through preprocessing, and an input feature-target feature data structure is formed according to time alignment; the target parameter is power data;

[0023] The preprocessed data is trained by using randomly generated initial multiple groups of hyperparameters, the training error is evaluated by using a fitness function, a number of groups of hyperparameters with the highest fitness are retained and new hyperparameters are generated, and the hyperparameter combination with the minimum error is obtained through repeated iteration, that is, the optimal hyperparameter combination;

[0024] According to the long-term forward and backward dependency relationship and the importance of different time steps in the preprocessed data, the prediction error is minimized through adversarial training, and the feedback of the discriminator is received, so that the prediction result approaches the real data in the statistical distribution, and the predicted false data is generated;

[0025] The real data and the false data predicted by the generator are mixed, sequence features are extracted, and a “true / false” probability is output, the classification accuracy of the real / false data is maximized through adversarial training, and the identification ability of the discriminator for the prediction data is minimized;

[0026] The optimal hyperparameter combination and the alternately trained generator and discriminator are used to output a prediction result.

[0027] Compared with the prior art, the above one or more technical solutions have the following beneficial effects:

[0028] 1. The core feature of time series data is time dependence, that is, the current data has an association with past or future data. Taking power data as an example, multiple information including time steps in the power data are used as input, a prediction model is built by using a generative adversarial framework, the prediction model contains both statistical time series analysis ideas and representation learning ability of machine learning, and the performance of the generator and the discriminator is continuously improved in the adversarial process, thereby solving the problem that current models lack self-adaptive ability.

[0029] 2. In terms of hyperparameter selection, we leverage the principles of the enzyme optimization algorithm to dynamically adjust hyperparameters, combining an elite strategy with mild mutation operations to avoid falling into local optima during parameter optimization. Individuals (hyperparameter settings) in the optimization process evolve over multiple generations to select the optimal hyperparameter configuration, enabling the model to achieve optimal training results within limited computing resources and time.

[0030] 3. The process of obtaining optimal hyperparameters is independent of the specific time series data, and the global search capability is applicable to any time series task, not limited to power data prediction. The optimization objective remains unchanged when executing different prediction tasks, and the number of iterations is adjusted to accommodate the complexity of the new task. This allows the system to quickly adapt to different prediction task scenarios and demonstrates a certain degree of versatility.

[0031] 4. The generator uses a combination of a bidirectional long short-term memory neural network and a transformer layer to integrate the relationships between different time steps and the dependencies between time series, improving the model's feature extraction capabilities. The discriminator, on the other hand, uses real sample data as input and calculates the difference between predicted and real data to drive improvements in the generator. This allows the performance of both the generator and the discriminator to continuously improve during the confrontation process.

[0032] 5. The adversarial training method of the generator and discriminator is applicable to any scenario that requires generating realistic time series data. The local time series dependencies captured during modeling are applicable to periodic data such as power and load, and are sensitive to sudden anomalies in time series data. This allows the system to quickly adapt to different prediction task scenarios by adjusting the specific number of network layers or attention heads when performing different prediction tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0034] Figure 1 is a schematic diagram of a time series data prediction system provided by one or more embodiments of the present invention;

[0035] Figure 2 This is a schematic diagram of the overall process of time series data prediction provided by one or more embodiments of the present invention;

[0036] Figure 3 is a flow chart of a time series data prediction process based on time series modeling and adversarial generation mechanism provided by one or more embodiments of the present invention;

[0037] Figure 4 is a schematic diagram of a hyperparameter optimization module provided by one or more embodiments of the present invention;

[0038] Figure 5 is a schematic diagram of a generative adversarial module provided by one or more embodiments of the present application. DETAILED DESCRIPTION

[0039] The application will be further described below with reference to the drawings and embodiments.

[0040] It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the application. Unless otherwise indicated, all technical and scientific terms used herein have the same meaning as would be understood by one of ordinary skill in the art to which the application pertains.

[0041] Embodiment one:

[0042] Time series data has a time index, and each data point has a corresponding time label (such as date, time, month, etc.), for example, daily power consumption, per-minute power load, per-second temperature sensor output temperature (directly output as current / voltage and then converted to temperature), etc. These time series data may exhibit long-term rising, falling or stable trends (such as increasing annual power consumption in summer), and repeating patterns within a fixed period (such as daily power consumption peak in the evening, increased heating load in winter), as well as non-fixed period fluctuations and randomness. The non-linear characteristics in these characteristics depend on the time series characteristics. Traditional methods try to predict future time series data through this dependency, but there are problems of overfitting, insufficient accuracy or low computational efficiency. A prediction model is established using time series modeling and generative adversarial mechanism, the hyperparameter tuning thereof depends on artificial experience, the model is prone to local optimum and has insufficient robustness, resulting in unsatisfactory adaptability and prediction accuracy of the model.

[0043] According to the prediction task requirements, the present scheme obtains historical parameter data of a target parameter and historical associated data having an associated relationship with the historical parameter data, obtains features associated with time labels through preprocessing, and forms an input feature-target feature data structure according to time alignment. The target parameter is power data.

[0044] This embodiment takes the "power prediction" task as an example, takes historical power data of a certain area within a period of time as real samples, and predicts power data in a future period of time as an example to explain the present scheme.

[0045] It can be understood that the present scheme is not limited to the power prediction scenario, and can be applied to prediction tasks of time series data, such as power load prediction and commodity inventory prediction.

[0046] For example, in the "power prediction" scenario, the input is the power data collected every 15 minutes, including historical power consumption data, power equipment operation data, power grid and power system data, and weather and date samples of influencing factors, to predict the power data in the future period.

[0047] For example, in the "load prediction" scenario, real samples such as user behavior data, power system load data, power grid nodes, and industry classification data are needed to predict the load data in the future period. The features are load-related features such as direct load and wind power.

[0048] For example, in the "sensor signal prediction" scenario, the relevant features are replaced by the time series signals collected by sensors (such as temperature, vibration, etc.).

[0049] As shown in Figure 1 The time series data prediction system includes a data preprocessing module, a hyperparameter optimization module, a generator module, a discriminator module, and a prediction module. The system is based on time series modeling and adversarial generation mechanism as a whole. The prediction model uses a generative adversarial framework as the base model, and improves and optimizes it based on it.

[0050] The data preprocessing module is configured to preprocess historical power information, as well as interconnection line information, weather data information, and backup information related to power information, to obtain power prediction data sets with obvious labels.

[0051] Among them, data collection is performed every 1 hour, and the specific data set composition includes time, positive backup, negative backup, direct load, interconnection line power load, total wind power, total photovoltaic power, total local power plant power, total non-market nuclear power, total self-prepared unit power, total test unit power, regional DC, day-ahead power, real-time power, etc. Form 16 columns of features + two output features. The first 16 columns of features are used to train and predict the two output features, and the training set and validation set are divided according to the ratio of 8:2. At this point, the data set is complete.

[0052] The hyperparameter optimization module is configured to use the elite strategy and mild mutation operation of the enzyme optimization algorithm to avoid falling into local optimum in the parameter optimization process. Through the evolution of individuals (hyperparameter settings) in the optimization process, the optimal hyperparameter configuration is selected, so that the model can obtain the optimal training result in limited computing resources and time.

[0053] The generator module includes a structure combining bidirectional long short-term memory neural network and transformer layer, which models the dependency relationship in time series and captures the relationship between different time steps, thereby performing time series modeling and multi-level fusion.

[0054] The discriminator module evaluates the similarity of the generated data and the real power data, and enhances the performance of the generator through adversarial training.

[0055] The prediction module outputs the prediction results of real-time power and day-ahead power.

[0056] The time series data prediction system proposed in the present solution is a hybrid model that combines deep learning and generative adversarial network (GAN). Its underlying technical principles include both statistical time series analysis ideas and machine learning representation learning capabilities.

[0057] First, according to the prediction task requirements, real data samples (such as historical power data and load, power data related to power) are collected, and an enzyme action optimization algorithm is used to simulate the self-excitation behavior in the enzyme catalysis process, dynamically adjust the hyperparameters, and avoid overfitting, so as to find the optimal solution in a complex parameter space.

[0058] Second, the generative adversarial network framework is used to build the model architecture, where the generator uses a hybrid predictor combining bidirectional long short-term memory neural network and transformer layer for sequence prediction, and the discriminator uses a price discriminator to distinguish the power prediction results. The generator not only generates power prediction data, but also improves the authenticity and stability of the prediction results through adversarial training. The discriminator evaluates the similarity of the generated data and the real power data, and enhances the performance of the generator through adversarial training.

[0059] In addition, the generator uses a structure combining bidirectional long short-term memory neural network and transformer layer. The bidirectional long short-term memory neural network is suitable for modeling long-term dependencies in time series, while the self-attention mechanism of the transformer layer can help capture the relationship between different time steps. The fusion of the two can better handle complex time series data, especially power data containing multiple features.

[0060] Finally, not only the daily prediction of power is optimized, but also the prediction of real-time power is modeled. The model performs multi-task learning through two targets (day-ahead power and real-time power), further improving the generalization ability of the model.

[0061] The system uses the ideas of time series modeling and generative adversarial mechanism, takes the generator and discriminator as the basic network, and divides the overall network structure into parameter optimization network, generator network, discriminator network, and prediction module, etc. The specific improvement strategy is: in the generative adversarial mechanism, the generator uses the design of bidirectional long short-term memory neural network and transformer layer, which is used for time series modeling and multi-level fusion, to capture the relationship between different time steps and long-distance dependencies, and improve the prediction accuracy.

[0062] Second, in the selection of hyperparameters, the enzyme action optimization algorithm is used to optimize the hyperparameters in the generator. The elite strategy and mild mutation operation are used to avoid falling into local optimum in the parameter optimization process.

[0063] Enzyme action optimization algorithm is an intelligent optimization algorithm inspired by enzyme catalytic reaction, which belongs to the category of metaheuristic algorithms. The core idea is to simulate the characteristics of enzyme in biochemical reaction, which is efficient and specific catalysis of target process, to solve complex optimization problems (such as hyperparameter search).

[0064] The individuals (hyperparameter settings) in the optimization process evolve through multiple generations, and the optimal hyperparameter configuration is selected, so that the model can get the optimal training result in limited computing resources and time. In the discriminator module, the real power information is input to judge whether the generated power data is real, and the difference between the generated data and the real data is used to drive the improvement of the generator.

[0065] Both of them constantly improve their performance in the confrontation. After completing the generative adversarial training, the model is evaluated using the validation set. The performance of the model is evaluated by calculating the accuracy, proportional accuracy, and directional accuracy between the predicted value and the true value.

[0066] Compared with the traditional prediction system, the prediction system based on time series modeling and adversarial generation mechanism takes multiple information (such as load information, tie line information, and backup information) including time steps as input, and uses the generative adversarial framework to build the prediction model. Especially for the current model lacking adaptive ability, the generative adversarial mechanism drives the generator and discriminator to constantly improve their performance in the confrontation process.

[0067] At the same time, the generator uses a combination of bidirectional long short-term memory neural network and transformer layer to fuse the relationship between different time steps and the dependency between time series, improving the model's feature extraction ability. The discriminator calculates the difference between the predicted data and the real data by inputting real sample data to drive the improvement of the generator, thereby constantly improving the performance of both in the confrontation process.

[0068] In the selection of hyperparameters, the enzyme action optimization algorithm is used to dynamically adjust the hyperparameters, combined with the elite strategy and mild mutation operation to avoid falling into local optimum in the parameter optimization process. The individuals (hyperparameter settings) in the optimization process evolve through multiple generations, and the optimal hyperparameter configuration is selected, so that the model can get the optimal training result in limited computing resources and time.

[0069] In addition, for the task of "electricity prediction", not only the daily prediction of electricity is optimized, but also the real-time electricity prediction is modeled. The model performs multi-task learning through two targets (i.e., day-ahead electricity and real-time electricity), further improving the generalization ability of the model.

[0070] As shown in Figure 2 , the collected electricity data and various disclosure data are processed and integrated into 18-column input data, including 16 columns of disclosure data and 2 columns of output features. The training set and the validation set are divided according to the ratio of 8:2. At this point, the data set is completed.

[0071] The hyperparameter optimization module adopts the enzyme action optimization method, combined with the elite strategy and slight mutation operation, to avoid falling into local optimum in the parameter optimization process. At the same time, the individuals (hyperparameter settings) in the optimization process are evolved for multiple generations to select the optimal hyperparameter configuration, so that the model can get the optimal training result in limited computing resources and time.

[0072] The generator module adopts the combination of bidirectional long short-term memory neural network and transformer layer. The bidirectional long short-term memory neural network is suitable for modeling long-term dependence in time series, and the self-attention mechanism of the transformer layer can help capture the relationship between different time steps. The fusion of the two can better handle complex time series data, especially electricity data containing multiple features.

[0073] The discriminator module discriminates the electricity prediction results. The generator not only generates electricity prediction data, but also improves the authenticity and stability of the prediction results through adversarial training. The discriminator evaluates the similarity between the generated data and the real electricity data, and enhances the performance of the generator through adversarial training.

[0074] The prediction module predicts the day-ahead and real-time electricity based on the output of the generative adversarial mechanism.

[0075] The prediction model based on time series modeling and generative adversarial mechanism has the specific principle as shown in Figure 3 .

[0076] Step 1: The data preprocessing module converts the input data into 16 columns of disclosure features + 2 columns of output features, and records the total number of samples as , each sample record contains 16-dimensional input records (denoted as ) and 2-dimensional target labels (denoted as ), with a batch size of 16, and the time series sample is constructed It is divided into training set and validation set according to the ratio of 8:2, and the training and validation data loader ( ) and the time series sample pair , input to the hyperparameter optimization module.

[0077] Step 2: The hyperparameter optimization module, as shown in Figure 4 , first initializes the population, with a number of individuals , a number of generations , and a number of individuals parameter , refers to the number of hidden layer units of the bidirectional long short-term memory neural network, , respectively refers to the number of dropout layers of the bidirectional long short-term memory neural network and the transformer layer, to prevent network overfitting. For each individual, fitness evaluation is performed, a hybrid predictor is constructed, and input , is updated on the training set according to the number of batches per round, and the mean square error is calculated on the validation set, with the sum and the total number of elements , the fitness is defined as: .

[0078] Selection and mutation are then performed, the population is sorted in ascending order of fitness, the top elites are retained, the remaining individuals are generated, and the process is repeated generations, and finally the individual parameter combination that minimizes the fitness is output , which is input to the generator module.

[0079] Step 3: The generator module, as shown in Figure 5 , includes multiple components such as a fully connected layer + activation function + dropout layer, bidirectional long short-term memory neural network, position encoding, transformer layer, feature extraction and standardization, output layer mapping and reshaping, etc.

[0080] First, the input is linearly transformed through a fully connected layer, then a rectified linear unit (ReLU) activation function is applied, and finally dropout is used to prevent overfitting. The purpose of this step is to improve the model's nonlinear expression ability.

[0081] The input fully connected layer + activation function + dropout layer is as follows:

[0082] , ;

[0083] where is the dimension of the hidden state vector, refers to the weight matrix, which maps the input from 16 dimensions to dimensions; refers to the bias, with a dimension of dimensions; refers to the rectified linear unit operation (activation function); refers to the dropout layer operation, which randomly sets zero according to the proportion to prevent overfitting.

[0084] The processed sequence is fed into a bidirectional recurrent neural network, which contains multiple memory units and can capture time dependencies from both directions of the sequence, improving the understanding of historical information. This structure can learn the long-term and short-term dynamic relationships of the input sequence over time. The output of the bidirectional recurrent neural network is obtained by as follows:

[0085]

[0086] wherein, is the dimension of the hidden state vector, is the number of memory network layers, represents the dropout ratio between bidirectional long short-term memory network layers, represents the batch size, represents the sequence length, represents the output dimension of the bidirectional long short-term memory network.

[0087] Position encoding is then performed, which is necessary because the subsequent structure is based on an attention mechanism. The position information of each time step in the sequence is supplemented, and the position encoding is superimposed on the output of the bidirectional recurrent neural network, ensuring that the model can understand the time sequence of the input.

[0088] Position encoding is as follows:

[0089]

[0090] wherein, denotes the position encoding, which is a pre-generated tensor used to represent the position of each time in the sequence in the attention module. The first three colons in the brackets represent the batch dimension, the sequence length dimension, and the feature dimension of the selected position encoding tensor, respectively; denotes the selection of the fourth dimension that is compatible with the feature dimension of the model; is the tensor after superimposing the position encoding, which has the same size as .

[0091] The transformer layer is then input, which further models the complex relationships between input features. This module can strengthen the representation of key features in the sequence through self-attention mechanisms, as follows:

[0092]

[0093] wherein, denotes the dimension of the hidden state vector, denotes the number of self-attention heads.​​​​​​​

[0094] After that, layer normalization is performed, and the tail is extracted. The meaning of this step is that the result of the last time step of the transformer layer output is selected as the final feature representation, and through standardization processing, it has a stable numerical distribution, which is convenient for the subsequent output layer to map, as shown in the following formula:

[0095] ;

[0096] wherein, denotes the feature of the sequence at the time step (index ).

[0097] Finally, the vector shape is reshaped through the fully connected layer. The normalized features are mapped to the target dimension (a total of 48 numbers, corresponding to 24 hours x 2 power) through a fully connected layer, and reshaped to a three-dimensional format to obtain the final power prediction sequence, as shown in the following formula:

[0098] ;

[0099] ;

[0100] wherein, is the output layer weight matrix, with a dimension of , is the bias, with a dimension of 48, is the final prediction result tensor, with a dimension of .

[0101] Step 4: The discriminator module includes a flattening layer and three fully connected layers. First, the prediction output tensor of the generator and the real sample tensor (both have a dimension of ) are input into the discriminator, and the sample is denoted as the power sequence tensor , which can be a real sample or a generator output.

[0102] Second, it is flattened into a vector, as shown in the following formula:

[0103] ;

[0104] wherein, is the flattening operation, and each sample is flattened from a matrix to a 48-dimensional vector.

[0105] Then it is input into the first layer of fully connected + activation function + dropout layer, as shown in the following formula:

[0106] ;

[0107] wherein, is the first layer weight matrix with dimension , is the first layer bias with dimension , is the activation function, indicates the dropout layer operation to prevent overfitting.

[0108] It is then input to the second layer fully connected + activation function layer as follows:

[0109] ;

[0110] wherein, is the second layer weight matrix with dimension , is the second layer bias with dimension , is the activation function.

[0111] It is then input to the third layer fully connected + layer as follows:

[0112] ;

[0113] wherein, is the activated prediction probability, is the third layer weight matrix with dimension , is the third layer bias with dimension , is the activation function to compress the output to . The output discriminant score is as follows:

[0114] .

[0115] Each sample corresponds to a score , the closer to 1 indicates the more inclined to the data in the real sample, the closer to 0 indicates the more inclined to the generated data.

[0116] Step 5: Train and evaluate the output of the generator and the discriminator, and the optimal parameters optimized by the enzyme action optimization algorithm, and verify the model performance using the validation set, and finally obtain the power prediction result.

[0117] The power prediction system based on time series modeling and adversarial generation mechanism can effectively improve the shortcomings of inaccurate power prediction and weak feature extraction ability in the past. At the same time, the advantages of lightweight power prediction system also make transfer learning possible, which can be connected to the platform by applying training weights in order to jointly predict multiple types of power. ​

[0118] The system of the present scheme has universality, and in addition to realizing the prediction of power, load and the like, it can also realize the prediction of electricity price in a virtual system. On the basis of obtaining data in Embodiment One, electricity price data is additionally obtained, and temperature, holiday and the like are added as influence factors to serve as real sample data sets, and the virtual system is used to simulate the predicted real-time electricity price and day-ahead electricity price.

[0119] Embodiment Two

[0120] The method for realizing time series data prediction based on the above system comprises the following steps:

[0121] According to the prediction task requirement, the historical parameter data of the target parameter and the historical associated data having an associated relationship with the historical parameter data are obtained, and features associated with time labels are obtained through preprocessing, and the input features-target features data structure is formed according to time alignment; the target parameter is power data;

[0122] The preprocessed data is trained by using randomly generated initial multiple groups of hyperparameters, the training error is evaluated by using the fitness function, a number of groups of hyperparameters with the highest fitness are reserved and new hyperparameters are generated, and the hyperparameter combination with the minimum error is obtained through repeated iteration, that is, the optimal hyperparameter combination;

[0123] According to the long-term forward and backward dependent relationship and the importance of different time steps in the preprocessed data, the prediction error is minimized through adversarial training, and the feedback of the discriminator is received, so that the prediction result approaches the real data in the statistical distribution, and the predicted false data is generated;

[0124] The real data and the false data predicted by the generator are mixed, sequence features are extracted and "true / false" probabilities are output, the classification accuracy of the real / false data is maximized through adversarial training, and the identification ability of the discriminator to the prediction data is minimized;

[0125] The optimal hyperparameter combination and the alternating training of the generator and the discriminator are used to output the prediction result.

[0126] The idea of time series modeling and generative adversarial mechanism is adopted, and the generator and discriminator are used as the basic network. In the generative adversarial mechanism, the generator adopts the design of bidirectional long short-term memory neural network and transformer layer, which is used for time series modeling and multi-level fusion, captures the relationship of different time steps and long-distance dependency, and improves the prediction accuracy. Secondly, in the selection of hyperparameters, the enzyme action optimization algorithm is used to optimize each hyperparameter in the generator, dynamically adjusts the hyperparameters, and uses the elite strategy and light mutation operation to avoid falling into local optimum in the parameter optimization process. The individuals (hyperparameter settings) in the optimization process are evolved for multiple generations, and the optimal hyperparameter configuration is selected, so that the model can get the optimal training result in limited computing resources and time. In the discriminator module, the real information in the original sample is input to judge whether the generated prediction data is real, and the difference between the generated data and the real data is used to drive the improvement of the generator. Both of them continuously improve their respective performance in the confrontation. After completing the generative adversarial training, the model is evaluated using the validation set. The accuracy, proportional accuracy, and directional accuracy between the predicted value and the true value are calculated to evaluate the performance of the model.

[0127] Embodiment three

[0128] An electronic device includes at least one processor and a memory connected to the processor, the memory being configured to store a computer program; the processor is configured to execute the computer program, the computer program comprising:

[0129] A data preprocessing module is configured to: according to the prediction task requirement, obtain the historical parameter data of the target parameter and the historical associated data associated with the historical parameter data, obtain the features associated with the time label through preprocessing, and form the input feature-target feature data structure according to time alignment; the target parameter is power data;

[0130] A hyperparameter optimization module is configured to: use randomly generated initial multiple groups of hyperparameters to train the preprocessed data, evaluate the training error using a fitness function, retain a number of groups of hyperparameters with the highest fitness and generate new hyperparameters, and obtain the hyperparameter combination with the minimum error through repeated iteration, that is, the optimal hyperparameter combination;

[0131] A generator is configured to: according to the long-term forward and backward dependency relationship and the importance of different time steps in the preprocessed data, minimize the prediction error through adversarial training, and receive feedback from the discriminator, so that the prediction result approximates the real data in the statistical distribution, and generates the predicted false data;

[0132] The discriminator is configured to mix real data and fake data predicted by the generator, extract sequence features and output a "true / false" probability, maximize the classification accuracy of real / fake data through adversarial training, and minimize the recognition ability of the discriminator to the predicted data;

[0133] The prediction module is configured to output a prediction result by using the optimal hyperparameter combination and the alternating training of the generator and the discriminator.

[0134] The above is only a preferred embodiment of the present application and is not intended to limit the present application. Those skilled in the art can make various modifications and changes to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A time series data prediction system, characterized in that: include: The data preprocessing module is configured to: obtain historical parameter data of the target parameter and historical associated data associated with the historical parameter data according to the prediction task requirements, obtain features associated with the time tag through preprocessing, and form a data structure of input features and target features by time alignment; wherein the target parameter is power data; The hyperparameter optimization module is configured to: use randomly generated initial sets of hyperparameters to train the preprocessed data, use the fitness function to evaluate the training error, retain the sets of hyperparameters with the highest fitness and generate new hyperparameters, and through repeated iterations, obtain the hyperparameter combination with the smallest error, which is the optimal hyperparameter combination; The generator is configured to minimize the prediction error through adversarial training based on the long-term forward and reverse dependencies and the importance of different time steps in the preprocessed data, receive feedback from the discriminator, make the prediction results close to the real data in terms of statistical distribution, and generate predicted false data; The discriminator is configured to mix real data with fake data predicted by the generator, extract sequence features and output "true / false" probabilities. Through adversarial training, it maximizes the classification accuracy of real / fake data and minimizes the discriminator's ability to identify predicted data. The prediction module is configured to: output prediction results using the optimal hyperparameter combination and alternating training of the generator and the discriminator; The hyperparameter optimization module initializes the population, determines the number of hidden layer units in the bidirectional LSTM network, and the number of discarded layers; constructs a hybrid predictor using the fitness function, sorts the population in ascending order of fitness through selection and mutation, retains a number of individuals in the sorting, and generates new individuals for the remaining individuals; after repeated iterations, outputs the individual parameter combination that minimizes fitness, which is the optimal hyperparameter combination; The generator linearly transforms the input features through a fully connected layer, and uses a modified linear unit activation function to prevent overfitting based on the dropout method. The feature sequence after overfitting prevention is passed through a bidirectional recurrent neural network to capture temporal dependencies from both directions of the sequence, which is used to learn the long-term and short-term dynamic relationships of the input sequence in time. Position encoding is superimposed on the output of the bidirectional recurrent neural network to ensure that the model can understand the temporal sequence of the input. The feature sequence after position encoding is passed through a transformer layer to further model the complex relationships between the input features, and the key features in the sequence are enhanced through the self-attention mechanism. Normalization is performed to extract the result of the last time step as the final feature representation, and the vector shape is reshaped through the fully connected layer to obtain the predicted sequence, that is, the predicted false data.

2. The time series data prediction system according to claim 1, wherein: The real data and the fake data predicted by the generator are mixed and input into the discriminator. After flattening, it passes through multiple sets of fully connected layers and activation functions in sequence. The "true / false" probability of the generated predicted data compared to the real data is obtained through the discriminant score.

3. The time series data prediction system according to claim 1, wherein: The prediction results are output by alternately training the generator and the discriminator and combining the optimal hyperparameter combination determined by the hyperparameter optimization module.

4. A time series data prediction method, implemented based on the time series data prediction system according to any one of claims 1 to 3, characterized in that: The following steps are included: According to the prediction task requirements, historical parameter data of the target parameter and historical associated data associated with the historical parameter data are obtained. After preprocessing, features associated with the time label are obtained, and the data structure of input features and target features is formed by time alignment. The target parameter is the power data; Use the randomly generated initial multiple sets of hyperparameters to train the preprocessed data, use the fitness function to evaluate the training error, retain the sets of hyperparameters with the highest fitness and generate new hyperparameters, and through repeated iterations, obtain the hyperparameter combination with the smallest error, which is the optimal hyperparameter combination; Based on the long-term positive and negative dependencies and the importance of different time steps in the preprocessed data, the prediction error is minimized through adversarial training. By receiving feedback from the discriminator, the prediction results are statistically close to the real data and false data is generated for prediction. Mix real data with fake data predicted by the generator, extract sequence features and output "true / false" probabilities. Through adversarial training, maximize the classification accuracy of real / fake data and minimize the discriminator's ability to identify predicted data. Using the optimal hyperparameter combination and alternating training of the generator and discriminator, the prediction results are output.

Citation Information

Patent Citations

  • New energy station wind-solar time sequence power generation method based on improved domain adversarial network

    CN117290705A

  • Generative adversarial network method and system for predicting new energy generating capacity

    CN117578438A