Qs file processing method and apparatus, electronic device, and storage medium
By adopting a network service-based QS file processing method, the problems of untimely QS file processing and data security are solved, enabling timely data processing and secure storage, thus meeting the needs of modern power systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA SOUTHERN POWER GRID COMPANY
- Filing Date
- 2023-10-31
- Publication Date
- 2026-07-21
AI Technical Summary
Existing QS file processing methods suffer from problems such as untimely processing, data redundancy, and data leakage.
The QS file processing method based on network services is adopted. By receiving POST requests from clients, a QS container is constructed to parse and integrate power flow calculation information. A DAT container is constructed to calculate the power flow information of topology nodes. The global ID allocation rules are obtained through the index database, and finally the power flow information is stored in the online model library.
It enables timely processing of QS files, avoids data redundancy and leakage, and meets the needs of modern computer network technology.
Smart Images

Figure CN117493286B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system simulation and analysis algorithm technology, and in particular to a QS file processing method, apparatus, electronic device and storage medium. Background Technology
[0002] When performing operational analysis on power systems, QS state estimation files (hereinafter referred to as QS files) are typically used for power flow analysis. QS files are a standard format file used for real-time monitoring and analysis of power grids, facilitating data exchange and are widely applied in power grid analysis and monitoring records. In practical applications, power flow calculation analysis files obtained from analyzing QS files at a specific time accurately reflect the power exchange and voltage distribution of the power grid at that time, providing more realistic guidance for power grid risk identification and power transmission simulation.
[0003] Existing QS file processing methods typically involve file copying and local processing, which can easily lead to problems such as untimely processing, data redundancy, and data leakage during data processing. Summary of the Invention
[0004] This invention provides a QS document processing method, apparatus, electronic device, and storage medium to solve or partially solve the technical problems that are prone to occur in existing QS document processing methods, such as untimely processing, data redundancy, and data leakage.
[0005] This invention provides a QS file processing method applied to a server, wherein the server is communicatively connected to an index database, and the method includes:
[0006] Receive a POST request sent by the client and obtain the QS file corresponding to the POST request;
[0007] A QS container is constructed, which is used to parse the QS file to obtain actual measurement records, extract QS timestamps, and integrate the power flow calculation information required to generate the power flow calculation file.
[0008] Construct a DAT container, calculate the power flow information of each topology node in the DAT container based on the actual measurement records and the power flow calculation information, and allocate each power flow information to the corresponding topology node;
[0009] Obtain generator set information from the power grid, determine the slack node based on the generator set information, calculate the power flow output of the slack node, and correct the power flow information based on the deviation between the power flow calculation result and the actual measurement record.
[0010] The global ID allocation rule is obtained through the index database, and the global ID allocation rule is used to assign a global ID to each power flow information in the DAT container.
[0011] Establish an online model library corresponding to the QS timestamp, and store all power flow information in the DAT container into the online model library according to the global ID allocation rule.
[0012] Optionally, obtaining the global ID allocation rules through the index database includes:
[0013] Create a new query request session with the index database, and query the global ID allocation rules from the index database through the query request session.
[0014] Optionally, the server corresponds to a temporary folder, and the method further includes:
[0015] After obtaining the QS file corresponding to the POST request, the QS file is stored in the temporary folder. The QS container is then used to parse the QS file in the temporary folder to obtain the actual measurement record.
[0016] Optionally, the method further includes:
[0017] If all power flow information in the DAT container is successfully stored in the online model library, the corresponding response code is returned to the client.
[0018] If the process of storing trend information into the online model library fails, the corresponding error code will be returned to the client.
[0019] Optionally, the method further includes:
[0020] After returning a response code or error code to the client, delete the QS file stored in the temporary folder.
[0021] Optionally, the server corresponds to a configuration module, which is used to configure parameters for the QS container and the DAT container. Therefore, before building the QS container, the method further includes:
[0022] The configuration module is initialized using the basic configuration information in the index database.
[0023] Optionally, the power flow information of each topology node includes the unbalanced power and reactive power of each topology node.
[0024] The present invention also provides a QS file processing device for a power grid, applied to a server, wherein the server is communicatively connected to an index database, and the device includes:
[0025] The POST request receiving module is used to receive POST requests sent by the client and obtain the QS file corresponding to the POST request;
[0026] The QS container construction module is used to construct a QS container, which is used to parse the QS file to obtain actual measurement records, extract QS timestamps, and integrate the power flow calculation information required to generate the power flow calculation file.
[0027] The DAT container construction module is used to construct a DAT container. Based on the actual measurement records and the power flow calculation information, it calculates the power flow information of each topology node in the DAT container and assigns each power flow information to the corresponding topology node.
[0028] The power flow information correction module is used to acquire generator set information of the power grid, determine the slack node based on the generator set information, calculate the power flow output of the slack node, and correct the power flow information based on the deviation between the power flow calculation result and the actual measurement record.
[0029] The global ID allocation rule acquisition module is used to acquire global ID allocation rules through the index database. The global ID allocation rules are used to assign a global ID to each power flow information in the DAT container.
[0030] The online model library data storage module is used to establish an online model library corresponding to the QS timestamp, and to store all power flow information in the DAT container into the online model library according to the global ID allocation rule.
[0031] The present invention also provides an electronic device, the device comprising a processor and a memory:
[0032] The memory is used to store program code and transmit the program code to the processor;
[0033] The processor is configured to execute the QS file processing method as described above, according to the instructions in the program code.
[0034] The present invention also provides a computer-readable storage medium for storing program code for performing the QS file processing method as described in any of the preceding claims.
[0035] As can be seen from the above technical solutions, the present invention has the following advantages: It proposes a QS file processing method based on network services. First, it receives a POST request sent by a client. Then, it constructs a QS container to parse the QS file in the request to obtain actual measurement records, extract QS timestamps, and integrate the power flow calculation information required to generate a power flow calculation file. Next, it constructs a DAT container to calculate the power flow information of each topology node in the DAT container based on the actual measurement records and power flow calculation information, and allocates each power flow information to the corresponding topology node. Then, it obtains the generator information of the power grid, determines the slack node based on the generator information, calculates the power flow output of the slack node, and corrects the power flow information based on the deviation between the power flow calculation results and the actual measurement records. Next, it obtains global ID allocation rules through an index database and assigns a global ID to each power flow information in the DAT container according to the global ID allocation rules. Finally, it establishes an online model library corresponding to the QS timestamps and stores all power flow information in the DAT container into the online model library according to the global ID allocation rules. By adopting the technical solution of this invention, online processing of QS files can be realized based on network services. With the cooperation of various processing modules, POST requests sent by clients can be processed in a timely manner and the results can be output. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 A flowchart illustrating the steps of a QS file processing method provided in this embodiment of the invention;
[0038] Figure 2 This is a schematic diagram of the overall process of a QS file processing method provided in an embodiment of the present invention;
[0039] Figure 3 This is a structural block diagram of a QS file processing device provided in an embodiment of the present invention. Detailed Implementation
[0040] This invention provides a QS file processing method, apparatus, electronic device, and storage medium to solve or partially solve the technical problems that are prone to occur in existing QS file processing methods, such as untimely processing, data redundancy, and data leakage.
[0041] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0042] As an example, the QS file is a standard format file used for real-time monitoring and analysis of power grid data exchange, and is widely used in power grid analysis and monitoring records. In practical applications, power flow calculation analysis files obtained from analyzing QS files at a specific time can accurately reflect the power grid's power exchange and voltage distribution at that time, providing more realistic guidance for power grid risk disclosure and power transmission simulation. Existing QS file processing methods typically involve file copying and local processing, which can easily lead to problems such as untimely processing, data redundancy, and data leakage during data processing.
[0043] Therefore, one of the core inventive points of this invention is: a network service-based QS file processing method and a standard interactive interface are proposed for the QS file processing flow of the power grid. First, a POST request sent by the client is received, and the QS file in the request is stored in a temporary folder. Next, a QS container is constructed to parse the QS file to obtain actual measurement records, extract the QS timestamp, and integrate the power flow calculation information required to generate the power flow calculation file. Then, a DAT container is constructed to calculate the power flow information of each topology node in the DAT container based on the actual measurement records and power flow calculation information, and to allocate each power flow information to the corresponding topology node. The process involves several steps: First, the system retrieves generator information from the power grid, identifies the slack node based on this information, calculates the power flow output of the slack node, and corrects the power flow information based on the deviation between the calculated results and actual measurements. Next, it obtains global ID allocation rules from the index database and assigns a global ID to each power flow information entry in the DAT container according to these rules. Finally, it establishes an online model library corresponding to the QS timestamp and stores all power flow information from the DAT container in the online model library according to the global ID allocation rules. After the execution process ends, it returns the corresponding response code or error code to the client and deletes the QS file in the temporary folder. By adopting this invention, online processing of QS files can be achieved based on network services. With the cooperation of various processing modules, POST requests sent by the client are processed promptly, and results are output. Furthermore, the flexible configuration and use of the temporary folder can solve the problems of data redundancy and data leakage that easily occur during data processing, making it more suitable for modern computer network technology.
[0044] Reference Figure 1 This diagram illustrates a flowchart of a QS file processing method provided by an embodiment of the present invention. The method is applied to a server, which is communicatively connected to an index database. The method may specifically include the following steps:
[0045] Step 101: Receive a POST request sent by the client and obtain the QS file corresponding to the POST request;
[0046] In a specific implementation, when a QS file needs to be processed, the client, acting as the requester, can send a POST request to the server, acting as the processor. POST is an HTTP (Hypertext Transfer Protocol) method used to send data from the client to the server. When sending data using the POST method, the data is included in the HTTP request body, rather than being visible in the URL (Uniform Resource Locator). Therefore, this method allows for the transmission of large amounts of data while ensuring data security. In this embodiment of the invention, sending the QS file to be processed via a POST request can, to a certain extent, ensure the security of transmitted data and prevent data leakage and other problems.
[0047] Meanwhile, POST requests are suitable for interacting with the server and updating, deleting, or adding data. In this embodiment of the invention, the processing objective of the POST request is to process the QS file through network services to obtain power flow calculation data, and store the power flow calculation data in an online model library. The online model library can be regarded as a standard interactive interface, and the data stored therein can be accessed by power grid operation and maintenance personnel to provide more effective guidance for power grid risk disclosure and power transmission simulation.
[0048] After the client sends a POST request, the server, acting as the processor, can receive the POST request from the client and obtain the corresponding QS file from the POST request for subsequent processing.
[0049] Furthermore, a temporary folder can be created for the server-side QS file processing process to temporarily store the QS file data that needs to be processed during the data processing. After the data processing is completed, the QS files stored in the temporary folder and the related temporary files generated in the process can be deleted. On the one hand, this can avoid data redundancy, and on the other hand, it can prevent data leakage and further ensure data security.
[0050] In the specific implementation, the server can also correspond to a temporary folder. After obtaining the QS file corresponding to the POST request, the QS file can be stored in the temporary folder. Then, the QS container in the server can be used to parse the QS file in the temporary folder to obtain the actual measurement record.
[0051] At the same time, the server can also communicate with an index database (INDEX database). In database processing, an index is a structure that sorts the values of one or more columns in a database table. Its main purpose is to speed up the retrieval of data in the table. In other words, the index database is an auxiliary data structure that helps information searchers find record IDs that meet the restrictions as quickly as possible.
[0052] Using indexes allows for quick access to specific information in a database table. For example, if you want to find a piece of information by a specific symbol, using an index can help you retrieve the information much faster than searching all the rows in the table.
[0053] For the server side, before data processing, it is necessary to configure the relevant processing modules (such as QS container and DAT container). At this time, the basic configuration information can be quickly determined by the index database to quickly configure the parameters of the relevant processing modules. The server side can correspond to a configuration module, which is used to configure the parameters of QS container and DAT container. Before building QS container, the basic configuration information in the index database can also be used to initialize the configuration module.
[0054] Step 102: Construct a QS container, which is used to parse the QS file to obtain actual measurement records, extract QS timestamps, and integrate the power flow calculation information required to generate the power flow calculation file.
[0055] In related technologies, a container is a lightweight virtualization technology. Lightweight virtualization refers to the use of an operating system virtualization technology that allows the user space on an operating system to be divided into several independent units that run in the kernel without interfering with each other. Such an independent space is called a container.
[0056] In this embodiment of the invention, the processing of QS file data on the server side can be mainly divided into two processing modules. One is a module for parsing and calculating the power flow of the QS file, namely the QS container in this step. In addition, the QS container can also store the parsed data. The other is a module for writing and storing the data of each topology node and generator set in the power grid, as well as the power flow information data output after power flow calculation, namely the DAT container mentioned in step 103 below.
[0057] The QS container is mainly used to parse QS files to obtain actual measurement records, extract QS timestamps from QS files, and integrate the power flow calculation information required to generate power flow calculation files.
[0058] The QS timestamp refers to the time when the corresponding QS file was generated, and it is usually recorded within the QS file. For constructing the QS container, after obtaining the QS file, a highly structured QS container corresponding to the QS file in this processing flow can be constructed by parsing the QS file in the temporary folder.
[0059] For better illustration, the main functional designs of the QS container are shown in the table below:
[0060]
[0061]
[0062] Table 1: Main Functional Design of QS Container
[0063] For example, the process of parsing the QS file mentioned in the embodiments of the present invention can be understood as reading the QS file line by line, extracting the data information according to the standard format of the QS file and instantiating it into memory data for later use, and the entire parsing process can be implemented through the "feed" function of the QS container.
[0064] Step 103: Construct a DAT container, calculate the power flow information of each topology node in the DAT container based on the actual measurement records and the power flow calculation information, and assign each power flow information to the corresponding topology node;
[0065] In related technologies, a .dat file, short for Data file, refers to a data file. A .dat file is a general file type used to store various data within an application. .dat files are typically generated and used by the application, but can also be created manually. They contain various data required by the application, such as user configurations, media file information, log data, game saves, etc. The main functions of a .dat file are to store application data, ensure data integrity and security, and improve application performance and efficiency.
[0066] In conjunction with the foregoing, in this embodiment of the invention, the DAT container can be understood as a processing container used to write and store data of various topology nodes and generator sets in the power grid, as well as power flow information data output after power flow calculation by the QS container, in dat file format.
[0067] For better illustration, the main functional designs of the DAT container are shown in the table below:
[0068]
[0069]
[0070] Table 2: Main Functional Design of DAT Container
[0071] Among them, B card is the node data card, which represents a node. This node can be a generator, transformer, etc. The node cards such as BQ card, BA card, and BD card in the table are voltage control node types unique to PSD-BPA (a power system analysis software), which will not be elaborated here. global_id refers to the global ID assigned according to the global ID allocation rules.
[0072] After the DAT container is constructed, the power flow information of each topology node in the DAT container can be calculated based on Kirchhoff's current law and the measurement records analyzed by the QS container, that is, based on the actual measurement records and power flow calculation information. Each power flow information is then distributed as a load to the corresponding topology node. The power flow information of each topology node includes the unbalanced power and reactive power of each topology node.
[0073] Step 104: Obtain generator set information of the power grid, determine the slack node based on the generator set information, calculate the power flow output of the slack node, and correct the power flow information based on the deviation between the power flow calculation result and the actual measurement record.
[0074] Next, based on the DAT container, information on all generator sets in the power grid can be obtained, and a suitable generator set can be selected as the balancing node from all generator sets according to the generator set information. Then, the power flow calculation module can be called to perform power flow analysis, calculate the power flow output of the balancing node, and correct the power flow information in each synchronization network in the DAT container according to the deviation between the power flow calculation results and the actual measurement records.
[0075] The method of selecting the balancing node can be set according to the actual situation. For example, the generator set with the power closest to the average value can be selected as the balancing node, or the generator set with the most stable historical operating status can be selected as the balancing node, etc. This invention does not limit this.
[0076] Step 105: Obtain the global ID allocation rule through the index database. The global ID allocation rule is used to assign a global ID to each power flow information in the DAT container.
[0077] Before obtaining the global ID allocation rules through the index database, the global ID allocation rules for the power grid can also be obtained by applying a unified encoding method to the power grid equipment model data. Since the DAT container stores data in the form of topology nodes (which can also be understood as generator sets), the topology node can be used as the encoding key during unified encoding. Therefore, the key fields included in the global ID allocation rules can be: primary key ID, equipment type, topology node unified encoding header, and topology node name. Further, the overall unified encoding method involved in the global ID allocation rules is as follows: First, using the topology node name as the key of the encoding rule, combined with the equipment type and the topology node unified encoding header, the encoding value corresponding to the topology node name is calculated according to a preset key-value calculation formula; then, each topology node in the power grid is obtained, and based on the name of each topology node in the power grid, combined with the encoding value corresponding to the topology node name, a unified code, i.e., a global ID, is assigned to the power grid topology node. Assuming that a topology node corresponds to a power flow information (which contains all power flow calculation related data of the topology node), according to the global ID allocation rule, a topology node corresponds to a global ID, which is equivalent to a power flow information corresponding to a global ID, forming a "topology node-power flow information-global ID" association relationship.
[0078] Similarly, in order to quickly match the global ID allocation rules, they can be stored in the index database as an index. Then, to obtain the global ID allocation rules through the index database, a new query request session with the index database can be created, and the global ID allocation rules can be queried from the index database through the query request session.
[0079] Thus, through the global ID allocation rules, not only can the calculated power flow information be quickly associated with the corresponding topology nodes throughout the entire power grid, but also when storing power flow information data in the online model library, it can be stored according to the corresponding relationship, realizing global cross-library storage for data processing.
[0080] Step 106: Establish an online model library corresponding to the QS timestamp, and store all power flow information in the DAT container into the online model library according to the global ID allocation rule.
[0081] Based on the foregoing, the goal of this POST service request is to insert power flow information into the online model database. The entire execution process actually involves processing the QS file to obtain power flow calculation data (i.e., the information in the DAT container), and finally storing it in the online model database.
[0082] Therefore, in the specific implementation, an online model library corresponding to the QS timestamp (equivalent to corresponding to the QS file being processed) can be established. That is, an online-model-data database with the QS timestamp as the suffix can be established, and all power flow information in the DAT container can be stored in the online model library according to the global ID allocation rules.
[0083] The online model library can be understood as an online model system database. This database is a template database used to create new databases, containing the basic objects needed for creating them, such as system tables, view tables, and login information. When the system creates a new database, it copies the contents of this template database to the new database. Since all newly created databases inherit from this model database, any changes made to the model database, such as adding objects, will be reflected in subsequent database creations.
[0084] In other words, in addition to serving as a repository for output results, if a new database is subsequently created based on the online model library, the changes made to the online model library will also be included in the newly created database. This means that the newly created database not only "inherits" the original content of the online model library, but can also be updated synchronously as the data in the online model library changes.
[0085] Furthermore, since the power flow information in the DAT container is complete, removing the online model library will not affect the implementation process, but an alternative output method is required, such as writing the power flow information in the DAT container into the result file.
[0086] After all the above processes are successfully executed, that is, after all the power flow information in the DAT container is successfully stored in the online model library, the server can return a corresponding response code to the client to inform the client operator that the QS file processing was successful.
[0087] If an error occurs during the execution of the above process, such as a failure to store the power flow information into the online model library or an error in other processing steps, a corresponding error code can be returned to the client to inform the client operator that the QS file processing has failed. Furthermore, the error code display can be set according to the corresponding step or reason for the error, that is, different error codes can be set to correspond to different failure reasons. For example, error code 400 indicates that the power flow information failed to be stored in the online model library, error code 401 indicates that the QS file parsing in the QS container failed, error code 402 indicates that the global ID allocation rule query failed, etc. This invention does not limit this.
[0088] In addition, to avoid data redundancy and data leakage, the QS file stored in the temporary folder can be deleted after the execution process ends and a response code or error code is returned to the client.
[0089] In this embodiment of the invention, a network service-based QS file processing method and a standard interactive interface are proposed for the QS file processing flow of a power grid. First, a POST request sent by a client is received, and the QS file in the request is stored in a temporary folder. Next, a QS container is constructed to parse the QS file to obtain actual measurement records, extract the QS timestamp, and integrate the power flow calculation information required to generate the power flow calculation file. Then, a DAT container is constructed to calculate the power flow information of each topology node in the DAT container based on the actual measurement records and power flow calculation information, and to allocate each power flow information to the corresponding topology node. The process involves acquiring generator information from the power grid, determining slack nodes based on this information, calculating the power flow output of the slack nodes, and correcting the power flow information based on the deviation between the calculated results and actual measurement records. Next, a global ID allocation rule is obtained from an index database, and a global ID is assigned to each power flow information entry in the DAT container according to this rule. Finally, an online model library corresponding to the QS timestamp is established, and all power flow information in the DAT container is stored in the online model library according to the global ID allocation rule. Upon completion of the execution process, the corresponding response code or error code is returned to the client, and the QS file in the temporary folder is deleted. By adopting this invention, online processing of QS files can be achieved based on network services. With the cooperation of various processing modules, POST requests sent by the client are processed in a timely manner, and results are output. Furthermore, the flexible configuration and use of the temporary folder solves the problems of data redundancy and data leakage that easily occur during data processing, making it more suitable for modern computer network technology.
[0090] For better illustration, refer to Figure 2 This diagram illustrates the overall flow of a QS file processing method provided by an embodiment of the present invention. It should be noted that the embodiments of the present invention only briefly describe the general flow of the QS file processing method in conjunction with the data processing flow. The specific implementation of each step can be referred to the relevant content of the foregoing embodiments. It is understood that the present invention does not impose any limitations on this.
[0091] (1) The client sends a POST request to the server. The POST request carries the QS file that needs to be processed. After receiving the POST request, the server stores the QS file in the created temporary folder and initializes the server configuration module with the data in the INDEX database.
[0092] (2) The server parses the QS file in the temporary directory to construct a highly structured QS container, obtains the actual measurement record, and extracts the QS timestamp from it.
[0093] (3) The server connects to the INDEX database and starts a session.
[0094] (4) Construct a DAT container and integrate all the power flow calculation information required to generate the power flow calculation file through the functions in the QS container.
[0095] (5) Based on Kirchhoff's current law, the unbalanced power and reactive power of each topology node in the DAT container are calculated using the actual measurement records of the QS container and then distributed as loads to the corresponding topology nodes.
[0096] (6) Obtain all generator sets in each synchronous AC power grid and select a suitable generator set as the balancing node.
[0097] Synchronous AC power grids are networks that transmit AC power, consisting of AC transmission lines and substations. In practical applications, both power generation and consumption in power systems are AC, and AC voltage conversion is convenient, making it suitable for power transmission over different distances and capacities. Synchronous power grids represent a fundamental principle of power grid development and offer significant advantages in terms of technology and economics.
[0098] (7) Output the power flow calculation file from the DAT container, call the power flow calculation module to perform power flow analysis, and correct the generator power flow information in each synchronization network in the DAT container based on the deviation between the power flow calculation results of the selected balanced generator set output and the actual measured record value of QS.
[0099] (8) Query the global ID allocation rules through the INDEX database session, and assign a global ID to each power flow information data in the DAT container according to the global ID allocation rules.
[0100] (9) Create an online-model-data database with QS timestamp as the suffix and insert all the power flow information in the DAT container into it.
[0101] (10) If all the above processes are executed successfully, return response code 200 to the client; otherwise, return the corresponding error code.
[0102] (11) The QS files stored in the temporary folder will be unconditionally deleted after the process is completed (regardless of whether the execution is successful or not) to prevent possible data leakage.
[0103] Reference Figure 3This diagram illustrates a structural block diagram of a QS file processing device provided by an embodiment of the present invention. The device is applied to a server, which is communicatively connected to an index database. Specifically, the device may include:
[0104] The POST request receiving module 301 is used to receive POST requests sent by the client and obtain the QS file corresponding to the POST request;
[0105] QS container construction module 302 is used to construct a QS container, which is used to parse the QS file to obtain actual measurement records, extract QS timestamps, and integrate the power flow calculation information required to generate the power flow calculation file.
[0106] DAT container construction module 303 is used to construct a DAT container, calculate the power flow information of each topology node in the DAT container based on the actual measurement records and the power flow calculation information, and allocate each power flow information to the corresponding topology node.
[0107] The power flow information correction module 304 is used to acquire generator set information of the power grid, determine the slack node based on the generator set information, calculate the power flow output of the slack node, and correct the power flow information based on the deviation between the power flow calculation result and the actual measurement record.
[0108] The global ID allocation rule acquisition module 305 is used to acquire global ID allocation rules through the index database. The global ID allocation rules are used to assign a global ID to each power flow information in the DAT container.
[0109] The online model library data storage module 306 is used to establish an online model library corresponding to the QS timestamp, and to store all power flow information in the DAT container into the online model library according to the global ID allocation rule.
[0110] In one optional embodiment, the global ID allocation rule acquisition module 305 is specifically used for:
[0111] Create a new query request session with the index database, and query the global ID allocation rules from the index database through the query request session.
[0112] In one optional embodiment, the server corresponds to a temporary folder, and the device further includes:
[0113] The temporary folder data storage module is used to store the QS file corresponding to the POST request into the temporary folder after obtaining the QS file. Then, the QS container is used to parse the QS file in the temporary folder to obtain the actual measurement record.
[0114] In one alternative embodiment, the device further includes:
[0115] The response code return module is used to return a corresponding response code to the client if all power flow information in the DAT container has been successfully stored in the online model library.
[0116] The error code return module is used to return the corresponding error code to the client if a storage failure occurs during the process of storing the power flow information into the online model library.
[0117] In one alternative embodiment, the device further includes:
[0118] The QS file deletion module is used to delete the QS files stored in the temporary folder after returning a response code or error code to the client.
[0119] In one optional embodiment, the server corresponds to a configuration module, which is used to configure parameters for the QS container and the DAT container. Then the method apparatus further includes:
[0120] The configuration module initialization setting module is used to initialize the configuration module using the basic configuration information in the index database.
[0121] In one alternative embodiment, the power flow information of each topology node includes the unbalanced power and reactive power of each topology node.
[0122] As the device embodiment is basically similar to the method embodiment, it is described in a relatively simple way. For relevant details, please refer to the description of the method embodiment above.
[0123] This invention also provides an electronic device, which includes a processor and a memory:
[0124] The memory is used to store program code and transfer the program code to the processor;
[0125] The processor is used to execute the QS file processing method of any embodiment of the present invention according to the instructions in the program code.
[0126] This invention also provides a computer-readable storage medium for storing program code for executing the QS file processing method of any embodiment of this invention.
[0127] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0128] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0129] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0130] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0131] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0132] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for processing QS documents in a power grid, characterized in that, Applied to a server, the server corresponds to a temporary folder and is communicatively connected to an index database; the method includes: Receive a POST request sent by the client, obtain the QS file corresponding to the POST request, and store the QS file in the temporary folder; A QS container is constructed, which is used to parse the QS files in the temporary folder to obtain actual measurement records, extract QS timestamps, and integrate the power flow calculation information required to generate power flow calculation files; Construct a DAT container, calculate the power flow information of each topology node in the DAT container based on the actual measurement records and the power flow calculation information, and allocate each power flow information to the corresponding topology node; Obtain generator set information of the power grid, determine the slack node based on the generator set information, calculate the power flow output of the slack node, and correct the power flow information of each topology node in the DAT container based on the deviation between the power flow calculation result of the slack node and the actual measurement record. The global ID allocation rule is obtained through the index database, and the global ID allocation rule is used to assign a global ID to each power flow information in the DAT container. Establish an online model library corresponding to the QS timestamp, and store all power flow information in the DAT container into the online model library according to the global ID allocation rule.
2. The QS file processing method according to claim 1, characterized in that, The step of obtaining the global ID allocation rules through the index database includes: Create a new query request session with the index database, and query the global ID allocation rules from the index database through the query request session.
3. The QS file processing method according to claim 1, characterized in that, Also includes: If all power flow information in the DAT container is successfully stored in the online model library, the corresponding response code is returned to the client. If the process of storing trend information into the online model library fails, the corresponding error code will be returned to the client.
4. The QS file processing method according to claim 3, characterized in that, Also includes: After returning a response code or error code to the client, delete the QS file stored in the temporary folder.
5. The QS document processing method according to claim 1, characterized in that, The server corresponds to a configuration module, which is used to configure parameters for the QS container and the DAT container. Therefore, before building the QS container, the method further includes: The configuration module is initialized using the basic configuration information in the index database.
6. The QS document processing method according to claim 1, characterized in that, The power flow information of each topology node includes the unbalanced power and reactive power of each topology node.
7. A QS document processing device for a power grid, characterized in that, The device is applied to a server, which corresponds to a temporary folder and is communicatively connected to an index database; the device includes: The POST request receiving module is used to receive POST requests sent by the client, obtain the QS file corresponding to the POST request, and store the QS file in the temporary folder; The QS container construction module is used to construct a QS container, which is used to parse the QS files in the temporary folder to obtain actual measurement records, extract QS timestamps, and integrate the power flow calculation information required to generate power flow calculation files. The DAT container construction module is used to construct a DAT container. Based on the actual measurement records and the power flow calculation information, it calculates the power flow information of each topology node in the DAT container and assigns each power flow information to the corresponding topology node. The power flow information correction module is used to acquire generator set information of the power grid, determine the slack node based on the generator set information, calculate the power flow output of the slack node, and correct the power flow information of each topology node in the DAT container based on the deviation between the power flow calculation result of the slack node and the actual measurement record. The global ID allocation rule acquisition module is used to acquire global ID allocation rules through the index database. The global ID allocation rules are used to assign a global ID to each power flow information in the DAT container. The online model library data storage module is used to establish an online model library corresponding to the QS timestamp, and to store all power flow information in the DAT container into the online model library according to the global ID allocation rule.
8. An electronic device, characterized in that, The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the QS file processing method according to any one of claims 1-6 according to the instructions in the program code.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program code for executing the QS file processing method according to any one of claims 1-6.