Simulation sample generation method, system equipment and medium
Generating simulated samples that meet the actual operating conditions of the power system through the WGAN-GP model solves the problems of poor sample diversity and waste of computing resources in the existing technology, and improves the training efficiency and generalization capabilities of the dynamic security and stability evaluation model.
Patent Information
- Application Number
- CN202411620814.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2024-12-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to generate training samples that meet the actual operating conditions of the power system, resulting in insufficient generalization capabilities of the dynamic security and stability evaluation model, wasted computing resources and inefficient training efficiency.
The WGAN-GP model is used to extract the operation distribution rules from the historical operation data, and generate simulation scenarios that conform to the actual operation conditions. The quality of simulation samples is ensured through abnormal scene control and sparseness verification.
It improves the diversity and coverage of training samples, saves computing resources, reduces computing time costs, and improves the training efficiency of the evaluation model.
Smart Images

Figure CN119150030A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electric power safety technology, and in particular to a simulation sample generation method system device and medium. Background Art
[0002] With the deployment of new loads in the power system, the power system source, grid and load terminals show highly power electronic characteristics, the power grid flow volatility increases, the system's anti-disturbance ability decreases, and dynamic safety and stability issues become increasingly prominent. In order to ensure the safe and stable operation of the power system, it is necessary to adopt efficient and accurate dynamic security situation awareness technology to evaluate the safety and stability of future power system operation scenarios under preset disturbances and detect security threats in a timely manner.
[0003] With the development of wide-area measurement technology, machine learning technology driven by power big data has become an important means to quickly and accurately evaluate the safety and stability of the system. The data-driven dynamic safety and stability evaluation method is to use a large number of historical operating modes to form safety and stability labels after the fault through numerical simulation, and then train and build a machine learning model offline, and conduct online rolling evaluation of ultra-short-term operating modes or real-time evaluation of current operating modes. However, the number of data samples required for training high-precision machine learning models is huge. The power system itself is a high-dimensional nonlinear system. If sample information is only collected directly from the historical operating scenarios of the power system, the poor diversity of training samples makes it difficult to cover the high-dimensional mapping space, which will lead to insufficient model evaluation capabilities. Therefore, it is necessary to generate a large number of power system operation scenario sets in the offline stage, and perform dynamic time-domain simulation of expected accident disturbances to obtain dynamic safety and stability labels under the corresponding scenarios, so as to generate training samples for training the evaluation model.
[0004] At present, the training sample set generation method usually adopts the Monte Carlo method to randomly change the load level and new energy output and other system operating state quantities according to the upper and lower limits of the load and the maximum and minimum output of new energy, thereby generating a large number of operating scenarios and forming a training sample library. However, affected by environmental factors such as climate, topography, and economic conditions in different regions, the load and new energy output conditions in different regions at the same time are different and show certain regularities. Therefore, the operating scenario set generated by this Monte Carlo-based sample generation method will involve some loads and new energy output states that do not conform to the actual operating conditions, making it difficult to accurately cover the distribution space of the actual operating mode of the power system, and the dynamic safety and stability assessment model is insufficient in generalizing the future operating scenarios to be evaluated. Moreover, this type of method will also generate a large number of training samples that deviate from the actual operating conditions of the system, resulting in a waste of computing resources, high computing time costs, and low training efficiency of the evaluation model. Summary of the invention
[0005] The embodiment of the present application provides a simulation sample generation method system device and medium, which can effectively and automatically extract and learn the operation distribution rules from the system's historical operation data, and then generate batch scenarios that conform to the actual operation conditions of the system, which are used to construct a training sample set for a dynamic security and stability evaluation model.
[0006] In the first aspect, the embodiment of the present application provides a simulation sample generation method, which is based on WGAN-GP and includes the following steps: obtaining a historical data set within a preset time range of the power grid, and constructing the data of the same power system and the same time in the historical data set into a historical scene; wherein the vectors in the historical scene include: the active output vector of the photovoltaic generator set , the active output vector of the wind turbine , load vector and the transmission capacity of AC / DC interconnection transmission channels ; Load vector Including active power and reactive power, the transmission capacity of AC and DC interconnection transmission channels It includes active transmission and reactive transmission; constructs a WGAN-GP initial model, and uses historical scenarios to train the generator and discriminator of the WGAN-GP initial model; uses the trained WGAN-GP model to generate simulation scenarios; inputs the simulation scenarios into a preset power flow model to obtain the power system operation parameters that realize the simulation scenarios; performs abnormal scenario control verification and sparsity verification on the power system operation parameters of the simulation scenarios; uses several simulation scenarios that pass the abnormal scenario control verification and sparsity verification as simulation samples to obtain a simulation sample set.
[0007] Furthermore, the WGAN-GP initial model is constructed, specifically including: using a fully connected neural network as the structural basic unit of the WGAN-GP model, determining the number of network layers, the number of neural units, the number of learning and the attenuation factor of the fully connected neural network in the WGAN-GP model by trial and error, and setting the activation function of each layer to the LeakyReLU function.
[0008] Furthermore, the generator and discriminator of the WGAN-GP initial model are trained using historical scenarios, specifically including: inputting a number of high-dimensional noises into the generator so that the generator outputs a number of corresponding simulation scenarios containing simulation scenario vectors; the high-dimensional noise has the same data dimension as the historical scenario; normalizing the historical scenario vectors, adding a label of 1 to the historical scenario and a label of 0 to the simulation scenario, and inputting the labeled historical scenarios and simulation scenarios as training sets into the discriminator of the WGAN-GP model for training so that the discriminator outputs a true or false probability judgment value for the input scenario; according to the loss function of the generator And the loss function of the discriminator , use the ADAM optimization algorithm to update the parameters of the generator and discriminator. When the loss function of the generator And the loss function of the discriminator When all converge, the WGAN-GP model training is completed.
[0009] Furthermore, according to the loss function of the generator And the loss function of the discriminator , use the ADAM optimization algorithm to update the parameters of the generator and discriminator. When the loss function of the generator And the loss function of the discriminator When all converge, the WGAN-GP model training is completed, which includes: S01, inputting high-dimensional noise data into the generator to generate a simulation scene, and inputting the simulation scene and the historical scene into the discriminator, and the discriminator outputs the true and false probability judgment value of the scene; S02, calculating the loss function of the generator and the discriminator respectively and ; S03, using the ADAM algorithm, according to the discriminator loss function Update the parameters of the discriminator and fix the parameters of the discriminator; S04, use the ADAM algorithm, according to the generator loss function Update the parameters of the generator; S05, input the high-dimensional noise data into the generator to generate a simulation scene, and input the simulation scene and the historical scene into the discriminator, and the discriminator outputs the true or false probability judgment value of the scene; S06, recalculate the loss function of the generator according to the judgment value ; S07, Execution Steps S04 to S07; wherein, is the preset number of generator parameter updates; S08, determining the loss function of the generator at this time And the loss function of the judge Whether it converges. When one loss function does not converge, execute steps S01 to S08. When both loss functions converge, the model training is completed.
[0010] Furthermore, the loss function of the generator is for: ; Loss function of the discriminator for: ; in, is the noise data, represents the expected value of the data, is the distribution of the noise data, Represents the discriminator’s judgment result on the scene, For the generated scene data, For historical scenes, P his ( X ) is the distribution of historical scenes, is the gradient operator, is the penalty factor, is the norm of 2; Actual scene data And the generated scene data Random interpolation between: ; r is a random number that follows a uniform distribution in the range [0,1].
[0011] Furthermore, the abnormal scene control verification specifically includes: obtaining the minimum allowable active output power through historical power flow data and the minimum allowable reactive output power , maximum allowable active output power and the maximum allowable reactive output power , and verify the active output power of the balancing units in the power system operating parameters of the simulation scenario and reactive output power Whether it exceeds the limit: ; ; Select a branch and set it to short-circuit. Check the stability under N-1 fault by determining whether the system power angle is stable, whether the voltage collapses, and whether the frequency is safe. Check whether the transmission section exceeds the limit by detecting whether there is a flow exceeding the limit in the key branch.
[0012] Furthermore, the sparsity check includes: adding the flow characteristic quantities related to the dynamic safety and stability assessment to the historical scenario vector to form a scenario sparsity check vector; the flow characteristic quantities at least include: the output of conventional thermal power units, line flow, node voltage amplitude and phase angle; determining the number of each category and the number of cluster centers in the scenario sparsity check vector by a clustering algorithm , and set the minimum number of scenes for each group to be sampled m , the number is less than m The cluster with a number less than m The cluster is regenerated using the generator, and the abnormal scene control and sparsity verification are repeated until the sparsity requirements of the corresponding cluster are met.
[0013] In the second aspect, the embodiment of the present application also provides a simulation sample generation system, the system includes: a data acquisition module, the data acquisition module acquires a historical data set within a preset time range of the power grid, and constructs the data of the same power system and the same time in the historical data set into a historical scene; wherein the vectors in the historical scene include: the active output vector of the photovoltaic generator set , the active output vector of the wind turbine , load vector and the transmission capacity of AC / DC interconnection transmission channels ; Load vector Including active power and reactive power, the transmission capacity of AC and DC interconnection transmission channels It includes active transmission and reactive transmission; a simulation scenario generation module, which constructs a WGAN-GP initial model and uses historical scenarios to train the generator and discriminator of the WGAN-GP initial model; uses the trained WGAN-GP model to generate simulation scenarios; a verification module, which inputs the simulation scenario into a preset power flow model to obtain the power system operation parameters that realize the simulation scenario; performs abnormal scenario control verification and sparsity verification on the power system operation parameters of the simulation scenario; uses several simulation scenarios that pass the abnormal scenario control verification and sparsity verification as simulation samples to obtain a simulation sample set.
[0014] In a third aspect, an embodiment of the present application further provides a simulation sample generation device, the device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: implement any one step of the above method.
[0015] In a fourth aspect, an embodiment of the present application further provides a non-volatile computer storage medium for generating a simulation sample, storing computer executable instructions, wherein the computer executable instructions are configured to: be able to implement any one of the steps of the above method.
[0016] A simulation sample generation method system device and medium provided in an embodiment of the present application can effectively increase the diversity of power system operation scenarios by automatically generating simulation samples from historical operation data using a WGAN-GP model, so that the training sample set can better cover various possible operation modes of the actual power system, and solve the problem that samples directly collected from historical data have poor diversity and are difficult to cover high-dimensional mapping space; compared with the GAN model, the WGAN-GP model uses the Wasserstein distance as the loss function, which can effectively describe the distance between the distributions when there is no overlap between the real scene distribution and the actual scene distribution, while avoiding the gradient vanishing or explosion phenomenon caused by its weight truncation; and compared with the traditional Monte Carlo method, this method effectively avoids the generation of a large number of training samples that do not conform to the actual operating conditions by automatically generating simulation samples and performing abnormal scene control verification and sparsity verification on them, thereby saving computing resources, reducing computing time costs, and improving the training efficiency of the evaluation model. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 A flowchart of a simulation sample generation method provided in an embodiment of the present application; Figure 2 A flowchart of the WGAN-GP model training process provided in an embodiment of the present application; Figure 3 A schematic diagram of the internal structure of a simulation sample generation system provided in an embodiment of the present application.
[0018] Figure 4 A schematic diagram of the internal structure of a simulation sample generating device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. 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 making creative work are within the scope of protection of the present application.
[0020] The technical solution proposed in the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0021] Figure 1 A flow chart of a simulation sample generation method provided in an embodiment of the present application. Figure 1 As shown, a simulation sample generation method provided in an embodiment of the present application is based on WGAN-GP and includes the following steps: Step 1: Obtain a historical data set within a preset time range of the power grid, and construct the data of the same power system and the same time in the historical data set into a historical scene.
[0022] Specifically, the historical operation data includes: the active output vector of the photovoltaic generator set , the active output vector of the wind turbine , load vector and the transmission capacity of AC / DC interconnection transmission channels The load vector Including active power and reactive power, the transmission capacity of the AC / DC interconnection transmission channel Includes active transmission and reactive transmission.
[0023] In one embodiment of the present application, the data of the same power system and the same time in the historical operation data set are constructed into a historical scene, and the process includes: The acquired historical operation data is divided into T subsets according to the preset time threshold, and n pieces of historical operation data are taken from each subset to construct a historical scenario vector for the historical operation data. : ; in Indicates that -dimensional real vector.
[0024] Step 2: construct a WGAN-GP initial model, and use the historical scenario to train the generator and discriminator of the WGAN-GP initial model.
[0025] Specifically, a fully connected neural network is used as the basic structural unit of the WGAN-GP model. The number of network layers, the number of neural units, the number of learning and the attenuation factor of the fully connected neural network in the WGAN-GP model are determined by trial and error, and the activation function of each layer is set to the LeakyReLU function.
[0026] Specifically, the generator and discriminator of the WGAN-GP initial model are trained using the historical scenario, including: A number of high-dimensional noises are input into the generator, so that the generator outputs a number of corresponding simulation scenes containing simulation scene vectors.
[0027] In one embodiment of the present application, the dimension of the high-dimensional noise is equal to N and conforms to a normal distribution.
[0028] The historical scene vectors of the historical scenes are normalized, and a label of 1 is added to the historical scenes, and a label of 0 is added to the simulation scenes. The labeled historical scenes and simulation scenes are input as training sets into the discriminator of the WGAN-GP model for training, so that the discriminator outputs a true or false probability discrimination value for the input scenes.
[0029] According to the loss function of the generator And the loss function of the discriminator , use the ADAM optimization algorithm to update the parameters of the generator and discriminator. When the loss function of the generator And the loss function of the discriminator When all converge, the WGAN-GP model training is completed.
[0030] It should be noted that the loss function of the optimal discriminator of the traditional GAN model is equivalent to the JS divergence. If there is no overlap between the generated power system scenario and the real scenario distribution, the gradient of the loss function will be a constant. Therefore, when approaching the optimal discriminator during the optimization process, the training of the generator will experience gradient vanishing and mode collapse. This affects the stable training of the GAN model, resulting in the inability to accurately generate scene data that conforms to the actual operating rules. To avoid the above phenomenon, an embodiment of the present application adopts the WGAN-GP model to construct a GAN model for power system scenario generation. The WGAN-GP model uses the Wasserstein distance as the loss function. At this time, regardless of whether there is an overlap between the real scene distribution and the actual scene distribution, it can effectively describe the distance between the distributions. At the same time, in order to avoid the gradient vanishing or explosion phenomenon caused by its weight truncation, a penalty term is added on the basis of the Wasserstein distance.
[0031] Figure 2 The flowchart of the WGAN-GP model training process provided in the embodiment of the present application is as follows: Figure 2 As shown, according to the loss function of the generator And the loss function of the discriminator , use the ADAM optimization algorithm to update the parameters of the generator and discriminator. When the loss function of the generator And the loss function of the discriminator When all converge, the WGAN-GP model training is completed, including: S01. Input high-dimensional noise data into a generator to generate a simulation scene, and input the simulation scene and the historical scene into a discriminator, and the discriminator outputs a true or false probability judgment value for the scene.
[0032] S02. Calculate the loss functions of the generator and discriminator respectively and ; Specifically, the loss function of the generator is for: .
[0033] The loss function of the discriminator for: .
[0034] in, is the noise data, represents the expected value of the data, is the distribution of the noise data, Represents the discriminator’s judgment result on the scene, For the generated scene data, For historical scenes, P his ( X ) is the distribution of historical scenes, is the gradient operator, is the penalty factor, is the norm of 2; For historical scene data and simulation scenario data Random interpolation between: ; r is a random number that follows a uniform distribution in the range [0,1].
[0035] S03, using the ADAM algorithm, according to the discriminator loss function Update the parameters of the discriminator and fix the parameters of the discriminator.
[0036] S04. Using the ADAM algorithm, according to the generator loss function Update the parameters of the generator.
[0037] S05. Input the high-dimensional noise data into the generator to generate a simulation scene, and input the simulation scene and the historical scene into the discriminator, and the discriminator outputs a true or false probability judgment value for the scene.
[0038] S06. Recalculate the loss function of the generator according to the discriminant value .
[0039] S07. Execution Steps S04 to S07; wherein, The number of updates for the preset generator parameters.
[0040] S08. Determine the loss function of the generator at this time And the loss function of the judge Whether both have converged. When one loss function does not converge, execute steps S01 to S08. When both loss functions have converged, the model training is completed.
[0041] Step 3: Use the trained WGAN-GP model to generate a simulation scenario.
[0042] Step 4: Input the simulation scenario into a preset power flow model to obtain the power system operating parameters that realize the simulation scenario.
[0043] It should be noted that constructing a power flow model is an existing technology. The power flow model is a network parameter model, which includes parameters such as network architecture, transmission line resistance, reactance, etc. An embodiment of the present application constructs an optimal power flow model based on the description of the power system network topology, component parameters and power generation costs in historical operation scenarios, and solves the optimal power flow with the minimum power generation cost as the objective function. The simulation scenario generated by the generator only contains the active output vector, load vector and the transmission volume of the AC / DC interconnection transmission channel, and the optimal power flow is to obtain the output of the thermal power unit in the scenario, line power flow, node voltage and other state quantities, and all the above quantities constitute a complete simulation scenario.
[0044] Step 5: Perform abnormal scenario control verification and sparsity verification on the power system operating parameters of the simulation scenario.
[0045] Specifically, abnormal scene control verification is performed, including: Obtain the minimum allowable active output power through historical power flow data and the minimum allowable reactive output power , maximum allowable active output power and the maximum allowable reactive output power , and verify the active output power of the balancing units in the power system operating parameters of the simulation scenario and reactive output power Whether it exceeds the limit: ; .
[0046] Select a branch and set it to short-circuit, and check the stability under N-1 fault by determining whether the system power angle is stable, whether the voltage collapses, and whether the frequency is safe.
[0047] By detecting whether there is a flow exceeding the limit in key branches, check whether the transmission section exceeds the limit.
[0048] The power system is a complex and highly dynamic system, and its operating status is affected by many factors. Abnormal scenario control can ensure that the generated simulation scenario is physically feasible and conforms to the actual operating rules of the power system, thereby avoiding invalid or erroneous data in model training; and the actual operating conditions of the power system are affected by a variety of environmental factors such as climate, topography, and economic conditions. The load and new energy output conditions in different regions and at different times are different. Through abnormal scenario control, it is ensured that the generated simulation scenario is closer to the actual operating conditions, and the practicality and reliability of the simulation samples are improved.
[0049] Specifically, the sparsity check includes: The power flow characteristic quantities related to the dynamic safety and stability assessment are added to the historical scenario vector to form a scenario sparsity verification vector; the power flow characteristic quantities at least include: conventional thermal power unit output, line power flow, node voltage amplitude and phase angle.
[0050] Determine the number of categories and cluster centers in the scene sparsity check vector by clustering algorithm , and set the minimum number of scenes for each group to be sampled m , the number is less than m The group with is sparse scene.
[0051] For numbers less than m The cluster is regenerated using the generator, and the abnormal scene control and sparsity verification are repeated until the sparsity requirements of the corresponding cluster are met.
[0052] The input of the generator is random noise, so the generated scene vector data set is also random. Some actual operating scenes may lack similar generated scenes near them, resulting in sparse distribution of scene samples. Therefore, the dynamic safety assessment model using this as a training sample is difficult to learn the complex functional mapping relationship between safety and stability indicators and flow characteristics under sparse operation mode, making the dynamic safety and stability assessment model have low assessment accuracy for these scenes. Increasing the density of training samples near these operating scenes is the key to reducing assessment errors. At this time, it is necessary to check the sparsity of the scene, and use the trained generator to perform multiple resampling and rejection sampling to generate the required sparse scene vectors.
[0053] Step 6: Use several scenes that have passed the abnormal scene control check and the sparsity check as simulation samples to obtain a simulation sample set.
[0054] In one embodiment of the present application, a historical operation data set of the power system in the past year is selected and divided into 12 monthly subsets by month, each of which contains n historical scenarios. In the training process of the WGAN-GP model, a historical scenario of a monthly subset is input to train the WGAN-GP model, and a scenario generator model of the month is obtained. After abnormal scenario control and sparsity verification, a set of simulation scenarios for each month is obtained. , t is the number of months, in the present application embodiment Through the historical scene and the generated simulation scenario Perform time domain simulation to obtain the specified dynamic safety index to construct a power system simulation sample; wherein the dynamic safety index includes transient frequency safety assessment, transient stability assessment, and transient voltage safety assessment. Taking the construction of a transient frequency safety assessment model using simulation samples as an example, the dynamic safety index can take the maximum frequency offset, the maximum frequency change rate, or the steady-state frequency, and at the same time extract the scenario state quantities related to frequency safety, such as inertia, rotating reserve, unit output, load level, unit capacity, damping coefficient, etc. The scenario state vector of each scenario and the corresponding label constitute a power system simulation sample, and batches of power system simulation samples are used as training sample sets for the dynamic safety assessment model.
[0055] The above is an embodiment of the method proposed in this application. Based on the same inventive concept, the embodiment of this application also provides a system, whose structure is as follows: Figure 2 shown.
[0056] Figure 3 Schematic diagram of the internal structure of a simulation sample generation system provided in an embodiment of the present application. Figure 3 As shown, the system includes: A data acquisition module, wherein the data acquisition module acquires a historical data set within a preset time range of the power grid, and constructs the data of the same power system and the same time in the historical data set into a historical scene; wherein the vectors in the historical scene include: the active output vector of the photovoltaic generator set , the active output vector of the wind turbine , load vector and the transmission capacity of AC / DC interconnection transmission channels The load vector Including active power and reactive power, the transmission capacity of the AC / DC interconnection transmission channel Includes active transmission and reactive transmission.
[0057] A simulation scenario generation module is provided, wherein the simulation scenario generation module constructs a WGAN-GP initial model and uses the historical scenario to train a generator and a discriminator of the WGAN-GP initial model; and uses the trained WGAN-GP model to generate a simulation scenario.
[0058] A verification module, wherein the verification module inputs a simulation scenario into a preset power flow model to obtain power system operating parameters that realize the simulation scenario; performs abnormal scenario control verification and sparsity verification on the power system operating parameters of the simulation scenario; and uses several simulation scenarios that pass the abnormal scenario control verification and sparsity verification as simulation samples to obtain a simulation sample set.
[0059] Based on the same inventive concept, the present application also provides a simulation sample generation device, whose structure is as follows: Figure 4 shown.
[0060] Figure 4 This is a schematic diagram of the internal structure of a simulation sample generation device provided in an embodiment of the present application. Figure 4 As shown, the device includes: at least one processor 201; and, a memory 202 communicatively connected to the at least one processor; The memory 202 stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor 201 so that the at least one processor 201 can: implement any one step of the above method.
[0061] Some embodiments of the present application provide corresponding Figure 1 A non-volatile computer storage medium generated by a simulation sample stores computer executable instructions, and the computer executable instructions are set as: Any step of the above method can be implemented.
[0062] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the IoT device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0063] The system and medium provided in the embodiments of the present application correspond one-to-one to the method. Therefore, the system and medium also have similar beneficial technical effects to the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the system and medium will not be repeated here.
[0064] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0065] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0066] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0067] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0068] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0069] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0070] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0071] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0072] The above is only the embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the present application.
Claims
1. A method for generating simulation samples, It is characterized in that The method is based on WGAN-GP and includes the following steps: Obtain a historical data set within a preset time range of the power grid, and construct the data of the same power system and the same time in the historical data set into a historical scene; wherein the vectors in the historical scene include: the active output vector of the photovoltaic generator set , the active output vector of the wind turbine , load vector and the transmission capacity of AC / DC interconnection transmission channels The load vector Including active power and reactive power, the transmission capacity of the AC / DC interconnection transmission channel Includes active transmission and reactive transmission; Constructing a WGAN-GP initial model, and using the historical scenario to train a generator and a discriminator of the WGAN-GP initial model; Use the trained WGAN-GP model to generate simulation scenarios; Input the simulation scenario into a preset power flow model to obtain the power system operation parameters that realize the simulation scenario; Performing abnormal scenario control verification and sparsity verification on the power system operation parameters of the simulation scenario; Several simulation scenarios that have passed the abnormal scenario control check and the sparsity check are taken as simulation samples to obtain a simulation sample set.
2. A simulation sample generation method according to claim 1, It is characterized in that Construct the WGAN-GP initial model, including: A fully connected neural network is used as the basic structural unit of the WGAN-GP model. The number of network layers, the number of neural units, the number of learning and the attenuation factor of the fully connected neural network in the WGAN-GP model are determined by trial and error, and the activation function of each layer is set to the LeakyReLU function.
3. A method for generating a simulation sample according to claim 2, It is characterized in that The generator and discriminator of the WGAN-GP initial model are trained using the historical scenario, specifically including: Inputting a plurality of high-dimensional noises into the generator, so that the generator outputs a plurality of corresponding simulation scenarios including simulation scenario vectors; the high-dimensional noise has the same dimension as the data in the historical scenario; Normalizing the historical scene vectors, adding a label of 1 to the historical scene, adding a label of 0 to the simulation scene, and inputting the labeled historical scene and simulation scene into the discriminator of the WGAN-GP model as training sets for training, so that the discriminator outputs a true or false probability discrimination value for the input scene; According to the loss function of the generator And the loss function of the discriminator , use the ADAM optimization algorithm to update the parameters of the generator and discriminator. When the loss function of the generator And the loss function of the discriminator When all converge, the WGAN-GP model training is completed.
4. A method for generating a simulation sample according to claim 3, It is characterized in that According to the loss function of the generator And the loss function of the discriminator , use the ADAM optimization algorithm to update the parameters of the generator and discriminator. When the loss function of the generator And the loss function of the discriminator When all converge, the WGAN-GP model training is completed, which specifically includes: S01, inputting high-dimensional noise data into a generator to generate a simulation scene, and inputting the simulation scene and the historical scene into a discriminator, and the discriminator outputs a true or false probability discrimination value of the scene; S02. Calculate the loss functions of the generator and discriminator respectively and ; S03, using the ADAM algorithm, according to the discriminator loss function Update the parameters of the discriminator and fix the parameters of the discriminator; S04. Using the ADAM algorithm, according to the generator loss function Update the parameters of the generator; S05, inputting high-dimensional noise data into a generator to generate a simulation scene, and inputting the simulation scene and the historical scene into a discriminator, and the discriminator outputs a true or false probability discrimination value of the scene; S06. Recalculate the loss function of the generator according to the discriminant value ; S07. Execution Steps S04 to S07; wherein, The number of updates for the preset generator parameters; S08. Determine the loss function of the generator at this time And the loss function of the judge Whether both have converged. When one loss function does not converge, execute steps S01 to S08. When both loss functions have converged, the model training is completed.
5. A method for generating a simulation sample according to claim 4, It is characterized in that The loss function of the generator for: ; The loss function of the discriminator for: ; in, is the noise data, represents the expected value of the data, is the distribution of the noise data, Represents the discriminator’s judgment result on the scene, For the generated scene data, For historical scenes, P his ( X ) is the distribution of historical scenes, is the gradient operator, is the penalty factor, is the norm of 2; For historical scene data and simulation scenario data Random interpolation between: ; r is a random number that follows a uniform distribution in the range [0,1].
6. A method for generating a simulation sample according to claim 1, It is characterized in that Abnormal scenario control verification specifically includes: Obtain the minimum allowable active output power through historical power flow data and the minimum allowable reactive output power , maximum allowable active output power and the maximum allowable reactive output power , and verify the active output power of the balancing units in the power system operating parameters of the simulation scenario and reactive output power Whether it exceeds the limit: ; ; Select a branch and set it to short-circuit, and check the stability under N-1 fault by determining whether the system power angle is stable, whether the voltage collapses, and whether the frequency is safe; By detecting whether there is a flow exceeding the limit in key branches, check whether the transmission section exceeds the limit.
7. A method for generating a simulation sample according to claim 6, It is characterized in that Sparsity verification specifically includes: Adding power flow characteristics related to dynamic safety and stability assessment to the historical scenario vector to form a scenario sparsity verification vector; the power flow characteristics include at least: conventional thermal power unit output, line power flow, node voltage amplitude and phase angle; Determine the number of categories and cluster centers in the scene sparsity check vector by clustering algorithm , and set the minimum number of scenes for each group to be sampled m , the number is less than m The group with is a sparse scene; For numbers less than m The cluster is regenerated using the generator, and the abnormal scene control and sparsity verification are repeated until the sparsity requirements of the corresponding cluster are met.
8. A simulation sample generation system, It is characterized in that The system comprises: A data acquisition module, wherein the data acquisition module acquires a historical data set within a preset time range of the power grid, and constructs the data of the same power system and the same time in the historical data set into a historical scene; wherein the vectors in the historical scene include: the active output vector of the photovoltaic generator set , the active output vector of the wind turbine , load vector and the transmission capacity of AC / DC interconnection transmission channels The load vector Including active power and reactive power, the transmission capacity of the AC / DC interconnection transmission channel Includes active transmission and reactive transmission; A simulation scenario generation module, wherein the simulation scenario generation module constructs a WGAN-GP initial model and uses the historical scenario to train a generator and a discriminator of the WGAN-GP initial model; and uses the trained WGAN-GP model to generate a simulation scenario; A verification module, wherein the verification module inputs a simulation scenario into a preset power flow model to obtain power system operating parameters that realize the simulation scenario; performs abnormal scenario control verification and sparsity verification on the power system operating parameters of the simulation scenario; and uses several simulation scenarios that pass the abnormal scenario control verification and sparsity verification as simulation samples to obtain a simulation sample set.
9. A simulation sample generating device, It is characterized in that The device comprises: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: Implement the steps of the method according to any one of claims 1 to 7.
10. A non-volatile computer storage medium generated by a simulation sample, storing computer executable instructions, It is characterized in that The computer executable instructions are configured to: Implement the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Adversarial sample generation method for face recognition system in physical domain
CN110991299A
Medium-term wind power scene generation method and system
CN111008455A
New energy scene generation method and system based on adversarial learning model
CN111553587A
Adversarial sample generation method based on content-aware GAN
CN111881935A
New energy output scene generation method based on deep learning and data driving
CN112232488A
Cited By
Multi-dimensional scene intelligent safety test method and device for unmanned driving
CN120524998A
Multi-dimensional scene intelligent safety testing method and device for unmanned vehicles
CN120524998B
Method for generating operation scene of network construction type SVG (Static Var Generator) accessed power system based on diffusion model
CN121507773A
