Time series data prediction system and method

By generating a prediction model that combines a generative adversarial framework with a bidirectional long short-term memory neural network and dynamically adjusting hyperparameters, the problem of insufficient adaptability in traditional time series data prediction methods is solved, achieving high-precision and efficient time series data prediction.

CN120611152AActive Publication Date: 2025-09-09SHANDONG JIANZHU UNIV
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional 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, their respective performance is improved in the adversarial process. The bidirectional long short-term memory neural network is combined with the transformer layer, and the enzyme action optimization algorithm is combined to dynamically adjust the hyperparameters to avoid local optimality and achieve adversarial training.

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 is suitable for periodic data such as electricity and load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120611152A_ABST
    Figure CN120611152A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of time series data prediction, in particular to a time series data prediction system and method. The hyper-parameter optimization module determines an optimal hyper-parameter combination; the generator minimizes a prediction error through adversarial training and receives feedback of the discriminator according to a long-term forward and reverse dependency relationship in the time sequence data and importance of different time steps, so that a prediction result is close to real data in statistical distribution, and predicted false data is generated; the discriminator mixes the real data and the predicted false data and outputs a'true / false 'probability, the classification accuracy of the real / false data is maximized through adversarial training, and the identification capability of the discriminator on the predicted data is minimized; and outputting a prediction result by utilizing the optimal hyper-parameter combination and alternate training of the generator module and the discriminator module. Based on the conception of time sequence modeling and an adversarial generation mechanism, the prediction precision and the adaptive capacity 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: A first aspect of the present invention provides a time series data prediction system, comprising: 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, maximize the classification accuracy of real / fake data through adversarial training, and minimize 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.

[0006] Furthermore, 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 through the fitness function, sorts the population in ascending order of fitness through selection and mutation, retains several individuals in the sorting, and generates new individuals for the rest; after repeated iterations, outputs the individual parameter combination that minimizes fitness, which is the optimal hyperparameter combination.

[0007] Furthermore, the generator module linearly transforms the input features through the fully connected layer, and prevents overfitting based on the dropout method by modifying the linear unit activation function.

[0008] Furthermore, to prevent overfitting, the feature sequence is processed through a bidirectional recurrent neural network to capture the temporal dependencies from both directions of the sequence, and is used to learn the long-term and short-term dynamic relationships of the input sequence in time.

[0009] Furthermore, positional encoding is superimposed on the output of the bidirectional recurrent neural network to ensure that the model can understand the temporal order of the input.

[0010] Furthermore, the position-encoded feature sequence passes through the transformer layer to further model the complex relationship between the input features, and the key features in the sequence are enhanced through the self-attention mechanism.

[0011] Furthermore, normalization is performed, and the result of the last time step is extracted as the final feature representation. The vector shape is reshaped through a fully connected layer to obtain the predicted sequence, that is, the predicted false data.

[0012] Furthermore, the real data and the false data predicted by the generator are mixed and input into the discriminator. After flattening, they pass through multiple sets of fully connected layers and activation functions in sequence, and the "true / false" probability of the generated predicted data compared with the real data is obtained through the discriminant score.

[0013] Furthermore, the generator and discriminator are trained alternately, combined with the optimal hyperparameter combination determined by the hyperparameter optimization module, to output the prediction results.

[0014] Furthermore, the target parameter also includes load data or sensor output signals.

[0015] A second aspect of the present invention provides a time series data prediction method, comprising the following steps: 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. Features associated with the time tag are obtained through preprocessing, 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 and fake data predicted by the generator, extract sequence features and output "true / false" probabilities, maximize the classification accuracy of real / false data through adversarial training, 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.

[0016] Compared with the existing technology, one or more of the above technical solutions have the following beneficial effects: 1. The core characteristic of time series data is time dependency, meaning that current data is correlated with past or future data. Taking electricity data as an example, by using multiple pieces of information, including time steps, as input, a prediction model is built using a generative adversarial framework. This approach incorporates statistical time series analysis techniques and relies on the representation learning capabilities of machine learning. By driving the interaction between the generator and discriminator, their respective performance is continuously improved during the adversarial process, addressing the current model's lack of adaptability.

[0017] 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.

[0018] 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.

[0019] 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.

[0020] 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

[0021] 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.

[0022] Figure 1 is a schematic diagram of a time series data prediction system provided by one or more embodiments of the present invention; 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; 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; Figure 4 is a schematic diagram of a hyperparameter optimization module provided by one or more embodiments of the present invention; Figure 5 Schematic diagram of a generative adversarial module according to one or more embodiments of the present invention. DETAILED DESCRIPTION

[0023] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0024] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.

[0025] Example 1: Time series data is time-indexed, with each data point having a corresponding time stamp (such as date, time of day, and month). Examples include daily electricity consumption, minute-by-minute power load, and second-by-second temperature sensor output (directly output as current / voltage and then converted to temperature). This time series data may exhibit long-term rising, falling, or stable trends (e.g., annual increases in summer electricity consumption), and recurring patterns within fixed periods (e.g., daily peak electricity consumption in the evening, increased heating load in winter). It also exhibits non-periodic fluctuations and randomness. The nonlinear characteristics of these characteristics are dependent on the time series features. Traditional methods attempt to predict time series data for a period of time in the future by exploiting these dependencies, but suffer from overfitting, insufficient accuracy, and low computational efficiency. Predictive models built using time series modeling and adversarial generative mechanisms rely on manual experience for hyperparameter tuning, making the models prone to local optima and lacking robustness, resulting in suboptimal adaptability and prediction accuracy.

[0026] Based on the prediction task requirements, this solution obtains the historical parameter data of the target parameter and the historical associated data that has an association relationship with the historical parameter data. After preprocessing, features associated with the time label are obtained, and a data structure of input features and target features is formed by time alignment; the target parameter is the power data.

[0027] This embodiment takes the task of "electricity prediction" as an example, takes the historical electricity data of a certain area over a period of time as a real sample, and predicts the electricity data for a period of time in the future as an example to explain this solution.

[0028] It is understandable that this solution is not limited to the scenario of power forecasting. Any forecasting task that can meet the needs of time series data can be applied to this solution, such as power load forecasting and commodity inventory forecasting.

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

[0030] For example, in the "load forecasting" scenario, it is necessary to obtain real samples such as user-side behavior data, power system load data, grid nodes, and industry classification data to predict load data for a period of time in the future. Features include load-related features such as direct load and wind power.

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

[0032] like Figure 1 As shown in the figure, 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 built on the basis of time series modeling and adversarial generation mechanism. The prediction model adopts the generative adversarial framework as the basic model, and the disease is improved and optimized on this basis. The data preprocessing module is configured to obtain a power forecast data set with obvious labels by preprocessing historical power information, as well as tie line information, meteorological data information and backup information related to the power information.

[0033] Among them, data collection is carried out at intervals of one hour. The specific data set consists of time, positive standby, negative standby, direct load, interconnection line load, total wind power, total photovoltaic power, total power generated by local power plants, total non-market nuclear power, total power of self-contained units, total power of test units, DC in various regions, day-ahead electricity, real-time electricity and other data, forming 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 into 8:2 ratios. At this point, the data set is completed.

[0034] The hyperparameter optimization module is configured to use an enzyme optimization algorithm with an elitist strategy and mild mutation operations to avoid 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.

[0035] The generator module, including a structure combining a bidirectional long short-term memory neural network and a transformer layer, performs time series modeling and multi-level fusion by modeling dependencies in time series and capturing the relationship between different time steps.

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

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

[0038] The time series data prediction system proposed in this solution is a hybrid model that integrates deep learning and generative adversarial networks (GANs). Its underlying technical principles include both statistical time series analysis ideas and the representation learning capabilities of machine learning.

[0039] First, real data samples are collected according to the prediction task requirements (for example, in this embodiment, historical electricity data and load, power, and other data related to electricity are collected). An enzyme action optimization algorithm is used to simulate the self-excitation behavior of the enzyme catalysis process, dynamically adjust hyperparameters, avoid overfitting, and find the optimal solution in the complex parameter space.

[0040] Secondly, a generative adversarial network framework was used to build the model architecture. The generator uses a hybrid predictor that combines a bidirectional long short-term memory neural network and a transformer layer for sequence prediction, while the discriminator uses a price discriminator to distinguish between power consumption forecasts. The generator not only generates power consumption forecast data but also improves the authenticity and stability of the forecast results through adversarial training. The discriminator evaluates the similarity between the generated data and real power consumption data, enhancing the generator's performance through adversarial training.

[0041] Furthermore, the generator uses a structure that combines a bidirectional long short-term memory neural network and a transformer layer. The bidirectional long short-term memory neural network is suitable for modeling long-term dependencies in time series, while the transformer layer's self-attention mechanism helps capture relationships between different time steps. This fusion of the two can better process complex time series data, especially electricity data containing multiple features.

[0042] Finally, not only is the daily electricity forecast optimized, but the real-time electricity forecast is also modeled. The model performs multi-task learning with two objectives (i.e., day-ahead electricity and real-time electricity), further improving the model's generalization ability.

[0043] The system utilizes time series modeling and generative adversarial mechanisms, with the generator and discriminator serving as the foundational networks. The overall network structure is divided into a parameter optimization network, a generator network, a discriminator network, and a prediction module. The specific improvement strategy is as follows: within the generative adversarial mechanism, the generator utilizes a bidirectional long short-term memory neural network and a transformer layer design for time series modeling and multi-layer fusion, capturing relationships across time steps and long-distance dependencies, thereby improving prediction accuracy.

[0044] Secondly, in the selection of hyperparameters, the enzyme optimization algorithm is used to optimize the various hyperparameters in the generator, dynamically adjust the hyperparameters, and use elite strategies and mild mutation operations to avoid falling into local optimality during the parameter optimization process.

[0045] The enzyme optimization algorithm is an intelligent optimization algorithm inspired by enzyme-catalyzed reactions, belonging to the category of metaheuristic algorithms. Its core concept is to mimic the efficient and specific catalytic properties of enzymes in biochemical reactions, and is used to solve complex optimization problems (such as hyperparameter search).

[0046] 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. The discriminator module, on the other hand, uses real power information as input to determine whether the generated power data is authentic, identifying the difference between generated data and real data to drive improvements in the generator.

[0047] The two models continuously improve their performance in the adversarial competition. After completing generative adversarial training, the model is evaluated using a validation set. Model performance is assessed by calculating metrics such as the accuracy between predicted and true values, as well as the proportional accuracy and directional accuracy.

[0048] Compared with previous traditional prediction systems, the prediction system based on time series modeling and adversarial generation mechanism takes multiple information including time steps (such as load information, interconnection line information and backup information) as input, and uses the generative adversarial framework to build a prediction model. In particular, for the problem that the current model lacks adaptive capabilities, the generative adversarial mechanism continuously improves the performance of each party during the adversarial process by driving the mutual relationship between the generator and the discriminator.

[0049] The generator combines a bidirectional long short-term memory neural network with 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 uses real sample data to calculate the difference between predicted and real data, driving improvements in the generator, thereby continuously improving the performance of both during the adversarial process.

[0050] For hyperparameter selection, we use an enzyme optimization algorithm for dynamic hyperparameter adjustment, combined with an elite strategy and mild mutation operations to avoid falling into local optima during the parameter optimization process. 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.

[0051] In addition, for the task of "electricity forecasting", not only the daily electricity forecast is optimized, but also the real-time electricity forecast is modeled. The model performs multi-task learning with two objectives (i.e., day-ahead electricity and real-time electricity), further improving the model's generalization ability.

[0052] like Figure 2 As shown in the figure, the collected electricity data and various disclosure data are processed and integrated into 18 columns of input data, including 16 columns of disclosure data and 2 columns of output features. The training set and the validation set are divided into 8:2 ratios. At this point, the dataset is complete.

[0053] The hyperparameter optimization module uses an enzyme optimization method, combined with an elite strategy and mild mutation operations, to avoid being trapped in local optimality during parameter optimization. At the same time, 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.

[0054] The generator module combines a bidirectional long short-term memory (LSTM) neural network with a transformer layer. The BLSTM neural network is suitable for modeling long-term dependencies in time series, while the transformer layer's self-attention mechanism helps capture relationships between different time steps. This fusion of the two enables better processing of complex time series data, especially electricity data containing multiple features.

[0055] The discriminator module distinguishes the power consumption prediction results. The generator not only generates power consumption 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 power consumption data, enhancing the generator's performance through adversarial training.

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

[0057] The prediction model based on time series modeling and adversarial generation mechanism, the specific principles are as follows Figure 3 shown.

[0058] Step 1: The data preprocessing module converts the input data into 16 columns of disclosure features + 2 columns of output features, recording the total number of samples , each sampling record contains 16-dimensional input records (denoted as ) and 2D target markers (denoted as ), batch size is 16, the time series sample construction is set Divide it into training set and validation set in a ratio of 8:2, and output training and validation data loaders at the same time ( ) and time series sample pairs , input to the hyperparameter optimization module.

[0059] Step 2: Hyperparameter optimization module such as Figure 4 As shown, first initialize the population, the number of individuals , Algebra , number parameter Refers to the number of hidden layer units in the bidirectional long short-term memory neural network. Refers to the number of discarded layers of the bidirectional long and short-term memory neural network and the transformer layer respectively to prevent the network from overfitting. Fitness evaluation is performed on each individual, and a hybrid predictor is constructed. Input , update the training set according to the number of batches per round, calculate the mean square error on the validation set, and the sum and the total number of elements , the fitness is defined as: .

[0060] After that, selection and mutation are performed, and the population is sorted in ascending order of fitness, retaining the top Elite, the rest generate new individuals, repeat Generation, and finally output the individual parameter combination that minimizes fitness , input generator module.

[0061] Step 3: The generator module is as follows Figure 5 As shown, it includes fully connected layer + activation function + dropout layer, bidirectional long short-term memory neural network, position encoding, transformer layer, feature extraction and normalization, output layer mapping and reshaping, etc.

[0062] First, input A fully connected layer performs a linear transformation, then applies the rectified linear unit (ReLU) activation function, and finally uses dropout to prevent overfitting. The purpose of this step is to improve the model's nonlinear expression capabilities.

[0063] Input fully connected layer + activation function + dropout layer, as shown below: , ; in, is the hidden state vector dimension, Refers to the weight matrix, which is used to map the input from 16 dimensions to dimension; Refers to the bias, dimension is dimension; Refers to the rectified linear unit operation (activation function); Refers to the discard layer operation, according to the proportion Randomly set to zero to prevent overfitting.

[0064] The processed sequence is fed into a bidirectional recurrent neural network, which contains multiple memory units that can capture temporal dependencies from both directions of the sequence and improve the understanding of historical information. This structure can learn the long-term and short-term dynamic relationships of the input sequence in time. Input bidirectional long short-term memory neural network to obtain , as shown below: , ; in, is the hidden state vector dimension, is the number of memory network layers, Indicates the drop ratio between layers of the bidirectional long short-term memory neural network, represents the batch size, represents the sequence length, Represents the output dimension of the bidirectional long short-term memory neural network.

[0065] After that, position encoding is performed. This step is because the structure based on the attention mechanism will be used later, so the position information of each time step in the sequence is supplemented. The position encoding is superimposed on the output of the bidirectional recurrent neural network to ensure that the model can understand the time sequence of the input.

[0066] Position encoding, as shown below: , ; in, Positional encoding is a pre-generated tensor used in the attention module to represent the position of each moment in the sequence. The first three colons in the brackets represent all the elements of the batch dimension, sequence length dimension, and feature dimension of the positional encoding tensor respectively. Indicates selecting the part of the fourth dimension that is adapted to the model feature dimension; is the tensor after superimposing position encoding, and Same size.

[0067] The data is then fed into the transformer layer to further model the complex relationships between the input features. This module can enhance the representation of key features in the sequence through the self-attention mechanism, as shown in the following formula: , ; in, refers to the dimension of the hidden state vector, Refers to the number of self-attention heads.

[0068] After that, layer normalization is performed and the tail is extracted. This step means that the result of the last time step output by the transformer layer is selected as the final feature representation and normalized to have a stable numerical distribution, which is convenient for subsequent output layer mapping, as shown in the following formula: ; in, The reference sequence is time steps (index ) characteristics.

[0069] Finally, the normalized features are passed through a fully connected layer and reshaped into a vector. The normalized features are mapped to the target dimension (48 numbers in total, corresponding to 24 hours × 2 power consumption) through a fully connected layer and reshaped into a three-dimensional format to obtain the final power consumption prediction sequence, as shown in the following formula: ; ; in, is the output layer weight matrix, with dimension , is the bias, dimension is 48, is the final prediction result tensor, with dimension .

[0070] Step 4: The discriminator module includes a flattening layer and three fully connected layers. First, the generator’s prediction output tensor and the real sample tensor (both dimensions are the same ) is input to the discriminator, and the sample is recorded as the power sequence tensor , which can be a real sample or the output of the generator.

[0071] Second, flatten it into a vector as follows: ; in, For the flattening operation, each sample is represented by The matrix is ​​flattened into a 48-dimensional vector.

[0072] Then it is input into the first layer of full connection + activation function + dropout layer, as shown below: ; in, is the first layer weight matrix, with dimension , is the first layer bias, with dimension , is the activation function, Refers to the discard layer operation to prevent overfitting.

[0073] Then it is input into the second layer of full connection + activation function layer, as shown below: ; in, is the second layer weight matrix, with dimension , is the second layer bias, dimension is , is the activation function.

[0074] Then input it into the third layer of full connection + Layer, as shown below: ; in, For the Sutra The predicted probability after activation, is the third layer weight matrix, with dimension , is the third layer bias, dimension is , is the activation function, which compresses the output to .

[0075] Then output the discriminant score as shown below: .

[0076] Each sample corresponds to a score , the closer it is to 1, the more it tends to the data in the real sample, and the closer it is to 0, the more it tends to the generated data.

[0077] Step 5: Train and evaluate the outputs of the generator and discriminator, as well as the optimal parameters obtained by the enzyme optimization algorithm, and use the validation set to verify the model performance to finally obtain the power prediction results.

[0078] The power forecasting system based on time series modeling and adversarial generation mechanism can effectively improve the shortcomings of previous power forecasts, such as inaccurate power forecasts and weak feature extraction capabilities. At the same time, the advantages of the lightweight power forecasting system also make transfer learning possible. It can be connected to the platform by applying training weights to enable joint prediction of multiple types of power.

[0079] The system of this solution is versatile. In addition to realizing the prediction of parameters such as power consumption and load, it can also realize electricity price prediction in the virtual system. Based on the data obtained in Example 1, additional electricity price data is obtained, and influencing factors such as temperature and holidays are added as real sample data sets. Attempts are made to use the virtual system to simulate the predicted real-time electricity price and day-ahead electricity price.

[0080] Example 2: The method for implementing time series data prediction based on the above system includes the following steps: 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. Features associated with the time tag are obtained through preprocessing, 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 and fake data predicted by the generator, extract sequence features and output "true / false" probabilities, maximize the classification accuracy of real / false data through adversarial training, 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.

[0081] This model leverages the principles of time series modeling and generative adversarial mechanisms, with a generator and a discriminator serving as the underlying networks. Within the generative adversarial mechanism, the generator employs a bidirectional long short-term memory neural network and transformer layers for time series modeling and multi-layer fusion, capturing relationships across time steps and long-range dependencies, thereby improving prediction accuracy. Furthermore, an enzyme optimization algorithm is used to optimize hyperparameters in the generator, dynamically adjusting them. An elitist strategy and mild mutation operations are employed to avoid local optima during the parameter optimization process. 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. The discriminator module, on the other hand, uses real-world information from the original samples to determine whether the generated predicted data is realistic, discriminating between generated and real data to drive improvements in the generator. Both models continuously improve their performance in the adversarial process. After completing generative adversarial training, the model is evaluated using a validation set. Model performance is assessed by measuring metrics such as the accuracy between predicted and true values, proportional accuracy, and directional accuracy.

[0082] Example 3: An electronic device includes at least one processor and a memory connected to the processor, the memory being used to store a computer program; the processor being used to execute the computer program, the computer program including: 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; 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, maximize the classification accuracy of real / fake data through adversarial training, and minimize 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.

[0083] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

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 discriminator.

2. The time series data prediction system according to claim 1, wherein: 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 through the fitness function, sorts the population in ascending order of fitness through selection and mutation, retains several individuals in the sorting, and generates new individuals for the rest; after repeated iterations, outputs the individual parameter combination that minimizes fitness, which is the optimal hyperparameter combination.

3. The time series data prediction system according to claim 1, wherein: The generator module linearly transforms the input features through the fully connected layer, and prevents overfitting based on the dropout method by modifying the linear unit activation function.

4. The time series data prediction system according to claim 3, wherein: The feature sequence after overfitting processing is processed through a bidirectional recurrent neural network to capture the temporal dependency from both directions of the sequence, and is used to learn the long-term and short-term dynamic relationship of the input sequence in time.

5. The time series data prediction system according to claim 4, wherein: Positional encoding is superimposed on the output of the bidirectional recurrent neural network to ensure that the model can understand the temporal order of the input.

6. The time series data prediction system according to claim 5, wherein: The positionally encoded feature sequence passes through the transformer layer to further model the complex relationship between the input features and enhance the representation of key features in the sequence through the self-attention mechanism.

7. The time series data prediction system according to claim 6, wherein: Normalization is performed, the result of the last time step is extracted 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.

8. 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.

9. 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.

10. A time series data prediction method, implemented based on the time series data prediction system according to any one of claims 1 to 9, 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

  • Track prediction method based on optimization generator

    CN118656602A

  • Photovoltaic power generation power prediction method based on Bi-LSTM

    CN120146096A

  • Method of predicting a parameter of interest in a semiconductor manufacturing process

    WO2024083435A1