Data interface control method adaptive to multiple simulation tools and data interface
By adapting the data interface control method of multi -simulation tools, analyzing and transforming the power system data, the data transmission of data transmission between different physical fields and simulation software has been solved, and efficient and accurate data integration and simulation analysis have been achieved.
Patent Information
- Application Number
- CN202411481123.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-01-28
AI Technical Summary
During the simulation and analysis of power equipment, the data transmission and conversion between different physics and simulation software are complex, inefficient and error-prone, resulting in repeated and complex data exchange.
Provide a data interface control method that adapts to the multi -simulation tool. By analyzing the data file of the power system, the power equipment model variables and parameter variables converted into a unified format, and transformed it into the data format corresponding to each simulation software to perform simulation calculations , Eventually converted the results of the target result file in a unified format.
It reduces the complexity of data integration and processing, improves the efficiency of the simulation analysis of power equipment, and ensures the accuracy and consistency of data transmission.
Smart Images

Figure CN119376979A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of power equipment simulation, and in particular to a data interface control method and a data interface adapted to multiple simulation tools. Background Art
[0002] Before the power system is built and put into use, it is necessary to simulate and analyze the power equipment model. The simulation and analysis of the power equipment model plays an indispensable role in accident prevention and response analysis, economic efficiency evaluation and resource optimization, as well as optimization of system regulation strategies and stability improvement. In the field of power equipment simulation and analysis technology, a frequently encountered challenge is how to efficiently transfer and convert data between diverse physical fields and between various simulation software that these physical places rely on.
[0003] During the simulation and analysis process of power equipment, the simulation software will obtain a large number of data sets. Only when the data sets meet the data format requirements of the corresponding simulation software interface can data be transmitted and converted between the simulation software. However, the simulation software used in different physical fields in the prior art is different, and even the simulation software used in the same physical field may be different. This will lead to problems such as repeated and complex exchange of different file data, low efficiency, and large errors during the simulation and analysis calculation process of power equipment.
[0004] Application Contents
[0005] The present application provides a data interface control method and a data interface that are compatible with multiple simulation tools, which can convert data generated by multiple simulation tools into a unified format to reduce the complexity of data integration and processing, thereby improving the efficiency of simulation analysis of power equipment.
[0006] In a first aspect, the present application provides a data interface control method adapted to multiple simulation tools, which is applicable to simulation analysis of power equipment models, including:
[0007] Acquire a data file generated by the power system, and parse the data file into corresponding power equipment model variables and parameter variables;
[0008] Respectively converting the power equipment model variables and the parameter variables into a power equipment model file and a parameter file in corresponding data formats;
[0009] Calculate the power equipment model file and the parameter file through simulation software to obtain a simulation calculation result file;
[0010] The simulation calculation result file is parsed to obtain a target result file in a unified format.
[0011] The embodiment of the present application can convert different data files into power equipment model variables and parameter variables in a same format by parsing the acquired data files into corresponding power equipment model variables and parameter variables, thereby facilitating the subsequent simulation calculations of the simulation software; by respectively converting the power equipment model variables and parameter variables into power equipment model files and parameter files corresponding to the simulation software format, it is convenient to perform simulation calculations on the converted power equipment model files and parameter files, and obtain simulation calculation result files; by parsing the simulation calculation result files, the simulation calculation result files with the corresponding data format of the simulation software can be converted into target result files in a unified format according to the required format, and the data generated by multiple simulation tools can be converted into a unified format to reduce the complexity of data integration and processing, thereby improving the efficiency of power equipment simulation analysis.
[0012] Furthermore, the data file generated by the power system is obtained, and the data file is parsed into corresponding power equipment model variables and parameter variables, specifically:
[0013] Identify the file type corresponding to the data file;
[0014] Based on the parsing method corresponding to the file type, the data file is parsed and read to obtain the power equipment model variables and the parameter variables; wherein the power equipment model variables and the parameter variables are both key-value pairs containing parameter types and corresponding numerical values.
[0015] In this way, by parsing data files of different data types into corresponding types of power equipment model variables and parameter variables, different data files can be converted into power equipment model variables and parameter variables in a format of one type, which is convenient for subsequent simulation calculations of simulation software.
[0016] Furthermore, the power equipment model variables and the parameter variables are converted into power equipment model files and parameter files in corresponding data formats, respectively, as follows:
[0017] Obtaining a data format corresponding to the simulation software;
[0018] Establishing a first mapping relationship between the power equipment model variable, the parameter variable and a data format corresponding to the simulation software, and encapsulating the first mapping relationship into a first program module;
[0019] Based on the first program module, an electric power equipment model file and a parameter file in a data format corresponding to the simulation software are generated.
[0020] In this way, by converting the power equipment model variables and parameter variables into power equipment model files and parameter files corresponding to the simulation software format, it is convenient to perform simulation calculations on the converted power equipment model files and parameter files.
[0021] Furthermore, the power equipment model file and the parameter file are calculated by simulation software to obtain a simulation calculation result file, specifically:
[0022] Calling the power flow calculation program in the simulation software through control instructions, performing power flow calculation on the power equipment model file and the parameter file, and obtaining a power flow result output file;
[0023] The transient calculation program or the short-circuit calculation program in the simulation software is called by a control instruction, and the power flow result output file is simulated to obtain the simulation calculation result file.
[0024] In this way, by calling the power flow calculation program, transient calculation program or short circuit calculation program in the simulation software, the power equipment model file and the parameter file can be quickly simulated and calculated, thereby improving the calculation efficiency.
[0025] Furthermore, the simulation calculation result file is parsed to obtain a target result file in a unified format, specifically:
[0026] Obtaining a target output file format corresponding to the data file;
[0027] Extracting the simulation calculation result file based on the target output file format to obtain output variables;
[0028] Establishing a second mapping relationship between the simulation calculation result file, the target output file format and the output variable, and encapsulating the second mapping relationship into a second program module;
[0029] Based on the second program module, a target result file in a unified format is obtained.
[0030] In this way, by parsing the simulation calculation result files, the simulation calculation result files with the corresponding data format of the simulation software can be converted into target result files in a unified format according to the required format. The data generated by various simulation tools can be converted into a unified format to reduce the complexity of data integration and processing, thereby improving the efficiency of simulation analysis of power equipment.
[0031] In a second aspect, the present application provides a data interface, including: a parsing module, a conversion module, a calculation module and an output module;
[0032] The parsing module is used to obtain the data file generated by the power system and parse the data file into corresponding power equipment model variables and parameter variables;
[0033] The conversion module is used to convert the power equipment model variables and the parameter variables into a power equipment model file and a parameter file in corresponding data formats respectively;
[0034] The calculation module is used to calculate the power equipment model file and the parameter file through simulation software to obtain a simulation calculation result file;
[0035] The output module is used to parse the simulation calculation result file to obtain a target result file in a unified format.
[0036] The embodiment of the present application can convert different data files into power equipment model variables and parameter variables in a same format by parsing the acquired data files into corresponding power equipment model variables and parameter variables, thereby facilitating the subsequent simulation calculations of the simulation software; by respectively converting the power equipment model variables and parameter variables into power equipment model files and parameter files corresponding to the simulation software format, it is convenient to perform simulation calculations on the converted power equipment model files and parameter files, and obtain simulation calculation result files; by parsing the simulation calculation result files, the simulation calculation result files with the corresponding data format of the simulation software can be converted into target result files in a unified format according to the required format, and the data generated by multiple simulation tools can be converted into a unified format to reduce the complexity of data integration and processing, thereby improving the efficiency of power equipment simulation analysis.
[0037] Further, the analysis module includes: an identification unit and a analysis unit;
[0038] The identification unit is used to identify the file type corresponding to the data file;
[0039] The parsing unit is used to parse and read the data file based on the parsing method corresponding to the file type to obtain the power equipment model variables and the parameter variables; wherein the power equipment model variables and the parameter variables are both key-value pairs containing parameter types and corresponding numerical values.
[0040] Further, the conversion module includes: a first acquisition unit, a first mapping unit and a first obtaining unit;
[0041] The first acquisition unit is used to acquire the data format corresponding to the simulation software;
[0042] The first mapping unit is used to establish a first mapping relationship between the power equipment model variable, the parameter variable and the data format corresponding to the simulation software, and encapsulate the first mapping relationship into a first program module;
[0043] The first obtaining unit is used to obtain the power equipment model file and parameter file in the data format corresponding to the simulation software based on the first program module.
[0044] Further, the calculation module includes: a first calculation unit and a second calculation unit;
[0045] The first calculation unit is used to call the power flow calculation program in the simulation software through a control instruction, perform power flow calculation on the power equipment model file and the parameter file, and obtain a power flow result output file;
[0046] The second calculation unit is used to call the transient calculation program or the short-circuit calculation program in the simulation software through a control instruction, simulate the power flow result output file, and obtain the simulation calculation result file.
[0047] Further, the output module includes: a second acquisition unit, an extraction unit, a second mapping unit and a second obtaining unit;
[0048] The second acquisition unit is used to acquire the target output file format corresponding to the data file;
[0049] The extraction unit is used to extract the simulation calculation result file based on the target output file format to obtain output variables;
[0050] The second mapping unit is used to establish a second mapping relationship between the simulation calculation result file, the target output file format and the output variable, and encapsulate the second mapping relationship into a second program module;
[0051] The second obtaining unit is used to obtain a target result file in a unified format based on the second program module. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 It is a flowchart of an embodiment of a data interface control method adapted to multiple simulation tools provided by the present application;
[0053] Figure 2 It is a structural diagram of an embodiment of a data interface provided by the present application. DETAILED DESCRIPTION
[0054] 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.
[0055] It should be understood that the step numbers used in this article are only for the convenience of description and are not intended to limit the order in which the steps are executed.
[0056] It should be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, the singular forms "a", "an" and "the" are intended to include plural forms unless the context clearly indicates otherwise.
[0057] The terms “include” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0058] The term "and / or" means and includes any and all possible combinations of one or more of the associated listed items.
[0059] Before the power system is put into operation, it is necessary to conduct simulation analysis on the power equipment model. This simulation analysis is crucial in preventing accidents, evaluating economic efficiency, optimizing resource allocation and system adjustment strategies. However, a major challenge facing simulation analysis is how to efficiently transfer and convert data between different physical fields and their simulation software. Due to the different simulation software used in different physical fields or in the same physical field, the data format is incompatible, resulting in complex data transmission, low efficiency and prone to errors.
[0060] Embodiment 1
[0061] Please refer to Figure 1 , a flow chart of an embodiment of a data interface control method adapted to multiple simulation tools provided by the present application, comprising steps S1 to S4;
[0062] Step S1, obtaining a data file generated by the power system, and parsing the data file into corresponding power equipment model variables and parameter variables;
[0063] It is understandable that when performing simulation analysis of power equipment, it is necessary to first obtain the data file generated by the power system, and identify the file type corresponding to the data file through control instructions, and save the file type. After confirming the file type corresponding to the data file, the data file can be parsed and read by calling the corresponding parsing program pre-set by the computer program to obtain the power equipment model variables and the parameter variables, and save them; wherein, the power equipment model variables and the parameter variables are in a unified format, and can be key-value pairs containing parameter types and corresponding values. In this step, the required target output file format, result report format, etc. can be determined. Exemplary but not limiting, step S1 can be implemented by Python programming language, by calling the mime library to identify the file type corresponding to the data file, when the identified file type is a .DAT file type, the .DAT file type will be saved, and jump to the corresponding .DAT parsing program compiled based on the pandas library to parse and read the data file corresponding to the .DAT file type, so as to obtain the power equipment model variables and the parameter variable key-value pair dictionary in a unified format.
[0064] It should be noted that the data file can be directly collected through existing technologies or directly input, and this application does not impose any restrictions.
[0065] It should be noted that file types include but are not limited to .DAT files, .SWI files, .RAW files, .DYR files, .CSV files, .XLS files, .XLSX files, and .XML and .E files of CIM models, etc. This application does not limit the specific file types.
[0066] It should be noted that the parsing methods include but are not limited to libraries or modules such as pandas, numpy, pypsse, PYCIM, and xml.erree.ElementTree.
[0067] It should be noted that the power equipment model variables and the parameter variables are all key-value pair dictionaries, where the parameter type is the key and the specific data of the parameter is the value. The power equipment model variables include but are not limited to generator dictionaries, load dictionaries, transformer dictionaries, line dictionaries, etc.; wherein the generator dictionary includes but is not limited to generator model, node type, connection object, rated power, reference voltage, active power, reactive power, internal reactance, stator resistance, excitation system parameters, speed regulator parameters and other key values; the load dictionary includes but is not limited to load type, connection object, active power demand, reactive power demand, power factor, load model, response speed and other key values; the transformer dictionary is shown in Table 1, including but not limited to connection object, transformation ratio, connection group, core loss per unit value, no-load current per unit value and other key values; the line dictionary includes but is not limited to connection object, length, unit impedance, unit reactance, rated power, rated voltage, shunt reactor and other key values. The parameter variables include but are not limited to program control parameters, fault setting parameters, output setting parameters and specific paths of simulation tool programs, wherein the program control parameters include but are not limited to key values such as algorithm type, calculation step size, convergence rule, error tolerance, maximum number of iterations, etc.; the fault setting parameters include but are not limited to key values such as fault location, type, occurrence time, recovery time, clearing method, etc.; the output setting parameters include but are not limited to key values such as result report, node selection of simulation results, target output file format, etc.
[0068] Table 1 Transformer dictionary format
[0069]
[0070] In this way, by parsing data files of different data types into corresponding types of power equipment model variables and parameter variables, different data files can be converted into power equipment model variables and parameter variables in a format of one type, which is convenient for subsequent simulation calculations of simulation software.
[0071] Step S2, converting the power equipment model variables and the parameter variables into power equipment model files and parameter files in corresponding data formats respectively;
[0072] It can be understood that after the acquired data file is converted into the power equipment model variables and the parameter variables in a unified format, the data format corresponding to the simulation software can be obtained through the instructions of the corresponding simulation software; and at the same time, a first mapping relationship is established between the power equipment model variables, the parameter variables and the data format corresponding to the simulation software, and the first mapping relationship is encapsulated into a first program module; and based on the first program module, the power equipment model file and parameter file corresponding to the data format of the simulation software are generated. Of course, since the data formats corresponding to each simulation software are inconsistent, a mapping relationship can be established between the power equipment model variables, the parameter variables and the data formats corresponding to several simulation software, and encapsulated into several program modules. After the simulation software is determined, the program module corresponding to the simulation software is directly called, and the input power equipment model variables and the parameter variables can be directly converted into power equipment model files and parameter files corresponding to the data format corresponding to the simulation software, without calling the program module corresponding to the non-corresponding simulation software. By way of example and not limitation, when the simulation software to be determined is BPA, the specific content of the input file and the data format of the parameters can be obtained through the BPA flow and stability manual (e.g., if the data format is F4.3, then
[12] in the input file means [0.012]). By analyzing the spaces, carriage returns and other characters between the parameters in the input power equipment model variables and parameter variables, it can be ensured that the power equipment model variables and parameter variables can be read, and data cards (one line of the .DAT file is one data card) can be added and modified in the power equipment model variables and parameter variables to generate power equipment model files and parameter files in the corresponding data format of BPA. Of course, the power equipment files and parameter files can also be integrated into one file to facilitate subsequent input into the simulation software.
[0073] It should be noted that the simulation software includes but is not limited to PSD-BPA, PSS / E, PSASP, DSP, etc., and this application does not impose any restrictions.
[0074] It should be noted that the data formats corresponding to various simulation software are different. For example, the calculation model of PSD-BPA only defines two-winding transformers. For three-winding transformers, they need to be converted into three two-winding transformers. The generator models only include classic models, dual-axis models with / without considering damping windings, and equivalent load models. The excitation system models are relatively rich. PSS / E defines two-winding and three-winding transformers, and the generator models are relatively rich. In addition to the above models, it also provides salient-pole machine / hidden-pole machine sub-transient models with exponential saturation curves, and hidden-pole machine sub-transient models considering stator transients. There are fewer types of excitation systems, but custom model functions are provided.
[0075] It should be noted that after the power equipment model file and the parameter file are generated, they can be imported into a simulation data folder under a specific path, wherein the specific path is the storage path in the parameter variable in step S1.
[0076] In this way, by converting the power equipment model variables and parameter variables into power equipment model files and parameter files corresponding to the simulation software format, it is convenient to perform simulation calculations on the converted power equipment model files and parameter files.
[0077] Step S3, calculating the power equipment model file and the parameter file through simulation software to obtain a simulation calculation result file;
[0078] It can be understood that after the power equipment model variables and the parameter variables are converted into power equipment model files and parameter files in corresponding data formats respectively, the power flow calculation program in the simulation software can be called through control instructions to perform power flow calculation on the power equipment model file and the parameter file to obtain a power flow result output file; then, the transient calculation program or short-circuit calculation program in the simulation software can be called through control instructions to simulate the power flow result output file to obtain the simulation calculation result file.
[0079] It should be noted that the flow calculation program will construct corresponding control instructions based on the simulation program, simulation data files and the storage path of the flow result output file. Generally speaking, a new process can be started in the python script, and the simulation program can be executed by calling the command line based on the subprocess module to control program operation, input, etc., and obtain output results. This application does not limit the calling module.
[0080] It should be noted that the control instructions mainly include but are not limited to initialization, reading files, running programs, saving calculation results, etc.; after initialization, the power equipment model file and the parameter file are read through a specific storage path, and the power equipment model file and the parameter file are written into the calculation library of the simulation software, and then the calculation program of the simulation software is called, and after the simulation calculation is completed, the simulation calculation result file is saved to the specific path, wherein the specific path is also the storage path in the parameter variable in step S1.
[0081] In this way, by calling the power flow calculation program, transient calculation program or short circuit calculation program in the simulation software, the power equipment model file and the parameter file can be quickly simulated and calculated, thereby improving the calculation efficiency.
[0082] Step S4: parsing the simulation calculation result file to obtain a target result file in a unified format.
[0083] It can be understood that after completing the simulation calculation through the simulation software, the simulation calculation result file can be parsed. Specifically, first, the target output file format corresponding to the data file is obtained; secondly, the simulation calculation result file is extracted based on the target output file format to obtain the output variable; thirdly, a second mapping relationship is established between the simulation calculation result file, the target output file format and the output variable, and the second mapping relationship is encapsulated into a second program module; finally, based on the second program module, a target result file in a unified format is obtained. Of course, a mapping relationship can also be established in advance between the simulation calculation result file, the target output file format and the output variable, and encapsulated into several program modules. When the simulation calculation result file is confirmed, the corresponding program module can be directly called to generate a target result file in a unified format.
[0084] It should be noted that when the data file is converted into the power equipment model variables and the parameter variables, the target output file format is clarified, so the target output file format can be directly obtained through the control instruction.
[0085] It should be noted that the simulation calculation result file can be analyzed through, but not limited to, libraries such as pandas and numpy to analyze the simulation output format of the simulation calculation result file, including the sorting of simulation data of each node, data format and result report, etc., which is conducive to the subsequent establishment of a mapping relationship between the target output format and the simulation output format and output variables.
[0086] It should be noted that the target result file in a unified format may be, but is not limited to, an EXCEL table, document, etc., and this application does not impose any restrictions.
[0087] In this way, by parsing the simulation calculation result files, the simulation calculation result files with the corresponding data format of the simulation software can be converted into target result files in a unified format according to the required format. The data generated by various simulation tools can be converted into a unified format to reduce the complexity of data integration and processing, thereby improving the efficiency of simulation analysis of power equipment.
[0088] The embodiment of the present application can convert different data files into power equipment model variables and parameter variables in a same format by parsing the acquired data files into corresponding power equipment model variables and parameter variables, thereby facilitating the subsequent simulation calculations of the simulation software; by respectively converting the power equipment model variables and parameter variables into power equipment model files and parameter files corresponding to the simulation software format, it is convenient to perform simulation calculations on the converted power equipment model files and parameter files, and obtain simulation calculation result files; by parsing the simulation calculation result files, the simulation calculation result files with the corresponding data format of the simulation software can be converted into target result files in a unified format according to the required format, and the data generated by multiple simulation tools can be converted into a unified format to reduce the complexity of data integration and processing, thereby improving the efficiency of power equipment simulation analysis.
[0089] Embodiment 2
[0090] Please refer to Figure 2 , a structural diagram of an embodiment of a data interface adapted to multiple simulation tools provided by the present application, comprising an analysis module 01, a conversion module 02, a calculation module 03 and an output module 04;
[0091] The analysis module 01 is used to obtain the data file generated by the power system and analyze the data file into corresponding power equipment model variables and parameter variables;
[0092] Specifically, the parsing module 01 includes: an identification unit and a parsing unit; the identification unit is used to identify the file type corresponding to the data file; the parsing unit is used to parse and read the data file based on the parsing method corresponding to the file type to obtain the power equipment model variables and the parameter variables; wherein the power equipment model variables and the parameter variables are both key-value pairs containing parameter types and corresponding numerical values.
[0093] It is understandable that when performing simulation analysis of power equipment, it is necessary to first obtain the data file generated by the power system, and identify the file type corresponding to the data file through control instructions, and save the file type. After confirming the file type corresponding to the data file, the data file can be parsed and read by calling the corresponding parsing program pre-set by the computer program to obtain the power equipment model variables and the parameter variables, and save them; wherein, the power equipment model variables and the parameter variables are in a unified format, and can be key-value pairs containing parameter types and corresponding values. In this step, the required target output file format, result report format, etc. can be determined. Exemplary but not limiting, step S1 can be implemented by Python programming language, by calling the mime library to identify the file type corresponding to the data file, when the identified file type is a .DAT file type, the .DAT file type will be saved, and jump to the corresponding .DAT parsing program compiled based on the pandas library to parse and read the data file corresponding to the .DAT file type, so as to obtain the power equipment model variables and the parameter variable key-value pair dictionary in a unified format.
[0094] It should be noted that the data file can be directly collected through existing technologies or directly input, and this application does not impose any restrictions.
[0095] It should be noted that file types include but are not limited to .DAT files, .SWI files, .RAW files, .DYR files, .CSV files, .XLS files, .XLSX files, and .XML and .E files of CIM models, etc. This application does not limit the specific file types.
[0096] It should be noted that the parsing methods include but are not limited to libraries or modules such as pandas, numpy, pypsse, PYCIM, and xml.erree.ElementTree.
[0097] It should be noted that the power equipment model variables and the parameter variables are all key-value pair dictionaries, where the parameter type is the key and the specific data of the parameter is the value. The power equipment model variables include but are not limited to generator dictionaries, load dictionaries, transformer dictionaries, line dictionaries, etc.; wherein the generator dictionary includes but is not limited to generator model, node type, connection object, rated power, reference voltage, active power, reactive power, internal reactance, stator resistance, excitation system parameters, speed regulator parameters and other key values; the load dictionary includes but is not limited to load type, connection object, active power demand, reactive power demand, power factor, load model, response speed and other key values; the transformer dictionary is shown in Table 1, including but not limited to connection object, transformation ratio, connection group, core loss per unit value, no-load current per unit value and other key values; the line dictionary includes but is not limited to connection object, length, unit impedance, unit reactance, rated power, rated voltage, shunt reactor and other key values. The parameter variables include but are not limited to program control parameters, fault setting parameters, output setting parameters and specific paths of simulation tool programs, wherein the program control parameters include but are not limited to key values such as algorithm type, calculation step size, convergence rule, error tolerance, maximum number of iterations, etc.; the fault setting parameters include but are not limited to key values such as fault location, type, occurrence time, recovery time, clearing method, etc.; the output setting parameters include but are not limited to key values such as result report, node selection of simulation results, target output file format, etc.
[0098] Table 1 Transformer dictionary format
[0099]
[0100]
[0101] In this way, by parsing data files of different data types into corresponding types of power equipment model variables and parameter variables, different data files can be converted into power equipment model variables and parameter variables in a format of one type, which is convenient for subsequent simulation calculations of simulation software.
[0102] The conversion module 02 is used to convert the power equipment model variables and the parameter variables into power equipment model files and parameter files in corresponding data formats respectively;
[0103] Specifically, the conversion module 02 includes: a first acquisition unit, a first mapping unit and a first obtaining unit; the first acquisition unit is used to obtain the data format corresponding to the simulation software; the first mapping unit is used to establish a first mapping relationship between the power equipment model variables, the parameter variables and the data format corresponding to the simulation software, and encapsulate the first mapping relationship into a first program module; the first obtaining unit is used to obtain the power equipment model file and parameter file in the data format corresponding to the simulation software based on the first program module.
[0104] It can be understood that after the acquired data file is converted into the power equipment model variables and the parameter variables in a unified format, the data format corresponding to the simulation software can be obtained through the instructions of the corresponding simulation software; and at the same time, a first mapping relationship is established between the power equipment model variables, the parameter variables and the data format corresponding to the simulation software, and the first mapping relationship is encapsulated into a first program module; and based on the first program module, the power equipment model file and parameter file corresponding to the data format of the simulation software are generated. Of course, since the data formats corresponding to each simulation software are inconsistent, a mapping relationship can be established between the power equipment model variables, the parameter variables and the data formats corresponding to several simulation software, and encapsulated into several program modules. After the simulation software is determined, the program module corresponding to the simulation software is directly called, and the input power equipment model variables and the parameter variables can be directly converted into power equipment model files and parameter files corresponding to the data format corresponding to the simulation software, without calling the program module corresponding to the non-corresponding simulation software. By way of example and not limitation, when the simulation software to be determined is BPA, the specific content of the input file and the data format of the parameters can be obtained through the BPA flow and stability manual (e.g., if the data format is F4.3, then
[12] in the input file means [0.012]). By analyzing the spaces, carriage returns and other characters between the parameters in the input power equipment model variables and parameter variables, it can be ensured that the power equipment model variables and parameter variables can be read, and data cards (one line of the .DAT file is one data card) can be added and modified in the power equipment model variables and parameter variables to generate power equipment model files and parameter files in the corresponding data format of BPA. Of course, the power equipment files and parameter files can also be integrated into one file to facilitate subsequent input into the simulation software.
[0105] It should be noted that the simulation software includes but is not limited to PSD-BPA, PSS / E, PSASP, DSP, etc., and this application does not impose any restrictions.
[0106] It should be noted that the data formats corresponding to various simulation software are different. For example, the calculation model of PSD-BPA only defines two-winding transformers. For three-winding transformers, they need to be converted into three two-winding transformers. The generator models only include classic models, dual-axis models with / without considering damping windings, and equivalent load models. The excitation system models are relatively rich. PSS / E defines two-winding and three-winding transformers, and the generator models are relatively rich. In addition to the above models, it also provides salient-pole machine / hidden-pole machine sub-transient models with exponential saturation curves, and hidden-pole machine sub-transient models considering stator transients. There are fewer types of excitation systems, but custom model functions are provided.
[0107] It should be noted that after the power equipment model file and the parameter file are generated, they can be imported into a simulation data folder under a specific path, wherein the specific path is the storage path of the parameter variables in step S1.
[0108] In this way, by converting the power equipment model variables and parameter variables into power equipment model files and parameter files corresponding to the simulation software format, it is convenient to perform simulation calculations on the converted power equipment model files and parameter files.
[0109] The calculation module 03 is used to calculate the power equipment model file and the parameter file through simulation software to obtain a simulation calculation result file;
[0110] Specifically, the calculation module includes: a first calculation unit and a second calculation unit; the first calculation unit is used to call the power flow calculation program in the simulation software through control instructions, perform power flow calculation on the power equipment model file and the parameter file, and obtain a power flow result output file; the second calculation unit is used to call the transient calculation program or short-circuit calculation program in the simulation software through control instructions, simulate the power flow result output file, and obtain the simulation calculation result file.
[0111] It can be understood that after the power equipment model variables and the parameter variables are converted into power equipment model files and parameter files in corresponding data formats respectively, the power flow calculation program in the simulation software can be called through control instructions to perform power flow calculation on the power equipment model file and the parameter file to obtain a power flow result output file; then, the transient calculation program or short-circuit calculation program in the simulation software can be called through control instructions to simulate the power flow result output file to obtain the simulation calculation result file.
[0112] It should be noted that the flow calculation program will construct corresponding control instructions based on the simulation program, simulation data files and the storage path of the flow result output file. Generally speaking, a new process can be started in the python script, and the simulation program can be executed by calling the command line based on the subprocess module to control program operation, input, etc., and obtain output results. This application does not limit the calling module.
[0113] It should be noted that the control instructions mainly include but are not limited to initialization, reading files, running programs, saving calculation results, etc.; after initialization, the power equipment model file and the parameter file are read through a specific storage path, and the power equipment model file and the parameter file are written into the calculation library of the simulation software, and then the calculation program of the simulation software is called, and after the simulation calculation is completed, the simulation calculation result file is saved to the specific path, wherein the specific path is also the storage path of the parameter variable in step S1.
[0114] In this way, by calling the power flow calculation program, transient calculation program or short circuit calculation program in the simulation software, the power equipment model file and the parameter file can be quickly simulated and calculated, thereby improving the calculation efficiency.
[0115] The output module 04 is used to parse the simulation calculation result file to obtain a target result file in a unified format.
[0116] Specifically, the output module 04 includes: a second acquisition unit, an extraction unit, a second mapping unit and a second obtaining unit; the second acquisition unit is used to obtain the target output file format corresponding to the data file; the extraction unit is used to extract the simulation calculation result file based on the target output file format to obtain output variables; the second mapping unit is used to establish a second mapping relationship between the simulation calculation result file, the target output file format and the output variables, and encapsulate the second mapping relationship into a second program module; the second obtaining unit is used to obtain a target result file in a unified format based on the second program module.
[0117] It can be understood that after completing the simulation calculation through the simulation software, the simulation calculation result file can be parsed. Specifically, first, the target output file format corresponding to the data file is obtained; secondly, the simulation calculation result file is extracted based on the target output file format to obtain the output variable; thirdly, a second mapping relationship is established between the simulation calculation result file, the target output file format and the output variable, and the second mapping relationship is encapsulated into a second program module; finally, based on the second program module, a target result file in a unified format is obtained. Of course, a mapping relationship can also be established in advance between the simulation calculation result file, the target output file format and the output variable, and encapsulated into several program modules. When the simulation calculation result file is confirmed, the corresponding program module can be directly called to generate a target result file in a unified format.
[0118] It should be noted that when the data file is converted into the power equipment model variables and the parameter variables, the target output file format is clarified, so the target output file format can be directly obtained through the control instruction.
[0119] It should be noted that the simulation calculation result file can be analyzed through, but not limited to, libraries such as pandas and numpy to analyze the simulation output format of the simulation calculation result file, including the sorting of simulation data of each node, data format and result report, etc., which is conducive to the subsequent establishment of a mapping relationship between the target output format and the simulation output format and output variables.
[0120] It should be noted that the target result file in a unified format may be, but is not limited to, an EXCEL table, document, etc., and this application does not impose any restrictions.
[0121] In this way, by parsing the simulation calculation result files, the simulation calculation result files with the corresponding data format of the simulation software can be converted into target result files in a unified format according to the required format. The data generated by various simulation tools can be converted into a unified format to reduce the complexity of data integration and processing, thereby improving the efficiency of simulation analysis of power equipment.
[0122] The embodiment of the present application can convert different data files into power equipment model variables and parameter variables in a same format by parsing the acquired data files into corresponding power equipment model variables and parameter variables, thereby facilitating the subsequent simulation calculations of the simulation software; by respectively converting the power equipment model variables and parameter variables into power equipment model files and parameter files corresponding to the simulation software format, it is convenient to perform simulation calculations on the converted power equipment model files and parameter files, and obtain simulation calculation result files; by parsing the simulation calculation result files, the simulation calculation result files with the corresponding data format of the simulation software can be converted into target result files in a unified format according to the required format, and the data generated by multiple simulation tools can be converted into a unified format to reduce the complexity of data integration and processing, thereby improving the efficiency of power equipment simulation analysis.
[0123] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the scope of protection of the present application. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of protection of the present application.
Claims
1. A data interface control method adapted to multiple simulation tools, characterized in that: Applicable to simulation analysis of power equipment models, including: Acquire a data file generated by the power system, and parse the data file into corresponding power equipment model variables and parameter variables; Respectively converting the power equipment model variables and the parameter variables into a power equipment model file and a parameter file in corresponding data formats; Calculate the power equipment model file and the parameter file through simulation software to obtain a simulation calculation result file; The simulation calculation result file is parsed to obtain a target result file in a unified format.
2. The data interface control method for adapting multiple simulation tools according to claim 1, characterized in that: The data file generated by the power system is obtained, and the data file is parsed into corresponding power equipment model variables and parameter variables, specifically: Identify the file type corresponding to the data file; Based on the parsing method corresponding to the file type, the data file is parsed and read to obtain the power equipment model variables and the parameter variables; wherein the power equipment model variables and the parameter variables are both key-value pairs containing parameter types and corresponding numerical values.
3. The data interface control method for adapting multiple simulation tools according to claim 1, characterized in that: The power equipment model variables and the parameter variables are converted into power equipment model files and parameter files in corresponding data formats respectively, specifically: Obtaining a data format corresponding to the simulation software; Establishing a first mapping relationship between the power equipment model variable, the parameter variable and a data format corresponding to the simulation software, and encapsulating the first mapping relationship into a first program module; Based on the first program module, an electric power equipment model file and a parameter file in a data format corresponding to the simulation software are generated.
4. The data interface control method for adapting multiple simulation tools according to claim 1, characterized in that: The power equipment model file and the parameter file are calculated by the simulation software to obtain a simulation calculation result file, specifically: Calling the power flow calculation program in the simulation software through control instructions, performing power flow calculation on the power equipment model file and the parameter file, and obtaining a power flow result output file; The transient calculation program or the short-circuit calculation program in the simulation software is called by a control instruction, and the power flow result output file is simulated to obtain the simulation calculation result file.
5. The data interface control method for adapting multiple simulation tools according to claim 1, characterized in that: The simulation calculation result file is parsed to obtain a target result file in a unified format, specifically: Obtaining a target output file format corresponding to the data file; Extracting the simulation calculation result file based on the target output file format to obtain output variables; Establishing a second mapping relationship between the simulation calculation result file, the target output file format and the output variable, and encapsulating the second mapping relationship into a second program module; Based on the second program module, a target result file in a unified format is obtained.
6. A data interface, characterized in that: include: Parsing module, conversion module, calculation module and output module; The parsing module is used to obtain the data file generated by the power system and parse the data file into corresponding power equipment model variables and parameter variables; The conversion module is used to convert the power equipment model variables and the parameter variables into a power equipment model file and a parameter file in corresponding data formats respectively; The calculation module is used to calculate the power equipment model file and the parameter file through simulation software to obtain a simulation calculation result file; The output module is used to parse the simulation calculation result file to obtain a target result file in a unified format.
7. The data interface according to claim 6, characterized in that: The analysis module includes: an identification unit and a analysis unit; The identification unit is used to identify the file type corresponding to the data file; The parsing unit is used to parse and read the data file based on the parsing method corresponding to the file type to obtain the power equipment model variables and the parameter variables; wherein the power equipment model variables and the parameter variables are both key-value pairs containing parameter types and corresponding numerical values.
8. The data interface according to claim 6, characterized in that: The conversion module includes: an acquisition unit, a first mapping unit and a first obtaining unit; The acquisition unit is used to acquire the data format corresponding to the simulation software; The first mapping unit is used to establish a first mapping relationship between the power equipment model variable, the parameter variable and the data format corresponding to the simulation software, and encapsulate the first mapping relationship into a first program module; The first obtaining unit is used to obtain the power equipment model file and parameter file in the data format corresponding to the simulation software based on the first program module.
9. The data interface according to claim 6, characterized in that: The calculation module includes: a first calculation unit and a second calculation unit; The first calculation unit is used to call the power flow calculation program in the simulation software through a control instruction, perform power flow calculation on the power equipment model file and the parameter file, and obtain a power flow result output file; The second calculation unit is used to call the transient calculation program or the short-circuit calculation program in the simulation software through a control instruction, simulate the power flow result output file, and obtain the simulation calculation result file.
10. The data interface according to claim 6, characterized in that: The output module includes: a second acquisition unit, an extraction unit, a second mapping unit, and a second obtaining unit; The second acquisition unit is used to acquire the target output file format corresponding to the data file; The extraction unit is used to extract the simulation calculation result file based on the target output file format to obtain output variables; The second mapping unit is used to establish a second mapping relationship between the simulation calculation result file, the target output file format and the output variable, and encapsulate the second mapping relationship into a second program module; The second obtaining unit is used to obtain a target result file in a unified format based on the second program module.