A test case generation method and system for relay protection device
By parsing the SCD file of the relay protection device and generating test cases, and using rule scripts to automatically fill in the logical nodes, the problems of time-consuming and error-prone test case editing are solved, and efficient and accurate test case generation is achieved.
Patent Information
- Application Number
- CN202310218764.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-08
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2043-03-08
AI Technical Summary
In the existing relay protection device testing method, test case editing is time-consuming and inefficient, prone to errors, and difficult to achieve full logic coverage.
By reading the rule script, parsing the SCD file of the relay protection device under test, generating test cases, and using the rule script to automatically fill in the missing logical nodes in the test case information, including the logical relationship between the set value, analog quantity and protection action, the test case is generated.
It improves the efficiency of test case editing, ensures complete logic coverage, reduces manual editing time, and reduces error rates.
Smart Images

Figure CN116340153B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of relay protection device testing, and in particular relates to a test case generation method and system for a relay protection device. Background Art
[0002] When testing a relay protection device, it is usually necessary to first generate a script corresponding to the test case for the device under test and import it into the corresponding tester. The tester executes the corresponding data of the test case and determines whether the test passes based on the execution result.
[0003] Traditionally, testing or inspecting relay protection devices involves manually editing test cases, performing manual or automatic testing or inspections based on the protection logic for each specific relay protection device. This means that existing testing methods, whether manual or automated, cannot avoid the complex editing of test cases, which is time-consuming and inefficient. Furthermore, manual editing is prone to errors when dealing with complex protection logic and parameters, making it difficult to achieve full coverage of the logic. Summary of the Invention
[0004] The purpose of the present invention is to provide a test case generation method and system for a relay protection device, which is used to solve the problems that the test case editing used in the existing relay protection device testing is time-consuming, inefficient and prone to errors.
[0005] To achieve the above object, the present invention provides a test case generation method for a relay protection device, comprising the following steps:
[0006] 1) Read the rule script, where each rule in the rule script includes a fixed value setting, a soft pressure plate state setting that satisfies the action condition, a protection action condition logic formula, and analog channel setting information; the protection action condition logic formula includes the logical relationship between the fixed value and the analog quantity;
[0007] Parse the SCD file of the relay protection device under test and match the rules in the rule script with the SCD file of the relay protection device under test to obtain the constant value settings corresponding to each logical node in the SCD file of the relay protection device under test, as well as the soft pressure plate state settings that meet the action conditions, the protection action condition logic formula, and the device connection information;
[0008] 2) Calculate the corresponding truth table based on the obtained protection action condition logic formula of the logical node;
[0009] 3) According to the constant value settings corresponding to the logical nodes and the contents in the truth table corresponding to the inequality terms in the protection action condition logic formula, the values of the various analog quantities that meet the inequality terms in the protection action condition logic formula are reversed, and the corresponding tester analog quantity state sequence file is generated according to the obtained values of the various analog quantities;
[0010] 4) Combine the fixed value settings corresponding to the logical nodes, the soft pressure plate state settings that meet the action conditions and / or do not meet the action conditions, the protection action and protection output settings, the tester configuration file and the tester analog state sequence file to generate a test case;
[0011] The tester configuration file is generated according to the analog channel setting information and the device connection information in the SCD file of the relay protection device under test;
[0012] The protection action and protection exit settings include protection action information obtained in the logical node of the SCD file and protection exit setting information obtained in the rule script.
[0013] The beneficial effects of the above technical solution are: for different relay protection devices under test and the same protection function, a set of rule scripts are abstractly formulated, and when calling the SCD file of the relay protection device to be tested to generate a test case, the rule script is used to automatically fill in the other missing items required for the logical node in the test case information to generate the test case, including the protection action condition logic (the logical relationship between the set value, analog quantity and protection action), soft pressure plate information, analog value, etc., which is equivalent to automatically editing the test case, which can effectively reduce the test case editing time and improve the test case editing efficiency; and, through the protection action condition logic formula, a corresponding logic formula truth table is obtained to represent each test case. Each row of the logic formula truth table represents a use case, and the entire truth table content can meet the full coverage of the test logic.
[0014] Furthermore, the fixed value setting includes an action time error, a fixed value error, an input value time setting, and an action fixed value setting; the input value time setting includes a normal state duration and a fault state duration of the relay protection device; the fixed value error is an error corresponding to the action fixed value setting, and the action time error is an error corresponding to the input value time setting;
[0015] The method for inferring the values of each analog quantity that meets the inequality terms in the protection action condition logic formula is: to find the values of at least one group of each analog quantity, so that the values of each analog quantity still meet the inequality terms in the protection action condition logic formula when the action time error and / or fixed value error corresponding to the input value time setting and / or action fixed value setting take the maximum value.
[0016] The beneficial effects of the above technical solution are: considering the error corresponding to the fixed value, it can ensure that the value of the analog quantity obtained is not affected by the error when the protection action is judged, and even when the fixed value error is the largest, it can correctly reflect the logical relationship between the analog quantity and the fixed value, so that the relay protection can operate correctly, avoiding the situation where the analog quantity value meets the protection action condition but the trigger fails due to the error in the fixed value.
[0017] Furthermore, each rule in the rule script also includes constraints on the rule name, logical node type, protection function description, and relay protection device IED name; the rules in the rule script are matched with the SCD file of the relay protection device under test in the following manner:
[0018] Traverse the logical nodes of the SCD file of the relay protection device under test, find the logical node that meets the restrictions of the logical node type, protection function description and relay protection device IED name in a certain rule, match the logical node with the satisfied rule, and use the fixed value setting and analog quantity setting corresponding to the rule, as well as the soft pressure plate state setting that meets the action condition, the protection action condition logic formula and the device connection information as the fixed value setting and analog quantity setting corresponding to the logical node, as well as the soft pressure plate state setting that meets the action condition, the protection action condition logic formula and the device connection information.
[0019] The beneficial effects of the above technical solution are: the rule script defines different rules in the rule script with logical node type, protection function description, and IED name as restrictions, which not only realizes the universality of the rules, but also meets the high customization of the uniqueness of the protection rules of special devices, and is also convenient for matching with the SCD file logical nodes of the relay protection device under test.
[0020] Furthermore, when matching the logic node with the satisfied rule, if the constant corresponding to the satisfied rule is not found in the logic node, the formula optimization is performed, and the logic formula corresponding to the constant is removed from the protection action condition logic formula to obtain a new protection action condition logic formula for the logic node for calculating the truth table.
[0021] The beneficial effect of the above technical solution is: eliminating the interference of fixed values that do not exist in the logical node, thereby avoiding the interference from affecting the result of the protection action condition logic formula.
[0022] Furthermore, the generated test cases are saved using XML scripts.
[0023] The present invention also provides a test case generation system for a relay protection device, comprising a processor, wherein the processor is configured to execute program instructions to implement the following steps:
[0024] 1) Read the rule script, where each rule in the rule script includes a fixed value setting, a soft pressure plate state setting that satisfies the action condition, a protection action condition logic formula, and analog channel setting information; the protection action condition logic formula includes the logical relationship between the fixed value and the analog quantity;
[0025] Parse the SCD file of the relay protection device under test and match the rules in the rule script with the SCD file of the relay protection device under test to obtain the constant value settings corresponding to each logical node in the SCD file of the relay protection device under test, as well as the soft pressure plate state settings that meet the action conditions, the protection action condition logic formula, and the device connection information;
[0026] 2) Calculate the corresponding truth table based on the obtained protection action condition logic formula of the logical node;
[0027] 3) According to the constant value settings corresponding to the logical nodes and the contents in the truth table corresponding to the inequality terms in the protection action condition logic formula, the values of the various analog quantities that meet the inequality terms in the protection action condition logic formula are reversed, and the corresponding tester analog quantity state sequence file is generated according to the obtained values of the various analog quantities;
[0028] 4) Combine the fixed value settings corresponding to the logical nodes, the soft pressure plate state settings that meet the action conditions / or do not meet the action conditions, the protection action and protection output settings, the tester configuration file and the tester analog state sequence file to generate a test case;
[0029] The tester configuration file is generated according to the analog channel setting information and the device connection information in the SCD file of the relay protection device under test;
[0030] The protection action and protection exit settings include protection action information obtained in the logical node of the SCD file and protection exit setting information obtained in the rule script.
[0031] The beneficial effects of the above technical solution are: for different relay protection devices under test and the same protection function, a set of rule scripts are abstractly formulated, and when calling the SCD file of the relay protection device to be tested to generate a test case, the rule script is used to automatically fill in the other missing items required for the logical node in the test case information to generate the test case, including the protection action condition logic (the logical relationship between the set value, analog quantity and protection action), soft pressure plate information, analog value, etc., which is equivalent to automatically editing the test case, which can effectively reduce the test case editing time and improve the test case editing efficiency; and, through the protection action condition logic formula, a corresponding logic formula truth table is obtained to represent each test case. Each row of the logic formula truth table represents a use case, and the entire truth table content can meet the full coverage of the test logic.
[0032] Furthermore, the fixed value setting includes an action time error, a fixed value error, an input value time setting, and an action fixed value setting; the input value time setting includes a normal state duration and a fault state duration of the relay protection device; the fixed value error is an error corresponding to the action fixed value setting, and the action time error is an error corresponding to the input value time setting;
[0033] The method for inferring the values of each analog quantity that meets the inequality terms in the protection action condition logic formula is: to find the values of at least one group of each analog quantity, so that the values of each analog quantity still meet the inequality terms in the protection action condition logic formula when the action time error and / or fixed value error corresponding to the input value time setting and / or action fixed value setting take the maximum value.
[0034] The beneficial effects of the above technical solution are: considering the error corresponding to the fixed value, it can ensure that the value of the analog quantity obtained is not affected by the error when the protection action is judged, and even when the fixed value error is the largest, it can correctly reflect the logical relationship between the analog quantity and the fixed value, so that the relay protection can operate correctly, avoiding the situation where the analog quantity value meets the protection action condition but the trigger fails due to the error in the fixed value.
[0035] Furthermore, each rule in the rule script also includes constraints on the rule name, logical node type, protection function description, and relay protection device IED name; the rules in the rule script are matched with the SCD file of the relay protection device under test in the following manner:
[0036] Traverse the logical nodes of the SCD file of the relay protection device under test, find the logical node that meets the restrictions of the logical node type, protection function description and relay protection device IED name in a certain rule, match the logical node with the satisfied rule, and use the fixed value setting and analog quantity setting corresponding to the rule, as well as the soft pressure plate state setting that meets the action condition, the protection action condition logic formula and the device connection information as the fixed value setting and analog quantity setting corresponding to the logical node, as well as the soft pressure plate state setting that meets the action condition, the protection action condition logic formula and the device connection information.
[0037] The beneficial effects of the above technical solution are: the rule script defines different rules in the rule script with logical node type, protection function description, and IED name as restrictions, which not only realizes the universality of the rules, but also meets the high customization of the uniqueness of the protection rules of special devices, and is also convenient for matching with the SCD file logical nodes of the relay protection device under test.
[0038] Furthermore, when matching the logic node with the satisfied rule, if the constant corresponding to the satisfied rule is not found in the logic node, the formula optimization is performed, and the logic formula corresponding to the constant is removed from the protection action condition logic formula to obtain a new protection action condition logic formula for the logic node for calculating the truth table.
[0039] The beneficial effect of the above technical solution is: eliminating the interference of fixed values that do not exist in the logical node, thereby avoiding the interference from affecting the result of the protection action condition logic formula.
[0040] Furthermore, the generated test cases are saved using XML scripts. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A flowchart of a test case generation method for a relay protection device according to an embodiment of the test case generation method for a relay protection device of the present invention;
[0042] Figure 2 Schematic diagram of a rule script corresponding to the high-zero current I section 1 time limit protection function of a transformer protection device in an embodiment of a test case generation method for a relay protection device of the present invention;
[0043] Figure 3 This is a schematic diagram of the logical node information of the SCD file of the relay protection device model under test in an embodiment of the test case generation method for a relay protection device of the present invention;
[0044] Figure 4 A schematic diagram of device connection information of an SCD file of a relay protection device model under test in an embodiment of a test case generation method for a relay protection device of the present invention;
[0045] Figure 5 A schematic diagram of voltage connection information for item A on the high-voltage side of the SCD file of the relay protection device model under test in an embodiment of the test case generation method for the relay protection device of the present invention;
[0046] Figure 6 This is a schematic diagram of a test case corresponding to the high-zero current I section 1 time limit protection function of a transformer protection device in an embodiment of a test case generation method for a relay protection device of the present invention;
[0047] Figure 7 A schematic diagram of a test case saved using an XML script in an embodiment of a test case generation method for a relay protection device of the present invention;
[0048] Figure 8 This is a flowchart of the execution of test cases when testing is performed in an embodiment of the test case generation method for a relay protection device of the present invention. DETAILED DESCRIPTION
[0049] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings and embodiments.
[0050] Example of a test case generation method for a relay protection device:
[0051] This embodiment provides a technical solution for a test case generation method for a relay protection device. Figure 1 ,The test case generation method mainly includes the following steps:
[0052] 1) Read the rule script. Each rule in the rule script includes a fixed value setting, a soft pressure plate state setting that meets the action conditions, a protection action condition logic formula, device connection information, and analog channel setting information; the protection action condition logic formula includes the logical relationship between the fixed value and the analog quantity; and parse the SCD file of the relay protection device under test, and match the rules in the rule script with the SCD file of the relay protection device under test to obtain the fixed value setting corresponding to each logical node in the SCD file of the relay protection device under test, as well as the soft pressure plate state setting that meets the action conditions, the protection action condition logic formula, and the device connection information.
[0053] In existing IEC61850 engineering relay protection application models, the logical node (LN) modeling principles in the SCD file require that each minimum functional unit of communication be modeled as an LN object. Data and data attributes belonging to the same functional object should be placed within the same LN object. The LN is the smallest functional unit completed by the IED itself, and each protection type, such as overcurrent protection (PTOC) and overvoltage protection (PTOV), is uniformly calibrated. Each LN contains common logical node information, status information, and setting information. For example, the information contained in the overcurrent protection (PTOC) node is shown in Table 1, including information such as action, action setting, action time setting, and control word setting.
[0054] Table 1 Overcurrent protection PTOC node information
[0055]
[0056]
[0057] Typically, a test case for a relay protection device should include pressure plate setting control information, input values that meet the action conditions (analog quantities such as current and voltage), action status information, and output information. However, the logical node (LN) in the SCD file only contains information such as the action, action setting, action time setting, and control word setting. It lacks soft pressure plate information and the logical relationship between setting, analog quantity, and protection action. To fill the missing logical node (LN) items in the test case information, this embodiment abstractly develops a set of rule scripts for different relay protection devices under test and the same protection function. Among them, the rule script defines different rules in the rule script with the logical node type, protection function description, and IED name as constraints (restrictions), which not only achieves the universality of the rules but also satisfies the high degree of customization of the uniqueness of the protection rules of special devices. Therefore, this embodiment can find the logical nodes in the SCD model file that meet the logical node, function description, and IED name rule constraints in the rule script by traversing the SCD model file logical nodes to match the corresponding pressure plate, set value, and analog quantity relationship. Specifically, the rules in the rule script are matched with the SCD file of the relay protection device under test in the following manner:
[0058] Traverse the logical nodes of the SCD model file and find the logical node that meets the restrictions of the logical node type, protection function description and relay protection device IED name in a certain rule, match the logical node with the satisfied rule, and use the fixed value setting and analog quantity setting corresponding to the rule, as well as the soft pressure plate state setting that meets the action condition, the protection action condition logic formula and the device connection information as the fixed value setting and analog quantity setting corresponding to the logical node, as well as the soft pressure plate state setting that meets the action condition, the protection action condition logic formula and the device connection information.
[0059] In this embodiment, the rule script is implemented in XML text; the node interpretation (i.e., the content of each rule in the script) is as follows:
[0060] Rule_name: rule name;
[0061] LN_typeLN: logical node type;
[0062] Constraintdec: protection function description, which can contain multiple;
[0063] IED_name: relay protection device IED name, can contain multiple;
[0064] do_RE: relative error of action time;
[0065] do_MAE: action time absolute error;
[0066] DZ_RE: fixed value relative error;
[0067] DZ_MAE: fixed absolute error;
[0068] good_time: duration of the relay protection device in normal state (to eliminate faults such as CT disconnection and test the device in normal state);
[0069] err_time: duration of the relay protection device fault state, which is the minimum value to meet the conditions and is actually increased according to the test case;
[0070] StrVal: action setting value;
[0071] RULE_Jumper: Soft jumper setting information, including name and status that meets action conditions;
[0072] RULE_math: describes the logical formula of the protection logic, which consists of analog quantity, logical node reference, and logical relationship;
[0073] RULE_connect: analog channel setting information (including two sets of voltage and current), as well as tester output information;
[0074] In this embodiment, taking the high zero current I section 1 time limit protection function of the transformer protection device as an example, the rule script is as follows: Figure 2 The specific meanings are as follows:
[0075] Rule name: Transformer;
[0076] Node type: PTOC;
[0077] Applicable protection function description: high zero current I stage 1 time limit, high zero current I stage 2 time limit, high zero current I stage 3 time limit, high zero current II stage 1 time limit, high zero current II stage 2 time limit, high zero current II stage 3 time limit, high zero current III stage 1 time limit, high zero current III stage 2 time limit;
[0078] Applicable device: "Transformer protection device";
[0079] The relative error of the action value is 2.5 (percentage), and the absolute error of the action value is 40;
[0080] The relative error of the fixed value is 2.5 (percentage), and the absolute error of the fixed value is 0.01;
[0081] The normal state lasts for 1000ms, and the fault state lasts for 1000ms;
[0082] The high zero-sequence overcurrent stage I constant is set to 0.5 (if the setting of this constant is defaulted in the rule script, it will be automatically calculated and generated when it is used);
[0083] Soft pressure plate settings that meet the action conditions: high-voltage side backup protection soft pressure plate - throw; high-voltage side voltage soft pressure plate - throw; high-voltage side voltage SV receiving soft pressure plate - throw;
[0084] Protection action condition logic formula: "(~ZroACalEna AND (Enable AND (Ia'_F>StrVal) AND (err_time>OpDlTmms))) or (ZroACalEna AND (Enable AND (sqrt((Ia_F*sin(Ia_A)+Ib_F*sin(Ib_A)+Ic_F*sin(Ic_A))^2+(Ia_F*cos(Ia_A)+Ib_F*cos(Ib_A)+Ic_F*cos(Ic_A))^2)>StrVal) AND (err_time>OpDlTmms)))";
[0085] The corresponding protection action condition logic formula for this protection action condition is: when self-generated zero current is not used, the high-voltage side zero-sequence current exceeds the high zero-sequence overcurrent stage I setting and persists for 1000ms; when self-generated zero current is used, the protection action condition occurs when the self-generated zero current exceeds the high zero-sequence overcurrent stage I setting and persists for 1000ms. The meanings of the settings "ZroACalEna, Enable, StrVal, OpDlTmms" are shown in Table 1. The action value in the above rule script actually refers to the action time, and the action value absolute error refers to the absolute error in the action time.
[0086] Device connection information (i.e., the virtual wiring method between the relay protection device under test and the tester): Ia = "HV1 side Phase A current", Ib = "HV1 side Phase B current", Ic = "HV1 side Phase C current", Ia1 = "HV side zero-sequence current", Ib1 = "", Ic1 = "", Va = "HV side Phase A voltage", Vb = "HV side Phase B voltage", Vc = "HV side Phase C voltage", Va1 = "", Vb1 = "", Vc1 = "", output_id = "1".
[0087] Among them, voltage and current related parameters such as Ia and Vb represent the output current and voltage of the tester, and output_id indicates that the tester output is set to port 1, that is, the port where the tester sends analog information of protection action is set to port 1.
[0088] It can be seen that in this embodiment, the fixed value setting includes the action time error, the fixed value error, the input value time setting, and the action fixed value setting; the input value time setting includes the normal state duration and the fault state duration of the relay protection device; the fixed value error is the error corresponding to the action fixed value setting, and the action time error is the error corresponding to the input value time setting;
[0089] according to Figure 2 The logic of the rule script shown and Figure 3 As shown in the LN node in the SCD file data model of the device under test, when the rules in the rule script are matched with the SCD file of the relay protection device under test, various constants such as "StrVal" are uniformly matched by name, where the protection action event corresponds to "high zero current I section 1 time limit", StrVal corresponds to the high zero sequence overcurrent I section constant, OpDlTmms corresponds to the high zero sequence overcurrent I section 1 time limit (constant), ZroACalEna corresponds to the high zero sequence overcurrent I section using self-generated zero current, and Enable corresponds to the high zero sequence overcurrent I section 1 time limit (control word).
[0090] If the constant corresponding to the satisfied rule is not found in the logic node, then the logic section is considered invalid. The logic section is discarded and the formula optimization is performed. The logic formula corresponding to the constant is removed from the protection action condition logic formula to obtain a new protection action condition logic formula for the logic node for subsequent calculations; for example, for the protection action condition logic formula "(~ZroACalEna and (Enable and (Ia'_F>StrVal) and (err_time>OpDlTmms)))", if the constant "ZroACalEna" in the rule script is not found in the SCD model node, the formula optimization is performed to remove the logic formula corresponding to the constant "ZroACalEna", and the new protection action condition logic formula is "Enable and (Ia'_F>StrVal) and (err_time>OpDlTmms)".
[0091] This embodiment also parses the analog quantity information in the device connection information of the SCD file of the relay protection device under test into a tester configuration file (.csg file) according to the analog quantity channel setting information in the rule script. For example, Va (the first group A voltage of the tester) is connected to the high voltage side A phase current, according to the following example: Figure 4 The device connection information in the SCD file of the relay protection device model shown in the figure, "intAddr="3-B:PISV / SVINGGIO1.SvIn1"" under the Inputs node indicates the second port of the third plug-in, which is connected to the first line of this group of SVs; and referring to Figure 5 The high-side A voltage connection of SVIN_GGIO1.SvIn1 corresponds to the short address information "sAddr="ISV680:B01.Run8006.CDin9.RLT01091F46"", where "1F46" represents the APPID number of the connected SV. One APPID number represents a group of SVs, which generates the tester configuration file (.csg file).
[0092] 2) Calculate the corresponding truth table based on the obtained protection action condition logic formula of the logical node;
[0093] Convert the fixed value, control word, calculation formula and inequality in the optimized new protection action condition logic formula into each node and calculate the truth table. Figure 2 The logic of the rule script shown and Figure 3 The logic formula of the LN node in the SCD file data model of the device under test does not need to be optimized. After the protection action condition logic formula is converted, the resulting logic formula "(|A&(B&C&D))||(A&(B&E&D))" has the following meaning:
[0094] "|" means logical NOT, "&" means logical AND, and "||" means logical OR;
[0095] A stands for "ZroACalEna", which means "high zero sequence overcurrent stage I adopts self-generated zero current";
[0096] B stands for "Enable", i.e. "High zero sequence overcurrent I stage 1 time limit (control word)";
[0097] C means "(Ia'_F>StrVal)", that is, "high-voltage side zero-sequence current" is greater than "high zero-sequence overcurrent I stage set value";
[0098] D means "(err_time>OpDlTmms)", that is, the fault duration is greater than "high zero sequence overcurrent I stage 1 time limit (fixed value)";
[0099] E represents the formula "(sqrt((Ia_F*sin(Ia_A)+Ib_F*sin(Ib_A)+Ic_F*sin(Ic_A))^2+(Ia_F*cos(Ia_A)+Ib_F*cos(Ib_A)+Ic_F*cos(Ic_A))^2)>StrVal)", which means that the "self-generated zero-sequence current" is greater than the "high zero-sequence overcurrent I stage setting"; when the logical formula "(|A&(B&C&D))||(A&(B&E&D))" is 1, it is determined that the protection action condition is met.
[0100] In this embodiment, the truth table corresponding to the calculated logical formula "(|A&(B&C&D))||(A&(B&E&D))" is shown in Table 2 below:
[0101] Table 2 Logical formula truth table
[0102]
[0103]
[0104] 3) According to the constant value setting corresponding to the logical node and the content in the truth table corresponding to the inequality term in the protection action condition logic formula, the values of each analog quantity that meets the inequality term condition in the protection action condition logic formula are reversed, and the corresponding tester analog quantity state sequence file is generated according to the obtained values of each analog quantity; wherein, the method of reversely inferring the values of each analog quantity that meets the inequality term condition in the protection action condition logic formula is: finding the value of at least one group of each analog quantity, so that the value of each analog quantity still meets the inequality term condition in the protection action condition logic formula when the action time error and / or the fixed value error corresponding to the input value time setting and / or the action constant value setting takes the maximum value;
[0105] Taking the inequality corresponding to the above E-term formula as an example, first calculate the error, and according to the relevant standards of relay protection, take the maximum value of the relative error and absolute error; according to Figure 2 In the rule script shown, the high zero sequence overcurrent I stage constant is 0.5, the relative error is the product of 0.5 and 2.5%, that is, 0.0125, and the absolute error is 0.01. Then the final constant error is 0.0125. Similarly, when calculating the action time error, follow the following formula: Figure 2 In the rule script shown, the setting value of high zero sequence overcurrent I stage 1 time limit (fixed value) is 100, the relative error is the product of 100 and 2.5%, that is, 2.5, and the absolute error is 40, so the calculated final action time error is 40; since the protection action condition is met when the E item is true (the analog calculation result is greater than the fixed value), and the high zero sequence overcurrent I stage fixed value is known to be 0.5, the calculated self-generated zero current (that is, the analog calculation result) should be greater than the high zero sequence overcurrent I stage fixed value. The value plus the maximum error, then the inequality is "(sqrt((Ia_F*sin(Ia_A)+Ib_F*sin(Ib_A)+Ic_F*sin(Ic_A))^2+(Ia_F*cos(Ia_A)+Ib_F*cos(Ib_A)+Ic_F*cos(Ic_A))^2)>0.5125)" Using the Newton iteration method, quickly solve a solution for each analog quantity that meets the conditions:
[0106] Va_F = 57.7 (voltage amplitude of phase A on the high-voltage side);
[0107] Vb_F = 57.7 (voltage amplitude of phase B on the high-voltage side);
[0108] Vc_F = 57.7 (high-voltage side C phase voltage amplitude);
[0109] Va_A=0 (voltage phase of phase A on the high-voltage side);
[0110] Vb_A=-120 (high-voltage side B phase voltage phase);
[0111] Vc_A=120 (high-voltage side C phase voltage phase);
[0112] Ia_F = 0.6 (Amplitude of phase A current on high voltage side 1);
[0113] Ib_F=0 (high voltage 1 side B phase current amplitude);
[0114] Ic_F=0 (high voltage 1 side C phase current amplitude);
[0115] Ia_A=0 (phase current of phase A on high voltage side 1);
[0116] Ib_A=0 (phase current of phase B on high voltage side 1);
[0117] Ic_A=0 (phase current of phase C on high voltage side 1);
[0118] Va1_F=57.7 (voltage amplitude of phase A on the medium voltage side);
[0119] Vb1_F=57.7 (medium voltage side phase B voltage amplitude);
[0120] Vc1_F=57.7 (medium voltage side C phase voltage amplitude);
[0121] Va1_A=0 (phase voltage of phase A on the medium voltage side);
[0122] Vb1_A=-120 (phase voltage of phase B on the medium voltage side);
[0123] Vc1_A=120 (phase voltage of phase C on the medium voltage side);
[0124] Ia1_F=0.1 (high-voltage side zero-sequence current amplitude);
[0125] Ib1_F=0 (unconnected);
[0126] Ic1_F = 0 (unconnected);
[0127] Ia1_A=0 (zero-sequence current phase on the high-voltage side);
[0128] Ib1_A=0 (unconnected);
[0129] Ic1_A=0 (unconnected);
[0130] As for the D-term formula "(err_time>OpDlTmms)", that is, the fault duration is greater than the "high zero sequence overcurrent I stage 1 time limit (fixed value)", since according to the following Figure 2In the rule script shown, OpDlTmms is set to 100, plus the absolute error of 40 set in the rule script, err_time should be greater than 140. To ensure that the protection can absolutely operate when the protection action conditions are met, according to the settings of the rule script, err_time (fault state duration) is set to 1000.
[0131] Similarly, if the protection action condition is met when the analog quantity calculation result is less than the set value, the analog quantity calculation result should be less than the set value minus the maximum error, thereby ensuring that the obtained analog quantity value is not affected by the error when the protection action is judged. Even when the set value error is the largest, the logical relationship between the analog quantity and the set value can be correctly reflected, so that the relay protection can operate correctly, avoiding the situation where the analog quantity value meets the protection action condition but the trigger fails due to the error in the set value.
[0132] After reversely calculating the values of each analog quantity according to the truth table, the calculated analog quantity information such as voltage, current, fault time, output (referring to whether the protection is activated and the action output) is used to generate the corresponding tpl state sequence file, that is, the tester analog quantity state sequence file, according to the tester state sequence script format.
[0133] 4) Combine the fixed value settings corresponding to the logical nodes, the soft pressure plate state settings that meet the action conditions and / or do not meet the action conditions, the protection action and protection output settings, the tester configuration file and the tester analog state sequence file to generate a test case;
[0134] Referring to Table 2, each row in the logic formula truth table represents a test case, and the logic formula truth table can meet the full coverage of the test logic; therefore, it is only necessary to directly read the logic formula truth table, interpret each item in one row as information in the relay protection device under test, and add the soft pressure plate setting information in the rule script to form a test case.
[0135] Taking row 15 of Table 2 (A=0, B=1, C=1, D=1, E=0, StrVal=1) as an example, the self-generated zero current value of high zero sequence overcurrent section I is 0, the time limit (control word) of high zero sequence overcurrent section I is 1, "Ia'_F>StrVal" is 1, "err_time>OpDlTmms" is 1, "sqrt((Ia_F*sin(Ia_A)+Ib_F*sin(Ib_A)+Ic_F*sin(Ic_A))^2+(Ia_F*cos(Ia_A)+Ib_F*cos(Ib_A)+Ic_F*cos(Ic_A))^2)>StrVal" is 0, and the protection action is 1; based on the above information and the analog quantity calculated previously, a tester state sequence file (.tpl) is generated for loading into the test case and participating in the generation of the test case.
[0136] The method for generating the tester configuration file (.csg file) has been described in detail in step 1) and will not be repeated here. After the tester configuration file is generated, it is also used to load it into the test case and participate in the generation of the test case.
[0137] The constant settings corresponding to the logical nodes and the soft pressure plate state settings that meet the action conditions (in this embodiment, the soft pressure plate state settings in the generated automatic test cases are soft pressure plate state settings that meet the action conditions) are all given in the rule script, and the protection action and protection outlet settings include the protection action information obtained in the logical nodes of the SCD file and the protection outlet setting information obtained in the rule script. For example, the soft pressure plate state settings that meet the action conditions are: high-voltage side backup protection soft pressure plate-thrown, high-voltage side voltage soft pressure plate-thrown and high-voltage side voltage SV receiving soft pressure plate-thrown. According to the device connection information, the tester outlet is set to port 1. Then, in this test case, the protection action may only exist when the high-voltage side backup protection soft pressure plate, the high-voltage side voltage soft pressure plate and the high-voltage side voltage SV receiving soft pressure plate are all in the put-in state, and the protection outlet must be port 1. So far, if Figure 6 As shown, a complete automatic test case for the high-zero current I section 1 time limit protection function of the transformer protection device has been generated. In other embodiments, the soft pressure plate state setting in the generated automatic test case is a soft pressure plate setting that does not meet the action conditions; this soft pressure plate setting that does not meet the conditions needs to be automatically obtained according to the soft pressure plate state setting that meets the action conditions when the automatic test case is generated in this step. It can also be pre-set to generate a soft pressure plate setting that does not meet the action conditions for the soft pressure plate effectiveness test.
[0138] The test cases generated above are saved in XML scripts. The specific format is as follows: Figure 7 As shown; in this embodiment, the test case script is not open to the user, but supports loading and saving.
[0139] Automatic testing uses the IEC61850 general protocol (the protocol corresponding to the relay protection device under test); after loading the SCD file, the test case can be automatically generated according to the above steps. The execution process of the test case is as follows: the corresponding automatic test software first loads the test case, and then remotely controls the soft pressure plate and fixed value of the device under test based on the IEC61850 control service, and passes the tester configuration file and state sequence file in the case to the tester client through the TCP protocol, and sends it to the tester for execution; if the corresponding export information of the tester is received, as well as the corresponding remote signal and SOE position change information, the test is considered to have passed, otherwise the test is considered to have failed; see the specific flow chart Figure 8 .
[0140] Furthermore, after setting the rule scripts in this embodiment, different automatic test cases can be generated for different relay protection devices, enabling automated testing of relay protection device test cases. Experimental verification demonstrated 100% case accuracy, 100% case validity, 100% protection function logic coverage, and a 95% improvement in test case editing efficiency. Manually editing a single protection function test case previously took four hours, while automatically generating it takes only 12 minutes. Automatic case generation significantly reduces labor costs, improves testing efficiency, and ensures test quality.
[0141] Example of a test case generation system for relay protection devices:
[0142] This embodiment provides a test case generation system for a relay protection device. The test case generation system includes a processor configured to execute program instructions to implement the steps of the test case generation method in the embodiment of the test case generation method for a relay protection device described above.
[0143] Since the specific content and working principle of the test case generation system are described in detail in the above-mentioned embodiment of the test case generation method for the relay protection device, they will not be repeated here.
[0144] The present invention has the following characteristics:
[0145] 1) For different relay protection devices under test and the same protection function, a set of rule scripts is abstractly formulated. When calling the SCD file of the relay protection device under test to generate a test case, the rule script is used to automatically fill in the other missing items required by the logical nodes in the test case information to generate the test case, including the protection action condition logic (the logical relationship between the set value, analog quantity and protection action), soft pressure plate information, analog quantity value, etc. This is equivalent to automatically editing the test case, which can effectively reduce the time of test case editing and improve the efficiency of test case editing;
[0146] 2) By protecting the action condition logic formula, a logic formula truth table is obtained to represent each test case. Each row of the logic formula truth table represents a use case. The entire truth table content can meet the full coverage of the test logic;
[0147] 3) The rule script defines different rules in the rule script based on the logical node type, protection function description, and IED name as constraints, which not only achieves the universality of the rules but also satisfies the high customization of the uniqueness of the protection rules for special devices;
[0148] 4) When inferring the values of each analog quantity that meets the inequality terms in the logical formula of the protection action condition, the error corresponding to the fixed value is taken into account to ensure that the value of the analog quantity obtained is not affected by the error when the protection action is judged. Even when the fixed value error is the largest, the logical relationship between the analog quantity and the fixed value can be correctly reflected, so that the relay protection can operate correctly, avoiding the situation where the analog quantity value meets the protection action condition but the trigger fails due to the error in the fixed value.
[0149] It should be understood that the above specific embodiments of the present invention are only used to illustrate or explain the principles of the present invention, and do not constitute a limitation of the present invention.
Claims
1. A test case generation method for a relay protection device, characterized in that: The steps include: 1) Read the rule script, where each rule in the rule script includes a fixed value setting, a soft pressure plate state setting that satisfies the action condition, a protection action condition logic formula, and analog channel setting information; the protection action condition logic formula includes the logical relationship between the fixed value and the analog quantity; Parse the SCD file of the relay protection device under test and match the rules in the rule script with the SCD file of the relay protection device under test to obtain the constant value settings corresponding to each logical node in the SCD file of the relay protection device under test, as well as the soft pressure plate state settings that meet the action conditions, the protection action condition logic formula, and the device connection information; 2) Calculate the corresponding truth table based on the obtained protection action condition logic formula of the logical node; 3) According to the constant value settings corresponding to the logical nodes and the contents in the truth table corresponding to the inequality terms in the protection action condition logic formula, the values of the various analog quantities that meet the inequality terms in the protection action condition logic formula are reversed, and the corresponding tester analog quantity state sequence file is generated according to the obtained values of the various analog quantities; 4) Combine the fixed value settings corresponding to the logical nodes, the soft pressure plate state settings that meet the action conditions and / or do not meet the action conditions, the protection action and protection output settings, the tester configuration file and the tester analog state sequence file to generate a test case; The tester configuration file is generated according to the analog channel setting information and the device connection information in the SCD file of the relay protection device under test; The protection action and protection exit settings include protection action information obtained in the logical node of the SCD file and protection exit setting information obtained in the rule script.
2. The test case generation method for a relay protection device according to claim 1, characterized in that: The fixed value setting includes action time error, fixed value error, input value time setting and action fixed value setting; the input value time setting includes the normal state duration and fault state duration of the relay protection device; The fixed value error is the error corresponding to the action fixed value setting, and the action time error is the error corresponding to the input value time setting; The method for inferring the values of each analog quantity that meets the inequality terms in the protection action condition logic formula is: to find the values of at least one group of each analog quantity, so that the values of each analog quantity still meet the inequality terms in the protection action condition logic formula when the action time error and / or fixed value error corresponding to the input value time setting and / or action fixed value setting take the maximum value.
3. The test case generation method for a relay protection device according to claim 1 or 2, characterized in that: Each rule in the rule script also includes constraints on the rule name, logical node type, protection function description, and relay protection device IED name; the rules in the rule script are matched with the SCD file of the relay protection device under test in the following manner: Traverse the logical nodes of the SCD file of the relay protection device under test, find the logical node that meets the restrictions of the logical node type, protection function description and relay protection device IED name in a certain rule, match the logical node with the satisfied rule, and use the fixed value setting and analog quantity setting corresponding to the rule, as well as the soft pressure plate state setting that meets the action condition, the protection action condition logic formula and the device connection information as the fixed value setting and analog quantity setting corresponding to the logical node, as well as the soft pressure plate state setting that meets the action condition, the protection action condition logic formula and the device connection information.
4. The test case generation method for a relay protection device according to claim 3, characterized in that: When matching the logic node with the satisfied rule, if the corresponding constant in the satisfied rule is not found in the logic node, the formula optimization is performed, and the logic formula corresponding to the constant is removed from the protection action condition logic formula to obtain a new protection action condition logic formula for the logic node for calculating the truth table.
5. The test case generation method for a relay protection device according to claim 1 or 2, characterized in that: The generated test cases are saved as XML scripts.
6. A test case generation system for a relay protection device, characterized in that: The system comprises a processor configured to execute program instructions to implement the following steps: 1) Read the rule script, where each rule in the rule script includes a fixed value setting, a soft pressure plate state setting that satisfies the action condition, a protection action condition logic formula, and analog channel setting information; the protection action condition logic formula includes the logical relationship between the fixed value and the analog quantity; Parse the SCD file of the relay protection device under test and match the rules in the rule script with the SCD file of the relay protection device under test to obtain the constant value settings corresponding to each logical node in the SCD file of the relay protection device under test, as well as the soft pressure plate state settings that meet the action conditions, the protection action condition logic formula, and the device connection information; 2) Calculate the corresponding truth table based on the obtained protection action condition logic formula of the logical node; 3) According to the constant value settings corresponding to the logical nodes and the contents in the truth table corresponding to the inequality terms in the protection action condition logic formula, the values of the various analog quantities that meet the inequality terms in the protection action condition logic formula are reversed, and the corresponding tester analog quantity state sequence file is generated according to the obtained values of the various analog quantities; 4) Combine the fixed value settings corresponding to the logical nodes, the soft pressure plate state settings that meet the action conditions and / or do not meet the action conditions, the protection action and protection output settings, the tester configuration file and the tester analog state sequence file to generate a test case; The tester configuration file is generated according to the analog channel setting information and the device connection information in the SCD file of the relay protection device under test; The protection action and protection exit settings include protection action information obtained in the logical node of the SCD file and protection exit setting information obtained in the rule script.
7. The test case generation system for relay protection device according to claim 6, characterized in that: The fixed value setting includes action time error, fixed value error, input value time setting and action fixed value setting; the input value time setting includes the normal state duration and fault state duration of the relay protection device; The fixed value error is the error corresponding to the action fixed value setting, and the action time error is the error corresponding to the input value time setting; The method for inferring the values of each analog quantity that meets the inequality terms in the protection action condition logic formula is: to find the values of at least one group of each analog quantity, so that the values of each analog quantity still meet the inequality terms in the protection action condition logic formula when the action time error and / or fixed value error corresponding to the input value time setting and / or action fixed value setting take the maximum value.
8. The test case generation system for relay protection device according to claim 6 or 7, characterized in that: Each rule in the rule script also includes constraints on the rule name, logical node type, protection function description, and relay protection device IED name; the rules in the rule script are matched with the SCD file of the relay protection device under test in the following manner: Traverse the logical nodes of the SCD file of the relay protection device under test, find the logical node that meets the restrictions of the logical node type, protection function description and relay protection device IED name in a certain rule, match the logical node with the satisfied rule, and use the fixed value setting and analog quantity setting corresponding to the rule, as well as the soft pressure plate state setting that meets the action condition, the protection action condition logic formula and the device connection information as the fixed value setting and analog quantity setting corresponding to the logical node, as well as the soft pressure plate state setting that meets the action condition, the protection action condition logic formula and the device connection information.
9. The test case generation system for relay protection devices according to claim 8, characterized in that: When matching the logic node with the satisfied rule, if the corresponding constant in the satisfied rule is not found in the logic node, the formula optimization is performed, and the logic formula corresponding to the constant is removed from the protection action condition logic formula to obtain a new protection action condition logic formula for the logic node for calculating the truth table.
10. The test case generation system for relay protection device according to claim 6 or 7, characterized in that: The generated test cases are saved as XML scripts.
Citation Information
Patent Citations
Remote inversion method of internal action logic of protection device
CN102496930A
Relay protection information specification function automatic test system and test method
CN114689978A