A method for generating RTDS test script

By designing the RTDS test script generation method, the RTDS testing process is automated, solving the problems of large test workload and low efficiency in the existing technology, and achieving efficient automated testing.

CN114048146BActive Publication Date: 2025-06-06STATE GRID ELECTRIC POWER RES INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111490758.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-08
Publication Date
2025-06-06
Estimated Expiration
2041-12-08

AI Technical Summary

Technical Problem

During the existing RTDS testing process, the test workload is large and the testing efficiency is low. A script is needed to design to automate the testing process.

Method used

Design a RTDS test script generation method, which analyzes test project information, calls common functions to set control elements, automatically executes test projects, records test results, and realizes pre-failure preparation and post-failure recovery.

Benefits of technology

Automatic batch testing is realized, which reduces the work intensity of the inspector, significantly improves the testing efficiency, and improves the testing efficiency by automatically saving the test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114048146B_ABST
    Figure CN114048146B_ABST
Patent Text Reader

Abstract

The invention discloses a method for generating an RTDS test script, which uses software to automatically generate a test script, and then executes the script in a Runtime module, thereby realizing an automatic test process. The generated RTDS script has a specific operation mode, including: a prepare button, a trigger button, and a restore button. The user can use these three buttons in RTDS to complete the logical coordination of all test items. The invention can automate the test process, automatically perform test items, and automatically record test results, which can reduce the work intensity of inspectors and improve test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for generating an RTDS test script, and belongs to the technical field of testing secondary devices of a power system. Background Art

[0002] RTDS, or Real Time Digital Simulation, is a hardware and software platform dedicated to power systems. Developed by Canada's RTDS Technology Company, RTDS has been widely used in online testing of secondary devices in power systems.

[0003] When using RTDS to conduct online testing of power system secondary devices, the usual testing process is as follows:

[0004] 1) Use the Draft software module of RTDS to build a simulation system model, compile and debug until there are no errors.

[0005] 2) Define analog output and switch input and output in the RTDS simulation model.

[0006] 3) Connect the input and output signals defined in the RTDS simulation model to the device under test.

[0007] 4) In the Runtime software module of RTDS, create control elements such as buttons, sliders, switches, and create monitoring elements such as drawings, meters, and indicator lights; in Runtime, run the simulation model to start testing, and perform manual testing item by item.

[0008] 5) Manually record the test results of each item after completing it.

[0009] 6) After all test items are completed, organize the test results and write a test report.

[0010] The characteristics of the above test are as follows: During the test, most of the test items are to simulate various simple faults and complex faults in the simulation system. The fault points include multiple locations inside and outside the zone, and the fault types include single-phase grounding, two-phase grounding, phase-to-phase short circuit, and three-phase short circuit; after the combination of fault points and fault types, there are more test items, usually a complete test of a device has at least about 300 test items and at most more than 1,000 test items.

[0011] The current testing process is to manually simulate faults one by one and record the test results. This method has a particularly large testing workload and low testing efficiency.

[0012] The Runtime software module of RTDS provides script language support, and the above test items can be automatically performed by writing script programs. Those skilled in the art are in urgent need of designing a script to solve the problem of particularly large test workload and low test efficiency during RTDS testing. Summary of the invention

[0013] Objective: To overcome the problem of low efficiency in testing power secondary devices using RTDS in the prior art, the present invention provides a method for generating RTDS test scripts, which can automate the test process, automatically perform test items, and automatically record test results, thereby reducing the workload of inspectors and improving test efficiency.

[0014] Technical solution: To solve the above technical problems, the technical solution adopted by the present invention is:

[0015] A method for generating an RTDS test script comprises the following steps:

[0016] Step 1: Read the next test item information from the stored test item list. The test item information includes: fault settings and overall settings.

[0017] Step 2: Parse the test item information and obtain the values ​​of each item in the fault setting and overall setting. The fault setting includes: fault location, fault type, fault delay time, fault duration; the overall setting includes: fault trigger angle, fault repetition times, whether to reclose, reclosing time, whether to enable pre-fault preparation, preparation time, whether to enable post-fault recovery, waiting time before recovery, waiting time after recovery, and the number of repetitions of all items.

[0018] Step 3: According to the value of each item in the fault setting and overall setting, call the relevant auxiliary functions in the general function part, set the value of the corresponding control element, and complete the setting of the test item. Call the function to set the Dial value to set the value of the fault position control element, call the function to set the Switch32 value to set the value of the fault type control element, call the function to set the Slider value to set the value of the fault delay time control element, call the function to set the Slider value to set the value of the fault duration control element, call the function to set the Slider value to set the value of the fault trigger angle control element, and call the function to set the Slider value to set the values ​​of the preparation time, waiting time before recovery, and waiting time after recovery.

[0019] Step 4: According to the values ​​of "Enable pre-fault preparation" and "Preparation time" in the overall settings, decide whether to trigger the "Prepare button" before executing this test. If "Enable pre-fault preparation" is 1, call the "Function to trigger PushButton" to trigger the "Prepare button". After the prepare button is triggered, call the "SUSPEND" command to suspend the execution of the script. The suspension time is the value of the "Prepare time". If "Enable pre-fault preparation" is 0, skip this step 4.

[0020] Step 5: Call the "Function to trigger PushButton" in the general function section to trigger the "Test Button" to execute and complete the test project set in step 3.

[0021] Step 6: Call the function for reading the meter value and the function for storing the plot waveform to obtain the value and waveform of the monitored element respectively, and store them in the file as the test results of this test project.

[0022] Step 7: According to the values ​​of "Whether to enable recovery after failure", "Waiting time before recovery" and "Waiting time after recovery" in the overall settings, decide whether to trigger the "Recovery button" after executing this test. If "Whether to enable recovery after failure" is 1, it means that the "Recovery button" will be triggered. Before the recovery button is triggered, first call the "SUSPEND" command to suspend the execution of the script, and the suspension time is the value of the "Waiting time before recovery"; call the "Function to trigger PushButton" to trigger the "Recovery button"; after the recovery button is triggered, call the "SUSPEND" command to suspend the execution of the script, and the suspension time is the value of the "Waiting time after recovery". If "Whether to enable recovery after failure" is 0, skip this step 7.

[0023] Step 8: Determine whether all test items in the test item list have been executed. If they have been executed, the script test is executed. Otherwise, return to step 1 to continue execution.

[0024] As a preferred solution, the control element name and the monitoring element name are extracted from the sib file of the test case, and the control element name and the monitoring element name are selected by the user from candidate input options and stored as variables.

[0025] As a preferred solution, the method for extracting the control component name and the monitoring component name from the sib file of the test case includes the following steps:

[0026] Open and read the sib file. Read the information after "COMPONENT" to get the type of the component. Read the GROUP information under the "COMPONENT" to get the path of the "COMPONENT". Read the DESC information to get the name of the "COMPONENT".

[0027] As a preferred solution, the names of the control elements include: POW control, fault trigger button control, first fault related control, second fault related control, preparation button control, and recovery button control. The names of the monitoring elements include: pre-stored meters and pre-stored drawings. The POW control, fault trigger button control, first fault related control, second fault related control, preparation button control, and recovery button control are displayed in a combo box for users to select and input. The pre-stored meters are displayed in a list box for users to select and input. The pre-stored drawings are displayed in a combo box for users to select and input.

[0028] As a preferred solution, the test item information is displayed in different interface controls for the user to select and input, and a test item list is generated after the user makes the selection.

[0029] As a preferred solution, the fault location is: inside the protection zone, outside the protection zone. The fault types are: single-phase grounding, two-phase short circuit, two-phase grounding, three-phase short circuit.

[0030] Beneficial effects: The method for generating an RTDS test script provided by the present invention has the following advantages:

[0031] (1) By executing the script generated by the present invention, batch automatic testing can be implemented instead of manual testing, which greatly reduces the intensity of testing work and significantly improves testing efficiency.

[0032] (2) Test scripts do not need to be written manually, but can be automatically generated using software, which is very simple and convenient.

[0033] (3) The automatic generation method of the RTDS script of the present invention is universal and applicable to test cases of various power systems, and is not limited to a certain test case.

[0034] (4) According to the automatic generation method of the RTDS script of the present invention, the required input data does not need to be manually input from scratch, but only needs to be selected and input from the provided candidate options, thereby effectively avoiding data input errors.

[0035] (5) The script automatically generated by the present invention completes each test item by triggering at most three buttons in sequence, which reduces the complexity of the script and improves the reliability of the script.

[0036] (6) Test results are automatically saved, eliminating the need to manually save test results, thus improving test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a schematic diagram of the process of the present invention.

[0038] Figure 2This is a schematic diagram of the structure of the sib file of the RTDS test case.

[0039] Figure 3 This is a schematic diagram of the test project information input interface.

[0040] Figure 4 This is a structural diagram of the test item list. DETAILED DESCRIPTION

[0041] The present invention will be further described below in conjunction with specific embodiments.

[0042] Since the script runs in the RTDS workstation, the script can store the voltage / current waveforms and tripping time of the device under test monitored in Runtime during the test. The voltage / current waveforms and tripping time of the device under test during the test are important data in the original inspection records, and the script can automatically save them for electronic archiving.

[0043] From the above analysis, it can be seen that it is feasible to automatically generate RTDS test scripts, perform RTDS dynamic model automatic testing and automatically store test results.

[0044] Figure 1 The flowchart of the method for automatically generating a RTDS test script according to the present invention and the execution process of the automatic generation script of the present invention using the Runtime software of RTDS are shown in FIG. Figure 1 The detailed instructions are as follows:

[0045] 1. Get the names of control components and monitoring components

[0046] First, the automatic generation method of the RTDS script of the present invention needs to obtain the following control element names: POW control, fault trigger button control, first fault related controls (including: fault location control, fault type control, fault duration control), second fault related controls (including: fault location control, fault type control, fault conversion time control, fault duration control), preparation button control, recovery button control, and the following monitoring element names: pre-stored meter, pre-stored drawing. The names of these control elements and monitoring elements will be used as input data of the automatic generation method of the RTDS script of the present invention.

[0047] The names of the above-mentioned components do not need to be manually input by the user. The automatic generation method of the RTDS script of the present invention will first read and analyze the sib file of the RTDS test case, extract all the control component names and monitoring component names contained in the test case, and provide them to the user as input options after filtering and sorting by type. The user can select and fill in the names of the above-mentioned control components and monitoring components from the candidate input options.

[0048] The process of reading and analyzing the sib file of the RTDS test case of the present invention is as follows:

[0049] sib file is a plain text file with the following structure: Figure 2 As shown:

[0050] The present invention calls a series of file operation functions to open and read the sib file, and determines whether each line of text read begins with "COMPONENT". The line is the starting position of the component, and the information after "COMPONENT" is read to obtain the type of the component. Then, the GROUP information under the "COMPONENT" is read to obtain the path of the "COMPONENT". Then, the DESC information is read to obtain the name of the "COMPONENT".

[0051] According to the above operation method, traverse the entire sib file and read the following types of "COMPONENT": PLOT, METER, SWITCH, DIAL, SWITCH32, BUTTON, SLIDER. Then store all the read components in the string format of "<type name>: <component name>". Then divide all components into three categories: input components, meter components, and drawing components; the "COMPONENT" types contained in the input components are: SWITCH, DIAL, SWITCH32, BUTTON, SLIDER; the "COMPONENT" types contained in the meter components are: METER; the "COMPONENT" types contained in the drawing components are: PLOT. Then sort the classified components separately to facilitate user selection. Finally, display the sorted input component names in the combo box for the user to select the name of the input control component, display the meter component names in the list box, and display the drawing component names in the combo box for the user to select the name of the input monitoring component.

[0052] 2. Get the test project list

[0053] Next, the automatic generation method of the RTDS script described in the present invention requires inputting a list of all pre-executed test items, and each group of test item information in the list includes fault settings and overall settings. Fault setting items include: fault location, fault type, fault delay time, and fault duration. Among them, the fault location is: inside the protection zone, outside the protection zone; the fault type is: single-phase grounding, two-phase short circuit, two-phase grounding, and three-phase short circuit. The overall setting items include: fault trigger angle, number of fault repetitions, whether to reclose, reclosing time, whether to enable pre-fault preparation, preparation time, whether to enable post-fault recovery, waiting time before recovery, waiting time after recovery, and the number of repetitions of all items.

[0054] The present invention provides Figure 3Interface to obtain the above test item list information:

[0055] exist Figure 3 In the interface, after the user enters a set of test item information, click "Add test group (end of list)" or "Add test group (after current group)" to add the group of test items to the Figure 4 The list of test items is shown.

[0056] After the script is executed, all test items in the test item list will be tested one by one.

[0057] 3. Automatic generation of RTDS scripts

[0058] Then, based on the names of the control elements and monitoring elements and the test item list information obtained above, the automatic generation method of the RTDS script described in the present invention can call the file reading and writing functions of the operating system to generate the following specific structure of the test script that conforms to the RTDS script language syntax.

[0059] The structure of the RTDS script code automatically generated by the present invention includes five parts, namely:

[0060] Step 1: Control component name part: This part of the code stores the name of the control component obtained as a variable, which changes as the component name selected and input by the user. The control component name stored here is used by the main function later.

[0061] Step 2: General function part: This part of the code is auxiliary function, which is fixed code and has nothing to do with the test case and test project settings. It mainly includes: function to set Slider value, function to trigger PushButton, function to set Dial value, function to set Switch32 value, function to read Meter value, function to store Plot waveform. The purpose of generating these auxiliary functions is to facilitate the subsequent main function call.

[0062] Step 3: Monitoring component name part: This part of the code stores the acquired monitoring component name as a variable, which changes as the component name selected and input by the user. The monitoring component name stored here is used by the main function later.

[0063] Step 4: Test item list section: This section of code stores the test item information in all the test item lists obtained, and changes according to the content of the test item information added to the list by the user. The test item list stored here is for the main function to execute item by item later.

[0064] Step 5: Test main function part: This part of code is the main function of the RTDS script, which is the core code of the RTDS script automatically generated by the present invention. The main function of the test main function is: looping through each test item in the test item list and recording the test results of each test item.

[0065] In the main test function, the code for executing each test item will call the code of the other four parts in the script. The operation process of the code of the main test function is described as follows:

[0066] Step 1: Read the next test item information from the stored test item list. The test item information is a line of string separated by commas. The first half of the string stores the fault location, fault type, fault delay time, and fault duration, and the second half stores the overall settings.

[0067] Step 2: Parse the test item information string and obtain the value of each item in the fault setting and overall setting. The fault setting includes: fault location, fault type, fault delay time, fault duration; the overall setting includes: fault trigger angle, fault repetition times, whether to reclose, reclosing time, whether to enable pre-fault preparation, preparation time, whether to enable post-fault recovery, waiting time before recovery, waiting time after recovery, and the number of repetitions of all items.

[0068] Step 3: Set the test project information in the RTDS simulated power grid. The control element name part in the script code has stored the name of the control element. According to the value of each item in the fault setting and the overall setting, call the relevant auxiliary functions in the general function part of the script code respectively, set the value of the corresponding control element, and complete the setting of the test project. For example: call the function that sets the Dial value to set the value of the fault location control element, call the function that sets the Switch32 value to set the value of the fault type control element, call the function that sets the Slider value to set the value of the fault delay time control element, call the function that sets the Slider value to set the value of the fault duration control element, call the function that sets the Slider value to set the value of the fault trigger angle control element, and call the function that sets the Slider value to set the values ​​of the preparation time, the waiting time before recovery, and the waiting time after recovery.

[0069] Step 4: According to the values ​​of "whether to enable fault preparation" and "preparation time" in the overall settings, decide whether to trigger the "preparation button" before executing this test. If "whether to enable fault preparation" is 1, call the "function to trigger PushButton" to trigger the "preparation button" (the name of the preparation button is stored in the control element name part of the script code). After the preparation button is triggered, call the "SUSPEND" command to suspend the execution of the script. The suspension time is the value of the "preparation time". If "whether to enable fault preparation" is 0, skip this step 4.

[0070] Step 5: Call the "Function to trigger PushButton" in the general function section to trigger the "Test Button" to execute and complete the test project set in step 3.

[0071] Step 6: Call the auxiliary function to read the meter value and the function to store the Plot waveform to store the test results of this test project. The monitoring component name part in the script code has stored the names of the monitoring components (including Meter and Plot). The values ​​and waveforms of these monitoring components are stored in the file as the test results of this test project.

[0072] Step 7: Based on the values ​​of "Whether to enable recovery after a fault", "Waiting time before recovery" and "Waiting time after recovery" in the overall settings, decide whether to trigger the "Recovery button" after executing this test. If "Whether to enable recovery after a fault" is 1, it means that the "Recovery button" will be triggered (the name of the recovery button is stored in the control element name part of the script code). However, before the recovery button is triggered, first call the "SUSPEND" command to suspend the execution of the script, and the suspension time is the value of the "Waiting time before recovery"; then call the "Function to trigger PushButton" to trigger the "Recovery button"; after the recovery button is triggered, call the "SUSPEND" command to suspend the execution of the script, and the suspension time is the value of the "Waiting time after recovery". If "Whether to enable recovery after a fault" is 0, skip this step 7.

[0073] Step 8: Determine whether all test items in the test item list have been executed. If they have been executed, the script test main function code has been executed, that is, the entire script code has been executed. Otherwise, return to step 1 to continue execution.

[0074] From the above description, we can see that the execution process of each test project is completed through three simple buttons, namely "Ready Button", "Test Button" and "Resume Button". The execution logic of the script code is simplified to triggering these three buttons, and the series of complex operations performed after the three buttons are triggered are implemented in the Draft software module of RTDS. The reason is that the RTDS script language function is limited, while the Draft software has very powerful control system programming capabilities and can easily implement various complex control logics.

[0075] The function of the "Prepare Button" is to complete the preparations before the start of the test project. The specific preparations that need to be done require the establishment of corresponding preparation logic in the Draft software.

[0076] The function of the "Test Button" is to execute the test item content, that is, to trigger a fault or change the system operation mode to complete the content of this test item. After this test item is completed, the script code will call the function of reading the meter value in the general function, read the test result value and store it as a CSV file; at the same time, the script code will call the function of storing the Plot waveform in the general function, and store the test result waveform as a COMTRADE file.

[0077] The function of the "Restore Button" is to restore the system status to the initial state so that the conditions for the next test are met.

[0078] 4. Execute RTDS script

[0079] Finally, in the Runtime software of RTDS, the RTDS script automatically generated in the method of the present invention is opened and started to be executed, so that all the test items in the above test item list can be automatically completed.

[0080] The complete execution process of the script code automatically generated by the present invention is briefly described as follows: first, the "prepare button" is triggered, at which time the test case performs pre-test preparations, and then the script will pause for the first time, and the pause time is the "waiting time after preparation"; after the waiting time is over, the "test button" is then triggered, and the current item in the test item list is tested. After the test item is executed, the test result record of the item is stored (including: action time, recording file, etc.); then the script will pause for the second time, and the pause time is the "waiting time before recovery"; after the waiting time is over, the "resume button" is then triggered, and the test case executes the recovery logic, and the system will recover to the initial state to prepare for the next test item; then the automatic test script program will pause for the third time, and the pause time is the "waiting time after recovery"; after the waiting time is over, if there are still test items to be executed, the test code of the next test item will be executed until all test items are completed.

[0081] The above-mentioned "prepare button" and "resume button" are not required to be triggered and can be skipped. Whether they are triggered depends on the overall settings in the current test project.

[0082] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for generating RTDS test scripts, Features: The steps include: Step 1: Read the next test item information from the stored test item list; the test item information includes: fault settings and overall settings; Step 2: Analyze the test item information and obtain the values ​​of each item in the fault setting and overall setting respectively; the fault setting includes: fault location, fault type, fault delay time, fault duration; the overall setting includes: fault trigger angle, fault repetition times, whether to reclose, reclosing time, whether to enable pre-fault preparation, preparation time, whether to enable post-fault recovery, waiting time before recovery, waiting time after recovery, and the number of repetitions of all items; Step 3: According to the value of each item in the fault setting and overall setting, call the function of setting the Dial value to set the value of the fault position control element, call the function of setting the Switch32 value to set the value of the fault type control element, call the function of setting the Slider value to set the value of the fault delay time control element, call the function of setting the Slider value to set the value of the fault duration control element, call the function of setting the Slider value to set the value of the fault trigger angle control element, call the function of setting the Slider value to set the values ​​of the preparation time, the waiting time before recovery, and the waiting time after recovery, and complete the setting of the test items; Step 4: According to the values ​​of "Enable pre-fault preparation" and "Preparation time" in the overall settings, decide whether to trigger the "Prepare button" before executing the test project; if "Enable pre-fault preparation" is 1, call the "Function that triggers PushButton" to trigger the "Prepare button". After the Prepare button is triggered, call the "SUSPEND" command to suspend the execution of the script, and the suspension time is the value of the "Preparation time"; if "Enable pre-fault preparation" is 0, skip this step 4; Step 5: Call the "Function to trigger PushButton" in the general function section to trigger the "Test Button" to execute and complete the test project set in step 3; Step 6: Call the function to read the meter value and the function to store the Plot waveform to obtain the value and waveform of the monitoring element respectively, and store them in the file as the test results of this test project; Step 7: According to the values ​​of "Enable recovery after failure", "Waiting time before recovery" and "Waiting time after recovery" in the overall settings, decide whether to trigger the "Resume button" after executing the test project; if "Enable recovery after failure" is 1, it means that the "Resume button" will be triggered; before the Resume button is triggered, first call the "SUSPEND" command to suspend the execution of the script, and the suspension time is the value of "Waiting time before recovery"; call the "Function to trigger PushButton" to trigger the "Resume button"; after the Resume button is triggered, call the "SUSPEND" command to suspend the execution of the script, and the suspension time is the value of "Waiting time after recovery"; if "Enable recovery after failure" is 0, skip this step 7; Step 8: Determine whether all test items in the test item list have been executed. If they have been executed, the script test is executed; otherwise, return to step 1 to continue execution.

2. A method for generating an RTDS test script according to claim 1, Features: The control component name and the monitoring component name are extracted from the sib file of the test case, and the control component name and the monitoring component name are selected by the user from candidate input options and stored as variables.

3. A method for generating an RTDS test script according to claim 2, Features: The method for extracting the control component name and the monitoring component name from the sib file of the test case includes the following steps: Open and read the sib file. Read the information after "COMPONENT", which is the type of the component. Read the GROUP information under the "COMPONENT" to get the path of the "COMPONENT". Read the DESC information to get the name of the "COMPONENT".

4. A method for generating an RTDS test script according to claim 2, Features: The names of control elements include: POW control, fault trigger button control, first fault related controls, second fault related controls, prepare button control, and restore button control; the names of monitoring elements include: pre-stored meters, pre-stored drawings; the POW control, fault trigger button control, first fault related controls, second fault related controls, prepare button control, and restore button control are displayed in a combo box for users to select and input; the pre-stored meters are displayed in a list box for users to select and input; the pre-stored drawings are displayed in a combo box for users to select and input.

5. A method for generating an RTDS test script according to claim 1, Features: The test item information is displayed in different interface controls for users to select and input, and a test item list is generated after the user makes a selection.

6. A method for generating an RTDS test script according to claim 1, Features: The fault locations are: inside the protection zone, outside the protection zone; the fault types are: single-phase grounding, two-phase short circuit, two-phase grounding, three-phase short circuit.

Citation Information

Patent Citations

  • Real-time digital emulation automatic test method

    CN101789583A

  • Method for automatically generating testing script

    CN104484269A