Method and system for automatically generating test case of relay protection device

By obtaining functional configuration files from relay protection devices and dynamically generating test cases, the problem of low automation in test case development in the existing technology is solved, efficient and accurate test case generation is achieved, and professional knowledge requirements and error rates are reduced.

CN118796684AActive Publication Date: 2024-10-18GUODIAN NANJING AUTOMATION SOFTWARE ENG
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410779151.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-10-18
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

The existing test case development platform for relay protection devices requires a lot of manual intervention, has a low degree of automation, is time-consuming and error-prone, and requires a high level of professional knowledge.

Method used

By obtaining the functional configuration file in real time from the debugging port of the relay protection device, using the test case management tool to load and extract the keyword set, connecting to the management platform dynamic library API, dynamically generating the test method set to form a test case, including natural language description and wiring topology .

Benefits of technology

It realizes the fully automatic generation of test cases for relay protection devices, reduces professional knowledge requirements, improves development efficiency, reduces error rates, and improves test quality and coverage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796684A_ABST
    Figure CN118796684A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of power system relay protection device testing, and provides a method and system for automatically generating a relay protection device test case, and the method comprises the steps: obtaining a function configuration file of a relay protection device from a debugging port of the relay protection device in real time; loading the function configuration file through a test case management tool, and extracting and packaging the function configuration file into a keyword set; the test case management tool calls a management platform dynamic library API and requests a test method set from the test case management platform based on the keyword set, and the test case management platform returns the test method set according to the request; and converting the test method set into a case data format of the test system through the test case management tool to form a test case. According to the invention, the error rate in the development process of the test case can be reduced, the test quality is improved, all function logics of the relay protection device can be enumerated, and the coverage rate of the test case is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of relay protection device testing in power systems, and in particular to a method and system for automatically generating test cases for relay protection devices. Background Art

[0002] Relay protection devices play a vital role as the first line of defense of the power system. The number of relay protection device engineering applications is huge and the functional configurations vary greatly, resulting in high repetitiveness and heavy workload in testing. The existing test system has accumulated a large number of test method template libraries and test cases, which can perform functional tests of protection devices more automatically, but the test case development process is somewhat difficult.

[0003] The existing relay protection test case development platform (i.e., test case management tool) requires users to have high professional knowledge, manually extract the functional configuration of the relay protection device to be tested, manually search the historical test method database by keywords, and then simply splice and combine the obtained test cases to generate new test cases. The degree of automation is weak and requires a lot of manual intervention, which is time-consuming, labor-intensive and prone to errors. Summary of the invention

[0004] The purpose of the present invention is to solve at least one technical problem in the background technology and to provide a method and system for automatically generating test cases for a relay protection device.

[0005] To achieve the above object, the present invention provides a method for automatically generating a test case for a relay protection device, comprising:

[0006] Obtain the function configuration file of the relay protection device in real time from the debugging port of the relay protection device;

[0007] Load the function configuration file through a test case management tool, and extract and encapsulate the function configuration file into a keyword set;

[0008] The test case management tool connects to the management platform dynamic library API and sends the keyword set to the test management platform dynamic library API;

[0009] The management platform dynamic library API receives the keyword set and synchronizes the keyword set to the thread of the test case management platform;

[0010] The test case management platform executes the commission specified by the management platform dynamic library API, obtains the corresponding test method set, returns the obtained test method set to the thread of the management platform dynamic library API, and the test case management tool obtains the test method set in the dynamic library API;

[0011] The test case management tool converts the test method set in the management platform dynamic library API into the test system's use case data format to form a test case.

[0012] According to one aspect of the present invention, the function configuration file of the relay protection device is obtained in real time from the debugging port of the relay protection device:

[0013] The debugging tool Sgview is used to communicate with the relay protection device through the debugging interface using private protocols to obtain the function configuration file of the relay protection device. Then, the data format file is automatically generated in a tree structure and encapsulated into the TestRelayModel.xml file for saving.

[0014] The functional configuration file includes: program model, alarm signal, event signal, input quantity, output quantity, soft pressure plate, setting group and control word group of the relay protection device.

[0015] According to one aspect of the present invention, the function configuration file is loaded through a test case management tool, and the function configuration file is extracted and packaged into a keyword set as follows:

[0016] The test case management tool GuideBook loads the TestRelayModel.xml file, analyzes all the logical functions of the relay protection device through the alarm signals and event signals in the TestRelayModel.xml file, traverses through adaptive algorithms and strategies, matches each logical function of the relay protection device with the input quantity, output quantity, soft pressure plate, set value group, and control word group recorded in the TestRelayModel.xml file, and automatically generates a keyword set RelayCoreWords that starts with the device model root element and connects the logical functions, input quantities, output quantities, soft pressure plates, set values, and control words of the relay protection device.

[0017] According to one aspect of the present invention, the test case management tool GuideBook calls the management platform dynamic library API method, requests a test method set from the test case management platform based on the keyword set, and the test case management platform returns the test method set according to the request, including:

[0018] The test case management tool GuideBook tool connects to the management platform dynamic library API, and sends a request instruction to the management platform dynamic library API in the form of a plain text string using the encapsulated keyword set;

[0019] The management platform dynamic library API receives the request instruction and synchronizes the instruction to the thread of the test case management platform AtsTestSvr;

[0020] The test case management platform AtsTestSvr executes the delegate specified by the management platform dynamic library API, analyzes the obtained keyword set to match the required test method set, and returns the obtained test method set to the thread of the management platform dynamic library API;

[0021] The test case management tool GuideBook obtains the test method set through the management platform dynamic library API.

[0022] According to one aspect of the present invention, the test method set is converted into the test case data format of the test system by the test case management tool to form the test case as follows:

[0023] The test case management tool serializes the received test method set to form a serialized test case; the serialized test case includes:

[0024] Test report for filling in test data;

[0025] Test method wiring topology;

[0026] Test steps expressed in natural language.

[0027] According to one aspect of the present invention, the test method wiring topology includes:

[0028] The wiring topology of analog quantity sampling of relay protection device is automatically parsed and given a natural language description;

[0029] The input and output quantities of the relay protection device and the wiring topology of the relay protection test instrument are automatically parsed and given a natural language description;

[0030] The wiring topology of the SV signal, Goose signal, GPS timing signal and printing function of the relay protection device is automatically parsed and given a natural language description.

[0031] To achieve the above object, the present invention also provides a system for automatically generating test cases for a relay protection device, comprising:

[0032] A function configuration file acquisition module is used to acquire the function configuration file of the relay protection device from the debugging port of the relay protection device in real time;

[0033] A keyword set extraction and packaging module loads the function configuration file through a test case management tool, and extracts and packages the function configuration file into a keyword set;

[0034] The test method set calling module, the test case management tool connects to the management platform dynamic library API and sends the keyword set to the test management platform dynamic library API; the management platform dynamic library API receives the keyword set and synchronizes the keyword set to the thread of the test case management platform; the test case management platform executes the commission specified by the management platform dynamic library API, obtains the corresponding test method set, returns the obtained test method set to the thread of the management platform dynamic library API, and the test case management tool obtains the test method set in the dynamic library API;

[0035] The test case generation module converts the test method set into the test system's case data format through the test case management tool to form a test case.

[0036] To achieve the above objectives, the present invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the method for automatically generating test cases for a relay protection device as described above is implemented.

[0037] To achieve the above objectives, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for automatically generating test cases for a relay protection device as described above is implemented.

[0038] According to the scheme of the present invention, a large number of test method libraries accumulated by the test case management platform AtsTestSvr can be conveniently and efficiently maintained through the scheme of the present invention; the present invention can fully automatically generate test cases, greatly reducing the professional knowledge requirements for test case developers, reducing the tedious process of manually developing test cases, improving the efficiency of relay protection device test case development, and reducing testing costs; the present invention uses adaptive algorithms and strategies to intelligently extract and combine the test method sets accumulated by the AtsTestSvr case management platform, which can reduce the error rate of the test case development process and improve the test quality; the relay protection device debugging tool Sgview can fully automatically enumerate all functional logics of the relay protection device through the private protocol communication of the debugging port, effectively ensuring the coverage of the test cases. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 The flowchart schematically shows a method for automatically generating test cases for a relay protection device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The present invention will now be discussed with reference to exemplary embodiments. It should be understood that the embodiments discussed are only to enable those skilled in the art to better understand and thus implement the present invention, rather than implying any limitation on the scope of the present invention.

[0041] As used herein, the term “including” and variations thereof are to be interpreted as open-ended terms meaning “including, but not limited to.” The term “based on” is to be interpreted as “based, at least in part, on.” The terms “one embodiment” and “an embodiment” are to be interpreted as “at least one embodiment.”

[0042] Figure 1 The flowchart schematically shows a method for automatically generating a test case for a relay protection device according to an embodiment of the present invention. Figure 1 As shown, in this embodiment, the method for automatically generating a test case for a relay protection device includes:

[0043] Obtain the function configuration file of the relay protection device in real time from the debugging port of the relay protection device;

[0044] Load the function configuration file through the test case management tool, and extract and encapsulate the function configuration file into a keyword set;

[0045] The test case management tool connects to the management platform dynamic library API and sends the keyword set to the test management platform dynamic library API; the management platform dynamic library API receives the keyword set and synchronizes the keyword set to the thread of the test case management platform; the test case management platform executes the commission specified by the management platform dynamic library API, obtains the corresponding test method set, returns the obtained test method set to the thread of the management platform dynamic library API, and the test case management tool obtains the test method set in the dynamic library API;

[0046] The test method set is converted into the test system's use case data format through the test case management tool to form a test case.

[0047] According to an embodiment of the present invention, obtaining a function configuration file of a relay protection device in real time from a debugging port of the relay protection device includes:

[0048] The debugging tool Sgview completes the communication of private protocol with the relay protection device through the debugging interface and obtains all functional configuration files of the relay protection device, including the program model, alarm signal, event signal, input quantity, output quantity, soft pressure plate, setting group, and control word group of the relay protection device;

[0049] Automatically generate a data format file in a tree structure and encapsulate it into a standard TestRelayModel.xml file for saving. The data format of the tree structure is as follows:

[0050] PSL-603UA-G-V3.20

[0051] ├── Event signal: RelayTripInfo

[0052] │├── Phase distance I segment

[0053] ││└── grodistance1

[0054] │├── Phase distance II segment

[0055] │└── grodistance2

[0056] ├── Output signal: RelayTripDout

[0057] │├── Phase A trip output

[0058] ││└── phasetrip1

[0059] ├── Soft压板: RelayEna

[0060] │├── Distance protection soft压板

[0061] ││└── grodistance1ena

[0062] │......

[0063] Compared with the traditional test case development platform, extracting the full function set of the relay protection device requires professionals with strong professional knowledge for manual extraction. This process of the present invention greatly reduces the requirements for the professional knowledge of relevant personnel. Through the private protocol of the debugging port, it can ensure that the acquired data is complete and comprehensive. TestRelayModel.xml uses the device model as the root node and records the complete protection function configuration through multiple data sets, including event signals, output signals, input signals, soft压板, setting groups, and control word groups. The file format is as follows:

[0064] <RelayModel type="relay" name="Line protection device" id="PSL-603UA-G-V3.20">

[0065] <paras-tripinfo name="Event signal" id="RelayTripInfo">

[0066] <data name="Phase A Tripping Output" id="phasetrip1" / >........

[0067]

[0068] <paras-tripdout name="Trip Output Signal" id="RelayTripDout">

[0069] <data name="Phase A Tripping Output" id="phasetrip1" / >........

[0070]

[0071] <paras-dataIn name="Input Signal" id="RelayDataIn">

[0072] <data name="Distance Protection Hard压板" id="grodistancehardswitch" / >........

[0073]

[0074] <paras-relayena name="Soft压板" id="RelayEna">

[0075] <data name="Distance Protection Soft压板" id="grodistance1ena" / >……

[0076]

[0077] <paras-relaysetting name="Setting Group" id="RelaySetting">

[0078] <data name="Ground Distance I Section Setting Value" id="grodistance1val" / >

[0079] <data name="Ground Distance I Section Time" id="grodistance1time" / >……

[0080]

[0081] <paras-relaysetena name="Control Word Group" id="RelaySettingEna">

[0082] <data name="Ground Distance I Section Control Word" id="grodistance1enaset" / >……

[0083] It should be noted that the term "压板" in the original text may be a specific technical term in the relevant field, and the translation here is only a literal translation for reference. It is recommended to check and adjust according to the actual professional context.

[0084]

[0085] Further, according to an embodiment of the present invention, the function configuration file is loaded through a test case management tool, and the function configuration file is extracted and packaged into a keyword set, including:

[0086] The test case management tool GuideBook loads the TestRelayModel.xml file;

[0087] The alarm signals and event signals in the TestRelayModel.xml file record all the achievable logical functions of the relay protection device. All the logical functions of the relay protection device are enumerated by traversing the alarm signals and event signals, and then each logical function of the relay protection device is matched with the input signal, output signal, soft pressure plate, set value group, and control word group recorded in the TestRelayModel.xml file. The keyword set RelayCoreWords is automatically generated, which starts with the device model root element and includes the logical functions, input quantities, output quantities, soft pressure plates, set values, and control words of the relay protection device.

[0088] In this embodiment, the keyword set RelayCoreWords includes multiple keyword groups, each keyword group is expressed as a specific functional logic of the relay protection device, and all keyword sets are expressed as a traversal of all functional logics of the relay protection device.

[0089] In this embodiment, the local test case management tool GuideBook has a keyword library of relay protection test templates. The configuration of the keyword library is accumulated by long-term relay protection tests and is a relay protection test asset. The present invention encapsulates all keyword sets RelayCoreWords in the function configuration file of the relay protection device to be tested into a keyword set in json array format, which is displayed in the form of key-value pairs as follows:

[0090] RelayCoreWords = {

[0091] {"relay":"PSL-603UA-G-V3.20","warning":"Control circuit disconnected $PT disconnected",

[0092] "tripinfo":"Touchdown distance I stage action", "tripdin":"HWJ",

[0093] "tripdout":"A phase tripping output", "relayena":"distance protection soft pressure plate",

[0094] "relaysetting":"ground distance I section fixed value $ground distance I section time","relaysetena":"ground distance I section control word"

[0095] }

[0096] {……}……

[0097] }

[0098] Further, according to an embodiment of the present invention, the test case management tool GuideBook requests a test method set from the test case management platform AtsTestSvr based on the keyword set through the management platform dynamic library API, and the test case management platform returns the test method set according to the request, including:

[0099] A method for connecting the test case management tool GuideBook to the management platform dynamic library API, transmitting the encapsulated keyword set to the management platform dynamic API in the form of a plain text string, and the management platform dynamic API sends a request instruction to the test case management platform AtsTestSvr;

[0100] The test case management platform AtsTestSvr obtains the request instruction, analyzes the keyword set, matches the required test method set and returns it to the management platform dynamic library API. The test case management tool GuideBook obtains the test method set from the management platform dynamic library API.

[0101] The management platform dynamic library API contains an exe file, which is implemented based on the standard COM method. The management platform dynamic library API provides a set of methods to realize the mutual communication and data exchange between the test case management tool and the test case management platform. It is the middleware for communication between the test case management tool and the test case management platform.

[0102] In this embodiment, the test case management platform AtsTestSvr has the same keyword library as the test case management tool GuideBook, which can realize two-way verification of the test case management tool GuideBook and the test case management platform AtsTestSvr, and realize double confirmation of keyword library consistency. The generated specific relay protection device keyword set RelayCoreWords must exist in the above-mentioned keyword library.

[0103] In this embodiment, the relay protection function logic keyword library CoreWordsLib is configured in the test case management platform AtsTestSvr. The relay protection function logic keyword library CoreWordsLib, as a relay protection device test asset library, is accumulated in the long-term relay protection device testing work. Each test method set is configured with a test device keyword description, test standard description, environmental requirement description, wiring topology description, and test method description.

[0104] The test method library in the test case management platform AtsTestSvr includes a complete set of relay protection test method templates (i.e., test method sets) of relay protection device manufacturers. Each test method template is associated one-to-many with a single keyword in the relay protection function logic keyword library CoreWordsLib, so that the same test method template can be applied to the testing of different functions of multiple relay protection models.

[0105] The set of relay protection test method templates contained in the test method library of the test case management platform AtsTestSvr is a test asset that has been gradually accumulated and improved in the long-term development and testing process of relay protection devices. It is developed and maintained by professional and technical personnel of relay protection and ensures the accuracy of test method case selection by matching a specific test method through a combination of multiple keywords.

[0106] In this embodiment, the test method set includes a fully automatic method, a semi-automatic method, and a manual test method.

[0107] Further, according to an embodiment of the present invention, the test method set is converted into the test case data format of the test system through a test case management tool to form a test case as follows:

[0108] The test case management tool serializes the received test method set to form a serialized test case (i.e., a relay protection device test case);

[0109] The serialized test case includes an automatically generated test report for filling in the test data. The filling in of the test report includes manual report, semi-automatic report, and fully automatic report. The test report and the test system realize the automatic filling in of the test report through bookmark management.

[0110] The sequenced test case contains the automatically generated test method wiring topology of the relay protection device, which includes:

[0111] The wiring topology of analog quantity sampling of relay protection device is automatically parsed and given a natural language description;

[0112] The input and output quantities of the relay protection device and the wiring topology of the relay protection test instrument are automatically parsed and given a natural language description;

[0113] The wiring topology of the SV signal, Goose signal, GPS timing signal and printing function of the relay protection device is automatically parsed and given a natural language description.

[0114] Sequenced test cases contain intelligently generated natural language expressions of test steps, for example:

[0115] {

[0116] Please complete the AC sampling wiring of the relay protection device [……];

[0117] Please connect the relay protection device input [……] in series with the tester’s 220V DC output [……];

[0118] Please connect the output [……] of the relay protection device to the input [……] of the relay protection tester;

[0119] Change the relay protection device setting / control word / soft pressure plate [……] to [……];

[0120] Check the manual test report item [……] Fill in the value [……]

[0121] …

[0122] }

[0123] The automatically generated relay protection device test cases are stored in the test case management tool GuideBook and the test case management platform AtsTestSvr.

[0124] According to the above scheme of the present invention, the test case management tool GuideBook calls the test case management platform dynamic library API as a client to realize the management of the test method template library and the full-automatic generation of test cases. The test case management platform AtsTestSvr installation database is used to store the test method library, test case library, and keyword library of the test method template. Through the above method steps, the accumulation of the test method library and the test method core vocabulary in the long-term development and testing process of the relay protection device can realize the development of the relay protection device test case in a fully automatic manner.

[0125] According to the above scheme of the present invention, the test case management tool GuideBook can automatically generate test cases comprehensively and accurately, avoiding the process of manually writing test cases and improving the efficiency of test case development; it can implement natural language description and wiring topology in test cases, realize intelligent serialization, reduce the risk of errors in manually developing test cases, and improve reliability; through the maintenance of keyword libraries and test method libraries, it can greatly improve the test coverage and reduce the risk of missed tests; by automatically generating test cases, it can reduce the difficulty of test case development and reduce dependence on professional knowledge, ensuring that people of different professional levels can develop comprehensive test cases.

[0126] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a system for automatically generating test cases for relay protection devices, comprising:

[0127] A function configuration file acquisition module is used to acquire the function configuration file of the relay protection device from the debugging port of the relay protection device in real time;

[0128] A keyword set extraction and packaging module loads the function configuration file through a test case management tool, and extracts and packages the function configuration file into a keyword set;

[0129] The test method set calling module, the test case management tool connects to the management platform dynamic library API and sends the keyword set to the test management platform dynamic library API; the management platform dynamic library API receives the keyword set and synchronizes the keyword set to the thread of the test case management platform; the test case management platform executes the commission specified by the management platform dynamic library API, obtains the corresponding test method set, returns the obtained test method set to the thread of the management platform dynamic library API, and the test case management tool obtains the test method set in the dynamic library API;

[0130] The test case generation module converts the test method set into the test system's case data format through the test case management tool to form a test case.

[0131] According to an embodiment of the present invention, obtaining a function configuration file of a relay protection device in real time from a debugging port of the relay protection device includes:

[0132] The debugging tool Sgview completes the communication of private protocol with the relay protection device through the debugging interface and obtains all functional configuration files of the relay protection device, including the program model, alarm signal, event signal, input quantity, output quantity, soft pressure plate, setting group, and control word group of the relay protection device;

[0133] Automatically generate data format files in a tree structure and encapsulate them into standard TestRelayModel.xml files for saving;

[0134] Compared with the traditional test case development platform, extracting the full function set of relay protection devices requires professionals with strong expertise to extract manually. This process of the present invention greatly reduces the requirement for the professional knowledge of relevant personnel. The private protocol of the debugging port can ensure the integrity and comprehensiveness of the acquired data. The file format is as follows:

[0135] <RelayModel type="relay" name="Line protection device" id="PSL-603UA-G-V3.20">

[0136] <paras-tripinfo name="Event signal" id="RelayTripInfo">

[0137] <data name="Phase A ground distance I section operation" id="grodistance1" / >........

[0138]

[0139] <paras-tripdout name="Output signal" id="RelayTripDout">

[0140] <data name="Phase A trip output" id="phasetrip1" / >........

[0141]

[0142] <paras-relayena name="Soft压板" id="RelayEna">

[0143] <data name="Distance protection soft压板" id="grodistance1ena" / >……

[0144]

[0145] <paras-relaysetting name="Setting group" id="RelaySetting">

[0146] <data name="Phase A ground distance I section setting value" id="grodistance1val" / >

[0147] <data name="Phase A ground distance I section time" id="grodistance1time" / >……

[0148]

[0149] <paras-relaysetena name="Control Word Group" id="RelaySettingEna">

[0150] <data name="Ground Distance I Segment Control Word" id="grodistance1enaset" / >……

[0151]

[0152]

[0153] Further, according to an embodiment of the present invention, the function configuration file is loaded by a test case management tool, and the function configuration file is extracted and encapsulated into a keyword set, including:

[0154] The test case management tool GuideBook loads the TestRelayModel.xml file;

[0155] All the logical functions of the relay protection device are analyzed through the alarm signals and event signals in the TestRelayModel.xml file, traversed through the adaptive algorithm and strategy, and each logical function of the relay protection device is matched with the input quantities, output quantities, soft pressure plates, setting value groups, and control word groups recorded in the TestRelayModel.xml file, and a keyword set RelayCoreWords starting with the device model root element and connecting the logical functions, input quantities, output quantities, soft pressure plates, setting values, and control words of the relay protection device is automatically generated.

[0156] In this embodiment, the keyword set RelayCoreWords contains multiple groups of keyword groups, each keyword group expresses a specific functional logic of the relay protection device, and all the keyword sets express the traversal of all the functional logics of the relay protection device.

[0157] In this embodiment, the local area of the test case management tool GuideBook has a keyword library of relay protection test templates. The configuration of the keyword library is accumulated from long-term relay protection tests and is a relay protection test asset. The present invention encapsulates all the keyword sets in the function configuration file of the relay protection device to be tested into a keyword set in the json array format, and is shown in the following key-value pair manner:

[0158] RelayCoreWords = {

[0159] {"relay":"PSL-603UA-G-V3.20","warning":"Control loop disconnection $ PT disconnection",

[0160] "tripinfo":"Touchdown distance I stage action", "tripdin":"HWJ",

[0161] "tripdout":"A phase tripping output", "relayena":"distance protection soft pressure plate",

[0162] "relaysetting":"ground distance I section fixed value $ground distance I section time","relaysetena":"ground distance I section control word"

[0163] }

[0164] {……}……

[0165] }

[0166] Further, according to an embodiment of the present invention, the test case management tool calls the management platform dynamic library API, requests the test method set from the test case management platform based on the keyword set, and the test case management platform returns the test method set according to the request, including:

[0167] The test case management tool GuideBook calls the method of the dynamic library API to send the encapsulated keyword set to the test case management platform AtsTestSvr in the form of an interface plain text string;

[0168] The test case management platform AtsTestSvr obtains the request instruction, calls the API adaptive method, analyzes the obtained keywords, matches the required test method set, and returns the test method set to the test case management tool GuideBook.

[0169] In this embodiment, the test case management platform AtsTestSvr has the same keyword library as the test case management tool GuideBook, which can realize two-way verification of the test case management tool GuideBook and the test case management platform AtsTestSvr, and double-confirm the consistency of the keyword libraries on both ends.

[0170] In this embodiment, the relay protection function logic keyword library CoreWordsLib is configured in the test case management platform AtsTestSvr. The relay protection function logic keyword library CoreWordsLib, as a relay protection device test asset library, is accumulated in the long-term relay protection device testing work. Each test method set is configured with the associated description of the test device, the standard document description, the wiring topology description, and the test method description.

[0171] The test method library in the test case management platform AtsTestSvr includes a complete set of relay protection test method templates (i.e., test method sets) of relay protection device manufacturers. Each test method template is associated one-to-many with a single keyword in the relay protection function logic keyword library CoreWordsLib, so that the same test method template can be applied to the testing of different functions of multiple relay protection models.

[0172] The set of relay protection test method templates contained in the test method library of the test case management platform AtsTestSvr is a test asset that has been gradually accumulated and improved in the long-term development and testing process of relay protection devices. It is developed and maintained by professional and technical personnel of relay protection and ensures the accuracy of test method case selection by matching a specific test method through a combination of multiple keywords.

[0173] In this embodiment, the test method set includes a fully automatic method, a semi-automatic method, and a manual test method.

[0174] Further, according to an embodiment of the present invention, the test method set is converted into the test case data format of the test system through a test case management tool to form a test case as follows:

[0175] The test case management tool serializes the received test method set to form a serialized test case (i.e., a relay protection device test case);

[0176] The serialized test case includes an automatically generated test report for filling in the test data. The filling in of the test report includes manual report, semi-automatic report, and fully automatic report. The test report and the test system realize the automatic filling in of the test report through bookmark management.

[0177] The sequenced test case contains the automatically generated test method wiring topology of the relay protection device, which includes:

[0178] The wiring topology of analog quantity sampling of relay protection device is automatically parsed and given a natural language description;

[0179] The input and output quantities of the relay protection device and the wiring topology of the relay protection test instrument are automatically parsed and given a natural language description;

[0180] The wiring topology of the SV signal, Goose signal, GPS timing signal and printing function of the relay protection device is automatically parsed and given a natural language description.

[0181] Sequenced test cases contain intelligently generated natural language expressions of test steps, for example:

[0182] {

[0183] Please complete the AC sampling wiring of the relay protection device [……];

[0184] Please connect the relay protection device input [……] in series with the tester’s 220V DC output [……];

[0185] Please connect the output [……] of the relay protection device to the input [……] of the relay protection tester;

[0186] Change the relay protection device setting / control word / soft pressure plate [……] to [……];

[0187] Check the manual test report item [……] Fill in the value [……]

[0188] …

[0189] }

[0190] The automatically generated relay protection device test cases are stored in the test case management tool GuideBook and the test case management platform AtsTestSvr.

[0191] According to the above scheme of the present invention, the test case management tool GuideBook acts as a client, calls the API of the test case management platform dynamic library, and realizes the management of the test method template library and the automatic generation of test cases. The test case management platform AtsTestSvr installs a database for storing the test method library, the test case library, and the keyword library of the test method template. Through the above method steps, the accumulation of the test method library and the test method core vocabulary in the long-term development and testing process of the relay protection device can realize the development of the relay protection device test case in a fully automatic manner.

[0192] According to the above scheme of the present invention, the test case management tool GuideBook can automatically generate test cases comprehensively and accurately, avoiding the process of manually writing test cases and improving the efficiency of test case development; it can implement natural language description and wiring topology in test cases, realize intelligent serialization, reduce the risk of errors in manually developing test cases, and improve reliability; through the maintenance of keyword libraries and test method libraries, it can greatly improve the test coverage and reduce the risk of missed tests; by automatically generating test cases, it can reduce the difficulty of test case development and reduce dependence on professional knowledge, ensuring that people of different professional levels can develop comprehensive test cases.

[0193] Furthermore, in order to achieve the above-mentioned purpose, the present invention also provides an electronic device, comprising: a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for automatically generating test cases for a relay protection device is implemented.

[0194] The present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for automatically generating test cases for a relay protection device is implemented.

[0195] According to the above scheme of the present invention, a large number of test method libraries accumulated by the test case management platform AtsTestSvr can be conveniently and efficiently maintained and increased through the scheme of the present invention; the present invention can fully automatically generate test cases, greatly reduce the professional knowledge requirements for test case developers, reduce the tedious process of manually developing test cases, improve the efficiency of relay protection device test case development, and reduce testing costs; the present invention uses adaptive algorithms and strategies to intelligently extract and combine the test method sets accumulated by the AtsTestSvr case management platform, which can reduce the error rate of the test case development process and improve the test quality; the relay protection device debugging tool Sgview can fully automatically enumerate all functional logics of the relay protection device through the private protocol communication of the debugging port, effectively ensuring the coverage of the test cases.

[0196] Those skilled in the art will appreciate that the modules and algorithm steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0197] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and equipment can refer to the corresponding processes in the aforementioned method implementation methods, and will not be repeated here.

[0198] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0199] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.

[0200] In addition, each functional module in the embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0201] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the energy-saving signal sending / receiving method of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0202] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other.

[0203] It should be understood that the size of the serial numbers of each step in the content of the invention and the implementation methods of the present invention does not absolutely mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the implementation methods of the present invention.

Claims

1. Method for automatically generating test cases for relay protection devices, It is characterized in that include: Obtain the function configuration file of the relay protection device in real time from the debugging port of the relay protection device; Load the function configuration file through a test case management tool, and extract and encapsulate the function configuration file into a keyword set; The test case management tool connects to the management platform dynamic library API and sends the keyword set to the test management platform dynamic library API; The management platform dynamic library API receives the keyword set and synchronizes the keyword set to the thread of the test case management platform; The test case management platform executes the commission specified by the management platform dynamic library API, obtains the corresponding test method set, returns the obtained test method set to the thread of the management platform dynamic library API, and the test case management tool obtains the test method set in the dynamic library API; The test case management tool converts the test method set in the management platform dynamic library API into the test system's use case data format to form a test case.

2. The method for automatically generating test cases for relay protection devices according to claim 1, It is characterized in that The function configuration file of the relay protection device obtained in real time from the relay protection device debugging port is: The debugging tool Sgview is used to communicate with the relay protection device through the debugging interface using private protocols to obtain the function configuration file of the relay protection device. Then, the data format file is automatically generated in a tree structure and encapsulated into the TestRelayModel.xml file for saving. The functional configuration file includes: program model, alarm signal, event signal, input quantity, output quantity, soft pressure plate, setting group and control word group of the relay protection device.

3. The method for automatically generating test cases for relay protection devices according to claim 1, It is characterized in that The function configuration file is loaded by the test case management tool, and the function configuration file is extracted and packaged into a keyword set as follows: The test case management tool GuideBook loads the TestRelayModel.xml file, analyzes all the logical functions of the relay protection device through the alarm signals and event signals in the TestRelayModel.xml file, traverses through adaptive algorithms and strategies, matches each logical function of the relay protection device with the input quantity, output quantity, soft pressure plate, set value group, and control word group recorded in the TestRelayModel.xml file, and automatically generates a keyword set RelayCoreWords that starts with the device model root element and connects the logical functions, input quantities, output quantities, soft pressure plates, set values, and control words of the relay protection device.

4. The method for automatically generating test cases for relay protection devices according to claim 1, It is characterized in that The test case management tool calls the management platform dynamic library API method, requests a test method set from the test case management platform based on the keyword set, and the test case management platform returns the test method set according to the request, including: The test case management tool GuideBook is connected to the management platform dynamic library API, and the test case management tool GuideBook sends a request instruction to the management platform dynamic library API by way of a plain text string using the encapsulated keyword set; The management platform dynamic library API receives the request instruction and synchronizes the instruction to the thread of the test case management platform AtsTestSvr; The test case management platform AtsTestSvr executes the delegate specified by the management platform dynamic library API, analyzes the obtained keyword set to match the required test method set, and returns the obtained test method set to the thread of the management platform dynamic library API; The test case management tool GuideBook obtains the test method set through the management platform dynamic library API.

5. A method for automatically generating test cases for a relay protection device according to any one of claims 1 to 4, It is characterized in that The test method set is converted into the test case data format of the test system through the test case management tool to form a test case: The test case management tool serializes the received test method set to form a serialized test case; The serialization test cases include: Test report for filling in test data; Test method wiring topology; Test steps expressed in natural language.

6. The method for automatically generating test cases for relay protection devices according to claim 5, It is characterized in that The test method wiring topology includes: The wiring topology of analog quantity sampling of relay protection device is automatically parsed and given a natural language description; The input and output quantities of the relay protection device and the wiring topology of the relay protection test instrument are automatically parsed and given a natural language description; The wiring topology of the SV signal, Goose signal, GPS timing signal and printing function of the relay protection device is automatically parsed and given a natural language description.

7. A system for automatically generating test cases for relay protection devices, It is characterized in that include: A function configuration file acquisition module is used to acquire the function configuration file of the relay protection device from the debugging port of the relay protection device in real time; A keyword set extraction and packaging module loads the function configuration file through a test case management tool, and extracts and packages the function configuration file into a keyword set; The test method set calling module, the test case management tool connects to the management platform dynamic library API and sends the keyword set to the test management platform dynamic library API; The management platform dynamic library API receives the keyword set and synchronizes the keyword set to the thread of the test case management platform; The test case management platform executes the commission specified by the management platform dynamic library API, obtains the corresponding test method set, returns the obtained test method set to the thread of the management platform dynamic library API, and the test case management tool obtains the test method set in the dynamic library API; The test case generation module converts the test method set into the test system's case data format through the test case management tool to form a test case.

8. Electronic equipment, It is characterized in that The invention comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the method for automatically generating a test case for a relay protection device as described in any one of claims 1 to 6 is implemented.

9. Computer readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for automatically generating a test case for a relay protection device according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Test case generating method and device

    CN101989227A

  • Generation method and device of automated test cases

    CN108399131A

  • Software test case automatic generation method and tool based on demand specification

    CN115344504A

  • Method and related device for automatically generating UI automatic test case

    CN117573567A

  • Page function testing method and related device

    WO2020233034A1