Method, device and computer equipment for generating and verifying time-series electric power carbon flow data
By combining the timing power flow section data and the carbon emission index data of the generator set, the power carbon emission flow calculation model is used to train the timing generation model to generate virtual carbon flow data, and the data reliability is improved through the verification module, the accuracy and real-time problems of timing power carbon flow data generation and verification in the prior art are solved, and the high-reliability timing power carbon flow data generation is achieved.
Patent Information
- Application Number
- CN202311377976.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-24
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2043-10-24
AI Technical Summary
The prior art has problems with accuracy and real-time when generating and verifying timing power carbon flow data, resulting in unreliable data.
By using the timing power flow section data and the carbon emission index data of the generator set, combined with the power carbon emission flow calculation model, the timing power-carbon flow coupling characteristic data is generated and pre-processed. The timing generation model is trained to generate virtual carbon flow data, and finally the data reliability is improved through the verification module.
It realizes the generation of accurate and reliable timing power carbon flow data, improves the real-time and reliability of the data, and supports more effective carbon tracking and power market decision-making.
Smart Images

Figure CN117421332B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, computer equipment, storage medium and computer program product for generating and verifying time-series electric power carbon flow data. Background Art
[0002] Time-series power carbon flow data is an important data basis for realizing real-time carbon tracking of large power grids and comprehensive spatiotemporal power carbon analysis models, and is crucial for carbon emission trend analysis, periodic analysis, real-time power carbon monitoring and forecasting. Accurate and reliable time-series power carbon flow data helps promote the integrated development of the green power market, carbon rights trading market and power market, and plays a positive role in achieving the goal of "carbon neutrality".
[0003] In traditional technology, the calculation of time-series power carbon flow data is achieved by analyzing historical coal, gas and power generation data and following the existing carbon trading market measurement standards. However, in the process of calculating time-series power carbon flow data in traditional technology, due to the great mismatch between carbon measurement and carbon accounting cycle and power grid data in real time, the calculation results of time-series power carbon flow data are not accurate enough. In addition, in traditional technology, the calculation results of time-series power carbon flow data are verified by obtaining real-time electric energy parameters, which increases the verification delay during the verification process. At the same time, the verification results are affected by factors such as the uncertainty of real-time electric energy parameters. Therefore, there is currently a lack of accurate and reliable time-series power carbon flow data generation and verification methods. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for generating and verifying time-series power carbon flow data, which can generate accurate and reliable time-series power carbon flow data, in response to the above-mentioned technical problems.
[0005] In a first aspect, the present application provides a method for generating and verifying time-series power carbon flow data, comprising:
[0006] According to the time-series power flow section data, the carbon emission index data of the generator set and the power carbon emission flow calculation model, the time-series power-carbon flow coupling characteristic data is obtained, and the time-series power-carbon flow coupling characteristic data is preprocessed to obtain training samples;
[0007] The time series generation model is trained through training samples until the training is completed, thereby generating virtual carbon flow data;
[0008] The virtual carbon flow data is divided into calculation input data and control group output data, the calculation input data is imported into the time series carbon flow calculation unit to obtain time series output data, and the time series output data is used as time series power carbon flow data;
[0009] By comparing the time-series electricity carbon flow data with the output data of the control group, the verification results of the time-series electricity carbon flow data are obtained.
[0010] In one embodiment, according to the time-series power flow section data, the carbon emission index data of the generator set, and the power carbon emission flow calculation model, the time-series power-carbon flow coupling characteristic data includes:
[0011] The time-series power flow section data and the carbon emission index data of the generator set are input into the power carbon emission flow calculation model, and matrix calculation is performed to determine the time-series power-carbon flow coupling characteristic data.
[0012] In one embodiment, the time series power-carbon flow coupling characteristic data is preprocessed to obtain training samples including:
[0013] splicing the time-series power-carbon flow coupling characteristic data, the key carbon characteristic data set before the time-series carbon flow calculation, and the key electric characteristic data to obtain spliced training data;
[0014] The concatenated training data is normalized to obtain training samples.
[0015] In one embodiment, the time series generation model includes an embedding layer, a generation layer, a supervision layer, a recovery layer, and a discriminative layer;
[0016] The time series generation model is trained through training samples until the training is completed, and the generated virtual carbon flow data includes:
[0017] Import the training samples into the embedding layer, project the original feature space of the training samples into the latent space through the embedding layer, and obtain the output data of the embedding layer;
[0018] The random sample space is projected into the virtual sample space through the generating layer to obtain the tensor output data of the generating layer;
[0019] The supervision layer compares and verifies all hidden states before the current moment, obtains the first output data of the supervision layer based on the output data of the embedding layer, and transmits the first output data of the supervision layer to the recovery layer; the supervision layer obtains the second output data of the supervision layer based on the tensor output data of the generation layer, and transmits the second output data of the supervision layer to the discrimination layer;
[0020] The recovery layer obtains the output variable of the recovery layer based on the first output data of the supervision layer;
[0021] The discriminant layer obtains a first discriminant result based on the output data of the embedding layer, and obtains a second discriminant result based on the second output data of the supervision layer.
[0022] In one embodiment, the time series generation model is trained by training samples until the training is completed, and generating virtual carbon flow data further includes:
[0023] According to the output data of the embedding layer, the first output data of the supervision layer, the output variable of the recovery layer, and the first discrimination result and the second discrimination result, the loss functions of the supervision layer, the generation layer and the discrimination layer are minimized iteratively. When the loss function is minimized, the model training is completed, and the output data of the current time series generation model is used as the virtual carbon flow data.
[0024] In one embodiment, by comparing the time series power carbon flow data with the control group output data, the verification result of the time series power carbon flow data is obtained, including:
[0025] Compare the time series power carbon flow data with the control group output data to obtain the error matrix between the time series output data and the control output data;
[0026] The error matrix is quantified to obtain the verification result of the time-series power carbon flow data.
[0027] In a second aspect, the present application also provides a time series power carbon flow data generation and verification device, comprising:
[0028] An acquisition module is used to obtain time-series power-carbon flow coupling characteristic data according to the time-series power flow section data, the carbon emission index data of the generator set, and the power carbon emission flow calculation model, and pre-process the time-series power-carbon flow coupling characteristic data to obtain training samples;
[0029] A generation module, used for training the time series generation model through training samples until the training is completed and generating virtual carbon flow data;
[0030] The verification module is used to divide the virtual carbon flow data into calculation input data and control group output data, import the calculation input data into the time series carbon flow calculation unit to obtain the time series output data; take the calculation input data as the calculation input of the time series carbon flow calculation model to obtain the time series output data, and use the time series output data as the time series power carbon flow data; and obtain the verification result of the time series power carbon flow data by comparing the time series power carbon flow data with the control group output data.
[0031] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0032] According to the time-series power flow section data, the carbon emission index data of the generator set and the power carbon emission flow calculation model, the time-series power-carbon flow coupling characteristic data is obtained, and the time-series power-carbon flow coupling characteristic data is preprocessed to obtain training samples;
[0033] The time series generation model is trained through training samples until the training is completed, thereby generating virtual carbon flow data;
[0034] The virtual carbon flow data is divided into calculation input data and control group output data, the calculation input data is imported into the time series carbon flow calculation unit to obtain time series output data, and the time series output data is used as time series power carbon flow data;
[0035] By comparing the time-series electricity carbon flow data with the output data of the control group, the verification results of the time-series electricity carbon flow data are obtained.
[0036] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0037] According to the time-series power flow section data, the carbon emission index data of the generator set and the power carbon emission flow calculation model, the time-series power-carbon flow coupling characteristic data is obtained, and the time-series power-carbon flow coupling characteristic data is preprocessed to obtain training samples;
[0038] The time series generation model is trained through training samples until the training is completed, thereby generating virtual carbon flow data;
[0039] The virtual carbon flow data is divided into calculation input data and control group output data, the calculation input data is imported into the time series carbon flow calculation unit to obtain time series output data, and the time series output data is used as time series power carbon flow data;
[0040] By comparing the time-series electricity carbon flow data with the output data of the control group, the verification results of the time-series electricity carbon flow data are obtained.
[0041] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0042] According to the time-series power flow section data, the carbon emission index data of the generator set and the power carbon emission flow calculation model, the time-series power-carbon flow coupling characteristic data is obtained, and the time-series power-carbon flow coupling characteristic data is preprocessed to obtain training samples;
[0043] The time series generation model is trained through training samples until the training is completed, thereby generating virtual carbon flow data;
[0044] The virtual carbon flow data is divided into calculation input data and control group output data, the calculation input data is imported into the time series carbon flow calculation unit to obtain time series output data, and the time series output data is used as time series power carbon flow data;
[0045] By comparing the time-series electricity carbon flow data with the output data of the control group, the verification results of the time-series electricity carbon flow data are obtained.
[0046] The above-mentioned time-series power carbon flow data generation and verification method, device, computer equipment, storage medium and computer program product obtain the time-series power-carbon flow coupling characteristic data according to the time-series power flow section data, the carbon emission index data of the generator unit and the power carbon emission flow calculation model, and pre-process the time-series power-carbon flow coupling characteristic data to obtain training samples, which can make the training sample data more accurate and rich, and help improve the performance of the model. The time-series generation model is trained by training samples until the training is completed, and virtual carbon flow data is generated. The virtual carbon flow data is divided into calculation input data and control group output data, and the calculation input data is imported into the time-series carbon flow calculation unit to obtain the time-series output data. The time-series output data is used as the time-series power carbon flow data, and accurate time-series power carbon flow data can be generated. By comparing the time-series power carbon flow data with the control group output data, the verification result of the time-series power carbon flow data is obtained, which can improve the reliability and integrity of the generated time-series power carbon flow data and provide decision support. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 An application environment diagram of a method for generating and verifying time-series electric power carbon flow data in one embodiment;
[0049] Figure 2 A schematic diagram of a flow chart of a method for generating and verifying time-series electric power carbon flow data in one embodiment;
[0050] Figure 3 A schematic diagram of a framework of a timing generation model in one embodiment;
[0051] Figure 4 A schematic diagram of a flow chart of steps for obtaining a time-series power carbon flow data verification result in an embodiment;
[0052] Figure 5 A schematic diagram of a verification method for time-series power carbon flow data in an embodiment;
[0053] Figure 6 A structural block diagram of a device for generating and verifying time-series electric power carbon flow data in one embodiment;
[0054] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] The time series power carbon flow data generation and verification method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal 102 sends a time-series power carbon flow data generation and verification request to the server 104, and the server 104 parses the time-series power carbon flow data generation and verification request, and obtains the corresponding time-series power flow section data and the carbon emission index data of the generator unit and the power carbon emission flow calculation model to obtain the time-series power-carbon flow coupling characteristic data, and pre-processes the time-series power-carbon flow coupling characteristic data to obtain training samples. The time-series generation model is trained through the training samples to generate virtual carbon flow data. The virtual carbon flow data is divided into calculation input data and control group output data, and the calculation input data is imported into the time-series carbon flow calculation unit to obtain the time-series output data, that is, the time-series power carbon flow data, and the time-series power carbon flow data is compared with the control group output data to obtain the verification result of the time-series power carbon flow data. The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0057] In an exemplary embodiment, Figure 2 As shown, a method for generating and verifying time-series power carbon flow data is provided, and the method is applied to Figure 1 The server in the example is used to illustrate, including the following steps 202 to 208. Among them:
[0058] Step 202, according to the time-series power flow section data, the carbon emission index data of the generator set and the power carbon emission flow calculation model, obtain the time-series power-carbon flow coupling characteristic data, and pre-process the time-series power-carbon flow coupling characteristic data to obtain training samples.
[0059] Among them, the time-series power flow section data refers to the data collected and recorded at different time points for the flow at a specific location in the power system, which usually contains the current, voltage, power and other information of each section of the power system, i.e., node or line, over a period of time. The time-series power flow section data used for analysis includes branch active power flow distribution, system bus node information, generator unit information, load distribution information, etc. The carbon emission index data of the generator unit refers to the information used to measure the carbon emissions generated by the generator unit during the power generation process. The carbon emission index data of the generator unit mainly includes carbon emissions, carbon emission intensity, carbon emission factor, combustion type, rated capacity of the generator unit and other data.
[0060] The power carbon emission flow calculation model is a matrix calculation method for the power system carbon emission flow. The time-series power-carbon flow coupling characteristic data can be calculated through the matrix calculation method for the power system carbon emission flow. The time-series power-carbon flow coupling characteristic data refers to the relationship data between power production and carbon emissions in different time periods. It is obtained by coupling the power flow section data with time-series information and the carbon emission index data of the generator unit. The time-series power-carbon flow coupling characteristic data can include power production data, carbon emission data, power system load demand, carbon emission factor data, etc.
[0061] Optionally, preprocessing the time-series power-carbon flow coupling characteristic data to obtain training samples means preprocessing the time-series power-carbon flow coupling characteristic data by using data normalization methods such as max-min (minimum-maximum) scaling and mean-variance method. Preprocessing the time-series power-carbon flow coupling characteristic data may also include data cleaning, data standardization, feature selection, etc.
[0062] Step 204 , training the time series generation model through training samples until the training is completed, and generating virtual carbon flow data.
[0063] Build a training framework for generative adversarial networks and supervised learning, set network structure, learning rate and other parameters, initialize the training process based on training samples, and after training, export the generative model and the generated virtual carbon flow data.
[0064] Step 206, dividing the virtual carbon flow data into calculation input data and control group output data, taking the calculation input data and importing it into the time series carbon flow calculation unit to obtain time series output data, and using the time series output data as time series power carbon flow data.
[0065] The virtual carbon flow data is segmented to obtain the calculation input data and the control group output data. Exemplarily, the virtual carbon flow data can be segmented by time window segmentation, threshold-based segmentation, stratified sampling segmentation, event-based segmentation and other methods. Among them, the time window segmentation method refers to segmenting the continuous time series data according to the set time window length, such as the data of a day can be segmented into multiple windows of hours or minutes, and the data in each window is regarded as a fragment for processing. The threshold-based segmentation method refers to segmenting the data according to the set threshold. For example, a threshold can be set, and when the data exceeds the threshold, the data is divided into different fragments. The stratified sampling segmentation method means that for unbalanced time series data, stratified sampling can be used to ensure that each category or subgroup has enough representative samples in the training set, validation set and test set. The event-based segmentation method means that since the data contains specific events or emergencies, the time series data before and after these events can be segmented according to these events and analyzed separately.
[0066] Import the calculation input data into the time series carbon flow calculation unit to obtain the time series output data. Analyze the generated virtual carbon flow data x' to obtain:
[0067] x'=[X' in ,X' out ]=[[C',G'],P']
[0068] Among them, X' in =[C',G'],X' out =P'. C' represents the key carbon characteristic data set before the calculation of the time series power-carbon flow coupling characteristic data of the initialization training is completed, G' represents the key electric characteristic data after the initialization training is completed, and P' represents the characteristic data set related to the calculation of the time series power-carbon flow coupling characteristic data after the initialization training is completed.
[0069] Replace the corresponding parts of the original sets E and S with [C', G'] to obtain E' and S'. At this time, replace the generated data into the time series carbon flow calculation unit M, and we can get:
[0070] P' M =M(E',S')
[0071] Among them, E is the carbon emission intensity of the unit, E' is the carbon emission intensity of the unit that has completed the initialization training, S is the time series power flow section data set, S' is the time series power flow section data set that has completed the initialization training, P' M Output data after the time series model calculation is completed for initialization training.
[0072] Step 208, by comparing the time-series power carbon flow data with the output data of the control group, a verification result of the time-series power carbon flow data is obtained.
[0073] The virtual carbon flow data is divided into calculation input data and control group output data. The calculation input data is imported into the time series carbon flow calculation unit to obtain the time series output data, which is the time series power carbon flow data. The time series power carbon flow data is compared with the control group output data. For example, the error method can be used to compare the two. The time series power carbon flow data and the control group output data can also be compared using mean comparison, variance analysis, and effect size calculation methods. Mean comparison means that the mean of the time series power carbon flow data and the control group data can be calculated and compared. The mean size of each group of data can be compared to determine whether there is a significant difference. Variance analysis refers to using the variance analysis method to compare the variance difference between the time series power carbon flow data and the control group data, and perform inferential statistical analysis. By judging the significance level of the variance analysis results, it is determined whether there is a difference between the two groups of data. The effect size calculation method can determine whether there is a significant difference between the two groups of data.
[0074] By comparing the time-series electricity carbon flow data with the output data of the control group, the verification results of the time-series electricity carbon flow data are obtained.
[0075] In the above-mentioned method for generating and verifying time-series power carbon flow data, the time-series power-carbon flow coupling characteristic data is obtained according to the time-series power flow section data, the carbon emission index data of the generator unit and the power carbon emission flow calculation model, and the time-series power-carbon flow coupling characteristic data is preprocessed to obtain training samples. The operating status and load characteristics of the power system in different time periods can be understood, which can make the training sample data more accurate and rich, and help improve the performance of the model. The time-series generation model is trained by training samples until the training is completed, and virtual carbon flow data is generated. The virtual carbon flow data is divided into calculation input data and control group output data, and the calculation input data is imported into the time-series carbon flow calculation unit to obtain the time-series output data. The time-series output data is used as the time-series power carbon flow data, and accurate time-series power carbon flow data can be generated. By comparing the time-series power carbon flow data with the control group output data, the verification result of the time-series power carbon flow data is obtained, which can improve the reliability and integrity of the generated time-series power carbon flow data and provide decision support.
[0076] In an exemplary embodiment, according to the time-series power flow section data, the carbon emission index data of the generator set and the power carbon emission flow calculation model, the time-series power-carbon flow coupling characteristic data is obtained, including: inputting the time-series power flow section data and the carbon emission index data of the generator set into the power carbon emission flow calculation model, performing matrix calculation, and determining the time-series power-carbon flow coupling characteristic data.
[0077] The time-series power flow section data is collected and analyzed. The current flow section data used for analysis includes branch active power flow distribution, system bus node information, generator set information, and load distribution information. The time-series power flow section data set is recorded as S t , S t It is the system power grid status information at time t.
[0078] According to the information of the power system units, the carbon emission index data of each unit is collected, and the time-series power-carbon flow coupling characteristic data is calculated by the matrix calculation method of the power system carbon emission flow. The time-series power-carbon flow coupling characteristic data is recorded as Time series power-carbon flow coupling characteristic data The calculation model is:
[0079]
[0080] Among them, t is the time parameter, E t is the carbon emission intensity of the unit at time t, and M(·) is the calculation framework of the time-series power carbon flow.
[0081] In this embodiment, based on the time-series power flow section data, the carbon emission index data of the generator set and the power carbon emission flow calculation model, the time-series power-carbon flow coupling characteristic data is obtained, which can understand the operating status and load characteristics of the power system in different time periods, and make the training sample data more accurate.
[0082] In an exemplary embodiment, the time-series power-carbon flow coupling characteristic data are preprocessed to obtain training samples, including: splicing the time-series power-carbon flow coupling characteristic data, the key carbon characteristic data set before the time-series carbon flow calculation, and the key electric characteristic data to obtain spliced training data; normalizing the spliced training data to obtain training samples.
[0083] By analyzing the time-series power-carbon flow coupling characteristic data, we can obtain:
[0084]
[0085] Among them, t is the time parameter, P t The characteristic data set related to the calculation of the time series power-carbon flow coupling characteristic data is C t C t ∈E t , C t G is the key carbon characteristic data set before calculating the time series power-carbon flow coupling characteristic data, denoted by t ∈S t ,S t is the key electrical characteristic data. As a training data set, the concatenated training data is as follows:
[0086]
[0087] For example, the above-mentioned spliced training data can be preprocessed by using data normalization methods such as min-max scaling and mean-variance method, and the training data after data normalization is used as training samples. The size of the sample feature space F of the training sample is |F|=|X t |=|C t |+|G t |+|P t |.
[0088] In this embodiment, the time-series power-carbon flow coupling characteristic data is preprocessed to obtain training samples, which can make the training sample data more accurate and rich, and help improve the performance of the model.
[0089] In an exemplary embodiment, the time series generation model includes an embedding layer, a generation layer, a supervision layer, a recovery layer and a discrimination layer; the time series generation model is trained by training samples until the training is completed, and the generation of virtual carbon flow data includes: importing the training samples into the embedding layer, projecting the original feature space of the training samples to the hidden space through the embedding layer, and obtaining the embedding layer output data; projecting the random sample space to the virtual sample space through the generation layer to obtain the generation layer tensor output data; comparing and verifying all hidden states before the current moment through the supervision layer, obtaining the first output data of the supervision layer based on the embedding layer output data, and transmitting the first output data of the supervision layer to the recovery layer; the supervision layer obtains the second output data of the supervision layer based on the generation layer tensor output data, and transmits the second output data of the supervision layer to the discrimination layer; the recovery layer obtains the recovery layer output variable based on the first output data of the supervision layer; the discrimination layer obtains the first discrimination result based on the embedding layer output data, and obtains the second discrimination result based on the second output data of the supervision layer.
[0090] like Figure 3 As shown in the figure, a layer display of a neural network based on the Keras framework is given. The neural network includes 5 core neural network layers (Layer), namely the embedding layer (Embedding Layer), the recovery layer (Recovery Layer), the generator layer (GeneratorLayer), the discriminator layer (DiscriminatorLayer) and the supervisor layer (SupervisorLayer). For the training batch data, 15 minutes is selected as a sampling node, the training time series length is 96, and the original feature space size is |F|=|X t |. Therefore, the shape of the input layer's initialization input tensor is Wherein * represents the size of the training batch, supports customization in the layer, and is recorded as parameter N in the example description of the present invention. In the Keras framework, the embedding layer is composed of neuron cells (Cell) composed of gated recurrent units (Gated Recurrent Units, GRU), and stacking of multiple groups of neuron cells is achieved through the Keras built-in stacking function keras.layers.StackedRNNCells.
[0091] Different from the standard generative adversarial network, the present invention first imports the training data into the embedding layer, at which time the original feature space F is projected into the hidden space H, and the output of the embedding layer outputs the data h. At this time, the size of the hidden space |H|=π|F|, where π is the embedding coefficient. At time t, the introduced supervision layer will realize the comparative verification of all hidden states before time t-1, and the supervision layer outputs the first output data h of the supervision layer. * , and h * Pass it to the recovery layer to get the recovery layer output variable x * .
[0092] The principle of adversarial network modeling is similar: the input layer inputs random variables z input , the shape of the input layer tensor is consistent with the initial data. The random sample space is projected to the virtual sample space through the generation layer to obtain the generation layer tensor output data e, and the virtual sample space is consistent with the hidden space size of the embedding layer. Similarly, after the supervision layer network is transmitted, the supervision layer is based on the generation layer tensor output data e, and the second output data of the supervision layer is obtained. * For the discriminant layer network, the discriminant layer obtains the first discriminant result y based on the output data h of the embedding layer real , the discriminant layer is based on the second output data e of the supervision layer * The second judgment result y fake .
[0093] In this embodiment, building a training framework for generative adversarial networks and supervised learning can provide greater flexibility and adaptability for the generation of time-series power carbon flow data, while improving the performance of the time-series generation model.
[0094] In an exemplary embodiment, the time series generation model is trained through training samples until the training is completed, and generating virtual carbon flow data also includes: iteratively minimizing the loss functions of the supervision layer, the generation layer, and the discrimination layer according to the embedding layer output data, the first output data of the supervision layer, the recovery layer output variable, and the first discrimination result and the second discrimination result. When the loss function is minimized, the model training is completed, and the output data of the current time series generation model is used as the virtual carbon flow data.
[0095] The loss function and optimization scheme are established for the supervision layer, generation layer and discrimination layer. For the supervision layer model, the definition of the loss function and its minimization iterative scheme are as follows:
[0096]
[0097] Among them, S[·] represents the supervision network, and the loss function S loss It is defined by the least square error (MSE) between the output of the supervision layer and the output of the embedding layer, and is implemented by the stochastic gradient descent (SGD) algorithm g loss The minimization iteration and parameter θ s Updates.
[0098] For the generative layer model, the definition of the loss function and its minimization iterative scheme are as follows:
[0099]
[0100] Among them, G[·] and R[·] represent the generator network and the recovery layer network respectively, and the loss function G loss By G adv and G m The two sets of loss functions are defined together. Among them, the loss function G adv It is used to evaluate the generator network's ability to "cheat" the discriminator, so the loss function is set to binary cross entropy to promote the generator to generate discriminators that can misjudge y fake ≈1, ones(·) represents the built-in function that generates a sequence of all “1”; G m By solving the mean difference and variance of the original data and the restored data, the generator network, the supervisory network, and the restoration layer network are promoted to jointly generate virtual data that is more consistent with the distribution of the original data; k1 and k2 represent the proportional coefficients of the loss function respectively; G loss Minimize the iterations and parameters θ through the stochastic gradient descent function g(·) G ,θ s and θ R Updates.
[0101] For the discriminative layer, the definition of the loss function and its minimization iterative scheme are as follows:
[0102]
[0103] Where D[·] represents the discriminator network and the loss function D loss By D ls1 and D ls2 The two sets of loss functions are defined together. ls1 By using binary cross entropy as loss model, the discriminator can improve y realThe recognition ability is finally minimized through g(·) iteration and parameter θ D renew.
[0104] Set the neural network structure parameters, hyperparameters, learning rate α, training batch size N, training epochs and other training environments, and initialize the training process. After the training is completed, export the generative model, including the generation layer network, supervision layer network and recovery layer network, and export the generated virtual carbon flow data.
[0105] x'=R[S[G[z input ,θ' G ],θ' S ],θ' R ]
[0106] The superscript symbol “'” indicates the parameters and variables that have been trained, and x' is the generated virtual carbon flow data.
[0107] In this embodiment, the time series generation model is trained through training samples until the training is completed. The generation model can optimize the selection of neural network hyperparameters, thereby improving the performance of the time series generation model and enhancing the integrity of the virtual carbon flow data.
[0108] In an exemplary embodiment, Figure 4 As shown, by comparing the time-series power carbon flow data with the control group output data, obtaining the verification result of the time-series power carbon flow data includes steps 402 to 404. Among them:
[0109] Step 402, compare the time series power carbon flow data with the control group output data to obtain an error matrix between the time series output data and the control output data.
[0110] Step 404, quantize the error matrix to obtain the verification result of the time series power carbon flow data.
[0111] Quantifying the error matrix means converting the error value in the error matrix into a measurement index or evaluation index. Figure 5 As shown, the generated virtual carbon flow data is divided into calculation input data and control group output data, and the calculation input data is imported into the time series carbon flow calculation unit to obtain the time series output data. The error matrix of the time series output data and the control output data is calculated, and the quantitative verification result scheme is obtained as follows:
[0112]
[0113] In the above formula, sum tempRepresents the error of each element, and sum represents the overall error. Calculate the error matrix of the timing output data and the control output data to obtain the quantitative verification result, including calculating the error values in the error matrix of the timing output data and the control output data through the mean square error (MSE) to obtain the verification evaluation index of the error matrix of the timing output data and the control output data. MES acc This is the final output verification evaluation index.
[0114] In this embodiment, by comparing the time-series power carbon flow data with the output data of the control group, the verification result of the time-series power carbon flow data is obtained, which can improve the reliability and integrity of the generated time-series power carbon flow data and provide decision support.
[0115] In another embodiment, a method for generating and verifying time-series power carbon flow data is provided, wherein:
[0116] The time-series power flow section data and the carbon emission index data of the generator set are obtained, and the time-series power flow section data and the carbon emission index data of the generator set are input into the power carbon emission flow calculation model to perform matrix calculation to determine the time-series power-carbon flow coupling characteristic data.
[0117] The time-series power-carbon flow coupling characteristic data, the key carbon characteristic data set before the time-series carbon flow calculation and the key electric characteristic data are spliced to obtain spliced training data, and the spliced training data are normalized to obtain training samples.
[0118] The time series generation model includes an embedding layer, a generation layer, a supervision layer, a recovery layer and a discrimination layer. The training samples are imported into the embedding layer, and the original feature space of the training samples is projected to the hidden space through the embedding layer to obtain the output data of the embedding layer; the random sample space is projected to the virtual sample space through the generation layer to obtain the tensor output data of the generation layer; all hidden states before the current moment are compared and verified through the supervision layer, and the first output data of the supervision layer is obtained based on the output data of the embedding layer, and the first output data of the supervision layer is transmitted to the recovery layer; the supervision layer obtains the second output data of the supervision layer based on the tensor output data of the generation layer, and the second output data of the supervision layer is transmitted to the discrimination layer; the recovery layer obtains the output variable of the recovery layer based on the first output data of the supervision layer; the discrimination layer obtains the first discrimination result based on the output data of the embedding layer, and obtains the second discrimination result based on the second output data of the supervision layer.
[0119] According to the output data of the embedding layer, the first output data of the supervision layer, the output variable of the recovery layer, and the first discrimination result and the second discrimination result, the loss functions of the supervision layer, the generation layer and the discrimination layer are minimized iteratively. When the loss function is minimized, the training of the time series generation model is completed, and the output data of the current time series generation model is used as the virtual carbon flow data.
[0120] The virtual carbon flow data is divided into calculation input data and control group output data, and the calculation input data is imported into the time series carbon flow calculation unit to obtain the time series output data, which is used as the time series power carbon flow data. The time series power carbon flow data is compared with the control group output data to obtain the error matrix between the time series output data and the control output data, and the error matrix is quantified to obtain the verification result of the time series power carbon flow data.
[0121] In this embodiment, the time-series power flow section data, the carbon emission index data of the generator unit, and the power carbon emission flow calculation model are used to obtain the time-series power-carbon flow coupling characteristic data, which can understand the operating status and load characteristics of the power system in different time periods, and can make the training sample data more accurate. Preprocessing the time-series power-carbon flow coupling characteristic data to obtain training samples can make the training sample data more accurate and rich, which helps to improve the performance of the model. Build a training framework for generative adversarial networks and supervised learning, train the time-series generation model through training samples until the training is completed, and generate virtual carbon flow data, which can provide greater flexibility and adaptability for the generation of time-series power carbon flow data, and at the same time improve the performance of the time-series generation model. By comparing the time-series power carbon flow data with the output data of the control group, the verification results of the time-series power carbon flow data are obtained, which can improve the reliability and integrity of the generated time-series power carbon flow data and provide decision support.
[0122] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0123] Based on the same inventive concept, the embodiment of the present application also provides a time-series power carbon flow data generation and verification device for implementing the time-series power carbon flow data generation and verification method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more time-series power carbon flow data generation and verification device embodiments provided below can refer to the above limitations on the time-series power carbon flow data generation and verification method, and will not be repeated here.
[0124] In an exemplary embodiment, Figure 6 As shown, a time-series power carbon flow data generation and verification device is provided, including: an acquisition module 602, a generation module 604 and a verification module 606, wherein:
[0125] The acquisition module 602 is used to obtain the time-series power-carbon flow coupling characteristic data according to the time-series power flow section data, the carbon emission index data of the generator set and the power carbon emission flow calculation model, and pre-process the time-series power-carbon flow coupling characteristic data to obtain training samples.
[0126] The generation module 604 is used to train the time series generation model through training samples until the training is completed and generate virtual carbon flow data.
[0127] Verification module 606 is used to divide the virtual carbon flow data into calculation input data and control group output data, take the calculation input data and import it into the time series carbon flow calculation unit to obtain the time series output data, use the time series output data as the time series power carbon flow data, and obtain the verification result of the time series power carbon flow data by comparing the time series power carbon flow data with the control group output data.
[0128] In an exemplary embodiment, the acquisition module is also used to input the time-series power flow section data and the carbon emission index data of the generator set into the power carbon emission flow calculation model, perform matrix calculation, and determine the time-series power-carbon flow coupling characteristic data.
[0129] In an exemplary embodiment, the acquisition module is also used to splice the time-series power-carbon flow coupling characteristic data, the key carbon characteristic data set before the time-series carbon flow calculation, and the key electric characteristic data to obtain spliced training data; and normalize the spliced training data to obtain training samples.
[0130] In an exemplary embodiment, the time series generation model includes an embedding layer, a generation layer, a supervision layer, a recovery layer and a discrimination layer; the generation module is also used to import the training sample into the embedding layer, and project the original feature space of the training sample to the hidden space through the embedding layer to obtain the embedding layer output data; the random sample space is projected to the virtual sample space through the generation layer to obtain the generation layer tensor output data; all hidden states before the current moment are compared and verified through the supervision layer, and the first output data of the supervision layer is obtained based on the embedding layer output data, and the first output data of the supervision layer is transmitted to the recovery layer; the supervision layer obtains the second output data of the supervision layer based on the generation layer tensor output data, and transmits the second output data of the supervision layer to the discrimination layer; the recovery layer obtains the recovery layer output variable based on the supervision layer first output data; the discrimination layer obtains the first discrimination result based on the embedding layer output data, and obtains the second discrimination result based on the supervision layer second output data.
[0131] In an exemplary embodiment, the generation module is also used to iteratively minimize the loss functions of the supervision layer, the generation layer, and the discrimination layer according to the embedding layer output data, the first output data of the supervision layer, the recovery layer output variable, and the first discrimination result and the second discrimination result. When the loss function is minimized, the model training is completed, and the output data of the current time series generation model is used as virtual carbon flow data.
[0132] In an exemplary embodiment, the verification module is also used to compare the time-series power carbon flow data with the control group output data to obtain an error matrix between the time-series output data and the control output data; and quantize the error matrix to obtain the verification result of the time-series power carbon flow data.
[0133] The above-mentioned time-series power carbon flow data generation and verification device obtains the time-series power-carbon flow coupling characteristic data through the time-series power flow section data, the carbon emission index data of the generator unit and the power carbon emission flow calculation model, which can understand the operating status and load characteristics of the power system in different time periods, and can make the training sample data more accurate. Preprocessing the time-series power-carbon flow coupling characteristic data to obtain training samples can make the training sample data more accurate and rich, which helps to improve the performance of the model. Building a training framework for generative adversarial networks and supervised learning, training the time-series generation model through training samples until the training is completed, and generating virtual carbon flow data, can provide greater flexibility and adaptability for the generation of time-series power carbon flow data, and at the same time improve the performance of the time-series generation model. By comparing the time-series power carbon flow data with the output data of the control group, the verification result of the time-series power carbon flow data is obtained, which can improve the reliability and integrity of the generated time-series power carbon flow data and provide decision support.
[0134] Each module in the above-mentioned time-series power carbon flow data generation and verification device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0135] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store time-series power flow section data and carbon emission index data of the generator set and time-series power-carbon flow coupling characteristic data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for generating and verifying time-series power carbon flow data is implemented.
[0136] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0137] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0138] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0139] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0140] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0141] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0142] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.
[0143] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for generating and verifying time-series power carbon flow data, characterized in that: The method comprises: According to the time-series power flow section data, the carbon emission index data of the generator set and the power carbon emission flow calculation model, the time-series power-carbon flow coupling characteristic data is obtained, and the time-series power-carbon flow coupling characteristic data is preprocessed to obtain a training sample; The time series generation model is trained by the training samples until the training is completed, thereby generating virtual carbon flow data; The virtual carbon flow data is divided into calculation input data and control group output data, the calculation input data is imported into a time series carbon flow calculation unit to obtain time series output data, and the time series output data is used as time series power carbon flow data; By using an error method or a mean comparison method, the time series power carbon flow data is compared with the output data of the control group to obtain a verification result of the time series power carbon flow data; The time series generation model includes an embedding layer, a generation layer, a supervision layer, a recovery layer, and a discrimination layer; wherein the time series generation model is trained by the training samples until the training is completed, and the generation of virtual carbon flow data includes: Importing the training sample into the embedding layer, projecting the original feature space of the training sample into the latent space through the embedding layer, and obtaining the embedding layer output data; The random sample space is projected into the virtual sample space through the generating layer to obtain the generating layer tensor output data; The supervisory layer compares and verifies all hidden states before the current moment, obtains first output data of the supervisory layer based on the output data of the embedding layer, and transmits the first output data of the supervisory layer to the recovery layer; the supervisory layer obtains second output data of the supervisory layer based on the tensor output data of the generation layer, and transmits the second output data of the supervisory layer to the discrimination layer; The recovery layer obtains the recovery layer output variable based on the first output data of the supervision layer; The discrimination layer obtains a first discrimination result based on the output data of the embedding layer, and obtains a second discrimination result based on the second output data of the supervision layer.
2. The method according to claim 1, characterized in that The time-series power-carbon flow coupling characteristic data obtained according to the time-series power flow section data, the carbon emission index data of the generator set, and the power carbon emission flow calculation model includes: The time-series power flow section data and the carbon emission index data of the generator set are input into the power carbon emission flow calculation model, and matrix calculation is performed to determine the time-series power-carbon flow coupling characteristic data.
3. The method according to claim 1, characterized in that: The preprocessing of the time series power-carbon flow coupling characteristic data to obtain training samples includes: The time-series power-carbon flow coupling characteristic data, the key carbon characteristic data set before the time-series carbon flow calculation, and the key electric characteristic data are spliced to obtain spliced training data; The spliced training data is normalized to obtain training samples.
4. The method according to claim 1, characterized in that The time series generation model is trained by the training samples until the training is completed, and the generation of virtual carbon flow data further includes: The loss functions of the supervision layer, the generation layer and the discrimination layer are minimized iteratively according to the output data of the embedding layer, the first output data of the supervision layer, the output variable of the recovery layer, and the first discrimination result and the second discrimination result. When the loss function is minimized, the model training is completed, and the output data of the current time series generation model is used as the virtual carbon flow data.
5. The method according to claim 1, characterized in that: By comparing the time series power carbon flow data with the control group output data, the verification result of the time series power carbon flow data is obtained, which includes: Comparing the time series power carbon flow data with the control group output data to obtain an error matrix between the time series output data and the control output data; The error matrix is quantized to obtain the verification result of the time-series power carbon flow data.
6. A device for generating and verifying time-series power carbon flow data, characterized in that: The device comprises: An acquisition module is used to obtain time-series power-carbon flow coupling characteristic data according to the time-series power flow section data, the carbon emission index data of the generator set, and the power carbon emission flow calculation model, and pre-process the time-series power-carbon flow coupling characteristic data to obtain training samples; A generation module is used to train the time series generation model through the training samples until the training is completed and generate virtual carbon flow data; the time series generation model includes an embedding layer, a generation layer, a supervision layer, a recovery layer and a discrimination layer; the generation module is also used to import the training samples into the embedding layer, and project the original feature space of the training samples into the hidden space through the embedding layer to obtain the embedding layer output data; the random sample space is projected into the virtual sample space through the generation layer to obtain the generation layer tensor output data; all hidden states before the current moment are compared and verified through the supervision layer, and the first output data of the supervision layer is obtained based on the embedding layer output data, and the first output data of the supervision layer is transmitted to the recovery layer; the supervision layer obtains the second output data of the supervision layer based on the generation layer tensor output data, and the second output data of the supervision layer is transmitted to the discrimination layer; the recovery layer obtains the recovery layer output variable based on the first output data of the supervision layer; the discrimination layer obtains the first discrimination result based on the embedding layer output data, and obtains the second discrimination result based on the second output data of the supervision layer; A verification module is used to divide the virtual carbon flow data into calculation input data and control group output data, take the calculation input data and import it into the time series carbon flow calculation unit to obtain time series output data, and use the time series output data as time series power carbon flow data; compare the time series power carbon flow data with the control group output data through an error method or a mean comparison method to obtain a verification result of the time series power carbon flow data.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Carbon emission flow generation method and device, model training method and device and computer equipment
CN116737793A