Data set expansion method and device, storage medium and electronic device
By generating and utilizing conditions to generate an adversarial network expanded power price data set, the problems of poor tuning effect and low prediction accuracy caused by insufficient data volume in the power spot market are solved, and the effective expansion of the data set and the performance improvement of the prediction model are achieved.
Patent Information
- Application Number
- CN202411544838.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-25
AI Technical Summary
The real-time electricity price prediction model in the electric spot market is due to insufficient data volume, which leads to poor tuning results and low prediction accuracy.
By extracting the sampled sample vector from the sampled data, multiple simulation vectors are generated based on the sampled sample vector and the preset random noise vector, and the judgment process is performed to obtain multiple probability values of different vectors as the real electricity price data. When the preset probability threshold is met, the target generator and the target discriminator are determined, and the target condition generation adversarial network is generated, and the network is used to expand the electricity price data set.
The electricity price data set is effectively expanded, the training effect and prediction accuracy of the prediction model are improved, and the problems of poor tuning effect and low prediction accuracy are solved due to insufficient data volume.
Smart Images

Figure CN119513597A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method and device for expanding a data set, a storage medium, and an electronic device. Background Art
[0002] In the electricity spot market, accurate prediction of real-time electricity prices is the key for power generation companies to optimize their power generation strategies and improve economic benefits. At present, deep learning models are the main tool for real-time electricity price prediction. They learn electricity price trends through historical data, but the prediction accuracy is limited by a variety of complex factors that affect electricity prices, including day-ahead declarations, seasonal effects, sudden equipment conditions, weather changes, and adjustments to electricity price algorithm policies. These factors are not only diverse and changeable, but also result in the magnitude of about 700 data points a week being insufficient for deep learning models to capture the latest market dynamics, thus affecting the model's tuning efficiency and prediction accuracy. The existing electricity price prediction model optimization relies on manual adjustments based on the latest data every week. The scarcity of data makes it difficult to fully train the model, making it unable to adapt to the rapidly changing characteristics of the market, resulting in poor model performance.
[0003] In the related technologies, there is no effective solution to the problem that the real-time electricity price prediction model in the electricity spot market has poor tuning effect and low prediction accuracy due to insufficient data.
[0004] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the invention
[0005] The embodiments of the present application provide a method and device for expanding a data set, a storage medium, and an electronic device, so as to at least solve the problem of poor tuning effect and low prediction accuracy of the real-time electricity price prediction model in the electricity spot market due to insufficient data volume.
[0006] According to one aspect of an embodiment of the present application, a method for expanding a data set is provided, including: extracting a sampling sample vector from sampled data, generating multiple simulation vectors based on the sampling sample vector and a preset random noise vector; performing judgment processing on the multiple simulation vectors and the sampling sample vector to obtain multiple probability values that different vectors are real electricity price data; when the multiple probability values all meet the preset probability threshold, determining the target generators corresponding to the multiple simulation vectors and the target discriminators corresponding to the multiple probability values, and generating a target conditional generative adversarial network based on the target generator and the target discriminator; and using the target conditional generative adversarial network to expand the target data set corresponding to the electricity price data.
[0007] In an exemplary embodiment, before extracting the sampling sample vector from the sampled data, the method further includes: determining the amount of data to be expanded using the conditional generative adversarial network; determining the collection period based on the amount of data; and cutting the original data in the database based on the collection period to obtain multiple sampled data.
[0008] In an exemplary embodiment, a sampling sample vector is extracted from the sampled data, and a plurality of simulation vectors are generated based on the sampling sample vector and a preset random noise vector, including: converting the sampling sample vector into a plurality of dense vectors having the same length as the preset random noise vector through an embedding layer in an initial generator; and multiplying the corresponding items of the plurality of dense vectors and the preset random noise vector to obtain a plurality of simulation vectors.
[0009] In an exemplary embodiment, multiple simulation vectors and sampling sample vectors are judged and processed to obtain multiple probability values that different vectors are real electricity price data, including: using at least three types of activation functions to judge multiple simulation vectors and sampling sample vectors to obtain target judgment results, wherein the probability of the processing results corresponding to the simulation vectors should be close to 0, and the probability of the processing results corresponding to the sampling sample vectors should be close to 1; based on the target judgment results, determine multiple probability values that different vectors are real electricity price data.
[0010] In an exemplary embodiment, a target generator corresponding to a plurality of simulation vectors and a target discriminator corresponding to a plurality of probability values are determined, and after a target conditional generative adversarial network is generated based on the target generator and the target discriminator, the method further includes: determining a loss calculation function corresponding to the target conditional generative adversarial network; and performing gradient adjustment on the target conditional generative adversarial network using the loss calculation function.
[0011] In an exemplary embodiment, before using the target condition to generate a target data set corresponding to the adversarial network to expand the electricity price data, the method also includes: determining the data demand corresponding to the electricity price prediction model; determining the target data volume to be generated based on the data demand and the actual amount corresponding to the original data; and using the target data volume to control the expansion size of the target data set.
[0012] According to another aspect of an embodiment of the present application, a data set expansion device is also provided, including: a generation module, used to extract a sampling sample vector from the sampled data, and generate multiple simulation vectors based on the sampling sample vector and a preset random noise vector; a judgment module, used to judge and process the multiple simulation vectors and the sampling sample vector to obtain multiple probability values that different vectors are real electricity price data; a first determination module, used to determine the target generators corresponding to the multiple simulation vectors and the target discriminators corresponding to the multiple probability values when the multiple probability values all meet the preset probability threshold, and generate a target conditional generative adversarial network based on the target generator and the target discriminator; an expansion module, used to use the target conditional generative adversarial network to expand the target data set corresponding to the electricity price data.
[0013] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for expanding the data set when running.
[0014] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for expanding the data set through the computer program.
[0015] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and the method for expanding the above-mentioned data set when the computer program is executed by a processor.
[0016] Through this application, a sampling sample vector is extracted from the sampled data, and multiple simulation vectors are generated based on the sampling sample vector and the preset random noise vector; multiple simulation vectors and sampling sample vectors are judged and processed to obtain multiple probability values that different vectors are real electricity price data; when multiple probability values all meet the preset probability threshold, the target generators corresponding to the multiple simulation vectors and the target discriminators corresponding to the multiple probability values are determined, and a target conditional generative adversarial network is generated based on the target generator and the target discriminator; the target conditional generative adversarial network is used to expand the target data set corresponding to the electricity price data. The above technical solution solves the problem of poor tuning effect and low prediction accuracy of the real-time electricity price prediction model in the electricity spot market due to insufficient data volume. Furthermore, by constructing a conditional generative adversarial network, a large amount of simulation data is generated, the electricity price data set is effectively expanded, and the training effect and prediction accuracy of the prediction model are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 It is a hardware structure block diagram of a computer terminal of a method for expanding a data set according to an embodiment of the present application;
[0020] Figure 2 is a flow chart of a method for expanding a data set according to an embodiment of the present application;
[0021] Figure 3 It is a model architecture diagram based on a conditional generative adversarial network according to an embodiment of the present application;
[0022] Figure 4 It is a flow chart of a real-time electricity price data enhancement method based on a conditional generative adversarial network according to an embodiment of the present application;
[0023] Figure 5 It is a structural block diagram of an expansion of a data set according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal, a mobile terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal of a method for expanding a data set according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor (Central Processing Unit, CPU) or a programmable logic device (Field Programmable Gate Array, FPGA)) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0027] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for expanding the data set in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0028] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0029] In this embodiment, a method for expanding a data set is provided. Figure 2 is a flow chart of a method for expanding a data set according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps S202-S208:
[0030] Step S202: extracting a sampling sample vector from the sampled data, and generating a plurality of simulation vectors based on the sampling sample vector and a preset random noise vector;
[0031] Step S204: performing judgment processing on the multiple simulation vectors and the sample vectors to obtain multiple probability values that different vectors are real electricity price data;
[0032] Step S206: when the plurality of probability values all meet the preset probability threshold, determining the target generators corresponding to the plurality of simulation vectors and the target discriminators corresponding to the plurality of probability values, and generating a target conditional generative adversarial network based on the target generator and the target discriminator;
[0033] Step S208: Generate a target data set corresponding to the adversarial network expansion charging price data using the target condition.
[0034] The above steps extract sampling sample vectors from the sampled data, generate multiple simulation vectors based on the sampling sample vectors and the preset random noise vectors; perform judgment processing on the multiple simulation vectors and the sampling sample vectors to obtain multiple probability values that different vectors are real electricity price data; when the multiple probability values all meet the preset probability threshold, determine the target generators corresponding to the multiple simulation vectors and the target discriminators corresponding to the multiple probability values, generate a target conditional generative adversarial network based on the target generator and the target discriminator; use the target conditional generative adversarial network to expand the target data set corresponding to the electricity price data. The above technical solution solves the problem of poor tuning effect and low prediction accuracy of the real-time electricity price prediction model in the electricity spot market due to insufficient data volume. Furthermore, by constructing a conditional generative adversarial network, a large amount of simulation data is generated, the electricity price data set is effectively expanded, and the training effect and prediction accuracy of the prediction model are improved.
[0035] In an exemplary embodiment, before extracting the sampling sample vector from the sampled data, the method further includes: determining the amount of data to be expanded using the conditional generative adversarial network; determining the collection period based on the amount of data; and cutting the original data in the database based on the collection period to obtain multiple sampled data.
[0036] Optionally, if a power generation company is going to use conditional generative adversarial networks to perform data enhancement on real-time electricity price data to improve the performance of its deep learning electricity price prediction model. And it is hoped that the data set will be expanded from 700 points (7 days * 96 points / day) in the most recent week to 7000 points, so as to provide a large enough amount of data for model training. Considering the volatility of the electricity market during the high temperature period in summer, one week (i.e. 7 days) is selected as the collection period. Based on the selected one-week collection period, the real-time electricity price data for the first week of July 2023 is cut out from the database, and 96 points per day constitute a vector. The 7 vectors of this week are used as sampling data, and each vector represents the real-time electricity price trend of one day. In this way, simulated electricity price data during the high temperature period in summer can be generated in a targeted manner. These data will be closer to the actual market situation, thereby effectively improving the prediction accuracy of the electricity price prediction model during the high temperature period, helping enterprises to make better power generation decisions, respond to changes in supply and demand in the electricity market, and maximize profits. At the same time, by reasonably setting the data volume and collection period, effective resource utilization and improved model performance are achieved.
[0037] In an exemplary embodiment, a sampling sample vector is extracted from the sampled data, and a plurality of simulation vectors are generated based on the sampling sample vector and a preset random noise vector, including: converting the sampling sample vector into a plurality of dense vectors having the same length as the preset random noise vector through an embedding layer in an initial generator; and multiplying the corresponding items of the plurality of dense vectors and the preset random noise vector to obtain a plurality of simulation vectors.
[0038] Optionally, a power generation company selects one day of real-time electricity price data from the first week of September 2023 as a sampling sample. The data for this day reflects the typical fluctuations in electricity demand and electricity prices in late summer, and contains 96 points (one data point every 15 minutes). The 96-point sampling sample vector is converted into a dense vector with the same length as the preset random noise vector through the embedding layer. Assume that the length is 672, which is the length of one week of real-time electricity price data. This conversion process enhances the feature representation of the sampled samples while also ensuring the dimensional consistency of the vector. The converted dense vector is multiplied by the corresponding terms of the random noise vector to generate multiple simulation vectors, each of which simulates the electricity price trend of one day, containing a total of 672 points. Through the above steps, a large number of high-quality simulation vectors can be generated based on limited sampling samples, significantly expanding the scale and diversity of the electricity price data set. These simulation vectors are used for training and tuning the electricity price prediction model, which significantly improves the accuracy of the model electricity price prediction.
[0039] In an exemplary embodiment, multiple simulation vectors and sampling sample vectors are judged and processed to obtain multiple probability values that different vectors are real electricity price data, including: using at least three types of activation functions to judge multiple simulation vectors and sampling sample vectors to obtain target judgment results, wherein the probability of the processing results corresponding to the simulation vectors should be close to 0, and the probability of the processing results corresponding to the sampling sample vectors should be close to 1; based on the target judgment results, determine multiple probability values that different vectors are real electricity price data.
[0040] Optionally, the daily real-time electricity price data of a week in December 2023 is selected from a power generation company database as a sampling sample vector. At the same time, based on random noise and these sampling samples, multiple simulation vectors are generated through the model generator, and each vector simulates the electricity price trend of one day. Design a discriminator network containing LeakyReLU, ReLU and tanh activation functions. The input of the discriminator network includes simulation vectors and sampling sample vectors. During the training process, based on the target judgment result, that is, the probability of the simulation vector is close to 0 and the probability of the sampling sample vector is close to 1, the parameters of the generator and the discriminator are continuously adjusted. The goal of the generator is to reduce the probability value of the simulation vector generated by it being identified as non-real data, while the discriminator needs to increase the probability value of the sampled sample vector being identified as real data. This process realizes the dynamic optimization and iteration of the model by calculating and feeding back the probability value. As the training progresses, the generator gradually generates simulation vectors with higher quality and closer to the characteristics of real data. These simulation vectors are used to expand the charging price data set, and then used for the training of the electricity price prediction model, which significantly improves the performance of the prediction model.
[0041] In an exemplary embodiment, a target generator corresponding to a plurality of simulation vectors and a target discriminator corresponding to a plurality of probability values are determined, and after a target conditional generative adversarial network is generated based on the target generator and the target discriminator, the method further includes: determining a loss calculation function corresponding to the target conditional generative adversarial network; and performing gradient adjustment on the target conditional generative adversarial network using the loss calculation function.
[0042] Optionally, a conditional generative adversarial network (CGAN) is used to generate more simulated electricity price data. First, determine the loss calculation function of the target CGAN. For the discriminator, the binary cross-entropy loss function (BCELoss) is selected because it can effectively measure the model's ability to distinguish between real and generated data. For the generator, BCELoss is also used, but the optimization direction is adjusted so that it can generate high-quality simulation vectors that are difficult for the discriminator to distinguish. Then, the real electricity price data and the simulation vector generated by the generator are input into the discriminator to calculate the loss of the discriminator. Using the loss calculation result of the discriminator, the gradient of the discriminator parameters is calculated by back propagation, and the discriminator parameters are adjusted using an optimization algorithm (such as Adam) to reduce its loss. Next, the generator generates a new simulation vector based on the current state of the discriminator. The loss of the generator is calculated. This loss is calculated from the discriminator's judgment result on the "authenticity" of the generated data, aiming to make the data generated by the generator more difficult to distinguish. Using the loss calculation results of the generator, the gradient of the generator parameters is calculated through back propagation, and the parameters of the generator are adjusted with an optimization algorithm to improve the quality of the generated data and make the simulation vector closer to the real electricity price data. Through precise loss function setting and gradient adjustment mechanism, CGAN technology is effectively used to generate a large amount of high-quality simulated electricity price data, which not only enriches the training materials of the electricity price prediction model, but also improves the prediction and generalization capabilities of the model, providing a solid data foundation for power companies to cope with market fluctuations and policy changes.
[0043] In an exemplary embodiment, before using the target condition to generate a target data set corresponding to the adversarial network to expand the electricity price data, the method also includes: determining the data demand corresponding to the electricity price prediction model; determining the target data volume to be generated based on the data demand and the actual amount corresponding to the original data; and using the target data volume to control the expansion size of the target data set.
[0044] Optionally, a power generation company uses conditional generative adversarial network (CGAN) technology for data enhancement. First, by analyzing the training history and prediction performance of the electricity price prediction model, it is determined that in order to achieve the goal of at least 10% improvement in prediction accuracy, the model needs a data set of at least 10,000 samples for training. Considering the existing data volume (about 700 samples a week), they determined that the data demand is 10,000 samples. Based on the size of the original data set (about 700 samples), in order to meet the data demand of 10,000 samples, it is calculated that an additional 9,300 samples need to be generated through CGAN. After the CGAN training is completed, the generator is used to generate data according to the determined target data volume. The generation process is controlled within 9,300 samples, which not only meets the data requirements of the model training, but also avoids the risk of increased computing costs and decreased data quality caused by generating too much data. Through the above-mentioned precise data demand assessment, goal-oriented data generation and flexible and controllable data set expansion strategy, the efficiency and pertinence of data generation are ensured, excessive consumption of resources is avoided, and more reliable data support is provided for effective decision-making in the electricity spot market.
[0045] Obviously, the embodiments described above are only some embodiments of the present application, not all embodiments. In order to better understand the above method, the above process is described below in conjunction with the embodiments, but it is not intended to limit the technical solutions of the embodiments of the present application, specifically:
[0046] An optional embodiment of the present application provides a real-time electricity price data enhancement method based on a conditional generative adversarial network to solve the problem of poor tuning effect and low prediction accuracy of the real-time electricity price prediction model in the electricity spot market due to insufficient data volume. The method constructs a CGAN model including a generator and a discriminator, wherein the generator generates simulated real-time electricity price data in batches under the guidance of random noise and sampling samples, while the discriminator learns to distinguish between real and generated electricity price data. During the training process, by using multiple types of activation functions and combining specific loss calculation functions for gradient adjustment, the simulated data finally generated can meet the latest market dynamics, effectively expand the training data set, and thus significantly improve the accuracy and stability of the electricity price prediction model.
[0047] Optional, Figure 3 It is a model architecture diagram based on a conditional generative adversarial network according to an embodiment of the present application; Figure 3 There are three main parts, as follows:
[0048] (1) Sampling samples and random noise: As the input of CGAN, sampling samples come from real data sets and are used to provide conditions for the generation process; random noise provides randomness for the generator and helps generate diverse simulation data.
[0049] (2) Generator: Receives random noise and sampled samples, and converts these inputs into simulated real-time electricity price data through an internal network model containing an Embedding layer and a Multiply layer. The goal of the generator is to generate simulated data that is difficult to distinguish from real data.
[0050] (3) Discriminator: It is used to determine whether a sample is real data or data simulated by the generator. Specifically, it receives the simulated data output by the generator and the pre-processed real data, judges the authenticity of the data through the internal network model, and outputs a probability value indicating the possibility that the data is real data.
[0051] Optionally, for the conditional generative adversarial network model, the real real-time electricity price data and the simulated electricity price data are input alternately. When the authenticity discrimination result of the discriminator for the given real or simulated data is about 0.5, it means that the generator model training is successful, and the data set can be effectively expanded based on the recent real-time electricity price data. Different from the traditional generative adversarial network, in order to achieve the goal of generating a large number of the same type of data based on a small number of samples, the input of the conditional generative network also has a "condition" of sampling samples. The sampled samples will be added to the training process of the generator and the discriminator, so that the final generator can quickly imitate the same type of data based on the type of the sampled samples, and expand the real-time electricity price data set of the past week.
[0052] Optional, Figure 4 The present invention is a flowchart of a method for enhancing real-time electricity price data based on a conditional generative adversarial network according to an embodiment of the present application; the method specifically comprises the following steps:
[0053] Step 1: Data preprocessing. Different from the traditional training method, the goal of this application is to enable the generative adversarial network model to learn the recent electricity price change trend based on the recent electricity price data. Therefore, when constructing the training set, the original data set needs to be cut into units of weeks. There are 7*96 points of electricity price data per week, so a one-dimensional vector of 672 points is constructed as input each week. After standardization, it can be input into the discriminator.
[0054] Optional, day-ahead declaration means that if the power generation day is D-day, the power plant needs to declare the power generation curve of D-day on the morning of D-1. Due to the uncertainty of new energy output, the declaration needs to rely on short-term power forecasts. The power generation curve is generally composed of 96 points, each point represents the average power generation from the current moment to the next 15 minutes. Each point multiplied by 15 minutes represents the declared power in the current 15 minutes. The day-ahead electricity price is used to calculate the income of the declared power (the medium and long-term power needs to be deducted).
[0055] Step 2: Generator construction. The generator uses normally distributed random noise and sampling samples as input. The random noise input vector is 672 points. The sampling sample uses one day's data, that is, 96 points, and uses the Embedding layer to convert it into a dense vector of the length of the random noise vector. Then use the Multiply layer to embed the sampling sample and the noise vector into a joint representation. This layer multiplies the corresponding items of two vectors of equal length and outputs a single vector as the resulting product, and uses the resulting vector as input. The generator uses a neural network model, and the activation function uses relu() and tanh(). The output data is 672 points of simulated real-time electricity price data for one week, which serves as another input to the discriminator.
[0056] Optionally, the real-time electricity price during the day is used to calculate the revenue from the actual power generation (the day-ahead power generation needs to be deducted). There are 96 points throughout the day, and each point represents the electricity price (MWh / yuan) from the current moment to the next 15 minutes.
[0057] It should be noted that, in general, the 672-point simulated real-time electricity price data output by the generator without the optimization process is very different from the real electricity price data. The generator needs to be optimized according to the results of the discriminator.
[0058] Step 3: Discriminator construction. The discriminator is used to distinguish whether any input sample is real or fake. The discriminator uses a neural network model to judge the real-time electricity price data faked by the generator and the real electricity price data after preprocessing. For the conditional generative adversarial network model, the Embedding layer is needed to convert the sampled sample into a dense vector of 672 points, which is represented as a joint vector of 672 points together with the output of the generator. This vector serves as the input of the discriminator. The three-layer network of the discriminator uses Leakrelu(), relu(), and tanh() as activation functions layer by layer, and the output value is the probability of judging that the input is real data.
[0059] Step 4: Discriminator optimization. The optimization direction of the discriminator is that when the generator's imitation electricity price data is used as input, the output probability should be close to 0; when the real electricity price data is used as input, the output probability should be close to 1. The loss calculation function uses BCELoss(), and the optimizer uses Adam(). Through continuous training, the discriminator's ability to identify real data will continue to increase.
[0060] Step 5: Generator optimization. Based on the 672-point vector simulated by the generator, the discriminator will output a probability value to determine whether the data is real data or simulated data. For the generator, the optimization direction is exactly opposite to that of the discriminator. For the given electricity price data simulated by the generator, because the discriminator hopes that its probability output value is close to 0, and the generator hopes that the probability value output by the discriminator is close to 1, when doing gradient descent optimization, it should be noted that the direction in which the generator calculates the loss is opposite to that of the discriminator, which makes the optimization directions of the two opposite. The loss calculation function of the generator uses BCELoss(), and the optimizer uses Adam().
[0061] Optionally, after continuous training and model convergence, the final discriminator outputs a probability value of 0.5 for the real electricity price data or the electricity price data imitated by the generator, indicating that it cannot determine whether the data is real or fake. At this time, the model has converged and can be put into production and used to expand the data set. When expanding the data set, a normally distributed random number and the real electricity price of a certain day can be used as input, and a converged model can be used to output 672 points of electricity price vector data.
[0062] It should be noted that during the model training process, it is necessary to closely monitor the loss change trend of the generator and discriminator, as well as the accuracy of the discriminator in distinguishing generated data from real data. Mode collapse may occur in the convergence process, that is, the types of data generated by the generator become very limited and cannot fully reflect market dynamics. Therefore, the diversity and quality of generated data should be checked regularly to ensure the effectiveness of model training. When judging whether the CGAN model has converged, it is necessary to observe whether the discriminator's discrimination results for generated data and real data are stable at around 0.5, which means that the discriminator cannot distinguish between generated data and real data, and the model reaches an ideal equilibrium state. However, more complex indicators may be required in actual operations, such as comprehensively judging the convergence state of the model by the diversity, stability and fit of the generated data with the market.
[0063] In summary, the optional embodiment of the present application, through the CGAN model, takes the recent real electricity price data as a condition, uses random noise and deep learning technology to generate a large amount of "simulated" electricity price data that conforms to the recent market characteristics, thereby effectively expanding the data set. The simulation data generated by this method not only enriches the original data set, but also reflects the latest changes and trends in the market, and provides more comprehensive and higher-quality training materials for the electricity price prediction model, thereby improving the prediction accuracy and stability of the model. Power generation companies can formulate better power generation plans based on these simulation data, reduce economic losses caused by prediction errors, and also reduce the cycle of model tuning, improve the efficiency and real-time nature of data-driven decision-making, and are an important technical support for the intelligent transformation of the power industry.
[0064] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0065] In this embodiment, a data set expansion device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0066] Figure 5 is a structural block diagram of a data set expansion device according to an embodiment of the present application, the device comprising:
[0067] A generating module 52, configured to extract a sampling sample vector from the sampled data, and generate a plurality of simulation vectors based on the sampling sample vector and a preset random noise vector;
[0068] A judgment module 54 is used to judge the multiple simulation vectors and the sample vectors to obtain multiple probability values that different vectors are real electricity price data;
[0069] A first determination module 56 is used to determine the target generators corresponding to the multiple simulation vectors and the target discriminators corresponding to the multiple probability values when the multiple probability values all meet the preset probability threshold, and generate a target conditional generative adversarial network based on the target generator and the target discriminator;
[0070] The expansion module 58 is used to generate a target data set corresponding to the adversarial network expansion charging price data using the target condition.
[0071] The above device extracts a sampling sample vector from the sampled data, generates multiple simulation vectors based on the sampling sample vector and a preset random noise vector; performs judgment processing on the multiple simulation vectors and the sampling sample vector to obtain multiple probability values that different vectors are real electricity price data; when the multiple probability values all meet the preset probability threshold, determines the target generator corresponding to the multiple simulation vectors and the target discriminator corresponding to the multiple probability values, generates a target conditional generative adversarial network based on the target generator and the target discriminator; uses the target conditional generative adversarial network to expand the target data set corresponding to the electricity price data. The above technical solution solves the problem of poor tuning effect and low prediction accuracy of the real-time electricity price prediction model in the electricity spot market due to insufficient data volume. Furthermore, by constructing a conditional generative adversarial network, a large amount of simulation data is generated, the electricity price data set is effectively expanded, and the training effect and prediction accuracy of the prediction model are improved.
[0072] In an exemplary embodiment, the above-mentioned device also includes: a second determination module, which is used to determine the amount of data to be expanded using the conditional generative adversarial network before extracting the sampling sample vector from the sampled data; determine the collection period according to the amount of data; and cut the original data in the database based on the collection period to obtain multiple sampling data.
[0073] In an exemplary embodiment, the above-mentioned generation module is also used to convert the sampled sample vector into multiple dense vectors with the same length as the preset random noise vector through the embedding layer in the initial generator; multiply the corresponding items of the multiple dense vectors and the preset random noise vector to obtain multiple simulation vectors.
[0074] In an exemplary embodiment, the above-mentioned judgment module is also used to use at least three types of activation functions to judge multiple simulation vectors and sampling sample vectors to obtain a target judgment result, wherein the probability of the processing result corresponding to the simulation vector should be close to 0, and the probability of the processing result corresponding to the sampling sample vector should be close to 1; based on the target judgment result, determine multiple probability values that different vectors are real electricity price data.
[0075] In an exemplary embodiment, the above-mentioned device also includes: an adjustment module, which is used to determine a target generator corresponding to multiple simulation vectors and a target discriminator corresponding to multiple probability values, and after generating a target conditional generative adversarial network based on the target generator and the target discriminator, determine the loss calculation function corresponding to the target conditional generative adversarial network; and use the loss calculation function to perform gradient adjustment on the target conditional generative adversarial network.
[0076] In an exemplary embodiment, the above-mentioned device also includes: a third determination module, which is used to determine the data demand corresponding to the electricity price prediction model before using the target condition to generate the target data set corresponding to the expanded electricity price data of the adversarial network; determine the target data volume to be generated based on the actual amount corresponding to the data demand and the original data; and use the target data volume to control the expansion size of the target data set.
[0077] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0078] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0079] S1, extracting a sampling sample vector from the sampled data, and generating a plurality of simulation vectors based on the sampling sample vector and a preset random noise vector;
[0080] S2. Perform judgment processing on the multiple simulation vectors and the sample vectors to obtain multiple probability values that different vectors are real electricity price data;
[0081] S3, when the multiple probability values all meet the preset probability threshold, determining the target generators corresponding to the multiple simulation vectors and the target discriminators corresponding to the multiple probability values, and generating a target conditional generative adversarial network based on the target generator and the target discriminator;
[0082] S4. Generate a target data set corresponding to the adversarial network expansion charging price data using the target condition.
[0083] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0084] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0085] An embodiment of the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps in any one of the above method embodiments are performed.
[0086] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0087] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0088] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0089] S1, extracting a sampling sample vector from the sampled data, and generating a plurality of simulation vectors based on the sampling sample vector and a preset random noise vector;
[0090] S2. Perform judgment processing on the multiple simulation vectors and the sample vectors to obtain multiple probability values that different vectors are real electricity price data;
[0091] S3, when the multiple probability values all meet the preset probability threshold, determining the target generators corresponding to the multiple simulation vectors and the target discriminators corresponding to the multiple probability values, and generating a target conditional generative adversarial network based on the target generator and the target discriminator;
[0092] S4. Generate a target data set corresponding to the adversarial network expansion charging price data using the target condition.
[0093] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0094] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0095] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0096] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for expanding a data set, characterized in that: include: Extracting a sampling sample vector from the sampled data, and generating a plurality of simulation vectors based on the sampling sample vector and a preset random noise vector; Performing judgment processing on the multiple simulation vectors and the sample vectors to obtain multiple probability values that different vectors are real electricity price data; When the multiple probability values all meet the preset probability threshold, determine the target generators corresponding to the multiple simulation vectors and the target discriminators corresponding to the multiple probability values, and generate a target conditional generative adversarial network based on the target generator and the target discriminator; The target condition is used to generate a target data set corresponding to the adversarial network augmented charging price data.
2. The method according to claim 1, characterized in that Before extracting the sampling sample vector from the sampled data, the method further includes: Determining the amount of data to be expanded using the conditional generative adversarial network; Determining a collection period according to the amount of data; The original data in the database is cut based on the acquisition cycle to obtain a plurality of sampled data.
3. The method according to claim 1, characterized in that Extracting a sampling sample vector from the sampled data, and generating a plurality of simulation vectors based on the sampling sample vector and a preset random noise vector, including: Converting the sample vector into multiple dense vectors with the same length as the preset random noise vector through an embedding layer in the initial generator; The plurality of dense vectors are multiplied by corresponding items of the preset random noise vector to obtain a plurality of simulation vectors.
4. The method according to claim 1, characterized in that: The plurality of simulation vectors and the sample vectors are judged and processed to obtain a plurality of probability values that different vectors are real electricity price data, including: At least three types of activation functions are used to judge the multiple simulation vectors and the sample vectors to obtain a target judgment result, wherein the probability of the processing result corresponding to the simulation vector should be close to 0, The probability of the processing result corresponding to the sample vector should be close to 1; Based on the target judgment result, multiple probability values of different vectors being real electricity price data are determined.
5. The method according to claim 1, characterized in that After determining a target generator corresponding to the multiple simulation vectors and a target discriminator corresponding to the multiple probability values, and generating a target conditional generative adversarial network based on the target generator and the target discriminator, the method further includes: Determine a loss calculation function corresponding to the target condition generative adversarial network; The loss calculation function is used to perform gradient adjustment on the target conditional generative adversarial network.
6. The method according to claim 1, characterized in that Before using the target condition to generate a target data set corresponding to the adversarial network augmented charging price data, the method further includes: Determine the data demand corresponding to the electricity price prediction model; Determine the target data amount to be generated according to the data demand amount and the actual amount corresponding to the original data; The target data volume is used to control an expansion size of the target data set.
7. A data set expansion device, characterized in that: include: A generating module, used for extracting a sampling sample vector from the sampled data, and generating a plurality of simulation vectors based on the sampling sample vector and a preset random noise vector; A judgment module, used for judging and processing the multiple simulation vectors and the sample vectors, and obtaining multiple probability values of different vectors being real electricity price data; A first determination module is used to determine the target generators corresponding to the multiple simulation vectors and the target discriminators corresponding to the multiple probability values when the multiple probability values all meet the preset probability threshold, and generate a target conditional generative adversarial network based on the target generator and the target discriminator; An expansion module is used to generate a target data set corresponding to the adversarial network expansion charging data using the target condition.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 6 when executed.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
