Disclosure of Invention
The invention aims to overcome the defects of the prior art, provides a power grid expected fault parallel analysis and calculation method based on file exchange, and improves the online analysis and calculation speed of a static safety analysis function.
The invention solves the practical problem by adopting the following technical scheme:
a power grid fault parallel analysis and calculation method based on file exchange comprises the following steps:
step 1, before calculation, establishing a task table, a calculation resource table and a system fault set; establishing computing resource information and computing task information according to the participating computing resource server;
step 2, running a total task scheduling process on a task scheduling server, adding a new power grid static safety analysis calculation total task in a task table when each round of static safety analysis function running period comes, decomposing the total task calculated according to expected faults of static safety analysis into a specific parallel calculation task of each calculation resource, writing the parallel calculation task into a calculation resource table, and preparing calculation data;
step 3, on the computing resource server, the computing resource daemon starts a corresponding computing resource computing process according to the task allocation state of each computing resource updated in the parallel computing resource table;
and 4, on the task scheduling server, when waiting for the next static security analysis calculation period to arrive, returning to execute the step 2.
Further, the specific steps of step 1 include:
(1-1) establishing a task table, comprising: the system comprises a task name, a task type, task starting personnel, a task computing module, a task computing function, task overtime time, a task computing family, a task current state, a task state change time scale, task starting time, task completion time, a task completion ratio and task current operation information;
(1-2) building a computing resource table, comprising: the resource calculation method comprises the following steps of resource name, resource server name, resource module function name, whether to be put into operation, resource calculation module process, resource calculation task state and resource current day failure times, wherein the resource calculation task state can be as follows: "idle", "release complete", "compute failure", "exception";
(1-3) establishing records of a computing resource table according to the number n of servers participating in parallel computing, wherein the records are recorded as a set R ═ { Ri, i ═ 1, …, n }, and n is the number of configured servers adopting the technology, namely the number of parallel computing resources; setting the resource task state of each computing resource REi to be idle initially;
(1-4) establishing a grid fault set according to the grid condition, wherein the grid fault set is recorded as NF (NFx, x is 1, …, n 2), and n2 is the maximum fault number;
further, the specific steps of step 2 include:
(2-1) firstly, generating a model file Fz for power grid load flow calculation, wherein the file comprises the connection relation of each branch in the power grid and load flow injection data of each node, and the model file is stored in a compression mode;
(2-2) scanning and checking the calculation resource table, finding out all resources with the resource task state set as 'free', recording the resources as a set RE ═ { REi, i ═ 1, …, n1}, wherein the total number of the resources is n 1;
(2-3) automatically generating n2 calculation subtasks according to the power grid fault set NF: and TF, TFj, j is 1, …, n2, and the distribution method is that according to the average distribution mode, the number of calculation faults borne by each calculation subtask is as follows: n3 ═ n2/n1+ 1; n3 number of computing failures assumed for each computing subtask; in order to generate a task file TFile of each computing subtask, the file is recorded as TFF { TFFj, j ═ 1, …, n2}, each file TFFj contains n3 faults, the file is recorded as TFFj-k, k ═ 1, …, n3, and the file adopts a text file described by an E language and contains resource state information and expected fault set information;
(2-4) performing task allocation on each computation subtask TFj in the set TF;
(2-5) scanning and checking the calculation resource table R, and judging the resource task state of each resource Ri in the table;
moreover, the specific steps of the step 2 (2-3) include:
(2-3-1) generating resource state information in the TFFj file, wherein the class name is calsc _ info and the attribute is described in the following table; each subtask corresponds to a line of data in the data block calsc _ info;
(2-3-2) generating an expected failure information class name flt _ info in the TFFj file, wherein the attribute is described in the following table; each expected failure TFFj-k corresponds to a row of data in the data block flt _ info;
moreover, the specific steps of the (2-4) th step of the step 2 include:
(2-4-1) scanning and checking the calculation resource table R, finding out a resource with a certain resource task state set as 'idle', and recording the resource as Ri;
(2-4-2) allocating the subtasks TFj to the computing resources Ri by: sending a load flow calculation model file Fz and a calculation file TFFj to a server for calculating the resource Ri, and setting the resource task state of the calculation resource Ri as 'release completion';
moreover, the specific steps of the (2-5) th step of the step 2 include:
(2-5-1) if the resource task state is 'calculation completion', recycling a resource Ri calculation result file FRsti, namely transmitting the result file FRsti to a task scheduling server, and displaying the content in each result file on a human-computer interface; after the result file FRsti is recovered, the resource task state of the resource Ri is set as 'idle';
(2-5-2) if the resource task state is 'computing failure', re-executing the step (2-4) of the step 2 on the subtask TFj allocated to the resource to re-allocate the computing task; meanwhile, accumulating the calculation failure times m of the resource Ri on the same day, and setting the calculation task state of the resource Ri to be idle when m is smaller than the specified failure time threshold value N; when m is larger than or equal to N, setting the state of the calculation task of the resource Ri to be abnormal, and enabling the resource Ri not to participate in the subsequent calculation task in the day any more;
further, the specific steps of step 3 include:
(3-1) judging the resource task state of the resource record Ri corresponding to the current server in the computing resource table, if the computing task state of the resource is 'release completion', starting a fault analysis computing process to compute, and executing the step (3-2) of the subsequent step 3; otherwise, no step is executed;
(3-2) reading in a newly received model file Fz of power grid load flow calculation to form a power grid calculation model;
(3-3) reading in the newly received task file TFFj, and for each failure TFFj-k, executing the following steps:
(3-3-1) simulating and setting the fault of the branch or the node in the power grid model;
(3-3-2) carrying out power grid load flow calculation, if the calculation is successful, executing the step (3-3-3), and if the calculation is failed, directly executing the step (3-6) of the step 3 and terminating the calculation;
(3-3-3) counting and recording branch and node out-of-limit conditions of the power grid after the fault according to the load flow calculation result to form a calculation result TFFRsti, and storing the calculation result TFFRsti into a memory table of the computer;
(3-3-4) restoring the branch and node states set by the fault to initial states;
(3-3-5) returning to the step 3-3-1) until all fault calculations are completed;
(3-4) after all the fault calculation is finished, generating a calculation result, and writing the calculation result into a calculation result file FRsti of the current calculation resource Ri;
(3-4-1) generating out-of-limit information of the fault-caused voltage, class name in the calculation result file Frsti: a fall _ v _ rst including the following attribute information; each fault causes the out-of-limit of the voltage to correspond to one record of the fall _ v _ rst data block;
(3-4-2) generating out-of-limit information of the branch caused by the fault in the calculation result file Frstill, class name: fall _ q _ rst, which contains the following attribute information; the out-of-limit of each branch caused by each fault corresponds to a record of a fall _ q _ rst data block;
(3-5) setting the resource task state of the computing resource Ri corresponding to the current server as 'computing completed', and returning to the (3-1) of the step (3);
and (3-6) after the calculation is failed, writing the calculation resource Ri corresponding to the current server into the calculation resource Ri, wherein the task state is 'calculation failure', and returning to the (3-1) in the step (3).
The invention has the advantages and beneficial effects that:
1. the invention relates to a power grid fault parallel analysis and calculation method based on file exchange. The human-computer interface is responsible for configuring data of the computing resource table and the task table; the task management is operated on a main server, the computing resource can be a plurality of servers, a fault analysis computing function is installed on each server, and the plurality of servers can realize parallel computing. The task management layer and the computing resource layer transmit interactive data through files, and meanwhile, the task management layer can also receive messages sent by the human-computer interface and respond to human-computer interaction. For the 'failure analysis' module, a task table shared by a network is used for driving a computing task, and input and output files are used as data interaction media. The method can shorten the total time of fault analysis calculation and improve the online analysis calculation speed of the static safety analysis function.
2. The invention defines the task table and the computing resource table in the memory of the task scheduling server, and defines the E file as the input and output data interaction medium, the task scheduling server uniformly distributes and issues the tasks, and simultaneously, a plurality of computing resource servers perform parallel computing, thereby greatly shortening the computing time; the online analysis and calculation speed of the static security analysis function is improved, and the minute-level calculation requirement is met; and then the stability of the power grid is improved.
Detailed Description
The embodiments of the invention will be described in further detail below with reference to the accompanying drawings:
the electric power system data markup language-E language specification (hereinafter referred to as "E language") is a novel and efficient electric power system data markup language which is formulated for the efficiency defect of a common data model (CIM) of an IEC 61970-301 electric power system on the basis of object-oriented abstraction and aims at the efficiency defect of the CIM when the CIM is described in an XML mode. The E language data file includes comments (optional), system declarations, data block start tags, data block header definitions, data blocks, data block end tags, and the like. Generally classified as class name definitions, attribute definitions, etc.; the national grid company enterprise standard Q-GDW-215-2008 power system data markup language-E language specification specifies the description mode of the E language, and the specific format is defined as follows:
1) note
Comments are an optional part of the E language, starting with a parallel-slash "//" guide. Annotations may appear anywhere in the data file, either as a separate line or as allowed at the back of the line.
2) System declarations
The system declaration of E language is located at the front end of the data block and is juxtaposed by a left angle bracket plus an exclamation mark "<! "guide Start, side by side with a sigh plus right braces! "end of mark". The name of the application system generating the data, the E language version, the character set and the data version are stated in the system declaration. The specific content within the tag is as follows:
a) system is an application System name. Refers to the name of the application system that generated the data.
b) Version ═ E language Version. Refers to the E language version used to encapsulate the data. Due to the development of the E language itself, grammar rules
And the symbol may be changed, this version information can be used for the difference of the program recognition language itself.
c) Code is the name of the character set. Refers to the character set used in this document.
d) Data is a version of the Data. The version of the data is referred to. Due to the change of application requirements, the packaging structure of the same type of data may be locally expanded, modified or simplified, and the version information can be used for program identification of slight differences of the data.
The above parts are divided by spaces and can be expanded according to the system condition. The following is a practical example of a system declaration: < | A! System 1.0 Code UTF-8 Data 1.0 | System SYS Version! < CHEM > A
3) Data block start and end
The start of the E language data block is represented by an angle bracket plus a horizontal slash in the angle bracket, wherein the angle bracket is used for indicating the start of the E language data block, and the angle bracket is used for indicating the end of the E language data block. In "class name:" entity name ", the former indicates the class of the data object in the data block, and the latter indicates the belonging object of the data in the data block.
4) Data block header definition
The data block header definition is marked with an address symbol "@" for indicating the basic structure of the data: i.e. a cross-table type, a single-row type or a multi-row type. The specific notation of the data block header definition is as follows: the single address character "@" represents that the basic structure of the data is in a horizontal table form, and the syntax is as follows: @ serial number attribute name 1 attribute name 2 attribute name 3 … "@", serial number, and space division among attribute names may be used, the serial number may be represented by a data ID (the same applies hereinafter), and the processing manner of the single-column and multi-column structure with respect to the serial number is similar. Each object in the data block of the horizontal table type structure occupies one row, and each attribute occupies one column, so that the data block is suitable for table type data or data with fewer attributes and more objects.
5) Data block
The data block is composed of a plurality of data lines, each of which is guided by a pound sign "#". Each data value in the data line is divided by a space. The expression mode of the data line corresponds to the definition of the data block head one by one. The first column of data blocks is always followed by a "#" followed by one or more spaces, which are followed by a sequence number, e.g., "# 10", to make the sequence number a single column. The sequence number indicates the order of the line data in the data block, starting with a 1. The sequence number is followed by a space before the sequence of data values begins.
The text interaction in the invention adopts E language description, and the data block definition adopts a horizontal table type, namely each class is a table, and each table has different attributes.
A power grid fault parallel analysis and calculation method based on file exchange comprises the following steps:
step 1, before calculation, establishing a task table, a calculation resource table and a system fault set; the task table and the computing resource table are established in a memory of the server, and other resource servers can access data in the task table and the computing resource table through network interfaces; establishing computing resource information and computing task information according to the participating computing resource server;
the specific steps of the step 1 comprise:
(1-1) creating a TASK table (DEF _ TASK) including: task name, task type (automatic calculation and manual calculation), task starting personnel, task calculation module, task calculation function, task overtime time, task calculation family, task current state, task state change time scale, task starting time, task completion ratio and task current operation information;
(1-2) building a computation resource table (DEF _ CALSC) comprising: the resource calculation method comprises the following steps of resource name, resource server name, resource module function name, whether to be put into operation, resource calculation module process, resource calculation task state and resource current day failure times, wherein the resource calculation task state can be as follows: "idle", "release complete", "compute failure", "exception";
(1-3) establishing records of a computing resource table according to the number n of servers participating in parallel computing, wherein the records are recorded as a set R ═ { Ri, i ═ 1, …, n }, and n is the number of configured servers adopting the technology, namely the number of parallel computing resources; setting the resource task state of each computing resource REi to be idle initially;
(1-4) establishing a grid fault set according to the grid condition, wherein the grid fault set is recorded as NF (NFx, x is 1, …, n 2), and n2 is the maximum fault number;
step 2, running a total task scheduling process on a task scheduling server, adding a new power grid static safety analysis calculation total task in a task table when each round of static safety analysis function running period comes, decomposing the total task calculated according to expected faults of static safety analysis into a specific parallel calculation task of each calculation resource, writing the parallel calculation task into a calculation resource table, and preparing calculation data;
as shown in fig. 1, the specific steps of step 2 include:
(2-1) firstly, generating a model file Fz for power grid load flow calculation, wherein the file comprises the connection relation of each branch in the power grid and load flow injection data of each node, and the model file is stored in a compression mode;
(2-2) scanning and checking the calculation resource table, finding out all resources with the resource task state set as 'free', recording the resources as a set RE ═ { REi, i ═ 1, …, n1}, wherein the total number of the resources is n 1;
(2-3) automatically generating n2 calculation subtasks according to the power grid fault set NF: and TF, TFj, j is 1, …, n2, and the distribution method is that according to the average distribution mode, the number of calculation faults borne by each calculation subtask is as follows: n3 ═ n2/n1+ 1; n3 number of computing failures assumed for each computing subtask; in order to generate a task file TFile of each computing subtask, the file is recorded as TFF { TFFj, j ═ 1, …, n2}, each file TFFj contains n3 faults, the file is recorded as TFFj-k, k ═ 1, …, n3, and the file adopts a text file described by an E language and contains resource state information and expected fault set information;
the step 2, the step (2-3) comprises the following specific steps:
(2-3-1) generating resource state information in the TFFj file, a class name (calsc _ info), and attributes described in the following table; each subtask corresponds to a line of data in the data block calsc _ info;
serial number
|
Properties
|
Data type
|
Description of the invention
|
1
|
Resource module name
|
Character string
|
|
2
|
Resource status
|
Shaping of
|
|
3
|
Current computing task ID
|
Long plastic
|
|
4
|
Current computing task function
|
Character string
|
|
5
|
Current computing task start time
|
Shaping of
|
|
6
|
Current computing task end time
|
Shaping of
|
|
7
|
Current computing task completion ratio
|
Floating point type
|
|
(2-3-2) generating an expected failure information class name (flt _ info) in the TFFj file, the attributes of which are described in the following table; each expected failure TFFj-k corresponds to a row of data in the data block flt _ info;
(2-4) performing task allocation on each computation subtask TFj in the set TF;
the specific steps of the (2-4) step of the step 2 comprise:
(2-4-1) scanning and checking the calculation resource table R, finding out a resource with a certain resource task state set as 'idle', and recording the resource as Ri;
(2-4-2) allocating the subtasks TFj to the computing resources Ri by: sending a load flow calculation model file Fz and a calculation file TFFj to a server for calculating the resource Ri, and setting the resource task state of the calculation resource Ri as 'release completion';
(2-5) scanning and checking the calculation resource table R, and judging the resource task state of each resource Ri in the table;
the specific steps of the (2) th step to the (5) th step of the step 2 comprise:
(2-5-1) if the resource task state is 'calculation completion', recycling a resource Ri calculation result file FRsti, namely transmitting the result file FRsti to a task scheduling server, and displaying the content in each result file on a human-computer interface (see step 3) for a result file format); after the result file FRsti is recovered, the resource task state of the resource Ri is set as 'idle';
(2-5-2) if the resource task state is 'computing failure', re-executing the step (2-4) of the step 2 on the subtask TFj allocated to the resource to re-allocate the computing task; meanwhile, accumulating the calculation failure times m of the resource Ri on the same day, and setting the calculation task state of the resource Ri to be idle when m is smaller than the specified failure time threshold value N; when m is larger than or equal to N, setting the state of the calculation task of the resource Ri to be abnormal, and enabling the resource Ri not to participate in the subsequent calculation task in the day any more;
and 3, on the computing resource server, starting the corresponding computing resource computing process by the computing resource daemon according to the task allocation state of each computing resource updated in the parallel computing resource table.
As shown in fig. 2, the specific steps of step 3 include:
(3-1) judging the resource task state of the resource record Ri corresponding to the current server in the computing resource table, if the computing task state of the resource is 'release completion', starting a fault analysis computing process to compute, and executing the step (3-2) of the subsequent step 3; otherwise, no step is executed;
(3-2) reading in a newly received model file Fz of power grid load flow calculation to form a power grid calculation model;
(3-3) reading in the newly received task file TFFj, and for each failure TFFj-k, executing the following steps:
(3-3-1) simulating and setting the fault of the branch or the node in the power grid model;
(3-3-2) carrying out power grid load flow calculation, if the calculation is successful, executing the step (3-3-3), and if the calculation is failed, directly executing the step (3-6) of the step 3 and terminating the calculation;
(3-3-3) counting and recording branch and node out-of-limit conditions of the power grid after the fault according to the load flow calculation result to form a calculation result TFFRsti, and storing the calculation result TFFRsti into a memory table of the computer;
(3-3-4) restoring the branch and node states set by the fault to initial states;
(3-3-5) returning to the step 3-3-1) until all fault calculations are completed.
(3-4) after all the fault calculation is finished, generating a calculation result, and writing the calculation result into a calculation result file FRsti of the current calculation resource Ri;
(3-4-1) generating out-of-limit information of the fault-caused voltage, class name in the calculation result file Frsti: a fall _ v _ rst including the following attribute information; each fault causes the out-of-limit of the voltage to correspond to one record of the fall _ v _ rst data block;
serial number
|
Properties
|
Data type
|
Description of the invention
|
1
|
Fault ID
|
Long plastic
|
|
2
|
Name of failure
|
Character string
|
|
3
|
The upper limit of bus bar quantity caused by fault
|
Shaping of
|
|
4
|
Maximum-over-limit bus name
|
Character string
|
|
5
|
Maximum and maximum bus voltage
|
Floating point type
|
|
6
|
Lower limit of bus number caused by fault
|
Shaping of
|
|
7
|
Lowest-lower limit bus name
|
Character string
|
|
8
|
Lowest lower limit bus voltage value
|
Floating point type
|
|
(3-4-2) generating out-of-limit information of the branch caused by the fault in the calculation result file Frstill, class name: fall _ q _ rst, which contains the following attribute information; each failure causes the violation of a branch to correspond to a record of the fall _ q _ rst data block.
Serial number
|
Properties
|
Data type
|
Description of the invention
|
1
|
Fault ID
|
Long plastic
|
|
2
|
Name of failure
|
Character string
|
|
3
|
Out-of-limit number of branches caused by fault
|
Shaping of
|
|
4
|
Highest-over-bound branch name
|
Character string
|
|
5
|
Maximum upper limit branch load flow active value
|
Floating point type
|
|
6
|
Maximum upper limit branch load flow reactive value
|
Floating point type
|
|
(3-5) setting the resource task state of the computing resource Ri corresponding to the current server as 'computing completed', and returning to the (3-1) of the step (3);
(3-6) after the calculation is failed, writing the calculation resource Ri task state of the calculation resource Ri corresponding to the current server into the calculation resource Ri, namely 'calculation failure', and returning to the (3-1) in the step (3);
and 4, on the task scheduling server, when waiting for the next static security analysis calculation period to arrive, returning to execute the step 2.
The working principle of the invention is as follows:
the invention provides a power grid fault parallel analysis and calculation method based on file exchange, which defines a task table and a calculation resource table in a task scheduling server memory, uniformly distributes and issues tasks by defining an E file as an input and output data interaction medium, and simultaneously performs parallel calculation by a plurality of calculation resource servers, thereby greatly shortening the calculation time; the online analysis and calculation speed of the static security analysis function is improved, and the minute-level calculation requirement is met; and then the stability of the power grid is improved.
It should be emphasized that the examples described herein are illustrative and not restrictive, and thus the present invention includes, but is not limited to, those examples described in this detailed description, as well as other embodiments that can be derived from the teachings of the present invention by those skilled in the art and that are within the scope of the present invention.