Training method of prediction model, and park electricity consumption prediction method and system thereof

By using the improved TimeGAN model, which utilizes Multi-scale TCN and Transformer networks, and combines self-supervised pre-training with gradient-penalized Wasserstein distance, the problem of feature extraction and training stability under small sample data in power consumption prediction for industrial parks is solved, achieving more efficient power consumption prediction.

CN122021740APending Publication Date: 2026-05-12SHENZHEN JIUNIU YIMAO INTELLIGENT IOT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-30
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing technologies face the bottleneck of small sample data in predicting electricity consumption in industrial parks. Traditional methods are prone to overfitting and have poor generalization ability, while deep learning methods are prone to getting stuck in local optima when trained with small samples, and cannot accurately explore the correlation between features.

Method used

An improved TimeGAN model is adopted, replacing the original embedder and generator with a Multi-scale TCN network and a Transformer network. By combining self-supervised pre-training and gradient-penalized Wasserstein distance, the stability of feature extraction and training is improved, and high-quality sample data is generated.

Benefits of technology

It effectively solves the problem of poor prediction performance under small sample data, improves the accuracy and stability of power consumption prediction in the park, and generates more diverse and representative sample data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122021740A_ABST
    Figure CN122021740A_ABST
Patent Text Reader

Abstract

The invention provides a training method of a prediction model, a park electricity consumption prediction method and a park electricity consumption prediction system, and the training method comprises the steps: constructing an improved TimeGAN model which is obtained by replacing an original embedder in the TimeGAN model with a first combination network and replacing an original generator in the TimeGAN model with a second combination network; the first combined network and the second combined network have the same structure, and each of the first combined network and the second combined network comprises a Multi-scale TCN network and a Transform network; inputting the second-order historical data of the power consumption of the park into the improved TimeGAN model to obtain sample data; and training the time recurrent neural network model through second-order historical data and sample data to obtain a prediction model. The method can effectively solve the problem of poor prediction performance caused by lack of a large amount of historical data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data prediction technology, and in particular to a method for training a prediction model, a method for predicting electricity consumption in a park, and a system thereof. Background Technology

[0002] With the advancement of smart city and green industrial park construction, the accuracy of electricity consumption forecasting in industrial parks directly impacts energy efficiency and operating costs. Current mainstream forecasting methods include traditional statistical methods, machine learning methods such as support vector machines and random forests, and deep learning methods such as long short-term memory networks.

[0003] However, in practical applications, electricity consumption forecasting in industrial parks faces a significant bottleneck due to small sample data. On the one hand, newly built industrial parks lack long-term historical electricity consumption accumulation and can usually only obtain short-term data of a few months or even a few weeks; on the other hand, some older industrial parks suffer from lost or incomplete historical electricity consumption data due to problems such as data acquisition equipment failure and data storage system damage.

[0004] Furthermore, traditional statistical and machine learning methods are prone to overfitting and poor generalization in small sample scenarios. Meanwhile, while existing deep learning methods can capture the temporal features of data, they rely on a large number of labeled samples for parameter optimization. However, with small sample data, model training is easily trapped in local optima, failing to accurately uncover the correlations between features. Therefore, there is an urgent need for a technical solution that can mine electricity features and improve prediction accuracy with small sample data. Summary of the Invention

[0005] To address the aforementioned issues, the present invention provides a training method for the prediction model, a prediction method for electricity consumption in industrial parks, and a system thereof. By improving the TimeGAN model using a Multi-scale TCN network and a Transformer network, the present invention can effectively solve the problem of poor prediction performance caused by a lack of a large amount of historical data.

[0006] In a first aspect, the present invention provides a method for training a prediction model, the training method comprising:

[0007] An improved TimeGAN model is constructed, which is obtained by replacing the original embedder in the original TimeGAN model with a first combined network and replacing the original generator in the original TimeGAN model with a second combined network. The first and second combined networks have the same structure, both including a Multi-scale TCN network and a Transformer network. The first combined network is a combined network trained with first-order historical data, while the Multi-scale TCN network and Transformer network in the second combined network are untrained combined networks. The second-order historical data of the park's electricity consumption were input into the improved TimeGAN model to obtain sample data; A prediction model is obtained by training a time-recurrent neural network model using second-order historical data and sample data.

[0008] Optionally, the first combined network further includes: an integrated network; a set of first-order historical data including a pair of past historical data and future historical data, wherein the future historical data is data that is closer to the current time in time than the past historical data; The steps to build an improved TimeGAN model include: Historical data is input into the Multi-scale TCN network and the Transformer network respectively, and the output of the Multi-scale TCN network and the Transformer network are integrated into a potential representation through the integration module. The latent representation is input into a time-recurrent neural network model to obtain the predicted data; The predicted data and the future historical data corresponding to the past historical data are input into the loss function module to obtain the error value, and the error value is passed to the first combined network to adjust the parameters of the first combined network.

[0009] Optionally, the steps for constructing the improved TimeGAN model also include: Replace the KL divergence loss function used in the TimeGAN model with the target loss function L; L = + ; in, Represented as the discriminator in the improved TimeGAN model For second-order historical data Expectations Represented as the discriminator in the improved TimeGAN model Sample data generated from the improved TimeGAN model Expectations; , A uniformly distributed random number between 0 and 1. It is second-order historical data. and sample data Random interpolation between; It is the coefficient of the gradient penalty term; It is a discriminator random interpolation The gradient at that point.

[0010] Optionally, the time-recurrent neural network model is an LSTM model.

[0011] In a second aspect, the present invention provides a method for predicting the electricity consumption of a park, the method comprising predicting the electricity consumption of the park using a time recurrent neural network model obtained by training method as described in any of the first aspects.

[0012] Thirdly, the present invention provides a training system for a prediction model, the training system comprising: The building module is configured to build an improved TimeGAN model. The improved TimeGAN model is obtained by replacing the original embedder in the original TimeGAN model with a first combined network and replacing the original generator in the original TimeGAN model with a second combined network. The first and second combined networks have the same structure, both including a Multi-scale TCN network and a Transformer network. The first combined network is a combined network trained with first-order historical data, while the Multi-scale TCN network and Transformer network in the second combined network are untrained combined networks. The input module is configured to input second-order historical data of electricity consumption in the park into the improved TimeGAN model to obtain sample data; The training module is configured to train a time-recurrent neural network model using second-order historical data and sample data to obtain a prediction model.

[0013] Optionally, the first combined network further includes: an integrated network; a set of first-order historical data including a pair of past historical data and future historical data, wherein the future historical data is data that is closer to the current time in time than the past historical data; The building blocks include: The integration unit is configured to input historical data into the Multi-scale TCN network and the Transformer network respectively, and integrate the outputs of the Multi-scale TCN network and the Transformer network into a potential representation through the integration module. The prediction training unit is configured to input latent representations into a time-recurrent neural network model to obtain prediction data; The adjustment unit is configured to input the predicted data and the future historical data corresponding to the past historical data into the loss function module to obtain the error value, and then pass the error value to the first combined network to adjust the parameters of the first combined network.

[0014] Fourthly, the present invention provides a prediction system for electricity consumption in a park, the prediction system comprising using a time recurrent neural network model obtained by training method as described in any of the first aspects to predict the electricity consumption of the park.

[0015] Fifthly, the present invention provides an electronic device, the electronic device comprising: At least one processor; and A memory that is communicatively connected to at least one processor; wherein, The memory stores instructions that can be executed by at least one processor, which enables the at least one processor to perform a training method such as any of the first aspects.

[0016] In a sixth aspect, the present invention provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the training method as described in any of the first aspects.

[0017] The prediction model training method, park electricity consumption prediction method and system provided in this invention replace the embedder and generator in the TimeGAN model. The Multi-scale TCN network, by using convolutional kernels with different dilation rates in parallel, can simultaneously capture local features at different time spans, such as minute-level instantaneous fluctuations and hour-level load changes. The self-attention mechanism of the Transformer network can calculate the relationship between any two time points in the sequence, thereby effectively capturing long-term patterns. Thus, the improved TimeGAN model can reduce the difference between sample data and second-order historical data, improve the authenticity of sample data, and make sample data also usable as historical data for training the time recurrent neural network model. This effectively solves the problem of poor prediction performance due to the lack of a large amount of historical data. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the conventional technology, the drawings used in the description of the embodiments or the conventional technology will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic flowchart illustrating a training method for a park electricity consumption prediction model according to an embodiment of this application. Figure 2 This is a framework diagram of an improved TimeGAN model in the self-supervised pre-training stage according to an embodiment of this application. Figure 3 This is a framework diagram of the power consumption prediction system for a park according to an embodiment of this application during the process of generating predicted values; Figure 4This is a partial framework diagram of the adversarial training of the improved TimeGAN model in the second stage, according to an embodiment of this application. Detailed Implementation

[0020] To facilitate understanding of this application, a more complete description will be provided below with reference to the accompanying drawings, which illustrate embodiments of the present application. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that the disclosure of this application will be thorough and complete.

[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.

[0022] When used herein, the singular forms of “a,” “an,” and “the” may also include the plural forms unless the context clearly indicates otherwise. It should also be understood that the terms “comprising,” “including,” or “having,” etc., specify the presence of the stated feature, whole, step, operation, component, part, or combination thereof, but do not preclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof.

[0023] First, the main key terms involved in this invention will be explained: (1) Generative Adversarial Networks (GANs): These networks (a generator and a discriminator) compete and learn from each other to generate realistic data.

[0024] (2) Time-series Generative Adversarial Networks (TimeGAN): This is a technique based on generative adversarial networks (GANs). It uses learned embedding spaces and supervised and unsupervised losses for adversarial and joint training, and is specifically designed to generate and augment time-series data.

[0025] (3) Long Short-Term Memory (LSTM): It is a neural network specifically designed to process time series data. It mainly consists of three parts: forget gate, input gate, and output gate.

[0026] (4) Generalization: Generalization ability refers to the ability of a model to perform well on new, unseen data. Overfitting is a manifestation of poor generalization ability, that is, the model performs well on the training set, but performs poorly on the test set or new data.

[0027] (5) Kullback-Leibler divergence: abbreviated as KL divergence, also known as relative entropy, was proposed by Solomon Kullback and Richard Leibler in 1951 to measure the difference between two probability distributions P and Q.

[0028] (6) Recurrent Neural Network (RNN): It is a neural network architecture specifically designed to process sequential data. Its core feature is that it uses historical information to model time dependencies through a "recurrent" structure.

[0029] (7) Multi-scale TCN: Multi-scale temporal convolutional network is a neural network architecture that enhances the model’s ability to process sequential data by introducing multi-scale feature fusion technology on the basis of traditional temporal convolutional network (TCN).

[0030] (8) Transformer: A neural network architecture designed entirely based on self-attention mechanism. Its core advantage is that it can process sequential data in parallel and efficiently capture long-distance dependencies. It has become a basic model in fields such as NLP (Natural Language Processing) and CV (Computer Vision).

[0031] It's important to note that the TimeGAN model is a time-series generation model that combines the advantages of Generative Adversarial Networks (GANs) and Autoencoders. The TimeGAN model comprises four network parts. The generator and discriminator are adversarial components, similar to the generator and discriminator in a GAN model. The embedder (containing an embedding function) and the reconstructing network (containing a recovery function) in the TimeGAN model are autoencoders. The four networks in the TimeGAN model are jointly trained by calculating reconstruction loss, supervised loss, and unsupervised loss. This allows the TimeGAN model to simultaneously learn distributed features, generate static and temporal features, and perform alternating training. Finally, optimization is performed to obtain the best synthesis result.

[0032] As a generative adversarial network model, TimeGAN has shown great potential, but it still has the following limitations.

[0033] 1. Insufficient starting point for representation learning: The embedders in TimeGAN models and existing improved TimeGAN models typically start learning from random initialization. When the amount of data is limited or the data quality is low, this "starting from scratch" approach may prevent the embedder from learning the most effective feature representations, thus limiting the upper limit of the quality that the generator can achieve.

[0034] 2. Limited feature extraction capability: The TimeGAN model uses a recurrent neural network (RNN) as the backbone network. Although RNN can handle short-term temporal dependencies, it is insufficient in capturing ultra-long-distance dependencies and in terms of parallel computing efficiency.

[0035] 3. Unstable training process: Traditional generative adversarial training processes use KL divergence (Kullback-Leibler divergence) to evaluate the distribution difference between the actual data and the sample data, which can easily lead to training instability, gradient vanishing, and may cause mode collapse, that is, the generated time series data lacks diversity and cannot fully reflect the complexity of real time series data.

[0036] Therefore, in order to solve the above problems, this invention proposes a new and improved TimeGAN model to improve the quality, stability and training efficiency of generated time series data.

[0037] Firstly, one embodiment of the present invention provides a training method for a park electricity consumption prediction model, combined with... Figure 1 The training method includes steps S101 to S103.

[0038] Step S101: Construct the improved TimeGAN model.

[0039] The improved TimeGAN model is obtained by replacing the original embedder in the TimeGAN model with a first combined network and replacing the original generator in the TimeGAN model with a second combined network. The first and second combined networks have the same structure, both including a Multi-scale TCN network and a Transformer network. The first combined network is a combined network trained with first-order historical data, while the Multi-scale TCN network and Transformer network in the second combined network are untrained combined networks.

[0040] Understandably, embedding an untrained second combined network into the improved TimeGAN model enables it to learn to generate forged representations similar to the latent representations corresponding to second-order historical data in adversarial games.

[0041] Furthermore, the steps for constructing the improved TimeGAN model include: constructing a first combined network and a second combined network, and training the first combined network.

[0042] The training of the first combined network can take various forms, such as self-supervised training or semi-supervised training. In this embodiment, self-supervised training is used to train the first combined network, and this will not be elaborated further.

[0043] In a further optional embodiment of this example, both the first combined network and the second combined network further include an integrated network. A set of first-order historical data includes a pair of past historical data and future historical data, wherein the future historical data is data that is closer to the current time in time than the past historical data.

[0044] For example, first-order historical data refers to the electricity consumption data of the park in a certain year, that is, the electricity consumption data of the park from January to December of that year. Among them, past historical data can be the data from January to August in the first-order historical data, and future historical data can be the data from September to December in the first-order historical data; or, past historical data can be the data from January, February, April, May, July, August, October, and November in the first-order historical data, and future historical data can be the data from March, June, September, and December in the first-order historical data, but it is not limited to these.

[0045] The steps for constructing the improved TimeGAN model include steps S1011 to S1013, combined with... Figure 2 .

[0046] Step S1011: Input the historical data X_past into the Multi-scale TCN network and the Transformer network respectively, so that the Multi-scale TCN network and the Transformer network can extract features from the historical data X_past and output them respectively. Then, the output results of the Multi-scale TCN network and the Transformer network are integrated into a potential representation h through the integration module.

[0047] In this embodiment, the integration module uses the `concat()` function to integrate the outputs of the Multi-scale TCN network and the Transformer network into a single latent representation `h` and outputs it. It is understood that the `concat()` function is used to concatenate two or more arrays or strings.

[0048] Step S1012: Input the latent representation into the constructed time-recurrent neural network model to obtain the prediction data.

[0049] Step S1013: Input the predicted data and the future historical data corresponding to the past historical data into the loss function module to obtain the error value, and pass the error value to the first combined network to adjust the parameters of the first combined network.

[0050] It is understood that the loss function module contains a loss function, where the error value is used to evaluate the parameters of the combined network in order to optimize the parameters of the combined network. In this embodiment, the loss function is the mean-square error (MSE) function. The loss function module uses the future historical data X_futuret as the true value and the past historical data X_past as the predicted value to calculate the error value. The same set of future historical data X_futuret can represent the park's electricity consumption over several days, weeks, or months, and the corresponding past historical data can also represent the park's electricity consumption over several days, weeks, or months. The calculation process of the loss function is not described in detail in this embodiment.

[0051] In this embodiment, the loss function module measures the error between the predicted and true values ​​using a loss function. This error value is then propagated to the combined network via backpropagation to guide parameter tuning. After continuous iteration, training of the combined network ends when the error value converges to a preset convergence value. The parameter tuning process for the combined network is not detailed in this embodiment. Simultaneously, before training the improved TimeGAN model using secondary historical data, the parameters in the new embedder of the improved TimeGAN model are tuned, while the parameters in the new generator remain unchanged from their initial configuration.

[0052] By repeatedly executing steps S1011 to S1013, a high-quality combined network of parameters can be obtained, thus completing the first stage of pre-training for the improved TimeGAN model. After the trained combined network is integrated into the improved TimeGAN model, the improved TimeGAN model can then enter the second stage of adversarial training, providing a more accurate learning model for the generator within the improved TimeGAN model. This fundamentally solves the problems of low starting point for representation learning and poor generalization ability under small sample conditions, resulting in a higher starting point for the entire prediction model's training, faster convergence, and higher performance ceiling.

[0053] It should be noted that in the second stage of adversarial training, the improved TimeGAN model will generate high-quality sample data. In this stage, the improved TimeGAN model retains the architecture of the original TimeGAN model, only replacing the embedder and generator with a combined network. This allows the improved TimeGAN model to simultaneously consider local details and overall patterns, thereby generating sample data that more closely resembles the distribution of real-world time-series data.

[0054] Specifically, in combination Figure 4 The improved TimeGAN model mainly consists of a reproducibility network, a discriminator, and a first and second combined network. The components in the improved TimeGAN model work together.

[0055] In this model, the first combined network constitutes the embedder of the improved TimeGAN model, and the second combined network constitutes the generator of the improved TimeGAN model. In the second stage of adversarial training, the embedder and the reconstructing network are responsible for embedding and reconstruction, and they are used for mapping between data and the latent space. The embedder loads the parameters pre-trained in the first stage, receives real time-series data X, and outputs a high-quality latent representation h. In this embodiment, the real time-series data X is the second-order historical data. Because the new embedder has undergone the first stage of pre-training, it has the ability to deeply understand the dynamic patterns of the data. The reconstructing network receives the latent representation h output from the embedder and attempts to reconstruct it into reconstructed time-series data that is as close as possible to the original input real time-series data X. By calculating the actual time series data X and the reconstructed time series data... The reconstruction loss between the two is used to ensure that the embedder can effectively compress and retain the key information of the real time-series data X. The improved TimeGAN model ensures the temporality of the generated sample data by providing a potential space for adversarial training, making the real time-series data X consistent with the sample data in terms of dynamic temporal features. This process relies on supervised learning methods, which will not be elaborated in this embodiment.

[0056] Building upon this foundation, the generator and discriminator engage in adversarial training. The generator aims to learn the latent distribution of real-time data X, taking random time-series noise Z as input, and attempting to generate a latent representation h similar to the latent representation related to the real-time data X. The discriminator's task is to distinguish whether the latent representation input through the embedder comes from the latent representation h generated from real time-series data X, or from a latent representation forged by the generator. Through this adversarial training, the discriminator forces the generator to continuously improve the realism of its forged data until the discriminator can no longer easily distinguish it, i.e., the realism reaches a preset threshold. Finally, the reconstruction loss, supervised loss, and unsupervised loss are jointly trained and optimized to obtain the best sample data. The above joint training optimization process can refer to the joint training optimization process in the existing TimeGAN model. This embodiment will not elaborate on the joint training optimization process.

[0057] This embodiment trains the improved TimeGAN model in two stages, thereby improving the quality, stability, and training efficiency of the time series data generated by the prediction module.

[0058] In a further optional embodiment of this example, the step of constructing the improved TimeGAN model further includes: Replace the KL divergence loss function used in the TimeGAN model with the target loss function L; L = + ; in, Represented as the discriminator in the improved TimeGAN model For second-order historical data Expectations Represented as the discriminator in the improved TimeGAN model Sample data generated from the improved TimeGAN model Expectations; , A uniformly distributed random number between 0 and 1. It is second-order historical data. and sample data Random interpolation between; It is the coefficient of the gradient penalty term, used to balance the two losses; It is a discriminator random interpolation The gradient at that point.

[0059] Understandably, the TimeGAN model uses Kullback-Leibler divergence to assess the distributional differences between the real time-series data and the sample data. However, Kullback-Leibler divergence is nonnegative, asymmetric, and biased towards high-probability regions. It tends to minimize errors in medium- and high-probability regions, but often ignores matching in low-probability regions. This can lead to the generated prediction model overfitting certain patterns in some cases, ignoring the diversity of data distribution, and causing the prediction model to collapse.

[0060] The loss function of the TimeGAN model can be expressed as: .

[0061] in, It is the distribution of real time-series data. It is the distribution of sample data; when Approaching 0 When the value is not zero, the loss value will tend to infinity.

[0062] Therefore, this embodiment uses Wasserstein distance with gradient penalty to improve the stability of the improved TimeGAN model during the second stage of training, thereby overcoming the problem of mode collapse in the KL divergence of the existing TimeGAN model during the optimization process.

[0063] The Wasserstein distance, also known as the Earth-Mover distance, is based on the core idea of ​​calculating the minimum "cost" required to "transfer" one distribution to another. Even when the two distributions do not overlap, the Wasserstein distance provides a smooth and meaningful distance value, offering a stable learning signal to the generator and fundamentally solving the problem of training instability. The optimization objective of using the Wasserstein distance with gradient penalty is:

[0064] in, Discriminator The K-Lipschitz continuity constraint must be satisfied. This represents the supremum that satisfies the K-Lipschitz condition. This indicates the discriminator. Expectations for real time series data This indicates the discriminator. The expectation for the sample data. The K-Lipschitz continuity constraint in the above formula is key, but it is difficult to implement directly. Early WGAN (Wasserstein Generative Adversarial Networks) forced this through weight pruning, but this led to vanishing or exploding gradients. This embodiment, however, introduces gradient penalty.

[0065] The core idea of ​​gradient penalty is to directly constrain the gradient of the discriminator so that its gradient norm at the interpolated samples between the real time series data and the sample data is close to 1. This satisfies the K-Lipschitz continuity constraint and avoids the drawbacks of weight clipping.

[0066] This embodiment introduces gradient penalty, which ensures that the discriminator has a smooth gradient throughout the input space. This provides the generator with a stable and high-quality learning signal, effectively mitigating mode collapse and significantly improving the stability of the improved TineGAN model training and the quality of the final generated sample data. Thus, by inputting small samples of second-order historical data on park electricity consumption into the improved TineGAN model, the original second-order historical data can be expanded to obtain more diverse historical data.

[0067] Step S102: Input the second-order historical data of the park's electricity consumption into the improved TimeGAN model to obtain sample data.

[0068] Step S103: Train the time recurrent neural network model using second-order historical data and sample data to obtain a prediction model, and combine it with... Figure 3 .

[0069] During the training phase, the predicted electricity consumption system for the park, constructed using the improved TineGAN model and prediction model, Figure 3 The actual data in the data is the second-order historical data; when the predicted electricity consumption system for the park, built using the improved TineGAN model and prediction model, is in the application stage, Figure 3 The real data in the context refers to the historical data provided by the given scenario. It should be noted that the third-order historical data and second-order historical data can be from the same batch of park electricity consumption data as the first-order historical data, or they can be from different batches. Second-order historical data can include, but is not limited to, first-order historical data, or it can include only a portion of the first-order historical data, but it is not limited to these. Step S102 can be understood as the second stage of adversarial training for the improved TimeGAN model; the first-order historical data is the training data for the combined network, i.e., multiple sets of historical data used in the first stage of training; the second-order historical data is the training data for the entire improved TimeGAN model, i.e., multiple sets of historical data used in the second stage of training. In this embodiment, the second-order historical data is equivalent to the first-order historical data.

[0070] In a further optional embodiment of this example, the time recurrent neural network model is an LSTM model, but it is not limited to this.

[0071] The training method for the park electricity consumption prediction model provided in this invention proposes an improved TimeGAN model that integrates self-supervised pre-training (i.e., first-stage training) with multi-scale feature enhancement. Firstly, a self-supervised pre-training mechanism is introduced, enabling the embedder to learn initial representations with greater generalization ability. Secondly, a unified architecture of multi-scale TCN and Transformer is adopted to collaboratively capture local and global features, significantly improving the representation and generation capabilities of the park electricity consumption prediction model. Finally, Wasserstein divergence and gradient penalty are used to ensure training stability. Simultaneously, this training method generates diverse sample sets based on an improved time-series generative adversarial network to effectively expand small sample datasets, providing a more comprehensive and representative training data foundation for subsequent prediction models.

[0072] Secondly, an embodiment of the present invention provides a method for predicting the electricity consumption of a park, the method comprising predicting the electricity consumption of the park using a time recurrent neural network model obtained by training method as described in any of the first aspects.

[0073] Thirdly, one embodiment of the present invention provides a training system for a park electricity consumption prediction model, the training system comprising: The building module is configured to build an improved TimeGAN model. The improved TimeGAN model is obtained by replacing the original embedder in the original TimeGAN model with a first combined network and replacing the original generator in the original TimeGAN model with a second combined network. The first and second combined networks have the same structure, both including a Multi-scale TCN network and a Transformer network. The first combined network is a combined network trained with first-order historical data, while the Multi-scale TCN network and Transformer network in the second combined network are untrained combined networks. The input module is configured to input second-order historical data of electricity consumption in the park into the improved TimeGAN model to obtain sample data; The training module is configured to train a time-recurrent neural network model using second-order historical data and sample data to obtain a prediction model.

[0074] In a further optional embodiment of this embodiment, the combined network further includes: an integrated network; a set of first-order historical data includes a pair of past historical data and future historical data, wherein the future historical data is data that is closer to the current time in time than the past historical data; The building blocks include: The integration unit is configured to input historical data into the Multi-scale TCN network and the Transformer network respectively, and integrate the outputs of the Multi-scale TCN network and the Transformer network into a potential representation through the integration module. The prediction training unit is configured to input latent representations into a time-recurrent neural network model to obtain prediction data; The adjustment unit is configured to input the predicted data and the future historical data corresponding to the past historical data into the loss function module to obtain the error value, and then pass the error value to the first combined network to adjust the parameters of the first combined network.

[0075] In a further optional embodiment of this embodiment, the construction module further includes a replacement module configured to replace the loss function of KL divergence used in the TimeGAN model with the target loss function L.

[0076] Specifically, the target loss function L is replaced by the KL divergence loss function used in the TimeGAN model as follows: L = + ; in, Represented as the discriminator in the improved TimeGAN model For second-order historical data Expectations Represented as the discriminator in the improved TimeGAN model Sample data generated from the improved TimeGAN model Expectations; , A uniformly distributed random number between 0 and 1. It is second-order historical data. and sample data Random interpolation between; It is the coefficient of the gradient penalty term; It is a discriminator random interpolation The gradient at that point.

[0077] Fourthly, one embodiment of the present invention provides a prediction system for electricity consumption in a park. The prediction system includes using a time recurrent neural network model obtained by training the method described in any of the first aspects to predict the electricity consumption of the park.

[0078] Fifthly, one embodiment of the present invention provides an electronic device, the electronic device comprising: At least one processor; and A memory that is communicatively connected to at least one processor; wherein, The memory stores instructions that can be executed by at least one processor, which enables the at least one processor to perform a training method such as any of the first aspects.

[0079] In a sixth aspect, one embodiment of the present invention provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the training method as described in any of the first aspects.

[0080] In the description of this specification, the references to terms such as "some embodiments," "other embodiments," "ideal embodiments," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example that are included in at least one embodiment or example of this application. In this specification, the illustrative descriptions of the above terms do not necessarily refer to the same embodiments or examples.

[0081] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0082] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for training a prediction model, characterized in that, The training method includes: An improved TimeGAN model is constructed, wherein the improved TimeGAN model is obtained by replacing the original embedder in the original TimeGAN model with a first combined network and replacing the original generator in the original TimeGAN model with a second combined network; the first combined network and the second combined network have the same structure, both including a Multi-scale TCN network and a Transformer network; the first combined network is a combined network trained with first-order historical data, while the Multi-scale TCN network and the Transformer network in the second combined network are untrained combined networks; The second-order historical data of the park's electricity consumption is input into the improved TimeGAN model to obtain sample data; The time-recurrent neural network model is trained using the second-order historical data and the sample data to obtain a prediction model.

2. The training method according to claim 1, characterized in that, The first combined network further includes: an integrated network; the set of first-order historical data includes a pair of past historical data and future historical data, wherein the future historical data is data that is closer to the current time in time than the past historical data; The steps for constructing the improved TimeGAN model include: The historical data is input into the Multi-scale TCN network and the Transformer network respectively, and the output of the Multi-scale TCN network and the output of the Transformer network are integrated into a potential representation by the integration module. The latent representation is input into the time-recurrent neural network model to obtain the prediction data; The predicted data and the future historical data corresponding to the past historical data are input into the loss function module to obtain the error value, and the error value is passed to the first combined network to adjust the parameters of the first combined network.

3. The training method according to claim 1, characterized in that, The steps for constructing the improved TimeGAN model also include: Replace the KL divergence loss function used in the TimeGAN model with the target loss function L; L = + ; in, The discriminator in the improved TimeGAN model is represented as [insert discriminator here]. For the second-order historical data Expectations The discriminator in the improved TimeGAN model is represented as [insert discriminator here]. Sample data generated from the improved TimeGAN model Expectations; , A uniformly distributed random number between 0 and 1. The second-order historical data and sample data Random interpolation between; It is the coefficient of the gradient penalty term; It is a discriminator In random interpolation The gradient at that point.

4. The training method according to any one of claims 1 to 3, characterized in that, The time-recurrent neural network model is an LSTM model.

5. A method for predicting electricity consumption in a park, characterized in that, The prediction method includes using a time-recurrent neural network model obtained by the training method as described in any one of claims 1 to 4 to predict the electricity consumption of the park.

6. A training system for a prediction model, characterized in that, The training system includes: The building module is configured to build an improved TimeGAN model, wherein the improved TimeGAN model is obtained by replacing the original embedder in the original TimeGAN model with a first combined network and replacing the original generator in the original TimeGAN model with a second combined network; the first combined network and the second combined network have the same structure, both including a Multi-scale TCN network and a Transformer network; the first combined network is a combined network trained with first-order historical data, while the Multi-scale TCN network and the Transformer network in the second combined network are untrained combined networks; The input module is configured to input the second-order historical data of the park's electricity consumption into the improved TimeGAN model to obtain sample data; The training module is configured to train the time-recurrent neural network model using the second-order historical data and the sample data to obtain a prediction model.

7. The training system according to claim 6, characterized in that, The first combined network further includes: an integrated network; the set of first-order historical data includes a pair of past historical data and future historical data, wherein the future historical data is data that is closer to the current time in time than the past historical data; The building module includes: The integration unit is configured to input the historical data into the Multi-scale TCN network and the Transformer network respectively, and to integrate the output of the Multi-scale TCN network and the output of the Transformer network into a potential representation through the integration module; A prediction training unit is configured to input the latent representation into the time-recurrent neural network model to obtain prediction data; The adjustment unit is configured to input the predicted data and future historical data corresponding to the past historical data into the loss function module to obtain an error value, and to pass the error value to the first combined network to adjust the parameters of the first combined network.

8. A prediction system for electricity consumption in a park, characterized in that, The prediction system includes using a time-recurrent neural network model obtained by the training method as described in any one of claims 1 to 4 to predict the electricity consumption of the park.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the training method as described in any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the training method as described in any one of claims 1 to 4.