Operation mode sample generation method and system based on CTGAN model
Through the sample generation method of the power system operating mode based on the CTGAN model, the problems of low sample generation efficiency and insufficient coverage in the prior art are solved, and the sample generated according to the safety margin of the specified section is realized, with wide applicability.
Patent Information
- Application Number
- CN202411483757.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-07
AI Technical Summary
The existing power system operating mode sample generation methods have problems of low efficiency and insufficient coverage, and it is difficult to apply to scenarios where large numbers of samples are needed, and it is impossible to generate specific types of operating mode samples in a targeted manner.
The operation mode sample generation method is adopted based on the CTGAN model. By collecting power data from each node of the power system, a running mode sample set is constructed, and inputting it into a preset CTGAN model to generate a target operation mode sample that meets the safety margin of the transmission section.
It realizes the generation of corresponding operating mode samples based on any safety margin of the specified section, which is widely applicable, and can quickly build the operating mode sample set and generate samples that meet specific safety requirements.
Smart Images

Figure CN119397277A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of power system security analysis, and in particular to a method and system for generating operation mode samples based on a CTGAN model. Background Art
[0002] The analysis of power system operation mode is the core link to ensure the safe and stable operation of the power system. The number of operating conditions that need to be considered and the difficulty of analysis are increasing day by day with the continuous increase in the scale of the power grid. How to obtain an operation mode sample set that meets the needs of power grid analysis has become a basic issue for compiling power grid operation mode reports and stable operation regulations.
[0003] Existing sample generation methods can be divided into two categories: random simulation method and optimization model method. The optimization model method needs to solve the optimization problem according to various boundary conditions, so its efficiency in generating samples is low. It has the disadvantages of being difficult to solve and time-consuming to generate. It is difficult to apply to scenarios that require a large number of samples for analysis. Although the random simulation method can quickly generate a large number of samples, due to the diversity of power system control variables and the complexity of their combination, the massive samples generated are difficult to cover various operating scenarios, and it is impossible to generate the required specific type of operating mode samples in a targeted manner. There are still certain limitations in practical applications.
[0004] Application Contents
[0005] The present application provides a method and system for generating operating mode samples based on a CTGAN model, so as to generate corresponding operating mode samples according to any safety margin of a specified section, which has wide applicability.
[0006] In a first aspect, the present application provides a method for generating operation mode samples based on a CTGAN model, comprising:
[0007] Collecting power data corresponding to each node of the power system during operation, and constructing an operation mode sample set based on the power data, wherein the nodes include load nodes, generator nodes and balance nodes;
[0008] The operating mode sample set is input into a preset CTGAN model to obtain the probability distribution of each sample in the operating mode sample set, and based on the probability distribution and the preset sample distribution, a target operating mode sample set that meets the transmission section safety margin is obtained, wherein the preset sample distribution is the distribution of each sample in the preset operating mode sample set that meets the transmission section safety margin.
[0009] The embodiment of the present application collects the power data corresponding to each node of the power system during operation, and constructs an operation mode sample set based on the power data. It can quickly construct an operation mode sample set based on the power data of each node during operation, which is convenient for subsequent input into the CTGAN model to generate target operation mode samples that meet the safety margin of the transmission section; by inputting the operation mode sample set into the preset CTGAN model, the operation mode sample set can learn the distribution characteristics of the preset operation mode sample set in the preset CTGAN model, and can generate corresponding operation mode samples according to any safety margin of the specified section, which has wide applicability.
[0010] Furthermore, the collecting of power data corresponding to each node of the power system during operation and the building of an operation mode sample set based on the power data are specifically as follows:
[0011] Collecting power data corresponding to each node of the power system during operation, and performing Monte Carlo simulation on the power data to obtain simulation operation mode data;
[0012] An operation mode sample set is constructed based on the simulation operation mode data.
[0013] In this way, by performing Monte Carlo simulation on the power data, a large amount of data reflecting the state of the power system and the operation mode of the specific object of concern can be obtained.
[0014] Furthermore, before inputting the operation mode sample set into the preset CTGAN model, the method further includes:
[0015] Encoding each sample in the operation mode sample set by a One-Hot method to obtain a One-Hot code;
[0016] Processing the continuous values in the operation mode sample set by a preset variational Gaussian mixture model to obtain a probability value of each sample in the operation mode sample set belonging to each operation mode, and obtaining a data value of each sample in the corresponding operation mode based on the probability;
[0017] Based on the One-Hot encoding and the data value, each sample in the operation mode sample set is concatenated into a vector.
[0018] In this way, by processing the data of each sample in the operating mode sample set and inputting the obtained results into the CTGAN model, the corresponding operating mode sample can be generated according to any safety margin of the specified section.
[0019] Furthermore, the training process of the CTGAN model is specifically as follows:
[0020] Acquire the transmission power of the transmission section under the current operation mode, determine the limit transmission capacity of the transmission section under the current operation mode based on the transmission power, and obtain the safety margin of the transmission section based on the limit transmission capacity and the current section power flow;
[0021] Dividing the operation mode sample set into operation mode sample sets of various types according to the transmission section safety margin;
[0022] Performing data processing on each sample in each type of operation mode sample set to obtain the preset operation mode sample set;
[0023] The CTGAN model is obtained by training a conditional table-generated adversarial network algorithm on the preset operation mode sample set, wherein the CTGAN model includes a generator and a discriminator.
[0024] In this way, by training the CTGAN model, the optimization gradient of the CTGAN model can be obtained through repeated games between the generator and the discriminator, and the distribution of each sample in the preset operating mode sample set that meets the safety margin of the transmission section can be learned, and then the corresponding operating mode sample can be generated according to any safety margin of the specified section.
[0025] Furthermore, the objective function of the CTGAN model training process is specifically:
[0026]
[0027] Where x is the sample set of the operation mode, p data is the sample distribution of the preset operation mode sample set, p z is the distribution of each sample in the operation mode sample set, D(x) and G(z) are the output results of the discriminator and the generator respectively; during the training process, the input of the generator G is the distribution of each sample p in the operation mode sample set z The random vector z in the generator G(z,θ g ) makes each sample distribution p in the operation mode sample set z The sample distribution p of the preset operation mode sample set g Exactly the same, the output of the discriminator D is D(x,θ d ) indicates that the operation mode sample set x is derived from the sample distribution p of the preset operation mode sample set date .
[0028] In this way, the optimized gradient of the CTGAN model is obtained through repeated games between the generator and the discriminator, which can learn the distribution of each sample in the target operating mode sample set that meets the safety margin of the transmission section, and then generate the corresponding operating mode sample according to any safety margin of the specified section.
[0029] In a second aspect, the present application provides an operation mode sample generation system based on a CTGAN model, including: a collection module and a generation module;
[0030] The acquisition module is used to collect power data corresponding to each node of the power system during operation, and to construct an operation mode sample set based on the power data, wherein the nodes include load nodes, generator nodes and balance nodes;
[0031] The generation module is used to input the operating mode sample set into a preset CTGAN model to obtain the probability distribution of each sample in the operating mode sample set, and based on the probability distribution and the preset sample distribution, obtain a target operating mode sample set that meets the transmission section safety margin, wherein the preset sample distribution is the distribution of each sample in the preset operating mode sample set that meets the transmission section safety margin.
[0032] The embodiment of the present application collects the power data corresponding to each node of the power system during operation, and constructs an operation mode sample set based on the power data. It can quickly construct an operation mode sample set based on the power data of each node during operation, which is convenient for subsequent input into the CTGAN model to generate target operation mode samples that meet the safety margin of the transmission section; by inputting the operation mode sample set into the preset CTGAN model, the operation mode sample set can learn the distribution characteristics of the preset operation mode sample set in the preset CTGAN model, and can generate corresponding operation mode samples according to any safety margin of the specified section, which has wide applicability.
[0033] Further, the acquisition module includes: an acquisition unit and a construction unit;
[0034] The acquisition unit is used to collect power data corresponding to each node of the power system during operation, and perform Monte Carlo simulation on the power data to obtain simulation operation mode data;
[0035] The construction unit is used to construct an operation mode sample set based on the simulation operation mode data.
[0036] Furthermore, the operation mode sample generation system based on the CTGAN model further includes: a processing module, the processing module including: an encoding unit, a processing unit and a splicing unit;
[0037] The encoding unit is used to encode each sample in the operation mode sample set by a One-Hot method to obtain a One-Hot code;
[0038] The processing unit is used to process the continuous values in the operation mode sample set by using a preset variational Gaussian mixture model to obtain a probability value that each sample in the operation mode sample set belongs to each operation mode, and obtain a data value of each sample in the corresponding operation mode based on the probability;
[0039] The splicing unit is used to splice each sample in the operation mode sample set into a vector based on the One-Hot encoding and the data value.
[0040] Furthermore, the training process of the CTGAN model is specifically as follows:
[0041] Acquire the transmission power of the transmission section under the current operation mode, determine the limit transmission capacity of the transmission section under the current operation mode based on the transmission power, and obtain the safety margin of the transmission section based on the limit transmission capacity and the current section power flow;
[0042] Dividing the operation mode sample set into operation mode sample sets of various types according to the transmission section safety margin;
[0043] Performing data processing on each sample in each type of operation mode sample set to obtain the preset operation mode sample set;
[0044] The CTGAN model is obtained by training a conditional table-generated adversarial network algorithm on the preset operation mode sample set, wherein the CTGAN model includes a generator and a discriminator.
[0045] Furthermore, the objective function of the CTGAN model training process is specifically:
[0046]
[0047] Where x is the sample set of the operation mode, p data is the sample distribution of the preset operation mode sample set, p z is the distribution of each sample in the operation mode sample set, D(x) and G(z) are the output results of the discriminator and the generator respectively; during the training process, the input of the generator G is the distribution of each sample p in the operation mode sample set z The random vector z in the generator G(z,θ g ) realizes the distribution of each sample p in the operation mode sample set z To the sample distribution p of the target operation mode sample set g The output of the discriminator D is D(x,θ d ) indicates that the operation mode sample set x is derived from the sample distribution p of the preset operation mode sample set date . BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a flowchart of an embodiment of a method for generating operation mode samples based on a CTGAN model provided in this application;
[0049] Figure 2 is a schematic diagram of processing continuous values through a variational Gaussian mixture model provided by the present application;
[0050] Figure 3 It is a structural diagram of an embodiment of an operation mode sample generation system based on the CTGAN model provided in this application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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 are within the scope of protection of this application.
[0052] It should be understood that the step numbers used in this article are only for the convenience of description and are not intended to limit the order in which the steps are executed.
[0053] It should be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, the singular forms "a", "an" and "the" are intended to include plural forms unless the context clearly indicates otherwise.
[0054] The terms “include” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0055] The term "and / or" means and includes any and all possible combinations of one or more of the associated listed items.
[0056] The analysis of the operation mode of the power system is the core of ensuring the safety and stability of the system. Its complexity and difficulty increase with the expansion of the scale of the power grid. Constructing an operation mode sample set that meets the analysis needs is the premise for formulating operation reports and stability regulations. The existing sample generation methods are divided into two categories: random simulation and optimization model. Among them, the optimization model method is not suitable for generating a large number of samples due to its complex solution and low efficiency. Although the random simulation method can quickly generate a large number of samples, due to the complexity and variability of the control variables of the power system, the samples are difficult to fully cover various operation scenarios, lack of pertinence, and limited application.
[0057] CTGAN (Conditional Generative Adversarial Network), Chinese name Conditional Generative Adversarial Network, is an open source framework that uses generative adversarial network technology to generate structured data. It aims to help data scientists, engineers, and researchers create virtual data sets with statistical authenticity to protect sensitive information while maintaining the feasibility of data analysis.
[0058] Embodiment 1
[0059] Please refer to Figure 1 , Figure 1 It is a flowchart of an embodiment of a method for generating operation mode samples based on a CTGAN model provided in the present application, including steps S1 to S2;
[0060] Step S1, collecting power data corresponding to each node of the power system during operation, and constructing an operation mode sample set based on the power data, wherein the nodes include load nodes, generator nodes and balance nodes;
[0061] It is understandable that the data acquisition system can be used to collect power data of load nodes, generator nodes and balancing nodes in the power system during operation, wherein the power data includes but is not limited to state variables such as active power, reactive power, voltage amplitude and phase angle. After the power data of each node during operation is collected, the uncertainty factors such as new energy fluctuations in the power system can be directly unified in the form of node power injection based on the power data to construct an operation mode sample set. Of course, the power data can also be Monte Carlo simulated first, and then the operation mode sample set can be constructed based on the simulated operation mode data after simulation, so as to obtain a large amount of operation mode data reflecting the state of the power system and the specific objects of concern. This application does not limit this. Among them, the operation mode sample set x is:
[0062]
[0063] Where PQ Node is the load node, PV Node is the generator node, VθNode is the balance node, P and Q represent the active and reactive power injection received or emitted by the corresponding node, respectively, and V and θ represent the node voltage amplitude and phase angle of the corresponding node, respectively.
[0064] It should be noted that for a power system with N nodes, at least 2N state variables must be known to obtain a complete operating mode sample set x.
[0065] In this way, by performing Monte Carlo simulation on the power data, a large amount of data reflecting the state of the power system and the operation mode of the specific object of concern can be obtained.
[0066] After the operation mode sample set is constructed, each sample in the operation mode sample set needs to be processed so that it can be input into the CTGAN model. Specifically, first, each discrete column data sample in the operation mode sample set is encoded by the One-Hot method to obtain the One-Hot encoding; secondly, considering the complexity of the distribution of the operation mode samples, the continuous values in the operation mode sample set need to be processed by the preset variational Gaussian mixture model to obtain the probability value of each sample in the operation mode sample set belonging to each operation mode, and sample from the operation mode corresponding to the highest probability density, and perform normalization to obtain the data value of each sample in the corresponding operation mode; finally, based on the One-Hot encoding and the data value, each sample in the operation mode sample set is spliced into a vector, where the vector r j The formula is: In the formula, is the splicing symbol, α 1,j and β i,j is the data value in the corresponding operation mode, d i,j is a One-Hot encoded discrete column, N c is a continuous column, N d is a discrete column. The schematic diagram of processing continuous values through the variational Gaussian mixture model is as follows Figure 2 As shown in the figure, it can be seen that the continuous column C needs to be transformed into i Extract the value c i,j , then calculate c i,j The probability value belonging to each operating mode is obtained, and the probability values are sorted to determine the highest probability density. Finally, samples are randomly selected from the highest probability density and the samples are normalized to obtain the data value of each sample in the corresponding operating mode.
[0067] It should be noted that the One-Hot method, also known as One-Hot Encoding, is a coding technology commonly used in machine learning and data processing. The basic principle is to convert categorical variables or discrete variables into binary vectors, in which only one element is "hot" (value is 1) and the rest are "cold" (value is 0). The position of this "hot" element represents the specific value of the categorical variable or discrete variable.
[0068] It should be noted that the variational Gaussian mixture model VGMM (Variational Gaussian Mixture Model) refers to a model that combines the variational inference method on the basis of the Gaussian mixture model (GMM). It can fit the complex distribution of each feature to obtain the corresponding Gaussian distribution, that is, the probability distribution.
[0069] In this way, by processing the data of each sample in the operating mode sample set and inputting the obtained results into the CTGAN model, the corresponding operating mode sample can be generated according to any safety margin of the specified section.
[0070] Step S2: input the operating mode sample set into a preset CTGAN model to obtain the probability distribution of each sample in the operating mode sample set, and based on the probability distribution and the preset sample distribution, obtain the target operating mode sample set that meets the transmission section safety margin, wherein the preset sample distribution is the distribution of each sample in the preset operating mode sample set that meets the transmission section safety margin.
[0071] It can be understood that after processing each sample in the operation mode sample set, the operation mode sample set can be input into the preset CTGAN model. Specifically, by inputting the operation mode sample set into the preset CTGAN model, the probability distribution of each sample in the operation mode sample set can be obtained. Since the CTGAN model has been trained in advance with the preset operation mode sample set that meets the transmission section safety margin, the preset sample distribution corresponding to the preset operation mode sample set has been saved in the CTGAN model. The CTGAN model can generate the values of each state variable in the required operation mode and substitute them into the power flow calculation by making the probability distribution learn the preset sample distribution, so as to obtain the target operation mode sample set that meets the transmission section safety margin.
[0072] It should be noted that power flow calculation is an existing calculation method and is not the focus of this application, so it will not be expanded here.
[0073] The training process of the CTGAN model is as follows: first, the transmission power of the transmission section under the current operation mode is obtained by monitoring the power system through the transmission section dimension reduction, and the limit transmission capacity of the transmission section under the current operation mode X is determined based on the transmission power, and the transmission section safety margin M is obtained based on the limit transmission capacity and the current section flow. S ; Wherein, the calculation formula of the limit transmission capacity TTC is: TTC = Max (P t (X)), where P t(X) is the transmission power under the current operation mode, X is the current operation mode; the transmission section safety margin M S The calculation formula is: Where P t is the current section flow. Secondly, through the transmission section safety margin M S The samples of the operation mode sample set are divided to obtain the operation mode sample sets of each type; then, each sample in the operation mode sample set of each type is processed to obtain the preset operation mode sample set; finally, the conditional table is used to generate an adversarial network algorithm to train on the preset operation mode sample set to obtain a CTGAN model, wherein the CTGAN model includes a generator and a discriminator. The objective function of the CTGAN model training process is specifically:
[0074]
[0075] Where x is the sample set of the operation mode, p data is the sample distribution of the preset operation mode sample set, p z is the distribution of each sample in the operation mode sample set, D(x) and G(z) are the output results of the discriminator and the generator respectively; during the training process, the input of the generator G is the distribution of each sample p in the operation mode sample set z The random vector z in the generator G(z,θ g ) realizes the distribution of each sample p in the operation mode sample set z To the sample distribution p of the target operation mode sample set g The output of the discriminator D is D(x,θ d ) indicates that the operation mode sample set x is derived from the sample distribution p of the preset operation mode sample set date .
[0076] It should be noted that the process of performing data processing on each sample in the sample set of each type of operation mode has been described in detail in the data processing in step S1, and will not be repeated here.
[0077] In this way, by training the CTGAN model, the optimization gradient of the CTGAN model can be obtained through repeated games between the generator and the discriminator, and the distribution of each sample in the preset operating mode sample set that meets the safety margin of the transmission section can be learned, and then the corresponding operating mode sample can be generated according to any safety margin of the specified section.
[0078] The embodiment of the present application collects the power data corresponding to each node of the power system during operation, and constructs an operation mode sample set based on the power data. It can quickly construct an operation mode sample set based on the power data of each node during operation, which is convenient for subsequent input into the CTGAN model to generate target operation mode samples that meet the safety margin of the transmission section; by inputting the operation mode sample set into the preset CTGAN model, the operation mode sample set can learn the distribution characteristics of the preset operation mode sample set in the preset CTGAN model, and can generate corresponding operation mode samples according to any safety margin of the specified section, which has wide applicability.
[0079] Embodiment 2
[0080] Please refer to Figure 3 , Figure 3 It is a structural diagram of an embodiment of an operation mode sample generation system based on a CTGAN model provided in the present application, including an acquisition module 01 and a generation module 02.
[0081] The acquisition module 01 is used to collect power data corresponding to each node of the power system during operation, and to construct an operation mode sample set based on the power data, wherein the nodes include load nodes, generator nodes and balance nodes;
[0082] Specifically, the acquisition module 01 includes: a collection unit and a construction unit; the collection unit is used to collect the power data corresponding to each node of the power system during operation, and perform Monte Carlo simulation on the power data to obtain simulated operation mode data; the construction unit is used to construct an operation mode sample set based on the simulated operation mode data.
[0083] It is understandable that the data acquisition system can be used to collect power data of load nodes, generator nodes and balancing nodes in the power system during operation, wherein the power data includes but is not limited to state variables such as active power, reactive power, voltage amplitude and phase angle. After the power data of each node during operation is collected, the uncertainty factors such as new energy fluctuations in the power system can be directly unified in the form of node power injection based on the power data to construct an operation mode sample set. Of course, the power data can also be Monte Carlo simulated first, and then the operation mode sample set can be constructed based on the simulated operation mode data after simulation, so as to obtain a large amount of operation mode data reflecting the state of the power system and the specific objects of concern. This application does not limit this. Among them, the operation mode sample set x is:
[0084]
[0085] Where PQ Node is the load node, PV Node is the generator node, VθNode is the balance node, P and Q represent the active and reactive power injection received or emitted by the corresponding node, respectively, and V and θ represent the node voltage amplitude and phase angle of the corresponding node, respectively.
[0086] It should be noted that for a power system with N nodes, at least 2N state variables must be known to obtain a complete operating mode sample set x.
[0087] In this way, by performing Monte Carlo simulation on the power data, a large amount of data reflecting the state of the power system and the operation mode of the specific object of concern can be obtained.
[0088] After the operation mode sample set is constructed, each sample in the operation mode sample set needs to be processed so that it can be input into the CTGAN model. Therefore, the operation mode sample generation based on the CTGAN model also includes: a processing module, the processing module includes: an encoding unit, a processing unit and a splicing unit; the encoding unit is used to encode each sample in the operation mode sample set by the One-Hot method to obtain a One-Hot code; the processing unit is used to process the continuous values in the operation mode sample set by a preset variational Gaussian mixture model to obtain the probability value that each sample in the operation mode sample set belongs to each operation mode, and obtain the data value of each sample in the corresponding operation mode based on the probability; the splicing unit is used to splice each sample in the operation mode sample set into a vector based on the One-Hot code and the data value.
[0089] Specifically, first, each discrete column data sample in the operation mode sample set is encoded by the One-Hot method to obtain a One-Hot code; secondly, considering the complexity of the distribution of the operation mode samples, it is also necessary to process the continuous values in the operation mode sample set by a preset variational Gaussian mixture model to obtain the probability value of each sample in the operation mode sample set belonging to each operation mode, and sample from the operation mode corresponding to the highest probability density, and perform normalization to obtain the data value of each sample in the corresponding operation mode; finally, based on the One-Hot code and the data value, each sample in the operation mode sample set is spliced into a vector, where the vector r j The formula is: In the formula, is the splicing symbol, α 1,j and β i,j is the data value in the corresponding operation mode, d i,j is a One-Hot encoded discrete column, N c is a continuous column, N dis a discrete column. The schematic diagram of processing continuous values through the variational Gaussian mixture model is as follows Figure 2 As shown in the figure, it can be seen that the continuous column C needs to be transformed into i Extract the value c i,j , then calculate c i,j The probability value belonging to each operating mode is obtained, and the probability values are sorted to determine the highest probability density. Finally, samples are randomly selected from the highest probability density and the samples are normalized to obtain the data value of each sample in the corresponding operating mode.
[0090] It should be noted that the One-Hot method, also known as One-Hot Encoding, is a coding technology commonly used in machine learning and data processing. The basic principle is to convert categorical variables or discrete variables into binary vectors, in which only one element is "hot" (value is 1) and the rest are "cold" (value is 0). The position of this "hot" element represents the specific value of the categorical variable or discrete variable.
[0091] It should be noted that the variational Gaussian mixture model VGMM (Variational Gaussian Mixture Model) refers to a model that combines the variational inference method on the basis of the Gaussian mixture model (GMM). It can fit the complex distribution of each feature to obtain the corresponding Gaussian distribution, that is, the probability distribution.
[0092] In this way, by processing the data of each sample in the operating mode sample set and inputting the obtained results into the CTGAN model, the corresponding operating mode sample can be generated according to any safety margin of the specified section.
[0093] The generation module 02 is used to input the operating mode sample set into a preset CTGAN model to obtain the probability distribution of each sample in the operating mode sample set, and based on the probability distribution and the preset sample distribution, obtain a target operating mode sample set that meets the transmission section safety margin, wherein the preset sample distribution is the distribution of each sample in the preset operating mode sample set that meets the transmission section safety margin.
[0094] It can be understood that after processing each sample in the operation mode sample set, the operation mode sample set can be input into the preset CTGAN model. Specifically, by inputting the operation mode sample set into the preset CTGAN model, the probability distribution of each sample in the operation mode sample set can be obtained. Since the CTGAN model has been trained in advance with the preset operation mode sample set that meets the transmission section safety margin, the preset sample distribution corresponding to the preset operation mode sample set has been saved in the CTGAN model. The CTGAN model can generate the values of each state variable in the required operation mode and substitute them into the power flow calculation by making the probability distribution learn the preset sample distribution, so as to obtain the target operation mode sample set that meets the transmission section safety margin.
[0095] It should be noted that power flow calculation is an existing calculation method and is not the focus of this application, so it will not be expanded here.
[0096] The training process of the CTGAN model is as follows: first, the transmission power of the transmission section under the current operation mode is obtained by monitoring the power system through the transmission section dimension reduction, and the limit transmission capacity of the transmission section under the current operation mode X is determined based on the transmission power, and the transmission section safety margin M is obtained based on the limit transmission capacity and the current section flow. S ; Wherein, the calculation formula of the limit transmission capacity TTC is: TTC = Max (P t (X)), where P t (X) is the transmission power under the current operation mode, X is the current operation mode; the transmission section safety margin M S The calculation formula is: Where P t is the current section flow. Secondly, through the transmission section safety margin M S The samples of the operation mode sample set are divided to obtain the operation mode sample sets of each type; then, each sample in the operation mode sample set of each type is processed to obtain the preset operation mode sample set; finally, the conditional table is used to generate an adversarial network algorithm to train on the preset operation mode sample set to obtain a CTGAN model, wherein the CTGAN model includes a generator and a discriminator. The objective function of the CTGAN model training process is specifically:
[0097]
[0098] Where x is the sample set of the operation mode, p data is the sample distribution of the preset operation mode sample set, p zis the distribution of each sample in the operation mode sample set, D(x) and G(z) are the output results of the discriminator and the generator respectively; during the training process, the input of the generator G is the distribution of each sample p in the operation mode sample set z The random vector z in the generator G(z,θ g ) realizes the distribution of each sample p in the operation mode sample set z To the sample distribution p of the target operation mode sample set g The output of the discriminator D is D(x,θ d ) indicates that the operation mode sample set x is derived from the sample distribution p of the preset operation mode sample set date .
[0099] It should be noted that the process of performing data processing on each sample in the sample set of each type of operation mode has been described in detail in the data processing in the acquisition module 01, and will not be repeated here.
[0100] In this way, by training the CTGAN model, the optimization gradient of the CTGAN model can be obtained through repeated games between the generator and the discriminator, and the distribution of each sample in the preset operating mode sample set that meets the safety margin of the transmission section can be learned, and then the corresponding operating mode sample can be generated according to any safety margin of the specified section.
[0101] The embodiment of the present application collects the power data corresponding to each node of the power system during operation, and constructs an operation mode sample set based on the power data. It can quickly construct an operation mode sample set based on the power data of each node during operation, which is convenient for subsequent input into the CTGAN model to generate target operation mode samples that meet the safety margin of the transmission section; by inputting the operation mode sample set into the preset CTGAN model, the operation mode sample set can learn the distribution characteristics of the preset operation mode sample set in the preset CTGAN model, and can generate corresponding operation mode samples according to any safety margin of the specified section, which has wide applicability.
[0102] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the scope of protection of the present application. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of protection of the present application.
Claims
1. A method for generating operation mode samples based on a CTGAN model, characterized in that: include: Collecting power data corresponding to each node of the power system during operation, and constructing an operation mode sample set based on the power data, wherein the nodes include load nodes, generator nodes and balance nodes; The operating mode sample set is input into a preset CTGAN model to obtain the probability distribution of each sample in the operating mode sample set, and based on the probability distribution and the preset sample distribution, a target operating mode sample set that meets the transmission section safety margin is obtained, wherein the preset sample distribution is the distribution of each sample in the preset operating mode sample set that meets the transmission section safety margin.
2. The method for generating operation mode samples based on the CTGAN model according to claim 1, characterized in that: The collecting of power data corresponding to each node of the power system during operation and constructing an operation mode sample set based on the power data are specifically as follows: Collecting power data corresponding to each node of the power system during operation, and performing Monte Carlo simulation on the power data to obtain simulation operation mode data; An operation mode sample set is constructed based on the simulation operation mode data.
3. The method for generating operation mode samples based on the CTGAN model according to claim 1, characterized in that: Before inputting the operation mode sample set into the preset CTGAN model, the method further includes: Encoding each sample in the operation mode sample set by a One-Hot method to obtain a One-Hot code; Processing the continuous values in the operation mode sample set by a preset variational Gaussian mixture model to obtain a probability value of each sample in the operation mode sample set belonging to each operation mode, and obtaining a data value of each sample in the corresponding operation mode based on the probability; Based on the One-Hot encoding and the data value, each sample in the operation mode sample set is concatenated into a vector.
4. The method for generating operation mode samples based on the CTGAN model according to claim 1, characterized in that: The training process of the CTGAN model is as follows: Acquire the transmission power of the transmission section under the current operation mode, determine the limit transmission capacity of the transmission section under the current operation mode based on the transmission power, and obtain the safety margin of the transmission section based on the limit transmission capacity and the current section power flow; Dividing the operation mode sample set into operation mode sample sets of various types according to the transmission section safety margin; Performing data processing on each sample in each type of operation mode sample set to obtain the preset operation mode sample set; The CTGAN model is obtained by training a conditional table-generated adversarial network algorithm on the preset operation mode sample set, wherein the CTGAN model includes a generator and a discriminator.
5. The method for generating operation mode samples based on the CTGAN model according to claim 4, characterized in that: The objective function of the CTGAN model training process is specifically: m G inm D axV(D,G)=E x~pdata(x) [log(D(x))]+E z~pz(z) [log(1-D(G(z))]; Where x is the sample set of the operation mode, p data is the sample distribution of the preset operation mode sample set, p z For each sample distribution in the operation mode sample set, D(x) and G(z) are the output results of the discriminator and the generator respectively; During the training process, the input of the generator G is each sample distribution p in the operation mode sample set z The random vector z in the generator G(z,θ g ) realizes the distribution of each sample p in the operation mode sample set z To the sample distribution p of the target operation mode sample set g The output of the discriminator D is D(x,θ d ) indicates that the operation mode sample set x is derived from the sample distribution p of the preset operation mode sample set date .
6. A system for generating operation mode samples based on a CTGAN model, characterized in that: include: Acquisition module and generation module; The acquisition module is used to collect power data corresponding to each node of the power system during operation, and to construct an operation mode sample set based on the power data, wherein the nodes include load nodes, generator nodes and balance nodes; The generation module is used to input the operating mode sample set into a preset CTGAN model to obtain the probability distribution of each sample in the operating mode sample set, and based on the probability distribution and the preset sample distribution, obtain a target operating mode sample set that meets the transmission section safety margin, wherein the preset sample distribution is the distribution of each sample in the preset operating mode sample set that meets the transmission section safety margin.
7. The operation mode sample generation system based on the CTGAN model according to claim 6, characterized in that: The acquisition module includes: an acquisition unit and a construction unit; The acquisition unit is used to collect power data corresponding to each node of the power system during operation, and perform Monte Carlo simulation on the power data to obtain simulation operation mode data; The construction unit is used to construct an operation mode sample set based on the simulation operation mode data.
8. The operation mode sample generation system based on the CTGAN model according to claim 6, characterized in that: Also includes: A processing module, the processing module comprising: an encoding unit, a processing unit and a splicing unit; The encoding unit is used to encode each sample in the operation mode sample set by a One-Hot method to obtain a One-Hot code; The processing unit is used to process the continuous values in the operation mode sample set by using a preset variational Gaussian mixture model to obtain a probability value that each sample in the operation mode sample set belongs to each operation mode, and obtain a data value of each sample in the corresponding operation mode based on the probability; The splicing unit is used to splice each sample in the operation mode sample set into a vector based on the One-Hot encoding and the data value.
9. The operation mode sample generation system based on the CTGAN model according to claim 6, characterized in that: The training process of the CTGAN model is as follows: Acquire the transmission power of the transmission section under the current operation mode, determine the limit transmission capacity of the transmission section under the current operation mode based on the transmission power, and obtain the safety margin of the transmission section based on the limit transmission capacity and the current section power flow; Dividing the operation mode sample set into operation mode sample sets of various types according to the transmission section safety margin; Performing data processing on each sample in each type of operation mode sample set to obtain the preset operation mode sample set; The CTGAN model is obtained by training a conditional table-generated adversarial network algorithm on the preset operation mode sample set, wherein the CTGAN model includes a generator and a discriminator.
10. The operation mode sample generation system based on the CTGAN model according to claim 9, characterized in that: The objective function of the CTGAN model training process is specifically: Where x is the sample set of the operation mode, p data is the sample distribution of the preset operation mode sample set, p z For each sample distribution in the operation mode sample set, D(x) and G(z) are the output results of the discriminator and the generator respectively; During the training process, the input of the generator G is each sample distribution p in the operation mode sample set z The random vector z in the generator G(z,θ g ) realizes the distribution of each sample p in the operation mode sample set z To the sample distribution p of the target operation mode sample set g The output of the discriminator D is D(x,θ d ) indicates that the operation mode sample set x is derived from the sample distribution p of the preset operation mode sample set date .
Citation Information
Cited By
C-RGAN-based extreme condition power grid operation mode sample generation method
CN122388551A