Power grid automatic real-time simulation method and device based on python interface
Through the automatic real-time grid simulation method based on the python interface, a real-time grid simulation model coupled to the simulator is automatically generated and fault simulation is performed, which solves the problem of low real-time simulation efficiency of traditional power grids, and realizes automatic real-time simulation and stable verification of power system models.
Patent Information
- Application Number
- CN202510568475.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-07-25
AI Technical Summary
Traditional manual real-time grid simulation tests are difficult to adapt to the rapid growth of power system operation mode, and the simulation efficiency is low and the process is cumbersome.
The automatic real-time grid simulation method based on the Python interface is adopted. By obtaining the typical operating mode data of the power system, a real-time grid simulation model coupled to the simulator is generated, and the error information output by the simulator is automatically corrected. Until the stable operation is completed, a fault set is generated for fault simulation, and the simulation report is automatically generated after all faults are completed.
It realizes the automatic generation of massive operation modes and simulation examples of the new power system real-time simulation and automatic stable verification of power system models, greatly improving simulation efficiency.
Smart Images

Figure CN120372974A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power grid real-time simulation technology, and particularly to a power grid automatic real-time simulation method and device based on a python interface. Background Art
[0002] Currently, China is vigorously promoting energy transformation. The large-scale integration of new energy into the grid has led to a sharp increase in the scale and complexity of simulation, and the contradiction between simulation efficiency and accuracy has become extremely prominent. As an important means for evaluating the hosting capacity of new energy, simulation technology urgently needs to solve the problem of accurate modeling of a large number of new energy power generation units, complex control ecosystems, and multi-time scale characteristics under limited simulation resources. Traditional electromechanical transient simulations cannot accurately reflect the simulation of new power systems at the electromagnetic scale. Therefore, it is necessary to adopt power system real-time simulation technology based on electromagnetic transients to accurately calculate the stability characteristics of the power grid.
[0003] Power system real-time simulation is a technical means based on high-performance simulation technology to simulate the dynamic operation of a power system in real-time or near real-time. It collects and processes power system data in real-time, constructs accurate simulation models, and runs these models on high-performance simulation hosts using simulation software to simulate the operation and response behavior of the power system under different operating conditions. However, since power grid real-time simulation is carried out based on hardware simulators, its simulation efficiency and speed are much lower than those of electromechanical transient simulation data. Therefore, traditional real-time simulation requires a large number of test personnel to participate in power grid modeling, simulation operation, and simulation data analysis.
[0004] Moreover, the number of new energy sources connected to the power grid is extremely large. Different penetration rates, connection points, and fault locations have significantly different impacts on system stability. The number of operating conditions to be considered in stability analysis and calculation increases geometrically. If the differences in different unit models are further considered, the complexity of system stability analysis will increase further. According to combined calculations, the number of system operation modes for a single provincial power grid will reach 2 to the 9th power annually. Traditional power grid real-time simulation tests carried out manually require manual adjustment of operation modes, manual setting of faults, manual tests, recordings, and stability identification. For each mode calculation, at least 8 man-hours are required, making it difficult to meet the rapidly growing demand for power system operation modes. Summary of the Invention
[0005] The purpose of this application aims to solve at least one of the above technical defects, especially the technical defect that traditional power grid real-time simulation tests carried out manually in the prior art are difficult to meet the rapidly growing demand for power system operation modes.
[0006] This application provides a power grid automatic real-time simulation method based on a python interface. The method includes:
[0007] Obtain the data of the typical operation mode of the power system, and generate a real-time power grid simulation model coupled with the simulator according to the power grid topology provided by the typical operation mode data, the simulation nodes and control components allocated by the preset simulator;
[0008] Run the real-time power grid simulation model through the simulator, and when it is determined that the real-time power grid simulation model is operating unstably, correct the real-time power grid simulation model according to the error information output by the simulator until the real-time power grid simulation model operates stably;
[0009] When it is determined that the real-time power grid simulation model is operating stably, after generating a fault set corresponding to the typical operation mode data, perform fault simulation on the real-time power grid simulation model according to the fault set. Until all the faults in the fault set are completed with fault simulation, adjust the current operation mode of the real-time power grid simulation model, and return to execute running the real-time power grid simulation model through the simulator and its subsequent steps. Until all the operation modes are scanned, use the python tool to automatically generate a simulation report.
[0010] Optionally, the generating a fault set corresponding to the typical operation mode data includes:
[0011] According to the principle of power system stability analysis and calculation, simulate the N-1 tripping faults of each power grid component in the typical operation mode data, and generate the N-1 fault set of the power grid components;
[0012] Generate the N-2 fault set of the power grid components according to the simultaneous or successive faults of double or multiple circuits in the same power transmission direction;
[0013] Simulate the faults of other key components in the typical operation mode data, and generate the fault sets of the other key components.
[0014] Optionally, the performing fault simulation on the real-time power grid simulation model according to the fault set until all the faults in the fault set are completed with fault simulation includes:
[0015] Generate a fault control interface of the simulator through python, and perform waveform recording on the voltage, current and power of relevant components to generate a simulation interface;
[0016] Trigger the real-time power grid simulation model to perform fault simulation according to the order of each fault in the fault set, and during each fault simulation, perform waveform recording on the voltage, current and power of relevant components in the real-time power grid simulation model, form waveform recording data corresponding to each fault and store it;
[0017] Restore the tripped components in the real-time power grid simulation model to the normal state, and when it is judged that the system is operating stably, traverse to trigger the next fault until all the faults in the fault set have completed the fault simulation.
[0018] Optionally, the judging that the system is operating stably includes:
[0019] Automatically analyze the stability characteristics of the recorded wave data by software, and when it is determined that the voltage deviation in the recorded wave data does not exceed the first preset deviation threshold and the frequency deviation is less than the second preset deviation threshold, judge that the system is operating stably.
[0020] Optionally, the method further includes:
[0021] When it is judged that the system is not operating stably, identify and record the mode information corresponding to the instability case, and after modifying the real-time power grid simulation model according to the preset stability control plan or stability control measures, re-perform the fault simulation on the instability case until the system operates stably.
[0022] Optionally, the adjusting the current operation mode of the real-time power grid simulation model includes:
[0023] According to the set mode adjustment principle, modify the primary and secondary control parameters in the real-time power grid simulation model based on the typical operation mode data, and adjust the unit output and load to adjust the real-time power grid simulation model from the current operation mode to the next operation mode.
[0024] Optionally, the according to the set mode adjustment principle, modifying the primary and secondary control parameters in the real-time power grid simulation model based on the typical operation mode data, and adjusting the unit output and load to adjust the real-time power grid simulation model from the current operation mode to the next operation mode includes:
[0025] According to the set mode adjustment principle, automatically generate power grid mode data by using python code and the typical operation mode data, and adjust the primary and secondary control parameters in the real-time power grid simulation model according to the power grid operation mode data, as well as adjust the unit output and load until the power flow of the typical operation mode data corresponding to the adjusted real-time power grid simulation model converges and the system is balanced.
[0026] This application provides a power grid automatic real-time simulation device based on a python interface, including:
[0027] A simulation model generation module, configured to obtain the typical operation mode data of the power system, and generate a real-time power grid simulation model coupled with the simulator according to the power grid topology provided by the typical operation mode data and the simulation nodes and control components allocated by the preset simulator;
[0028] A simulation model correction module, configured to run the power grid real-time simulation model through the simulator, and when it is determined that the power grid real-time simulation model is not operating stably, correct the power grid real-time simulation model according to the error information output by the simulator until the power grid real-time simulation model operates stably;
[0029] An automatic simulation module, configured to, when it is determined that the power grid real-time simulation model is operating stably, generate a fault set corresponding to the typical operation mode data, and then perform fault simulation on the power grid real-time simulation model according to the fault set. After all the faults in the fault set have completed the fault simulation, adjust the current operation mode of the power grid real-time simulation model, and return to execute the step of running the power grid real-time simulation model through the simulator and its subsequent steps. Until all operation modes have been scanned, use the python tool to automatically generate a simulation report.
[0030] The present application also provides a computer-readable storage medium, in which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the one or more processors are caused to execute the steps of the power grid automatic real-time simulation method based on the python interface as described in any one of the above embodiments.
[0031] The present application also provides a computer device, including: one or more processors, and a memory;
[0032] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the power grid automatic real-time simulation method based on the python interface as described in any one of the above embodiments are executed.
[0033] As can be seen from the above technical solutions, the embodiments of the present application have the following advantages:
[0034] The power grid automatic real-time simulation method and device based on the python interface provided by this application can, after obtaining the typical operation mode data of the power system, generate a power grid real-time simulation model coupled with the simulator according to the power grid topology provided by the typical operation mode data and the simulation nodes and control elements allocated by the preset simulator. In this way, the power grid real-time simulation model can be run through the simulator. During this process, this application can determine whether the power grid real-time simulation model is running stably. If it is not running stably, the power grid real-time simulation model can be corrected according to the error information output by the simulator until the power grid real-time simulation model runs stably; when it is determined that the power grid real-time simulation model is running stably, this application can generate a fault set corresponding to the typical operation mode data, and then perform fault simulation on the power grid real-time simulation model according to the fault set. Until all the faults in the fault set have completed the fault simulation, adjust the current operation mode of the power grid real-time simulation model, and return to execute the steps of running the power grid real-time simulation model through the simulator and its subsequent steps. Until all the operation modes have been scanned, use the python tool to automatically generate a simulation report. This application combines the python tool with the simulator, realizes the automatic generation of a large number of operation modes and simulation examples for the real-time simulation of the new power system, and can thus meet the requirements of automatic real-time simulation and automatic stability checking of the power system model, and greatly improve the problems of low efficiency and cumbersome simulation process in the traditional power grid real-time simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0036] Figure 1 It is a schematic flowchart of a power grid automatic real-time simulation method based on the python interface provided by an embodiment of this application;
[0037] Figure 2 It is a specific flowchart of the power grid real-time simulation method provided by an embodiment of this application;
[0038] Figure 3 It is a schematic structural diagram of a power grid automatic real-time simulation device based on the python interface provided by an embodiment of this application;
[0039] Figure 4 It is a schematic internal structure diagram of a computer device provided by an embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0040] 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.
[0041] In one embodiment, Figure 1 As shown, Figure 1 A schematic diagram of a flow chart of a method for automatic real-time simulation of a power grid based on a python interface provided in an embodiment of the present application; the present application provides a method for automatic real-time simulation of a power grid based on a python interface, the method may include:
[0042] S110: Acquire typical operation mode data of the power system, and generate a real-time simulation model of the power grid coupled with the simulator according to the power grid topology provided by the typical operation mode data and the simulation nodes and control elements allocated by the preset simulator.
[0043] In this step, when performing automatic real-time simulation of the power grid, you can first obtain the typical operating mode data of the power system. The typical operating mode data is determined based on the typical electromechanical transient operating mode data determined each year. Generally, there are 4 to 12 sets of typical operating mode data based on the startup conditions and load changes of hydropower and new energy. These typical operating mode data can be used as the basic data for real-time simulation of the power grid.
[0044] Furthermore, the present application has developed an automatic conversion module of electromechanical transient to electromagnetic transient based on Python language. This module can automatically convert typical operating mode data into a real-time simulation model of the power grid through the model library matching method, and allocate simulation resources according to the existing real-time simulator, thereby meeting the needs of automatic operation of the simulation model.
[0045] Specifically, the steps of automatically constructing a real-time power grid simulation model in the present application may include the following:
[0046] a. Preset model library of primary equipment and their control equipment such as lines, high-voltage reactors, switches, transformers, traditional generators, new energy units and energy storage, and automatically match model parameters related to electromechanical transients;
[0047] b. Automatically combine and generate a model based on electromechanical transient data, that is, the power grid topology provided by typical operating mode data, and automatically allocate simulation nodes and control elements based on simulator resources to form a real-time power grid simulation model coupled with the simulator.
[0048] S120: Run the real-time power grid simulation model through the emulator, and when it is determined that the real-time power grid simulation model is not operating stably, correct the real-time power grid simulation model according to the error information output by the emulator until the real-time power grid simulation model operates stably.
[0049] In this step, after constructing the real-time power grid simulation model through S110, the present application can run the real-time power grid simulation model through the emulator. During this process, the present application can also monitor the operating stability of the real-time power grid simulation model. When it is determined that the real-time power grid simulation model is not operating stably, the real-time power grid simulation model can be corrected according to the error information output by the emulator until the real-time power grid simulation model operates stably, so that subsequent operations can be performed.
[0050] Specifically, the present application can be automatically compiled and automatically simulated and run. For example, when there is an error in simulation compilation or operation, the present application can correct the real-time power grid simulation model according to the error information given by the emulator until the system can operate correctly, and automatically adjust the voltage of the real-time simulation system and maintain the frequency stability of the system.
[0051] S130: When it is determined that the real-time power grid simulation model is operating stably, after generating a fault set corresponding to the typical operating mode data, perform fault simulation on the real-time power grid simulation model according to the fault set. Until all the faults in the fault set have completed fault simulation, adjust the current operating mode of the real-time power grid simulation model, and return to execute running the real-time power grid simulation model through the emulator and its subsequent steps. Until all the operating modes have been scanned, use the python tool to automatically generate a simulation report.
[0052] In this step, when the real-time power grid simulation model is not operating stably through S120, it is corrected according to the error information output by the emulator until the real-time power grid simulation model operates stably. At this time, the present application can generate a fault set corresponding to the typical operating mode data, and perform fault simulation on the real-time power grid simulation model according to the fault set. Until all the faults in the fault set have completed fault simulation, the current operating mode of the real-time power grid simulation model can also be adjusted, and continue to run the real-time power grid simulation model in this operating mode through the emulator, and determine whether the real-time power grid simulation model is operating stably. When the real-time power grid simulation model is not operating stably, the model can be corrected, and after determining that the corrected model operates stably, continue to generate a fault set corresponding to the corresponding typical operating mode data, and automatically generate a test case until all the operating modes have been scanned. It can also use the python tool to automatically generate a simulation report.
[0053] For example, when all the operating modes and all the test cases in the present application have been scanned, the python tool automatically generates a simulation report, mainly including:
[0054] a. The XX method XX example is stable;
[0055] b. The XX method XX example becomes unstable. Obtain the instability characteristic recording file. After taking control measures for the instability, it becomes stable / remains unstable;
[0056] c. The total time of simulation calculation, the total number of simulation examples in the simulation calculation.
[0057] In the above embodiments, after obtaining the typical operation mode data of the power system, according to the power grid topology provided by the typical operation mode data and the simulation nodes and control components allocated by the preset simulator, a real-time power grid simulation model coupled with the simulator can be generated. In this way, the real-time power grid simulation model can be run through the simulator. During this process, the present application can determine whether the real-time power grid simulation model is operating stably. If it is not operating stably, the real-time power grid simulation model can be corrected according to the error information output by the simulator until the real-time power grid simulation model operates stably; when it is determined that the real-time power grid simulation model is operating stably, the present application can generate a fault set corresponding to the typical operation mode data, and then perform fault simulation on the real-time power grid simulation model according to the fault set. Until all the faults in the fault set are completed for fault simulation, adjust the current operation mode of the real-time power grid simulation model, and return to execute running the real-time power grid simulation model through the simulator and its subsequent steps. Until all the operation modes are scanned, use the python tool to automatically generate a simulation report. The present application combines the python tool with the simulator, realizing the automatic generation of a large number of operation modes and simulation examples for real-time simulation of a new type of power system, and thus being able to meet the requirements of automatic real-time simulation and automatic stability checking of the power system model, and greatly improving the problems of low efficiency and cumbersome simulation process in traditional power grid real-time simulation.
[0058] In one embodiment, generating the fault set corresponding to the typical operation mode data in S130 may include:
[0059] S131: According to the principles of power system stability analysis and calculation, simulate the N-1 tripping faults of each power grid component in the typical operation mode data, and generate the N-1 fault set of the power grid components.
[0060] S132: Generate the N-2 fault set of the power grid components according to the simultaneous or successive faults of double-circuit or multi-circuit lines in the same power transmission direction.
[0061] S133: Simulate the faults of other key components in the typical operation mode data, and generate the fault set of the other key components.
[0062] In this embodiment, when generating a real-time simulation fault set according to the primary topology of the power grid, the automatic fault model matching function can be implemented through software code. The fault types covered by the fault set are iterated into the power grid real-time simulation model, and then automatically recompiled and run again.
[0063] For example, the specific fault set settings of this application can include the following:
[0064] a. According to the principles of power system stability analysis and calculation, simulate the N-1 tripping faults of components such as lines and main transformers to generate the N-1 fault set of power grid components;
[0065] b. According to the simultaneous or successive faults (with an interval of 3 s) of double-circuit or multi-circuit lines (two or more main transformers) in the same power transmission direction, generate the N-2 fault set of power grid components;
[0066] Other key components, such as the tripping of large-capacity power plants or the centralized disconnection from the grid of new energy, etc.
[0067] Through the above process, a fault set corresponding to the typical operation mode data can be automatically generated, and then the operation of automatically generating calculation examples can be realized.
[0068] In one embodiment, in S130, performing fault simulation on the power grid real-time simulation model according to the fault set until all faults in the fault set are completed with fault simulation may include:
[0069] S134: Generate a fault control interface for the simulator through python, and perform waveform recording on the voltage, current, and power of relevant components to generate a simulation interface.
[0070] S135: Trigger the power grid real-time simulation model to perform fault simulation in the order of each fault in the fault set, and during each fault simulation, perform waveform recording on the voltage, current, and power of relevant components in the power grid real-time simulation model to form waveform recording data corresponding to each fault and store it.
[0071] S136: Restore the tripped components in the power grid real-time simulation model to the normal state, and when it is judged that the system is operating stably, traverse and trigger the next fault until all faults in the fault set are completed with fault simulation.
[0072] In this embodiment, when performing fault simulation on the power grid real-time simulation model according to the fault set, the fault control interface of the simulator can be generated first through Python, and the voltages, currents, and powers of relevant components can be recorded to generate a simulation interface. Then, the power grid real-time simulation model is triggered to perform fault simulation in the order of each fault in the fault set, and during each fault simulation, the voltages, currents, and powers of relevant components in the power grid real-time simulation model are recorded to form and store the recorded data corresponding to each fault. Next, the application can restore the tripped components in the power grid real-time simulation model to the normal state, and when it is determined that the system is operating stably, the next fault is traversed and triggered until all faults in the fault set have completed fault simulation.
[0073] In one embodiment, the determination of the stable operation of the system may include:
[0074] Automatically analyze the stability characteristics of the recorded data by software, and when it is determined that the voltage deviation in the recorded data does not exceed the first preset deviation threshold and the frequency deviation is less than the second preset deviation threshold, it is determined that the system is operating stably.
[0075] In a specific implementation manner, the application can perform fault scanning according to the generated fault set and automatically determine whether the system is unstable after the fault according to the general stability criterion of the power system. The main functions include:
[0076] a. Generate the fault control interface of the corresponding simulator through Python, and record the voltages, currents, and powers of relevant components to generate a simulation interface. To avoid excessive storage of the recording time, the number of recording components and the recording length can be appropriately controlled. For example, the number of recording variables for each simulation interface does not exceed 64, and the recording time length does not exceed 10s, etc.
[0077] b. On the premise that the system is operating stably (the voltage deviation of each node does not exceed ±5% and the frequency deviation is less than ±0.2Hz), trigger the faults in the order of the fault set and store the recorded data in the folder at the specified path;
[0078] c. After storing the recording, restore the tripped components to the normal state, and traverse and trigger the next fault 5s after the system is operating stably (the voltage deviation of each node does not exceed ±5% and the frequency deviation is less than ±0.2Hz) until all faults are triggered and simulated.
[0079] All faults in the fault set can be scanned in the above manner, and the corresponding examples can be automatically generated.
[0080] In one embodiment, as Figure 2 shown, Figure 2 is the specific process schematic diagram of the power grid real-time simulation method provided by the embodiment of the application; the method may further include:
[0081] When it is determined that the system is operating unstably, identify and record the mode information corresponding to the instability case, and after correcting the real-time power grid simulation model according to the preset stability control plan or stability control measures, perform a fault simulation on the instability case again until the system operates stably.
[0082] In this embodiment, while triggering the fault simulation, the present application can also automatically analyze the recorded wave data by software, perform stability discrimination on the stability characteristics such as system voltage, frequency, and component overload, identify the instability cases, and record the corresponding modes and fault types.
[0083] Furthermore, for the simulation examples that have been determined to be unstable, after the automatic simulation calculation is completed, the present application can also, through manual analysis, design a stability control plan (adjusting power generation output and load, etc.) or stability control measures (real-time generator tripping, load shedding, energy storage control measures), and after correcting the model using the stability control plan or stability control measures, perform a traversal simulation analysis of the instability case in this mode until the system operates stably.
[0084] Even further, if the control plan and control measures have been pre-designed or already exist, they can be added to the real-time simulation problem processing library of the system through python code, automatically correct the model, and simulate and verify the stability of the system including the control scheme, thereby avoiding manual intervention.
[0085] In one embodiment, adjusting the current operating mode of the real-time power grid simulation model in S130 may include:
[0086] S137: According to the set mode adjustment principle, and based on the typical operating mode data, modify the primary and secondary control parameters in the real-time power grid simulation model, and adjust the generator output and load to adjust the real-time power grid simulation model from the current operating mode to the next operating mode.
[0087] In this embodiment, when adjusting the current operating mode of the real-time power grid simulation model, the primary and secondary control parameters in the real-time power grid simulation model can be modified according to the set mode adjustment principle and based on the typical operating mode data, and the generator output and load can be adjusted, so as to adjust the real-time power grid simulation model to the next operating mode and perform automatic simulation calculation.
[0088] In one embodiment, according to the set mode adjustment principle in S137, and based on the typical operating mode data, modifying the primary and secondary control parameters in the real-time power grid simulation model, and adjusting the generator output and load to adjust the real-time power grid simulation model from the current operating mode to the next operating mode may include:
[0089] According to the set mode adjustment principle, use Python code and the typical operation mode data to automatically generate power grid mode data, and adjust the primary and secondary control parameters in the power grid real-time simulation model according to the power grid operation mode data, as well as adjust the unit output and load until the power flow of the typical operation mode data corresponding to the adjusted power grid real-time simulation model converges and the system is balanced.
[0090] In this embodiment, when modifying the power grid real-time simulation model according to the set mode adjustment principle and based on the typical operation mode data, Python code and the typical operation mode data can be used to automatically generate power grid mode data, and the primary and secondary control parameters in the power grid real-time simulation model can be adjusted according to the power grid operation mode data, as well as adjust the unit output and load until the power flow of the typical operation mode data corresponding to the adjusted power grid real-time simulation model converges and the system is balanced.
[0091] In a specific implementation manner, the operation mode adjustment process of this application is as follows:
[0092] a. According to the mode adjustment principle, adjust data such as unit startup, load output, and line maintenance, traverse to generate a mode data set, and adjust the power flow convergence and system balance of the electromechanical transient data corresponding to each mode.
[0093] The generation of mode data adopts the mode of external Python tools, which is independent of the automatic real-time simulation tool software. Python code is used to automatically generate mode data according to the mode adjustment principle, automatically call the electromechanical transient simulation tool to calculate power flow data, judge whether it converges and is balanced, ensure the reliability and accuracy of the mode data, and thus ensure the authenticity and effectiveness of the power grid real-time simulation model.
[0094] b. Use Python to call the above mode data one by one, compare it with the original mode, and perform operations such as deletion, addition, and adjustment on the relevant components of the power grid real-time simulation model according to the comparison results, and ensure that the power grid model can operate stably;
[0095] c. According to the fault set automatic generation method and automatic traversal and scanning method proposed in this application, automatically identify instability cases and perform automatic stability checking according to the preset control measures.
[0096] Through the above method, the operation mode of the power grid real-time simulation model can be automatically adjusted, realizing the full process automation of the stable calculation of the new power system, greatly improving the efficiency of the power grid real-time simulation calculation, and making it possible to perform full-time stable real-time simulation calculation for a large number of new energy sources connected to the power grid.
[0097] The following describes the power grid automatic real-time simulation device based on the python interface provided by the embodiments of the present application. The power grid automatic real-time simulation device based on the python interface described below can be correspondingly referred to the power grid automatic real-time simulation method based on the python interface described above.
[0098] In one embodiment, as Figure 3 shown, Figure 3 is a schematic structural diagram of a power grid automatic real-time simulation device based on the python interface provided by the embodiments of the present application; the present application provides a power grid automatic real-time simulation device based on the python interface, which may include a simulation model generation module 210, a simulation model correction module 220, and an automatic simulation module 230, specifically including the following:
[0099] The simulation model generation module 210 is configured to obtain the typical operation mode data of the power system, and generate a power grid real-time simulation model coupled with the simulator according to the power grid topology provided by the typical operation mode data and the simulation nodes and control elements allocated by the preset simulator.
[0100] The simulation model correction module 220 is configured to run the power grid real-time simulation model through the simulator, and when it is determined that the power grid real-time simulation model is not operating stably, correct the power grid real-time simulation model according to the error information output by the simulator until the power grid real-time simulation model operates stably.
[0101] The automatic simulation module 230 is configured to, when it is determined that the power grid real-time simulation model is operating stably, generate a fault set corresponding to the typical operation mode data, and perform fault simulation on the power grid real-time simulation model according to the fault set. After all the faults in the fault set are completed with fault simulation, adjust the current operation mode of the power grid real-time simulation model, and return to execute the step of running the power grid real-time simulation model through the simulator and its subsequent steps until all the operation modes are scanned. After that, use the python tool to automatically generate a simulation report.
[0102] In the above embodiments, after obtaining the typical operation mode data of the power system, a real-time power grid simulation model coupled with the simulator can be generated according to the power grid topology provided by the typical operation mode data and the simulation nodes and control components allocated by the preset simulator. In this way, the real-time power grid simulation model can be run through the simulator. During this process, the present application can determine whether the real-time power grid simulation model is running stably. If it is not running stably, the real-time power grid simulation model can be corrected according to the error information output by the simulator until the real-time power grid simulation model runs stably; when it is determined that the real-time power grid simulation model is running stably, the present application can generate a fault set corresponding to the typical operation mode data, and then perform fault simulation on the real-time power grid simulation model according to the fault set. After all the faults in the fault set have completed the fault simulation, the current operation mode of the real-time power grid simulation model is adjusted, and the process returns to execute running the real-time power grid simulation model through the simulator and its subsequent steps until all the operation modes have been scanned. Then, a simulation report is automatically generated using the python tool. The present application combines the python tool with the simulator, realizing the automatic generation of a large number of operation modes and simulation examples for the real-time simulation of the new power system, and thus can meet the requirements of automatic real-time simulation and automatic stability checking of the power system model, greatly improving the problems of low efficiency and cumbersome simulation process in the traditional real-time power grid simulation.
[0103] In one embodiment, the present application further provides a computer-readable storage medium, in which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the one or more processors are caused to execute the steps of the power grid automatic real-time simulation method based on the python interface as described in any one of the above embodiments.
[0104] In one embodiment, the present application further provides a computer device, including: one or more processors, and a memory.
[0105] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the power grid automatic real-time simulation method based on the python interface as described in any one of the above embodiments are executed.
[0106] Schematically, as Figure 4 shown, Figure 4 is an internal structure schematic diagram of a computer device provided by an embodiment of the present application. The computer device 300 can be provided as a server. Referring to Figure 4, the computer device 300 includes a processing component 302, which further includes one or more processors, and memory resources represented by a memory 301 for storing instructions executable by the processing component 302, such as application programs. The application programs stored in the memory 301 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 302 is configured to execute instructions to perform the power grid automatic real-time simulation method based on the python interface in any of the above embodiments.
[0107] The computer device 300 may further include a power component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate based on an operating system stored in the memory 301, such as Windows Server TM, Mac OS XTM, Unix TM, Linux TM, Free BSDTM or the like.
[0108] Those skilled in the art can understand that Figure 4 the structure shown in
[0109] is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different component layout.
[0110] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0111] The foregoing description of the disclosed embodiments enables those skilled in the art to practice or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A power grid automatic real-time simulation method based on a python interface, characterized in that, The method includes: Obtaining the typical operation mode data of the power system, and generating a real-time power grid simulation model coupled with the simulator according to the power grid topology provided by the typical operation mode data, the simulation nodes and control elements allocated by the preset simulator; Running the real-time power grid simulation model through the simulator, and when it is determined that the real-time power grid simulation model is operating unstably, correcting the real-time power grid simulation model according to the error information output by the simulator until the real-time power grid simulation model operates stably; When it is determined that the real-time power grid simulation model is operating stably, after generating a fault set corresponding to the typical operation mode data, performing fault simulation on the real-time power grid simulation model according to the fault set, until all faults in the fault set are completed with fault simulation, adjusting the current operation mode of the real-time power grid simulation model, and returning to execute running the real-time power grid simulation model through the simulator and its subsequent steps, until all operation modes are scanned, and then automatically generating a simulation report using the python tool.
2. The power grid automatic real-time simulation method based on a python interface according to claim 1, wherein The generating a fault set corresponding to the typical operation mode data includes: According to the principle of power system stability analysis and calculation, simulating the N-1 tripping faults of each power grid element in the typical operation mode data, and generating an N-1 fault set of the power grid elements; Generating an N-2 fault set of the power grid elements according to the simultaneous or successive faults of double-circuit or multi-circuit lines in the same power transmission direction; Simulating the faults of other key elements in the typical operation mode data, and generating a fault set of the other key elements.
3. The power grid automatic real-time simulation method based on a python interface according to claim 1, wherein The performing fault simulation on the real-time power grid simulation model according to the fault set until all faults in the fault set are completed with fault simulation includes: Generating a fault control interface of the simulator through python, and performing waveform recording on the voltage, current and power of relevant elements to generate a simulation interface; Triggering the real-time power grid simulation model to perform fault simulation according to the order of each fault in the fault set, and during each fault simulation, performing waveform recording on the voltage, current and power of relevant elements in the real-time power grid simulation model, forming waveform recording data corresponding to each fault and storing it; Restoring the tripped elements in the real-time power grid simulation model to the normal state, and when it is judged that the system is operating stably, traversing and triggering the next fault until all faults in the fault set are completed with fault simulation.
4. The method for automatic real-time simulation of power grid based on python interface according to claim 3, characterized in that, The judging the system to be operating stably includes: Automatically analyzing the stability characteristics of the waveform recording data by software, and when it is determined that the voltage deviation in the waveform recording data does not exceed the first preset deviation threshold and the frequency deviation is less than the second preset deviation threshold, judging that the system is operating stably.
5. The method for automatic real-time simulation of power grid based on python interface according to claim 3, characterized in that, The method further includes: When it is judged that the system is operating unstably, identifying and recording the mode information corresponding to the instability case, and after correcting the real-time power grid simulation model according to the preset stability control plan or stability control measures, re-performing fault simulation on the instability case until the system operates stably.
6. The power grid automatic real-time simulation method based on a python interface according to claim 1, characterized in that The adjusting the current operation mode of the real-time power grid simulation model includes: Adjust the principle according to the set method, modify the primary and secondary control parameters in the power grid real-time simulation model based on the typical operation mode data, and adjust the unit output and load to adjust the power grid real-time simulation model from the current operation mode to the next operation mode.
7. The method for automatic real-time simulation of power grid based on python interface according to claim 6, characterized in that, The adjustment of the principle according to the set method, modification of the primary and secondary control parameters in the power grid real-time simulation model based on the typical operation mode data, and adjustment of the unit output and load to adjust the power grid real-time simulation model from the current operation mode to the next operation mode includes: According to the set method adjustment principle, use Python code and the typical operation mode data to automatically generate power grid mode data, and adjust the primary and secondary control parameters in the power grid real-time simulation model according to the power grid operation mode data, and adjust the unit output and load until the power flow of the typical operation mode data corresponding to the adjusted power grid real-time simulation model converges and the system is balanced.
8. An automatic real-time power grid simulation device based on a python interface, characterized in that, Includes: A simulation model generation module for obtaining the typical operation mode data of the power system and generating a power grid real-time simulation model coupled with the simulator according to the power grid topology provided by the typical operation mode data and the simulation nodes and control components allocated by the preset simulator. A simulation model correction module for running the power grid real-time simulation model through the simulator, and when it is determined that the power grid real-time simulation model is operating unstably, correcting the power grid real-time simulation model according to the error information output by the simulator until the power grid real-time simulation model operates stably. An automatic simulation module for, when it is determined that the power grid real-time simulation model is operating stably, generating a fault set corresponding to the typical operation mode data, performing fault simulation on the power grid real-time simulation model according to the fault set, until all the faults in the fault set are completed with fault simulation, adjusting the current operation mode of the power grid real-time simulation model, and returning to execute the step of running the power grid real-time simulation model through the simulator and its subsequent steps, until all the operation modes are scanned, and automatically generating a simulation report using a Python tool.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, which when executed by one or more processors, cause the one or more processors to execute the steps of the power grid automatic real-time simulation method based on the Python interface as described in any one of claims 1 to 7.
10. A computer device, characterized in that, Includes: One or more processors, and a memory; The memory stores computer-readable instructions, which when executed by the one or more processors, execute the steps of the power grid automatic real-time simulation method based on the Python interface as described in any one of claims 1 to 7.