Method and system for automatically generating test cases for a protective relay
The method and system for automatically generating test cases for relay protection devices solve the problem of excessive manual intervention in existing technologies, realize fully automated test case generation, improve efficiency and quality, and reduce costs.
Patent Information
- Application Number
- CN202410779151.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2044-06-17
AI Technical Summary
Existing relay protection device test case development platforms require a large amount of manual intervention and have a low degree of automation, resulting in time-consuming, labor-intensive, and error-prone testing work.
By using a method and system to automatically generate test cases for relay protection devices, functional configuration files are obtained from the device's debugging port. Test cases are automatically generated using test case management tools and dynamic library APIs, including keyword set extraction, encapsulation, conversion, and serialization processing, thus achieving fully automated test case generation.
It significantly reduced the requirements for professional knowledge, improved the efficiency of test case development, reduced the error rate, improved test quality and coverage, and reduced costs.
Smart Images

Figure CN118796684B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system relay protection device testing technology, and in particular to a method and system for automatically generating test cases for relay protection devices. Background Technology
[0002] Relay protection devices play a crucial role as the first line of defense in power systems. The sheer number of relay protection devices used in engineering projects, coupled with their diverse functional configurations, leads to highly repetitive and labor-intensive testing. While existing testing systems have accumulated a large library of test method templates and test cases, enabling relatively automated functional testing of protection devices, developing test cases remains challenging.
[0003] Existing relay protection test case development platforms (i.e. test case management tools) require users to have high levels of professional knowledge, manually extract the functional configuration of the relay protection device under test, 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 automation level is weak, requires a lot of manual intervention, is time-consuming and labor-intensive, and is prone to errors. Summary of the Invention
[0004] The purpose of this invention is to solve at least one technical problem in the background art and to provide a method and system for automatically generating test cases for relay protection devices.
[0005] To achieve the above objectives, the present invention provides a method for automatically generating test cases for relay protection devices, comprising:
[0006] Obtain the functional configuration file of the relay protection device in real time from the relay protection device's debugging port;
[0007] The functional configuration file is loaded using a test case management tool, and the functional configuration file is extracted and encapsulated into a keyword set.
[0008] The test case management tool connects to the dynamic library API of the test management platform and sends the keyword set to the dynamic library API of the test management platform.
[0009] The management platform's 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 delegate specified by the management platform dynamic library API, obtains the corresponding 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 then obtains the test method set from the dynamic library API.
[0011] The test case management tool converts the set of test methods in the dynamic library API of the management platform into the test case data format of the test system, thus forming test cases.
[0012] According to one aspect of the present invention, the real-time acquisition of the functional configuration file of the relay protection device from the relay protection device debugging port is as follows:
[0013] The debugging tool Sgview is used to communicate with the relay protection device through the debugging interface using a private protocol to obtain the functional configuration file of the relay protection device. Then, the data format file is automatically generated in a tree structure and packaged into a TestRelayModel.xml file for saving.
[0014] The functional configuration file includes the following for the relay protection device: program model, alarm signal, event signal, input quantity, output quantity, soft pressure plate, setting group, and control word group.
[0015] According to one aspect of the present invention, the step of loading the functional configuration file through a test case management tool and extracting and encapsulating the functional configuration file into a keyword set is as follows:
[0016] The test case management tool GuideBook loads the TestRelayModel.xml file and analyzes all the logical functions of the relay protection device through the alarm signals and event signals in the TestRelayModel.xml file. It then traverses the data using adaptive algorithms and strategies, matching each logical function of the relay protection device with the input, output, soft switch, setting group, and control word group recorded in the TestRelayModel.xml file. This automatically generates a keyword set RelayCoreWords that starts with the device model root element and connects the logical functions, inputs, outputs, soft switches, settings, and control words of the relay protection device.
[0017] According to one aspect of the present invention, the test case management tool GuideBook calls a dynamic library API method of the management platform to request a set of test methods from the test case management platform based on the keyword set. The test case management platform returns the set of test methods according to the request, including:
[0018] The test case management tool GuideBook connects to the management platform's dynamic library API and sends a request command to the management platform's dynamic library API in plain text format, containing a set of encapsulated keywords.
[0019] The management platform's dynamic library API receives request instructions and synchronizes them to the threads 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 test method sets through the management platform's dynamic library API.
[0022] According to one aspect of the present invention, the step of converting the test method set into the test system's test case data format using a test case management tool to form test cases is as follows:
[0023] The test case management tool serializes the received set of test methods to form serialized test cases; the serialized test cases include:
[0024] Test reports used to fill 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 wiring topology of the test method includes:
[0028] The wiring topology of analog sampling of relay protection devices 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 described in natural language.
[0030] The wiring topology of relay protection device SV signal, Goose signal, GPS time synchronization signal, and printing function is automatically parsed and assigned a natural language description.
[0031] To achieve the above objectives, the present invention also provides a system for automatically generating test cases for relay protection devices, comprising:
[0032] The function configuration file acquisition module acquires the function configuration file of the relay protection device in real time from the relay protection device's debugging port.
[0033] The keyword set extraction and encapsulation module loads the functional configuration file through the test case management tool, and extracts and encapsulates the functional configuration file into a keyword set;
[0034] The test method set invocation module connects the test case management tool 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 delegate specified by the management platform dynamic library API, obtains the corresponding 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 obtains the test method set from the dynamic library API.
[0035] The test case generation module uses a test case management tool to convert the set of test methods into the test case data format of the test system, thus forming test cases.
[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, it implements the method for automatically generating test cases for relay protection devices as described above.
[0037] To achieve the above objectives, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method for automatically generating test cases for relay protection devices as described above.
[0038] According to the present invention, the large number of test method libraries accumulated by the test case management platform AtsTestSvr can be maintained conveniently and efficiently through the present invention; the present invention can 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 set accumulated by the AtsTestSvr test case management platform, which can reduce the error rate in the test case development process and improve test quality; the relay protection device debugging tool Sgview can automatically enumerate all functional logic of the relay protection device through private protocol communication of the debugging port, effectively ensuring the coverage of test cases. Attached Figure Description
[0039] Figure 1 The flowchart illustrates a method for automatically generating test cases for relay protection devices according to an embodiment of the present invention. Detailed Implementation
[0040] The invention will now be discussed with reference to exemplary embodiments. It should be understood that the described embodiments are merely intended to enable those skilled in the art to better understand and thus implement the invention, and are not intended to imply any limitation on the scope of the invention.
[0041] As used herein, the term "comprising" and its variations are to be interpreted as open-ended terms meaning "including but not limited to". The term "based on" is to be interpreted as "at least partially based on". The terms "one embodiment" and "an embodiment" are to be interpreted as "at least one embodiment".
[0042] Figure 1 This is a flowchart illustrating a method for automatically generating test cases for relay protection devices according to an embodiment of the present invention. Figure 1 As shown, in this embodiment, the method for automatically generating test cases for relay protection devices includes:
[0043] Obtain the functional configuration file of the relay protection device in real time from the relay protection device's debugging port;
[0044] Load the feature configuration file through the test case management tool, and extract and encapsulate the feature configuration file into a keyword set;
[0045] The test case management tool connects to the management platform's dynamic library API and sends the keyword set to the test management platform's dynamic library API; the management platform's dynamic library API receives the keyword set and synchronizes the keyword set to the test case management platform's thread; the test case management platform executes the delegate specified by the management platform's dynamic library API, obtains the corresponding test method set, and returns the obtained test method set to the management platform's dynamic library API's thread; the test case management tool then obtains the test method set from the dynamic library API.
[0046] Test case management tools are used to convert the set of test methods into the test case data format of the test system, thus forming test cases.
[0047] According to one embodiment of the present invention, the functional configuration file of the relay protection device is obtained in real time from the debugging port of the relay protection device, including:
[0048] The debugging tool Sgview communicates with the relay protection device through the debugging interface to complete the private protocol and obtain all the function configuration files of the relay protection device, including the relay protection device's program model, alarm signals, event signals, input quantities, output quantities, soft pressure plates, setting groups, and control word groups.
[0049] The data format file is automatically generated using a tree structure and then packaged into a standard TestRelayModel.xml file for saving. The tree structure data format is as follows:
[0050] PSL-603UA-G-V3.20
[0051] ├── Event Signal: RelayTripInfo
[0052] │ ├── Grounding distance segment I
[0053] │ │ └──grodistance1
[0054] │ ├── Grounding distance II segment
[0055] │ └──grodistance2
[0056] ├── Output signal: RelayTripDout
[0057] │ ├── Phase A Trip Output
[0058] │ │ └──phasetrip1
[0059] ├── Soft pressure plate: RelayEna
[0060] │ ├── Distance Protection Soft Pressure Plate
[0061] │ │ └──grodistance1ena
[0062] │ ......
[0063] Compared to traditional test case development platforms that require specialized personnel with strong professional knowledge to manually extract the full functionality of relay protection devices, this invention significantly reduces the expertise requirements. By using the private protocol of the debugging port, the completeness and comprehensiveness of the acquired data can be guaranteed. TestRelayModel.xml uses the device model as the root node and records the complete protection function configuration through multiple datasets, including event signals, output signals, input signals, soft circuit boards, setting groups, and control word groups. The file format is as follows:
[0064] <relaymodel type="relay" name="线路保护装置" id="PSL-603UA-G-V3.20">
[0065] <paras-tripinfo name="事件信号" id="RelayTripInfo">
[0066] <data name="接地距离I段动作" id="grodistance1">< / data> ........
[0067] < / paras-tripinfo>
[0068] <paras-tripdout name="开出量信号" id="RelayTripDout">
[0069] <data name="A相跳闸出口" id="phasetrip1">< / data> ........
[0070] < / paras-tripdout>
[0071] <paras-datain name="开入量信号" id="RelayDataIn">
[0072] <data name="距离保护硬压板" id=" grodistancehardswitch">< / data> ........
[0073] < / paras- dataIn >
[0074] <paras-relayena name="软压板" id="RelayEna">
[0075] <data name="距离保护软压板" id=" grodistance1ena">< / data> ……
[0076] < / paras-relayena>
[0077] <paras-relaysetting name="定值组" id="RelaySetting">
[0078] <data name="接地距离I段定值" id=" grodistance1val">< / data>
[0079] <data name="接地距离I段时间" id=" grodistance1time">< / data> ……
[0080] < / paras-relaysetting>
[0081] <paras-relaysetena name="控制字组" id="RelaySettingEna">
[0082] <data name="接地距离I段控制字" id=" grodistance1enaset">< / data> ……
[0083] < / paras-relaysetena>
[0084] < / relaymodel>
[0085] Furthermore, according to one embodiment of the present invention, the functional configuration file is loaded through a test case management tool, and the functional configuration file is extracted and encapsulated 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 implementable logical functions of the relay protection device. By traversing the alarm signals and event signals, all logical functions of the relay protection device are enumerated. Then, each logical function of the relay protection device is matched with the input signals, output signals, soft switches, setting groups, and control word groups recorded in the TestRelayModel.xml file. This automatically generates a keyword set RelayCoreWords that starts with the device model root element and contains the logical functions, input signals, output signals, soft switches, setting groups, and control words of the relay protection device.
[0088] In this embodiment, the keyword set RelayCoreWords contains multiple sets of keyword groups. Each keyword group represents a specific functional logic of the relay protection device, and the entire keyword set represents a traversal of all functional logics of the relay protection device.
[0089] In this embodiment, the test case management tool GuideBook has a local keyword library for relay protection test templates. The keyword library's configuration is accumulated from long-term relay protection testing and constitutes a relay protection test asset. This invention encapsulates all keyword sets (RelayCoreWords) in the functional configuration file of the relay protection device under test into a JSON array format keyword set, as shown below in key-value pair format:
[0090] RelayCoreWords= {
[0091] { "relay": "PSL-603UA-G-V3.20", "warning": "Control loop disconnection / PT disconnection",
[0092] "tripinfo": "Grounding distance I-stage operation", "tripdin": "HWJ",
[0093] "tripdout": Phase A trip output; "relayena": Distance protection soft switch.
[0094] "relaysetting": "Ground distance I segment setting value $ground distance I segment time", "relaysetena": "Ground distance I segment control word"
[0095] }
[0096] { ……}……
[0097] }
[0098] Furthermore, according to one embodiment of the present invention, the test case management tool GuideBook requests a set of test methods from the test case management platform AtsTestSvr based on the keyword set via the management platform's dynamic library API. The test case management platform returns a set of test methods according to the request, including:
[0099] The method for connecting the test case management tool GuideBook to the dynamic library API of the management platform involves transmitting the encapsulated keyword set to the dynamic API of the management platform in plain text string format. The dynamic API of the management platform then sends a request command to the test case management platform AtsTestSvr.
[0100] The test case management platform AtsTestSvr receives the request command, analyzes the keyword set, and matches the required test method set, returning it to the management platform's dynamic library API. The test case management tool GuideBook then obtains the test method set from the management platform's dynamic library API.
[0101] The Management Platform Dynamic Library API contains an EXE file, which is implemented based on standard COM. The Management Platform Dynamic Library API provides a set of methods to enable communication and data exchange between the test case management tool and the test case management platform. It serves as 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 bidirectional verification between the test case management tool GuideBook and the test case management platform AtsTestSvr, and achieve 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 test case management platform AtsTestSvr is configured with the relay protection function logic keyword library CoreWordsLib. The relay protection function logic keyword library CoreWordsLib is a test asset library of relay protection devices, which has been accumulated in the long-term relay protection device testing work. Each test method set is configured with the keyword description of the test device, the test standard description, the environmental requirement description, the wiring topology description, and the 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) from relay protection device manufacturers. Each test method template is associated with a single keyword in the relay protection function logic keyword library CoreWordsLib in a one-to-many manner, so that the same test method template can be applied to the testing of different functions of multiple relay protection models.
[0105] The test method library in the AtsTestSvr test case management platform contains a collection of relay protection test method templates that have been gradually accumulated and improved over a long period of relay protection device development and testing. These test assets were developed and maintained by relay protection professionals. By combining multiple keywords to match a specific test method, the accuracy of test method test case selection is ensured.
[0106] In this embodiment, the set of testing methods includes fully automatic methods, semi-automatic methods, and manual testing methods.
[0107] Furthermore, according to one embodiment of the present invention, the test method set is converted into the test case data format of the test system using a test case management tool, forming test cases as follows:
[0108] The test case management tool serializes the received test method set to form serialized test cases (i.e., relay protection device test cases).
[0109] Serialized test cases include automatically generated test reports for filling in test data. The filling of test reports includes manual reporting, semi-automatic reporting, and fully automatic reporting. The test reports and the test system achieve automatic filling of test reports through bookmark management.
[0110] Serialized test cases include automatically generated test method wiring topologies for relay protection devices, which include:
[0111] The wiring topology of analog sampling of relay protection devices 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 described in natural language.
[0113] The wiring topology of relay protection device SV signal, Goose signal, GPS time synchronization signal, and printing function is automatically parsed and assigned a natural language description.
[0114] Serializable test cases contain intelligently generated test steps expressed in natural language, for example:
[0115] {
[0116] Please complete the AC sampling wiring of the relay protection device [...];
[0117] Please connect the input of the relay protection device [...] to the 220V DC output of the series tester [...];
[0118] Please connect the output of the relay protection device [...] to the input of the relay protection tester [...];
[0119] Modify the relay protection device setting / control word / soft pressure plate [...] to [...];
[0120] Check the manually entered values for the test report items [...].
[0121] ...
[0122] }
[0123] The automatically generated test cases for relay protection devices are stored in the test case management tool GuideBook and the test case management platform AtsTestSvr.
[0124] According to the above-described scheme of the present invention, the test case management tool GuideBook, acting as a client, calls the dynamic library API of the test case management platform to achieve fully automated management of the test method template library and generation of test cases. The AtsTestSvr test case management platform installs a database to store the test method library, test case library, and keyword library for test method templates. Through the above steps, the accumulation of the test method library and core terminology library during the long-term development and testing of relay protection devices enables the fully automated development of test cases for relay protection devices.
[0125] According to the above-described solution 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 descriptions and wiring topologies in test cases, realize intelligent serialization, reduce the risk of errors in manually developing test cases, and improve reliability; through the maintenance of the keyword library and the test method library, the test coverage can be greatly improved and the risk of missed tests can be reduced; by automatically generating test cases, the difficulty of test case development can be reduced, the dependence on professional knowledge can be reduced, and it can be ensured that people with different professional levels can develop comprehensive test cases.
[0126] Furthermore, to achieve the above objectives, the present invention also provides a system for automatically generating test cases for relay protection devices, comprising:
[0127] The function configuration file acquisition module acquires the function configuration file of the relay protection device in real time from the relay protection device's debugging port.
[0128] The keyword set extraction and encapsulation module loads the functional configuration file through the test case management tool, and extracts and encapsulates the functional configuration file into a keyword set;
[0129] The test method set invocation module connects the test case management tool 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 delegate specified by the management platform dynamic library API, obtains the corresponding 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 obtains the test method set from the dynamic library API.
[0130] The test case generation module uses a test case management tool to convert the set of test methods into the test case data format of the test system, thus forming test cases.
[0131] According to one embodiment of the present invention, the functional configuration file of the relay protection device is obtained in real time from the debugging port of the relay protection device, including:
[0132] The debugging tool Sgview communicates with the relay protection device through the debugging interface to complete the private protocol and obtain all the function configuration files of the relay protection device, including the relay protection device's program model, alarm signals, event signals, input quantities, output quantities, soft pressure plates, setting groups, and control word groups.
[0133] The data format file is automatically generated in a tree structure and packaged into a standard TestRelayModel.xml file for saving.
[0134] Compared to traditional test case development platforms that require specialized personnel with strong professional knowledge to manually extract the full functionality of relay protection devices, this invention significantly reduces the expertise requirements. The proprietary protocol of the debugging port ensures complete and comprehensive data acquisition. For example, the file format is as follows:
[0135] <relaymodel type="relay" name="线路保护装置" id="PSL-603UA-G-V3.20">
[0136] <paras-tripinfo name="事件信号" id="RelayTripInfo">
[0137] <data name="接地距离I段动作" id="grodistance1">< / data> ........
[0138] < / paras-tripinfo>
[0139] <paras-tripdout name="开出量信号" id="RelayTripDout">
[0140] <data name="A相跳闸出口" id="phasetrip1">< / data> ........
[0141] < / paras-tripdout>
[0142] <paras-relayena name="软压板" id="RelayEna">
[0143] <data name="距离保护软压板" id=" grodistance1ena">< / data> ……
[0144] < / paras-relayena>
[0145] <paras-relaysetting name="定值组" id="RelaySetting">
[0146] <data name="接地距离I段定值" id=" grodistance1val">< / data>
[0147] <data name="接地距离I段时间" id=" grodistance1time">< / data> ……
[0148] < / paras-relaysetting>
[0149] <paras-relaysetena name="控制字组" id="RelaySettingEna">
[0150] <data name="接地距离I段控制字" id=" grodistance1enaset">< / data> ……
[0151] < / paras-relaysetena>
[0152] < / relaymodel>
[0153] Furthermore, according to one embodiment of the present invention, the functional configuration file is loaded through a test case management tool, and the functional configuration file is extracted and encapsulated into a keyword set, including:
[0154] The test case management tool GuideBook loads the TestRelayModel.xml file;
[0155] By analyzing the alarm and event signals in the TestRelayModel.xml file, all the logical functions of the relay protection device are analyzed. Through adaptive algorithms and strategies, each logical function of the relay protection device is matched with the input, output, soft switch, setting group, and control word group recorded in the TestRelayModel.xml file. The system automatically generates a keyword set RelayCoreWords that starts with the device model root element and connects the logical functions, inputs, outputs, soft switches, settings, and control words of the relay protection device.
[0156] In this embodiment, the keyword set RelayCoreWords contains multiple sets of keyword groups. Each keyword group represents a specific functional logic of the relay protection device, and the entire keyword set represents a traversal of all functional logics of the relay protection device.
[0157] In this embodiment, the test case management tool GuideBook has a local keyword library for relay protection test templates. The keyword library's configuration is accumulated from long-term relay protection testing and constitutes a relay protection test asset. This invention encapsulates all keyword sets in the functional configuration file of the relay protection device under test into a JSON array format keyword set, as shown below in key-value pair format:
[0158] RelayCoreWords= {
[0159] { "relay": "PSL-603UA-G-V3.20", "warning": "Control loop disconnection / PT disconnection",
[0160] "tripinfo": "Grounding distance I-stage operation", "tripdin": "HWJ",
[0161] "tripdout": Phase A trip output; "relayena": Distance protection soft switch.
[0162] "relaysetting": "Ground distance I segment setting value $ground distance I segment time", "relaysetena": "Ground distance I segment control word"
[0163] }
[0164] { ……}……
[0165] }
[0166] Furthermore, according to one embodiment of the present invention, the test case management tool calls the dynamic library API of the management platform to request a set of test methods from the test case management platform based on the keyword set. The test case management platform returns the set of test methods according to the request, including:
[0167] The test case management tool GuideBook calls the dynamic library API to send the encapsulated keyword set to the test case management platform AtsTestSvr via plaintext strings.
[0168] The test case management platform AtsTestSvr receives the request command, calls the API adaptive method, analyzes the obtained keywords, matches the required set of test methods, and returns the set of test methods 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 bidirectional verification between 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 test case management platform AtsTestSvr is configured with the relay protection function logic keyword library CoreWordsLib. As a test asset library for relay protection devices, CoreWordsLib is accumulated over a long period of relay protection device testing work. Each test method set is configured with the associated description of the test device, standard document description, wiring topology description, and 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) from relay protection device manufacturers. Each test method template is associated with a single keyword in the relay protection function logic keyword library CoreWordsLib in a one-to-many manner, so that the same test method template can be applied to the testing of different functions of multiple relay protection models.
[0172] The test method library in the AtsTestSvr test case management platform contains a collection of relay protection test method templates that have been gradually accumulated and improved over a long period of relay protection device development and testing. These test assets were developed and maintained by relay protection professionals. By combining multiple keywords to match a specific test method, the accuracy of test method test case selection is ensured.
[0173] In this embodiment, the set of testing methods includes fully automatic methods, semi-automatic methods, and manual testing methods.
[0174] Furthermore, according to one embodiment of the present invention, the test method set is converted into the test case data format of the test system using a test case management tool, forming test cases as follows:
[0175] The test case management tool serializes the received test method set to form serialized test cases (i.e., relay protection device test cases).
[0176] Serialized test cases include automatically generated test reports for filling in test data. The filling of test reports includes manual reporting, semi-automatic reporting, and fully automatic reporting. The test reports and the test system achieve automatic filling of test reports through bookmark management.
[0177] Serialized test cases include automatically generated test method wiring topologies for relay protection devices, which include:
[0178] The wiring topology of analog sampling of relay protection devices 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 described in natural language.
[0180] The wiring topology of relay protection device SV signal, Goose signal, GPS time synchronization signal, and printing function is automatically parsed and assigned a natural language description.
[0181] Serializable test cases include intelligently generated test steps expressed in natural language, for example:
[0182] {
[0183] Please complete the AC sampling wiring of the relay protection device [...];
[0184] Please connect the input of the relay protection device [...] to the 220V DC output of the series tester [...];
[0185] Please connect the output of the relay protection device [...] to the input of the relay protection tester [...];
[0186] Modify the relay protection device setting / control word / soft pressure plate [...] to [...];
[0187] Check the manually entered values for the test report items [...].
[0188] ...
[0189] }
[0190] The automatically generated test cases for relay protection devices are stored in the test case management tool GuideBook and the test case management platform AtsTestSvr.
[0191] According to the above-described scheme of the present invention, the test case management tool GuideBook acts as a client, calling the API of the dynamic library of the test case management platform to realize the management of the test method template library and the fully automated generation of test cases. The AtsTestSvr test case management platform installs a database to store the test method library, test case library, and keyword library for test method templates. Through the above method steps, the accumulation of the test method library and core terminology library during the long-term development and testing of relay protection devices enables the fully automated development of test cases for relay protection devices.
[0192] According to the above-described solution 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 descriptions and wiring topologies in test cases, realize intelligent serialization, reduce the risk of errors in manually developing test cases, and improve reliability; through the maintenance of the keyword library and the test method library, the test coverage can be greatly improved and the risk of missed tests can be reduced; by automatically generating test cases, the difficulty of test case development can be reduced, the dependence on professional knowledge can be reduced, and it can be ensured that people with different professional levels can develop comprehensive test cases.
[0193] Furthermore, to achieve the above objectives, 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 the processor executes the computer program to implement the above-described method for automatically generating test cases for relay protection devices.
[0194] The present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the above-described method for automatically generating test cases for relay protection devices.
[0195] According to the above-described solution of the present invention, the large number of test method libraries accumulated by the test case management platform AtsTestSvr can be conveniently and efficiently maintained and expanded through the solution of the present invention; the present invention can 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 intelligently extracts and combines the test method set accumulated by the AtsTestSvr test case management platform through adaptive algorithms and strategies, which can reduce the error rate in the test case development process and improve test quality; the relay protection device debugging tool Sgview can automatically enumerate all functional logic of the relay protection device through private protocol communication of the debugging port, effectively ensuring the coverage of test cases.
[0196] Those skilled in the art will recognize that the modules and algorithm steps described in conjunction with the embodiments disclosed herein can be implemented using electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0197] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and equipment can be referred to the corresponding process in the foregoing method implementation, and will not be repeated here.
[0198] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0199] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the objectives of the embodiments of the present invention, depending on actual needs.
[0200] In addition, the functional modules in the embodiments of the present invention can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
[0201] If the aforementioned functions are implemented as software functional 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 this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the energy-saving signal transmission / reception methods of various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0202] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in this application.
[0203] It should be understood that the sequence number of each step in the invention and its embodiments does not absolutely imply 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 embodiments of the present invention.
Claims
1. A method for automatically generating test cases for relay protection devices, characterized in that, include: Obtain the functional configuration file of the relay protection device in real time from the relay protection device's debugging port; The functional configuration file is loaded using a test case management tool, and the functional configuration file is extracted and encapsulated into a keyword set. The test case management tool connects to the management platform's dynamic library API and sends the keyword set to the management platform's dynamic library API. The management platform's 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 delegate specified by the management platform dynamic library API, obtains the corresponding 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 then obtains the test method set from the management platform dynamic library API. The test case management tool converts the set of test methods in the dynamic library API of the management platform into the test case data format of the test system, thus forming test cases; The process involves loading the functional configuration file using a test case management tool and extracting and encapsulating the functional configuration file into a keyword set: The test case management tool GuideBook loads the TestRelayModel.xml file and analyzes all the logical functions of the relay protection device through the alarm signals and event signals in the TestRelayModel.xml file. It then traverses the data using adaptive algorithms and strategies, matching each logical function of the relay protection device with the input, output, soft switch, setting group, and control word group recorded in the TestRelayModel.xml file. This automatically generates a keyword set RelayCoreWords that starts with the device model root element and connects the logical functions, inputs, outputs, soft switches, settings, and control words of the relay protection device. The test case management tool calls the management platform's dynamic library API method to request a set of test methods from the test case management platform based on the keyword set. The test case management platform returns a set of test methods according to the request, including: The test case management tool GuideBook connects to the management platform's dynamic library API. The test case management tool GuideBook sends a request instruction to the management platform's dynamic library API in plain text string format after encapsulating the keyword set. The management platform's dynamic library API receives request instructions and synchronizes them to the threads 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 test method sets through the management platform's dynamic library API.
2. The method for automatically generating test cases for relay protection devices according to claim 1, characterized in that, The function configuration file of the relay protection device is obtained in real time from the debugging port of the relay protection device as follows: The debugging tool Sgview is used to communicate with the relay protection device through the debugging interface using a private protocol to obtain the functional configuration file of the relay protection device. Then, the data format file is automatically generated in a tree structure and packaged into a TestRelayModel.xml file for saving. The functional configuration file includes the following for the relay protection device: program model, alarm signal, event signal, input quantity, output quantity, soft pressure plate, setting group, and control word group.
3. The method for automatically generating test cases for relay protection devices according to claim 1 or 2, characterized in that, The test case management tool converts the test method set into the test system's test case data format, forming the test cases as follows: The test case management tool serializes the received set of test methods to form serialized test cases; The serialization test cases include: Test reports used to fill in test data; Test method wiring topology; Test steps expressed in natural language.
4. The method for automatically generating test cases for relay protection devices according to claim 3, characterized in that, The wiring topology of the test method includes: The wiring topology of analog sampling of relay protection devices 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 described in natural language. The wiring topology of relay protection device SV signal, Goose signal, GPS time synchronization signal, and printing function is automatically parsed and assigned a natural language description.
5. A system for automatically generating test cases for relay protection devices, characterized in that, include: The function configuration file acquisition module acquires the function configuration file of the relay protection device in real time from the relay protection device's debugging port. The keyword set extraction and encapsulation module loads the functional configuration file through the test case management tool, and extracts and encapsulates the functional configuration file into a keyword set; The test method set calling module and the test case management tool connect to the management platform dynamic library API to send the keyword set to the management platform dynamic library API. The management platform's 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 delegate specified by the management platform dynamic library API, obtains the corresponding 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 then obtains the test method set from the management platform dynamic library API. The test case generation module uses a test case management tool to convert the set of test methods into the test case data format of the test system, thus forming test cases. The process involves loading the functional configuration file using a test case management tool and extracting and encapsulating the functional configuration file into a keyword set: The test case management tool GuideBook loads the TestRelayModel.xml file and analyzes all the logical functions of the relay protection device through the alarm signals and event signals in the TestRelayModel.xml file. It then traverses the data using adaptive algorithms and strategies, matching each logical function of the relay protection device with the input, output, soft switch, setting group, and control word group recorded in the TestRelayModel.xml file. This automatically generates a keyword set RelayCoreWords that starts with the device model root element and connects the logical functions, inputs, outputs, soft switches, settings, and control words of the relay protection device. The test case management tool calls the management platform's dynamic library API method to request a set of test methods from the test case management platform based on the keyword set. The test case management platform returns a set of test methods according to the request, including: The test case management tool GuideBook connects to the management platform's dynamic library API. The test case management tool GuideBook sends a request instruction to the management platform's dynamic library API in plain text string format after encapsulating the keyword set. The management platform's dynamic library API receives request instructions and synchronizes them to the threads 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 test method sets through the management platform's dynamic library API.
6. An electronic device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements a method for automatically generating test cases for relay protection devices as described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the method for automatically generating test cases for relay protection devices as described in any one of claims 1-4.
Citation Information
Patent Citations
Test case generating method and device
CN101989227A
Method and related device for automatically generating UI automatic test case
CN117573567A