A method and system for deriving a power grid simulation calculation database
By using Python and spreadsheet software in a collaborative manner, the power grid simulation database is automatically parsed and systematically managed, solving the problems of repetitive work and high error rates in the conversion and management of PSASP and PSD-BPA data, and realizing efficient and accurate power grid simulation database derivation.
Patent Information
- Application Number
- CN202511277619.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-09
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-09-09
AI Technical Summary
Existing power grid simulation software, PSASP and PSD-BPA, suffer from repetitive work, high error rates, complex data structures, and chaotic management during data conversion and management. Existing solutions have failed to effectively address these issues.
Using the Python programming language and spreadsheet software, a high-quality PSD-BPA derivative database is generated through classification and parsing, node optimization and merging, parameter verification and key information statistics, combined with the capacity ratio method or growth allocation method, to achieve automated parsing and systematic management.
It significantly improves the efficiency and accuracy of power grid planning simulation database construction, ensures operational relevance and data quality, and supports the rapid generation of high-quality databases for multiple scenarios.
Smart Images

Figure CN120763120B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power grid simulation technology, and in particular relates to a method and system for deriving a power grid simulation calculation database. Background Technology
[0002] At present, the leading software products for large-scale power grid power system analysis and simulation in my country include PSASP (Power System Analysis Synthesis Program) and PSD-BPA (Power System Design–Bus Protection Analysis). PSD-BPA, with its advantages of ease of learning and use, large-scale calculation, fast calculation speed, high numerical stability and powerful functions, has good adaptability to large-scale power grid data and has gradually gained widespread application in the power planning and design stage.
[0003] 1) The problem of repetitive work in the construction of PSASP and PSD-BPA calculation databases. Given the usage characteristics and actual work requirements of the two software programs, power grid operation and dispatch departments typically use PSASP software to calculate the power grid operation mode for the current or next year; meanwhile, power grid planning departments and design institutions prefer to use PSD-BPA software to predict the planning horizon for the next 2-10 years. Although the mutual conversion function of PSASP and PSD-BPA calculation data packets has been implemented, due to the inability to directly convert the new model and the differences between the two sets of data on the basic network structure of different horizon years, a significant amount of time is still required for adjustment after data packet conversion. Therefore, there is a problem of repetitive work in the construction and maintenance of the two sets of data (PSASP and PSD-BPA).
[0004] 2) The error rate is high and diagnosis is difficult during the construction of the computational data package model. First, existing equipment parameters are usually directly derived from nameplate parameters in the equipment ledger or actual measurement data; however, these parameters may contain errors during system input. Second, although the PSASP software provides a user-friendly interface, manual input through multiple data cards is still required when processing large-scale power grid data models. Furthermore, checking and verifying the data in the established models is cumbersome, which undoubtedly increases the risk of errors.
[0005] 3) The combination of different timeframes and operating modes leads to complex and disorganized data structures for computational data packages. Power system simulation calculations typically require analysis of different grid operating conditions across multiple timeframes. However, both PSASP and PSD-BPA software face challenges in data management. While PSASP allows setting up multiple data groups and managing data by defining the data groups referenced by the calculation scheme, it suffers from several problems. First, the initialization of data groups requires significant human resources. Second, as the number of calculation modes increases, the data volume grows exponentially, leading to data redundancy and impacting computational efficiency. As for PSD-BPA, although it can provide a separate data file for each calculation method, each calculation method's data file requires substantial human intervention during the construction process. Furthermore, fine-tuning the basic network structure in subsequent calculations necessitates adjusting each calculation method's data file individually, making it difficult to improve computational efficiency.
[0006] 4) Regarding the aforementioned issues, existing research has proposed some valuable solutions. However, these solutions still lack specificity and systematicity, failing to effectively address the problems. In managing data models in original database files, researchers have proposed a NoSQL-based PSD-BPA data parsing and management method and system. This method utilizes a NoSQL database to store model data, achieving unified management and updating of power grid data. Although this method leverages professional database management technology to manage computational data packets, it requires a high level of database information management skills from users in practical applications. Furthermore, subsequent database management and database file regeneration require secondary development, posing a high technical barrier. The method's user-friendliness and adaptability largely depend on the level of secondary development. Regarding achieving rapid PSD-BPA modeling based on existing power grid data, some researchers have proposed using spreadsheet software to achieve rapid modeling and generate computational data files. However, they have failed to propose that power grid data can be obtained through parsing existing data packets, and have not explored leveraging the powerful data analysis and processing capabilities of spreadsheet software to derive other operating modes that meet computational needs based on a single operating mode.
[0007] Based on the above problems, this invention proposes a derivative scheme for power grid simulation calculation database. Summary of the Invention
[0008] To address the above technical problems, this invention provides a method and system for deriving a power grid simulation calculation database.
[0009] The technical solution adopted by this invention to solve its technical problem is:
[0010] A method for deriving a power grid simulation calculation database, the method comprising the following steps:
[0011] S100: Obtain the original power grid simulation PSD-BPA calculation database file and identify the location of power grid data and external communication channel data in the target area;
[0012] S200: Based on the Python programming language, it reads the original PSD-BPA calculation database file, classifies and parses the data models in the database, and identifies the device type and parameters according to the PSD-BPA model format specification.
[0013] S300: Use spreadsheet software to classify and organize the analysis results, optimize and merge nodes, verify parameters, and statistically analyze key information to achieve systematic management of the database;
[0014] S400: Based on simulation requirements and future system evolution, adjust the planning year data model using either multi-file or single-file mode; allocate regional loads using the capacity ratio method or the growth allocation method; set zonal load control and power output coefficients, and calculate typical mode values; verify the system's power surplus or deficit, and optimize reactive power equipment switching according to voltage level and region; reconstruct the PSD-BPA database and iteratively calculate and correct it until a valid derived database is generated.
[0015] Preferably, S100 includes:
[0016] S110: If the original data is a PSASP software data package, use the PSASP→PSD-BPA conversion program to convert the PSASP data package into a PSD-BPA data package, which includes the DAT power flow file and the SWI stability file; if the original data is a PSD-BPA software data package, the DAT power flow file and the SWI stability file can be obtained directly.
[0017] S120: Mark the start and end lines of the target area power grid data card in the DAT power flow file and SWI stability file using comment strings, and also mark the location of the target area power grid external communication channel data card.
[0018] Preferably, S200 includes:
[0019] S210: Based on Python language, read the marked regional power grid data cards in the original DAT power flow file and SWI file, with one data card corresponding to one string, and the string elements of multiple data cards are combined into a data frame one by one;
[0020] S220: Based on the configuration format specifications of various models in PSD-BPA, identify the start and end markers of each model configuration and distinguish different model types;
[0021] S230: Combining the corresponding formats of various model data cards of PSD-BPA, specifying the data parameters corresponding to each column, and using the Python programming language to parse the data card string, obtain the parameters and model information of various models.
[0022] Preferably, S300 includes:
[0023] S310: Based on the three major elements of power supply, power grid and load, the parsed model data is classified and stored to construct a standardized electronic data sheet;
[0024] S320: Merge redundant nodes of the same voltage level at the same site, eliminate "small reactor" data cards within the site, unify site name descriptions, and simplify the database structure to optimize the reverse parsing data model;
[0025] S330: Verify and correct model data based on physical information and design parameters of power grid equipment ledger;
[0026] S340: Real-time aggregation of dynamic data on power supply capacity, load level, substation capacity, and reactive power compensation capacity.
[0027] Preferably, S400 includes:
[0028] S410: Adjust the data models of power sources and power grids for the planning year using either a multi-file management mode or a single-file management mode. The multi-file management mode creates an independent, standardized database table file for each planning year, generating the target year's database by adding, deleting, and modifying data models for planned power source projects and power grid engineering projects. The single-file management mode integrates the data models stored in the basic method with newly added data models in the planning into a standardized database table file. Two variable columns, Yst (input year) and Yend (exit year), are added to the unified standardized database table. A valid period is set for each data model. During the generation of the planning year's Yplan data card, a conditional validation mechanism is introduced. If the conditions Yplan ≤ Yend and Yplan ≤ Yst are met, the data card statement is generated normally; otherwise, a null value is assigned.
[0029] S420: The regional load is adjusted using either the capacity ratio method or the growth allocation method. The capacity ratio method allocates the total regional load according to the proportion of the transformer capacity of each substation. The growth allocation method dynamically adjusts the load distribution between existing and new substations based on the load growth rate and the number of new substations.
[0030] S430: Set the load control factor and power output factor of each zone under typical operating mode, and calculate the load value and power output under typical operating mode;
[0031] S440: Performs power balance calculations on power sources, loads, and external power in the regional system, predicts the power surplus and deficit status of the system, optimizes the switching of reactive power equipment according to voltage level and region, and achieves hierarchical and regional reactive power balance.
[0032] S450: Concatenate strings to generate a new data card, reconstruct the database file and perform trial calculations. If the data does not converge or the voltage is not up to standard, return corrected data. If the database calculation converges and the voltage level is up to standard, then effective database derivation is achieved.
[0033] Preferably, in S420, the regional load is adjusted using the capacity ratio method, specifically as follows:
[0034] Set the total load of a certain region in a planned year as follows: The area contains n substations, and the load supplied by each substation is calculated using the following formula:
[0035] ;
[0036] in, This represents the planned load supplied by the f-th substation in the current year. This represents the substation capacity of the f-th substation in the planned horizontal year;
[0037] In S420, the increasing allocation method is used to adjust the regional load, specifically as follows:
[0038] Assume that during the planning period, the load growth rate of a specific area is... If the number of substations in the region in the baseline year is n, and the number of new substations in the planned target year is m, then the load supplied by each substation in the planned target year can be calculated using the following formula:
[0039] ;
[0040] in, This represents the annual load supplied by the foundation level of the f-th substation. This represents the planned load supplied by the f-th substation in the current year. This indicates the load shared by the f-th substation due to the addition of a new substation of the same voltage level in the nearby area. This indicates that the newly added substation will share the load supplied by existing substations in the nearby area, and must meet the following requirements. .
[0041] Preferably, S430 includes:
[0042] S431: Take the load baseline value of the i-th partition. The maximum annual load value is used as the benchmark value for thermal power, hydropower, wind power, and photovoltaic power sources in zone i, which represents the rated installed capacity of the power source. , , , ;
[0043] S432: Set the load factor for the i-th partition under the four typical conditions of abundant / sparse, abundant / sparse, and dry / sparse. , , , Set the thermal power output coefficient of the i-th partition under the corresponding mode. , , , Set the hydropower output coefficient of the i-th partition under the corresponding mode. , , , Set the wind power output coefficient of the i-th partition under the corresponding mode. , , , Set the photovoltaic output coefficient of the i-th partition under the corresponding mode. , , , ;
[0044] S433: Calculate the load and power output of the i-th partition under four typical modes, specifically:
[0045] ;
[0046] ;
[0047] ;
[0048] ;
[0049] ;
[0050] ;
[0051] ;
[0052] ;
[0053] in, , , , These represent the loads under four typical configurations for the i-th partition. , , , These represent the power output under the four typical modes of the i-th partition;
[0054] S434: Assign the calculation result to the corresponding field in the database to generate a system operation mode data card.
[0055] Preferably, in S440, a power balance calculation is performed on the power source, load, and external power in the regional system to predict the power surplus / deficit status of the system, specifically as follows:
[0056] ;
[0057] ;
[0058] ;
[0059] ;
[0060] in, - The symbols represent the regional system power balance difference under different typical modes. "+" indicates power surplus, "-" indicates power deficit, and W indicates DC external power received in the region.
[0061] Preferably, S450 includes:
[0062] S451: Use the string concatenation function provided in the spreadsheet software to classify and row-divide the data, and generate a new data card;
[0063] S452: Use the Python programming language to read the raw data file, write the processed data, and reconstruct the PSD-BPA database;
[0064] S453: Perform a trial calculation on the new database. If there are problems such as the new database not converging or local voltage not meeting the requirements, then correct the data table and return to S440. If the new database calculation converges and the voltage level is qualified and the power flow distribution is reasonable, then the database for different years and multiple operating modes can be derived.
[0065] A power grid simulation calculation database derivative system includes:
[0066] The file acquisition and identification module is used to acquire the original power grid simulation PSD-BPA calculation database file and identify the location of power grid data and external communication channel data in the target area.
[0067] The classification and parsing module is used to read the original PSD-BPA calculation database file based on the Python programming language, classify and parse the data models in the database, and identify the device type and parameters according to the PSD-BPA model format specification.
[0068] The systematic management module is used to classify and organize the analysis results, optimize and merge nodes, verify parameters, and statistically analyze key information using spreadsheet software, so as to achieve systematic management of the database.
[0069] The database derivative module is used to adjust the planning year data model according to simulation requirements and future system evolution by selecting multi-file or single-file mode; allocate regional load using the capacity ratio method or the growth allocation method; set the zonal load control and power output coefficients and calculate typical mode values; verify the system power surplus and deficit, optimize the switching of reactive power equipment according to voltage level and region; reconstruct the PSD-BPA database and iteratively calculate and correct it until a valid derivative database is generated.
[0070] The aforementioned method and system for generating power grid simulation calculation databases enables automated parsing, standardized management, and intelligent generation of the original PSD-BPA database, significantly improving the efficiency and accuracy of power grid planning simulation database construction. By accurately identifying the data location in the target area, the system ensures the targeted nature of subsequent operations; the efficient parsing of complex model formats using Python lays a solid foundation for data management; and the use of spreadsheet software for systematic data organization, node optimization, and parameter verification effectively improves the database's quality and maintainability. Finally, through flexible selection of data management modes, scientific load allocation, precise setting of operating coefficients, intelligent verification of power balance and reactive power configuration, and combined with an iterative trial calculation correction mechanism, the system automatically generates high-quality and convergently reliable PSD-BPA derived databases that meet the needs of various future planning scenarios. This solves the problems of low efficiency, error-proneness, and difficulty in adapting to rapid generation across multiple scenarios associated with traditional manual operations. Attached Figure Description
[0071] Figure 1 This is a flowchart of a power grid simulation calculation database derivation method in one embodiment of the present invention. Detailed Implementation
[0072] To enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.
[0073] In one embodiment, such as Figure 1 As shown, a method for deriving a power grid simulation calculation database includes the following steps:
[0074] S100: Obtain the original power grid simulation PSD-BPA calculation database file and identify the location of power grid data and external communication channel data in the target area;
[0075] S200: Based on the Python programming language, it reads the original PSD-BPA calculation database file, classifies and parses the data models in the database, and identifies the device type and parameters according to the PSD-BPA model format specification.
[0076] S300: Use spreadsheet software to classify and organize the analysis results, optimize and merge nodes, verify parameters, and statistically analyze key information to achieve systematic management of the database;
[0077] S400: Based on simulation requirements and future system evolution, adjust the planning year data model using either multi-file or single-file mode; allocate regional loads using the capacity ratio method or the growth allocation method; set zonal load control and power output coefficients, and calculate typical mode values; verify the system's power surplus or deficit, and optimize reactive power equipment switching according to voltage level and region; reconstruct the PSD-BPA database and iteratively calculate and correct it until a valid derived database is generated.
[0078] The aforementioned method for deriving a power grid simulation calculation database can parse existing simulation calculation data packages and systematically manage the parsed model data in a standardized data table format, making the database management process more intuitive, efficient, and easy to operate. Furthermore, by improving and adjusting the database, it can be rapidly derived according to specified horizontal years and other operating conditions.
[0079] In one embodiment, S100 includes:
[0080] S110: If the original data is a PSASP software data package, use the PSASP→PSD-BPA conversion program to convert the PSASP data package into a PSD-BPA data package, which includes the DAT power flow file and the SWI stability file; if the original data is a PSD-BPA software data package, the DAT power flow file and the SWI stability file can be obtained directly.
[0081] S120: Mark the start and end lines of the target area power grid data card in the DAT power flow file and SWI stability file using comment strings, and also mark the location of the target area power grid external communication channel data card.
[0082] Specifically, the calculation data of a large power grid usually includes data from multiple regional power grids. However, in combination with actual calculation needs, the study usually focuses on the regional power grid of a certain province or city (this invention selects a certain province as an example). The start and end lines of the data card of the research regional power grid are marked in the original data packet file by special comment strings. At the same time, the location of the data card of the external communication channel of the regional power grid is also marked to facilitate the reading / writing of the corresponding data of the regional power grid in subsequent steps.
[0083] This solution effectively processes raw power grid data from various sources, ensuring the availability of basic data through conversion procedures or direct acquisition. By precisely marking the start and end lines of target areas and interconnection channel data cards in the critical data files (DAT power flow file and SWI stability file), clear operational guidance and positioning basis are provided for subsequent steps, effectively avoiding omissions or confusion during data processing and significantly improving the accuracy and efficiency of target data extraction.
[0084] In one embodiment, S200 includes:
[0085] S210: Based on the Python language, with the help of powerful file operation functions, it reads the marked regional power grid data cards in the original DAT power flow file and SWI file, with one data card corresponding to one string, and the string elements of multiple data cards are combined into a data frame one by one;
[0086] S220: Based on the configuration format specifications of various models in PSD-BPA, identify the start and end marks of each model configuration to distinguish different model types; for example, the starting character of an AC symmetrical line in the DAT file is "L" and the starting character in the SWI file is "LO", and the starting character of a transformer in the DAT file is "T" and the starting character in the SWI file is "XO", etc.
[0087] S230: Combining the corresponding formats of various model data cards of PSD-BPA, specifying the data parameters corresponding to each column, and using the Python programming language to parse the data card string, obtain the parameters and model information of various models.
[0088] Specifically, for example, the parsing process for a symmetrical AC line data card is as follows:
[0089] Read the DAT file, extracting each line of data as a string, and store multiple strings as a data frame; locate the marked power grid data segment in the designated area, and extract relevant data cards from the target area to form a new data frame; classify and filter the corresponding data cards according to the starting characters of different model data, selecting AC symmetrical line data cards starting with "L"; initialize a multi-dimensional data group to store the location and space of the data cards after reverse analysis; extract the corresponding data information into the target data group "1-df" according to the data card format, and output the reverse analysis results in tabular form.
[0090] Efficient and structured reading and parsing of marked area data cards was achieved using Python programming. By treating each data card as an independent string and assembling it into a data frame, batch processing is facilitated programmatically. Adhering to the strict model format specifications of PSD-BPA, model types and start / end markers are identified, ensuring the accuracy of model classification. By specifying the corresponding parameters for each column and parsing the strings, detailed parameters and information of various power grid equipment models can be accurately extracted. This provides a clear and complete underlying data support for subsequent data processing, verification, optimization, and final database reconstruction, greatly improving the automation and reliability of data parsing.
[0091] In one embodiment, S300 includes:
[0092] S310: Based on three major elements—power source (including hydropower, thermal power, new energy, and regulating power sources), power grid (including substations and lines) and load—the parsed model data is classified and stored, and standardized electronic data tables are constructed. By organizing the parsed model data, the readability of the database is significantly improved.
[0093] S320: Merge redundant nodes of the same voltage level at the same site, eliminate "small reactor" data cards within the site, unify site name descriptions, and simplify the database structure to optimize the reverse parsing data model;
[0094] S330: Verify and correct model data based on physical information and design parameters of power grid equipment ledger;
[0095] S340: Real-time aggregation of dynamic data on power supply capacity, load level, substation capacity, and reactive power compensation capacity.
[0096] Specifically, in section S320, in the original calculation data, multiple switching devices of the same voltage level within the same site (e.g., substation or power plant) are typically set as independent electrical nodes. These intra-site nodes are connected via "small reactors." However, in actual simulation calculations, such detailed node division is usually unnecessary. This approach leads to a significant increase in the number of nodes in the database, generates a large number of "small reactor" data cards, and results in multiple ways of representing the same site name, thus reducing the readability of the database. To address this issue, this invention proposes a method that, under the same voltage level, merges nodes at the same site into a single node as much as possible to simplify the database structure. Furthermore, in section S330, the parameters in the original database are thoroughly verified and checked using the physical information recorded in the power grid equipment ledger and typical parameters from the design phase. This process not only verifies the accuracy of the data but also involves data correction to ensure that all data conforms to the actual condition of the current power grid equipment. This significantly improves the accuracy and reliability of the database model parameters, providing a guarantee for the reliability of the simulation results. In section S340, the advanced statistical functions of the spreadsheet software are used to summarize key information from the standardized data tables, including power generation capacity, load level, substation capacity, and reactive power compensation (including capacitors and reactance) capacity. This step updates the status of each component of the system in real time, facilitating the rapid acquisition of relevant system status in subsequent steps and laying the foundation for derivative work on the database.
[0097] Furthermore, in the process of power system planning and design, it is usually necessary to conduct detailed studies and analyses for different planning level years (such as engineering design level year, planning level year, transition year, etc.) and different operating conditions (such as summer evening peak, winter evening peak, spring midday peak, etc.). Therefore, based on the database, it is necessary to combine the system development plan of the planning level year and make corresponding adjustments to the data models of load level, power generation capacity, grid structure, etc.; at the same time, according to the actual performance of the system under different operating conditions, necessary corrections should be made to the real-time load changes, power generation output, and grid equipment status.
[0098] In one embodiment, S400 includes:
[0099] S410: Adjust the data models of power sources and power grids for the planning year using either a multi-file management mode or a single-file management mode. The multi-file management mode creates an independent, standardized database table file for each planning year, generating the target year's database by adding, deleting, and modifying data models for planned power source projects and power grid engineering projects. The single-file management mode integrates the data models stored in the basic method with newly added data models in the planning into a single standardized database table file. Two variable columns, Yst (input year) and Yend (exit year), are added to this standardized database table. A valid period is set for each data model. During the generation of the planning year's Yplan data card, a conditional validation mechanism is introduced. If the conditions Yplan ≤ Yend and Yplan ≤ Yst are met, the data card statement is generated normally; otherwise, a null value is assigned. This method enables effective management of databases containing multiple planning years using a single standardized table.
[0100] S420: The regional load is adjusted using either the capacity ratio method or the growth allocation method. The capacity ratio method allocates the total regional load according to the proportion of the transformer capacity of each substation. The growth allocation method dynamically adjusts the load distribution between existing and new substations based on the load growth rate and the number of new substations.
[0101] S430: Set the load control factor and power output factor of each zone under typical operating mode, and calculate the load value and power output under typical operating mode;
[0102] S440: Performs power balance calculations on power sources, loads, and external power in the regional system, predicts the power surplus and deficit status of the system, optimizes the switching of reactive power equipment according to voltage level and region, and achieves hierarchical and regional reactive power balance.
[0103] S450: Concatenates strings to generate a new data card, reconstructs the database file, and performs trial calculations. If the data does not converge or the voltage is unqualified, it returns corrected data. If the database calculation converges and the voltage level is qualified, it achieves effective database derivation. This provides high-quality input for power grid planning simulation.
[0104] In one embodiment, S420 uses a capacity occupancy method to adjust the regional load, specifically as follows:
[0105] Set the total load of a certain region in a planned year as follows: The area contains n substations, and the load supplied by each substation is calculated using the following formula:
[0106] ;
[0107] in, This represents the planned load supplied by the f-th substation in the current year. This represents the substation capacity of the f-th substation in the planned horizontal year;
[0108] In S420, the increasing allocation method is used to adjust the regional load, specifically as follows:
[0109] Assume that during the planning period, the load growth rate of a specific area is... If the number of substations in the region in the baseline year is n, and the number of new substations in the planned target year is m, then the load supplied by each substation in the planned target year can be calculated using the following formula:
[0110] ;
[0111] in, This represents the annual load supplied by the foundation level of the f-th substation. This represents the planned load supplied by the f-th substation in the current year. This indicates the load shared by the f-th substation due to the addition of a new substation of the same voltage level in the nearby area. This indicates that the newly added substation will share the load supplied by existing substations in the nearby area, and must meet the following requirements. .
[0112] Furthermore, within a given year, the system's electricity demand fluctuates with changes in social activities at different times, while the output of power sources such as hydropower, wind power, and photovoltaic power changes with natural environmental factors such as precipitation, wind speed, and sunlight. The system requires a dynamic balance between load and power output, necessitating adjustments in the output of thermal power, pumped storage, and new energy storage power stations with regulatory capabilities, thus creating different operating modes. The following section selects four typical modes: summer evening peak (abundant harvest), summer night (sparse harvest), winter evening peak (dry season), and winter night (dry season), and discusses the steps and corresponding methods using four power sources: thermal power, hydropower, wind power, and photovoltaic power.
[0113] In one embodiment, S430 includes:
[0114] S431: Take the load baseline value of the i-th partition. The maximum annual load value is used as the benchmark value for thermal power, hydropower, wind power, and photovoltaic power sources in zone i, which represents the rated installed capacity of the power source. , , , ;
[0115] S432: Set the load factor for the i-th partition under the four typical conditions of abundant / sparse, abundant / sparse, and dry / sparse. , , , Set the thermal power output coefficient of the i-th partition under the corresponding mode. , , , Set the hydropower output coefficient of partition i under the corresponding mode. , , , Set the wind power output coefficient of the i-th partition under the corresponding mode. , , , Set the photovoltaic output coefficient of the i-th partition under the corresponding mode. , , , ;
[0116] S433: Calculate the load and power output of the i-th partition under four typical modes, specifically:
[0117] ;
[0118] ;
[0119] ;
[0120] ;
[0121] ;
[0122] ;
[0123] ;
[0124] ;
[0125] in, , , , These represent the loads under four typical configurations for the i-th partition. , , , These represent the power output under the four typical modes of the i-th partition;
[0126] S434: Assign the calculation result to the corresponding field in the database to generate a system operation mode data card.
[0127] Specifically, by using the above calculation method and combining it with the formulas in the table file, the precise determination of load values for different zones and the accurate calculation of the output power of various power sources in each zone can be achieved. Subsequently, according to the specific calculation method, the corresponding calculated values are assigned to each element in the database to quickly generate the corresponding cards. The control coefficient settings for load and hydropower under various typical modes in the standardized table are shown in Table 1; the load base values and actual values under various typical modes in the standardized table are shown in Table 2; and the hydropower base values and output values under various typical modes in the standardized table are shown in Table 3.
[0128] Table 1
[0129]
[0130] Table 2
[0131]
[0132] Table 3
[0133]
[0134] In one embodiment, S440 performs a power balance calculation on the power source, load, and external power in the regional system to predict the power surplus / deficit status of the system, specifically as follows:
[0135] ;
[0136] ;
[0137] ;
[0138] ;
[0139] in, - The symbols represent the regional system power balance difference under different typical modes. "+" indicates power surplus, "-" indicates power deficit, and W indicates DC external power received in the region.
[0140] Specifically, under different typical scenarios in the planning year, compared to the basic scenario, due to significant changes in load, power supply, and power input, newly generated data packets will be difficult to converge quickly without prior assessment of the system's power surplus / deficit. Therefore, the ∆P index can reflect the system's active power surplus / deficit under different typical scenarios. During the calculation of new data packets, the power support capacity of the external power grid through AC tie lines will be actively optimized, providing a quantitative analytical basis for adjusting data packets under different typical scenarios. Furthermore, it must be pointed out that in actual calculations, due to the objective existence of system network losses, ∆P can only serve as a reference indicator and cannot accurately reflect the absolute value of the system's surplus / deficit. The standardized design of the power balance sheet is shown in Table 4.
[0141] Table 4
[0142]
[0143] On the other hand, based on practical experience in electrical calculations, if the principle of hierarchical (by voltage level) and zoned (different regions) reactive power balance is implemented in the system, the convergence of database calculations will be improved, and the voltage levels of each node in the calculation results will be within a relatively reasonable range. Therefore, this invention can also use the reactive power balance calculation method in the system to rationally configure the switching of new reactive power equipment.
[0144] In one embodiment, S450 includes:
[0145] S451: Use the string concatenation function provided in the spreadsheet software to classify and row-divide the data to generate new data cards; in this way, the original calculation data cards can be regenerated to ensure the organization and clarity of the data;
[0146] S452: Using the Python programming language to read the raw data file, write the processed data, and reconstruct the PSD-BPA database; this process involves precise data processing and efficient transformation to ensure the accuracy and reliability of the database reconstruction.
[0147] S453: Perform trial calculations on the new database. If there are issues such as non-convergence of the new database or unqualified local voltages, correct the data table and return to S440. If the new database calculations converge, and the voltage level is qualified and the power flow distribution is reasonable, then databases for different years and multiple operating modes can be derived. Through the above steps, databases for different years and multiple operating modes can be derived, significantly improving the efficiency of power system simulation calculation and modeling.
[0148] The aforementioned method for generating a power grid simulation database achieves efficient, accurate, and automated generation of such databases, significantly improving the efficiency and quality of planning and analysis. Through collaboration between Python and spreadsheet software, it automates data parsing, model optimization, and systematic management. It supports flexible adjustment of planning year data in both multi-file and single-file modes, scientifically allocates load using capacity proportion and growth allocation methods, and sets zoning coefficients to accurately simulate various typical operating modes. It innovatively combines power balance prediction with reactive power hierarchical zoning optimization, and uses iterative calculations to ensure database convergence and voltage qualification rates. Ultimately, it rapidly generates high-quality PSD-BPA derived databases adapted to different years and multiple operating scenarios, providing strong support for power grid planning decisions.
[0149] In one embodiment, a power grid simulation calculation database derivation system is also provided, comprising:
[0150] The file acquisition and identification module is used to acquire the original power grid simulation PSD-BPA calculation database file and identify the location of power grid data and external communication channel data in the target area.
[0151] The classification and parsing module is used to read the original PSD-BPA calculation database file based on the Python programming language, classify and parse the data models in the database, and identify the device type and parameters according to the PSD-BPA model format specification.
[0152] The systematic management module is used to classify and organize the analysis results, optimize and merge nodes, verify parameters, and statistically analyze key information using spreadsheet software, so as to achieve systematic management of the database.
[0153] The database derivative module is used to adjust the planning year data model according to simulation requirements and future system evolution by selecting multi-file or single-file mode; allocate regional load using the capacity ratio method or the growth allocation method; set the zonal load control and power output coefficients and calculate typical mode values; verify the system power surplus and deficit, optimize the switching of reactive power equipment according to voltage level and region; reconstruct the PSD-BPA database and iteratively calculate and correct it until a valid derivative database is generated.
[0154] For specific limitations regarding the power grid simulation calculation database derivation system, please refer to the limitations of the power grid simulation calculation database derivation method described above, which will not be repeated here. Each module in the aforementioned power grid simulation calculation database derivation system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0155] The foregoing has provided a detailed description of the power grid simulation calculation database derivation method and system provided by this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention, and the descriptions of the embodiments above are merely for the purpose of helping to understand the core ideas of this invention. It should be noted that those skilled in the art can make various improvements and modifications to this invention without departing from the principles of this invention, and these improvements and modifications also fall within the protection scope of the claims of this invention.
Claims
1. A power grid simulation calculation database derivation method, characterized by, The method comprises the following steps: S100: Obtain an original power grid simulation PSD-BPA calculation database file, and identify a target regional power grid data position and an external tie-in channel data position; S200: Based on a Python programming language, read the original PSD-BPA calculation database file, classify and analyze a data model in the database, and identify a device type and a parameter according to a PSD-BPA model format specification; S300: Use a table software to classify and arrange the analysis results, optimize and combine nodes, verify parameters, and statistically analyze key information, so as to realize systematic management of the database; S400: According to simulation requirements and future system evolution, select a multi-file or single-file mode to adjust a planning year data model; use a capacity proportion method or a growth allocation method to allocate regional loads; set a partition load control and a power supply output coefficient, calculate a typical mode value; check system power profit and loss, optimize reactive power equipment switching according to voltage grades and regions; reconstruct the PSD-BPA database and iteratively test and correct, until an effective derivative database is generated; S400 comprises: S410: Adjust the data model of the power supply and the power grid in the planning year through a multi-file management mode or a single-file management mode, wherein the multi-file management mode is to create an independent standardized database table file for each planning year, and generate a target year database by adding, deleting or modifying the data model for the power supply project and the power grid engineering in the planning; the single-file management mode is to integrate the data model stored in the basic mode and the newly added data model in the planning into a standardized database table file, add two variable columns of input year Yst and exit year Yend in the unified standardized database table, set the effective period for each data model, and introduce a condition verification mechanism in the data card generation process in the planning year Yplan, if the condition Yplan≤Yend and Yplan≤Yst is met, the data card statement is normally generated; otherwise, an empty value is assigned; S420: Use a capacity proportion method or a growth allocation method to adjust regional loads, wherein the capacity proportion method allocates the total regional load according to the proportion of the transformer capacity of each transformer substation; the growth allocation method dynamically adjusts the load allocation of the existing station and the new station according to the load growth rate and the number of new stations; S430: Set the load control coefficient and the power supply output coefficient of each partition in the typical operation mode, and calculate the load value and the power supply output in the typical operation mode; S440: Perform power balance calculation on the power supply, the load and the external power in the regional system, predict the system power profit and loss state, optimize the reactive power equipment switching according to the voltage grades and the regions, and realize the reactive power hierarchical and partition balance; S450: Concatenate strings to generate new data cards, reconstruct the database file and test, return the correction data if the data does not converge or the voltage is unqualified, and realize the effective database derivation if the database calculation converges and the voltage level is qualified.
2. The method of claim 1, wherein, S100 comprises: S110: If the original data is PSASP software data packet, use PSASP PSB-PA conversion program to convert PSASP data packet to PSD-BPA data packet, including DAT power flow file and SWI stability file; if the original data is PSD-BPA software data packet, DAT power flow file and SWI stability file can be directly obtained; S120: In DAT power flow file and SWI stability file, mark the start and end rows of target regional power grid data card through annotation string, and mark the position of external interconnection channel data card of target regional power grid.
3. The method of claim 2, wherein, S200 includes: S210: Based on Python language, read the marked regional power grid data card in the original DAT power flow file and SWI file, with one data card corresponding to one string, and multiple data card string elements forming a data frame one by one; S220: According to the configuration format specification of various models of PSD-BPA, identify the start and end identifiers of each model configuration, and distinguish different model types; S230: Combine the corresponding format of various model data cards of PSD-BPA, specify columns corresponding to each data parameter, and use Python programming language to parse the data card string to obtain the parameters and model information contained in each type of model.
4. The method of claim 3, wherein, S300 includes: S310: According to the classification storage of power supply, power grid and load, build a standardized electronic data table; S320: Merge redundant nodes of the same voltage level in the same station, eliminate intra-station "small reactance" data cards, unify the station name expression, simplify the database structure, and optimize the inverse analysis data model; S330: Based on the physical information and design parameters of the grid equipment account, verify and correct the model data; S340: Real-time summary of power installed capacity, load level, transformer capacity, and reactive power compensation capacity dynamic data.
5. The method of claim 4, wherein, In S420, the capacity proportion method is used to adjust the regional load, specifically: Let the total load of a region in a planning year be set as , and the region contains n substations, and the load supplied by each substation is calculated by the following formula: ; wherein, denotes the load supplied by the fth substation in the planning level year, denotes the substation capacity of the fth substation in the planning level year. In S420, the growth allocation method is used to adjust the regional load, specifically: Assuming that the load growth rate of a certain area during the planning period is , the number of substations in the base year of the area is n, and the number of newly added substations in the planning target year is m, then the load supplied by each substation in the planning target year can be calculated according to the following formula: ; wherein, represents the load supplied by the fth substation at the base level of the year, represents the load supplied by the fth substation at the planning level of the year, represents the load supplied by the fth substation shared by the newly added substation of the same voltage level in the vicinity, represents the load supplied by the stock substation in the vicinity shared by the newly added substation, and needs to satisfy .
6. The method of claim 5, wherein, S430 includes: S431: take the load reference value of the i-th partition For the maximum load value throughout the year, take the reference value of the thermal power, hydropower, wind power and photovoltaic power of the i-th partition as the rated installed capacity of the power source , , , ; S432: Set the load factor of the i-th partition under the four typical modes of abundant large, abundant small, dry large and dry small , , , ; Set the thermal power output factor of the i-th partition under the corresponding mode , , , ; Set the hydropower output factor of the i-th partition under the corresponding mode , , , ; Set the wind power output factor of the i-th partition under the corresponding mode , , , ; Set the photovoltaic output factor of the i-th partition under the corresponding mode , , , ; S433: Calculate the load and power output of the i-th partition under four typical modes, specifically: ; ; ; ; ; ; ; ; wherein, , , , respectively represent the load of the i-th partition under four typical modes, , , , respectively represent the power output of the i-th partition under four typical modes. S434: Assign the calculation results to the corresponding fields of the database to generate system operation mode data cards.
7. The method of claim 6, wherein, In S440, the power supply, load, and external power in the regional system are calculated for power balance, and the system power profit and loss state is predicted, specifically: ; ; ; ; wherein, - represents the power balance difference of the regional system under different typical modes, "+" represents power surplus, "-" represents power deficit, and W represents the DC external power in the region.
8. The method of claim 7, wherein, S450 includes: S451: Use the string concatenation function provided in the table software to classify and row the data, and generate new data cards; S452: Use Python programming language to read the original data file and write the processed data to reconstruct the PSD-BPA database; S453: Trial calculation of the new database, if there is a new database that does not converge, local voltage is unqualified, then correct the data table, and return to S440; if the new database calculation converges, and the voltage level is qualified, the power flow distribution is reasonable, then realize the database derivation of different years and multiple operation modes.
9. A power grid simulation calculation database derivation system based on the method according to any one of claims 1 to 8, characterized in that, includes: A file acquisition and identification module is configured to acquire an original power grid simulation PSD-BPA calculation database file, and identify a target regional power grid data position and an external tie-in channel data position; A classification analysis module is configured to read the original PSD-BPA calculation database file based on a Python programming language, and perform classification analysis on a data model in the database, so as to identify a device type and a parameter according to a PSD-BPA model format specification; A systematic management module is configured to use a table software to classify and arrange the analysis results, optimize and combine nodes, verify parameters, and count key information, so as to realize systematic management of the database; A database derivation module is configured to select a multi-file or single-file mode to adjust a planning year data model according to simulation requirements and future system evolution, and distribute regional loads by using a capacity proportion method or a growth apportionment method; A typical mode value is calculated by setting a regional load control and a power supply output coefficient; System power profit and loss is checked, and reactive power equipment switching is optimized according to voltage grades and regions; the PSD-BPA database is reconstructed and iteratively tested and corrected until an effective derived database is generated.
Citation Information
Patent Citations
PSD-BPA-oriented method for rapidly generating wind power plant current collection line model, box transformer substation model and generator set model
CN113627014A
Joint simulation method and device based on Python and PSD-BPA
CN116502401A