CMS server-side protocol testing method, system, device and storage medium
Through the CMS server-side protocol testing method, automated analysis and execution of test cases solves the problem of heavy workload for substation secondary system communication protocol testing, improves testing efficiency and consistency, and achieves comprehensive coverage and efficient automation of new generation devices. test.
Patent Information
- Application Number
- CN202211058379.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-31
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-08-31
AI Technical Summary
In the existing technology, the testing workload of the substation secondary system communication protocol is huge, requires a lot of manual intervention, and is difficult to automate, resulting in low testing efficiency.
Provides a CMS server-side protocol testing method that selects test cases through automatic analysis, performs automatic testing, records the testing process and generates test reports, reducing manual intervention and improving testing efficiency.
It has realized automated testing of the equipment under test, covering all types of devices in the new generation substation. The test has good consistency, a high degree of automation, and the test report is rich in information and easy to analyze and find problems.
Smart Images

Figure CN115396352B
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of substation secondary system communication test, and in particular relates to a CMS (substation secondary system communication message) server-side protocol test method, system, equipment and storage medium. Background Art
[0002] The power industry includes power generation, transmission, transformation, distribution, and consumption, which is not only related to national economic security, but also closely related to people's daily life and social stability. Substations are the assembly points for transmission and distribution, and are an important link in the power industry. Substations are places in the power system that transform voltage and current, receive and distribute electric energy. The electrical equipment in the substation is divided into primary equipment and secondary equipment. Primary equipment refers to equipment that directly produces, transmits, distributes and uses electric energy. Secondary equipment refers to equipment that measures, monitors, controls and protects the operating conditions of primary equipment and systems, mainly including relay protection devices, automatic devices, measurement and control devices, metering devices, automation systems, and DC equipment that provides power to secondary equipment. At present, the chips of secondary equipment used in power production, operation, and management rely heavily on imports. Among them, the underlying communication of the secondary system of substations that complies with the 61850 specification also relies on the international MMS (Manufacturing Message Specification) protocol.
[0003] The substation secondary system communication message (CMS) based on DL / T860 is an autonomous and controllable protocol specification, which is mainly used for communication between secondary devices in substations. The power industry series standard DL / T860 mainly includes DL / T860.3 (Power Automation Communication Network and System Part 3: General Requirements), DL / T860.3 (Power Automation Communication Network and System Part 4: System and Project Management), DL / T860.5 (Power Automation Communication Network and System Part 5: Functional Communication Requirements and Device Model), DL / T860.6 (Power Automation Communication Network and System Part 6: Communication Configuration Description Language for Substations Related to Intelligent Electronic Devices), DL / T860.72 (Power Automation Communication Network and System Part 7-2: Basic information and communication structure - Abstract Communication Service Interface (ACSI)), DL / T860.73 (Electric Power Automation Communication Network and System Part 7-3: Basic Communication Structure Common Data Class), DL / T860.74 (Electric Power Automation Communication Network and System Part 7-4: Basic Information and Communication Structure - Logical Node and Data Object Class), DL / T860.10 (Electric Power Automation Communication Network and System Part 10: Conformance Test), etc., among which the substation secondary system communication message is a communication mechanism implemented based on DL / T860.72.
[0004] There are many types of secondary equipment in substations, including protection, monitoring, measurement, recording, switches, auxiliary control and other types of devices. There are many types of devices produced by different manufacturers. The communication between devices must be based on the same protocol and the functional specifications implemented must be consistent to achieve smooth interconnection. In order to ensure that the protocol consistency meets the requirements, professional centralized testing must be carried out. However, due to the large number of manufacturers and device types, the communication protocol includes 57 communication services, and each service requires a variety of positive and negative test cases for testing. It is necessary to record the test steps, input and output, test questions, test messages, test conclusions of each test case, automatically generate test reports, etc., which is a huge workload. Summary of the invention
[0005] The purpose of the present invention is to address the problems in the above-mentioned prior art and provide a CMS server-side protocol testing method, system, device and storage medium, which can automatically test the consistency compliance of the server under test, thereby reducing the intervention of testers and the testing workload, and effectively improving the server automation testing level and testing efficiency.
[0006] In order to achieve the above object, the present invention has the following technical solutions:
[0007] In a first aspect, a CMS server-side protocol testing method is provided, comprising:
[0008] Test data setting of the device under test;
[0009] Service settings of the device under test;
[0010] For the equipment under test that has completed the test data and service settings, it automatically analyzes and selects the test cases that need to be executed;
[0011] Perform automatic testing according to the selected test cases, record the test process, give test conclusions, and identify test problems;
[0012] Export the test process, test conclusions and test issues, and generate a test report.
[0013] As a preferred solution of the CMS server-side protocol testing method of the present invention, in the step of setting the test data of the device under test, the test data includes pre-set test data and dynamically generated test data;
[0014] The pre-set test data includes data related to association negotiation services, model and data services, data set services, control services, setting group services, report services, log services, file services, and remote procedure calls;
[0015] The associated negotiation service includes the IP address of the device under test and the security certificate format;
[0016] Models and data services are modifiable data indexes;
[0017] The dataset service includes the number of datasets that can be created and the number of entries in each dataset;
[0018] The control service includes supported control modes and corresponding control points, and control return-to-school delay time;
[0019] The set value group service includes set value control block index and set value data set;
[0020] Reporting services include supported report types and report triggering methods;
[0021] The log service includes log triggering methods;
[0022] File services include supported services and the paths and file names of files that can be read, written, and deleted;
[0023] Remote procedure call is a remote call service supported;
[0024] The dynamically generated test data is generated according to the data type, current value, maximum value, minimum value and step size.
[0025] As a preferred solution of the CMS server-side protocol testing method of the present invention, in the step of setting the service of the device under test, the service setting specifically includes selecting the service type supported by the device under test and verifying it according to the test data. If the corresponding test data is not configured, it is considered that the selected service type is not supported.
[0026] As a preferred solution of the CMS server-side protocol testing method of the present invention, the service type is selected from 57 service types specified in the substation secondary system communication message specification.
[0027] As a preferred solution of the CMS server-side protocol testing method of the present invention, the step of performing automatic testing according to the selected test case includes:
[0028] 1) Check the preconditions of the test case. If the conditions are met, proceed to the next step, otherwise the test is interrupted;
[0029] 2) Start message monitoring;
[0030] 3) Select and associate a client. If successful, proceed to the next step, otherwise, interrupt the test;
[0031] 4) Select multiple fixed values and calculate a new fixed value based on the maximum value, minimum value and step size information of the fixed values;
[0032] 5) Read the value of the fixed value control block;
[0033] 6) Organize the test steps and expected results, and push them into the corresponding queues in sequence;
[0034] 7) In the step queue, the step information is gradually taken out, sent to the client thread, the client thread is called to execute the corresponding service, and the actual result of the step is placed in the actual result queue;
[0035] 8) When the step queue is not empty, repeat step 7), otherwise proceed to the next step;
[0036] 9) Stop packet capture and throw out the end of test case execution;
[0037] 10) Determine whether the number of the actual result queue is the same as the number of the expected result queue. If not, jump to step 14) to execute, otherwise proceed to the next step;
[0038] 11) Take out the actual results and compare them with the expected results in turn, judge the positive and negative responses, error codes, and time checks. If they meet the expectations, the step passes, otherwise it fails;
[0039] 12) Determine whether the actual queue is empty. If not, repeat step 11), otherwise proceed to the next step;
[0040] 13) If all steps are in line with expectations, the test case passes, otherwise it fails;
[0041] 14) Save messages and test records;
[0042] 15) Update test progress and test case status.
[0043] Furthermore, the specific contents of the test case precondition check in step 1) include:
[0044] Whether the client list is empty;
[0045] Whether the configuration supports the services required by the test case;
[0046] Whether the model contains constant value control blocks.
[0047] Furthermore, the step 6) of organizing the test steps and the steps of expected results specifically includes:
[0048] Select Edit Group Setting Value, the expected result is to return a positive response;
[0049] Set the edit group setting value, the setting value is the new setting value in step 4), and the expected result is to return a positive response;
[0050] Read edit group setting value, the expected result is to return a positive response;
[0051] Compare the read fixed value to see if it is the same as the new fixed value in step 4). The expected result is that it is the same as the new fixed value.
[0052] Confirms the edit group setting, the expected result is a positive response.
[0053] In a second aspect, a CMS server-side protocol testing system is provided, comprising:
[0054] Test data setting module, used for setting test data of the device under test;
[0055] Service setting module, used for service setting of the device under test;
[0056] The test case selection module is used to automatically analyze and select the test cases that need to be executed for the device under test that has completed the test data and service settings;
[0057] Automatic testing module, used to perform automatic testing according to the selected test cases, record the test process, give test conclusions, and find test problems;
[0058] The test report generation module is used to export the test process, test conclusions and test problems, and generate a test report.
[0059] As a preferred solution of the CMS server-side protocol testing system of the present invention, the device under test test data set by the test data setting module includes pre-set test data and dynamically generated test data;
[0060] The pre-set test data includes data related to association negotiation services, model and data services, data set services, control services, setting group services, report services, log services, file services, and remote procedure calls;
[0061] The associated negotiation service includes the IP address of the device under test and the security certificate format;
[0062] Models and data services are modifiable data indexes;
[0063] The dataset service includes the number of datasets that can be created and the number of entries in each dataset;
[0064] The control service includes supported control modes and corresponding control points, and control return-to-school delay time;
[0065] The set value group service includes set value control block index and set value data set;
[0066] Reporting services include supported report types and report triggering methods;
[0067] The log service includes log triggering methods;
[0068] File services include supported services and the paths and file names of files that can be read, written, and deleted;
[0069] Remote procedure call is a remote call service supported;
[0070] The dynamically generated test data is generated according to the data type, current value, maximum value, minimum value and step size.
[0071] As a preferred solution of the CMS server-side protocol testing system of the present invention, the service setting module selects the service type supported by the device under test and verifies it according to the test data. If the corresponding test data is not configured, it is considered that the selected service type is not supported.
[0072] As a preferred solution of the CMS server-side protocol testing system of the present invention, when the service setting module selects the service type supported by the device under test, it selects from 57 service types specified in the substation secondary system communication message specification.
[0073] As a preferred solution of the CMS server-side protocol testing system of the present invention, the steps of the automatic testing module performing automatic testing according to the selected test case include:
[0074] 1) Check the preconditions of the test case. If the conditions are met, proceed to the next step, otherwise the test is interrupted;
[0075] 2) Start message monitoring;
[0076] 3) Select and associate a client. If successful, proceed to the next step, otherwise, interrupt the test;
[0077] 4) Select multiple fixed values and calculate a new fixed value based on the maximum value, minimum value and step size information of the fixed values;
[0078] 5) Read the value of the fixed value control block;
[0079] 6) Organize the test steps and expected results, and push them into the corresponding queues in sequence;
[0080] 7) In the step queue, the step information is gradually taken out, sent to the client thread, the client thread is called to execute the corresponding service, and the actual result of the step is placed in the actual result queue;
[0081] 8) When the step queue is not empty, repeat step 7), otherwise proceed to the next step;
[0082] 9) Stop packet capture and throw out the end of test case execution;
[0083] 10) Determine whether the number of the actual result queue is the same as the number of the expected result queue. If not, jump to step 14) to execute, otherwise proceed to the next step;
[0084] 11) Take out the actual results and compare them with the expected results in turn, judge the positive and negative responses, error codes, and time checks. If they meet the expectations, the step passes, otherwise it fails;
[0085] 12) Determine whether the actual queue is empty. If not, repeat step 11), otherwise proceed to the next step;
[0086] 13) If all steps are in line with expectations, the test case passes, otherwise it fails;
[0087] 14) Save messages and test records;
[0088] 15) Update test progress and test case status.
[0089] According to a third aspect, an electronic device is provided, including:
[0090] a memory storing at least one instruction; and
[0091] The processor executes the instructions stored in the memory to implement the CMS server-side protocol testing method.
[0092] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the CMS server-side protocol testing method is implemented.
[0093] Compared with the prior art, the first aspect of the present invention has at least the following beneficial effects:
[0094] The method of the present invention automatically analyzes and selects the test cases to be executed for the tested device that completes the test data and service settings, and performs automatic testing according to the selected test cases, records the test process, gives the test conclusion, finds out the test problems, is easy to analyze, and has a high degree of automation. The method of the present invention performs the service settings of the tested device, can cover all types of devices in the new generation substation, and the test case coverage is relatively comprehensive during the automatic test, the test consistency is good, and the input under certain conditions is required to return the corresponding output, and automatically judges whether the response meets the substation secondary system communication message regulations. The test process and judgment basis for all tested devices and tested servers are the same, and the tested devices and servers have high compliance. Finally, the test process, test conclusion and test problems are derived, and a test report is generated. The present invention can realize that for each test case, the test input and output, the interaction process and interaction results (positive and negative responses) in chronological order, the judgment results of each step, and the final results are recorded. The test report covers relatively rich information, and the test problems found are easy to analyze.
[0095] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0096] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0097] Figure 1 Flow chart of the CMS server-side protocol testing method according to an embodiment of the present invention;
[0098] Figure 2 The overall flow chart of the embodiment of the present invention performing automatic testing according to the selected test case;
[0099] Figure 3 Schematic diagram of a software interface for presetting test data in an embodiment of the present invention;
[0100] Figure 4 Flowchart of test case preparation and test organization steps and expected results in the embodiment of the present invention;
[0101] Figure 5 A flowchart of a test step queue executed in an embodiment of the present invention;
[0102] Figure 6 Flow chart of test result processing according to an embodiment of the present invention;
[0103] Figure 7 A structural block diagram of a CMS server-side protocol testing system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0104] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0105] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0106] The substation secondary system communication message is a communication service mechanism based on the DL / T860 standard, which specifies the mapping implementation methods of various abstract services, namely, the message headers, data formats, encoding methods, and correct and incorrect response mechanisms of both parties when the client and the server interact. Each manufacturer must correctly and uniformly implement requests and responses based on the substation secondary system communication message to ensure the interconnection and interoperability of the equipment. As a communication protocol on the server side, it must correctly respond to various requests received. In order to verify whether the implementation of each manufacturer's equipment complies with the provisions of the substation secondary system communication message, it must be subjected to detailed and strict consistency testing. There are many manufacturers and various equipment, and the workload of professional testing in a concentrated time is large. In order to meet the requirements of professional testing, the present invention proposes a server-side protocol automatic testing method based on the substation secondary system communication message.
[0107] Example 1
[0108] See also Figure 1 A CMS server-side protocol testing method according to an embodiment of the present invention comprises the following steps:
[0109] S1. Test data setting of the device under test;
[0110] S2, service settings of the device under test;
[0111] S3. Automatically analyze and select the test cases to be executed for the device under test that has completed the test data and service settings;
[0112] S4. Perform automatic testing according to the selected test cases, record the test process, give test conclusions, and find out test problems;
[0113] S5. Export the test process, test conclusions and test problems, and generate a test report.
[0114] In a possible implementation, the parameters used in the test of step S1 include two types, namely, pre-set test data and dynamically generated test data. Some services only need one of the two methods, while some services need both methods.
[0115] 1.1 Pre-set test data
[0116] There are many types of devices under test. Each type of device may support different services. The model index of the same type of device may also be different. Therefore, some service tests require the manufacturer to configure the data index to be able to test and judge normally. In addition, during automatic testing, relevant test data will be automatically selected or generated, such as Figure 3 As shown, the test parameters that need to be configured are as follows:
[0117] a) Association negotiation service
[0118] It is necessary to configure the IP address and security certificate format of the device under test.
[0119] b) Model and data services
[0120] The index of the data that can be modified.
[0121] c) Dataset Services
[0122] The number of data sets that can be created, the number of entries each data set contains, etc.
[0123] d) Control services
[0124] Supported control modes and corresponding control points, control of return to school delay time, etc.
[0125] e) Setting group service
[0126] Constant value control block index, constant value data set, etc.
[0127] f) Reporting Services
[0128] Supported report types, report triggering methods, etc.
[0129] g) Log service
[0130] Log triggering method, etc.
[0131] h) Document Services
[0132] Supported services and paths and file names of files that can be read, written, and deleted.
[0133] i) Remote Procedure Call
[0134] Supports remote invocation of services.
[0135] 1.2 Dynamically generated test data
[0136] It is generated according to the data type, current value, maximum value, minimum value and step size. For example, for BOOL data, if the current value is FALSE, the test data is TRUE when it needs to change, and FALSE when it does not need to change. For integer data INT8, the test data is the current value plus or minus the step size, and cannot exceed the range specified by the maximum and minimum values. If the maximum value is 100, the minimum value is 0, the step size is 2, and the current value is 3, then the test data may be 3+2, and so on for other data types. In addition, boundary data and abnormal data are also used in the test.
[0137] In a possible implementation, step S2 selects the service type supported by the device under test and verifies it according to the test data configured by the manufacturer. If the corresponding test data is not configured, it is considered that the service is not supported. For example, if the device under test supports the write data service but no writable data is configured, it is considered that the write service is not supported.
[0138] The service type in step S2 is selected from 57 service types specified in the substation secondary system communication message specification.
[0139] The 57 services specified in the substation secondary system communication message specification are as follows:
[0140] 1) Association negotiation service
[0141] Associate, Abort, Release, AssociateNegotiate;
[0142] 2) Model and data services
[0143] GetServerDirectory, GetLogicDeviceDirectory, GetLogicNodeDirectory, GetAllDataValues, GetAllDataDefinition, GetAllCBValues, GetDataValues, SetDataValues, GetDataDirectory, GetDataDefinition;
[0144] 3) Dataset Services
[0145] CreateDataSet, DeleteDataSet, GetDataSetDirectory, GetDataSetValues, SetDataSetValues;
[0146] 4) Control services
[0147] Select, SelectWithValue, Cancel, Operate, CommandTermination, TimeActivatedOperate, TimeActivatedOperateTermination;
[0148] 5) Setting group service
[0149] SelectActiveSG, SelectEditSG, SetEditSGValue, ConfirmEditSGValues, GetEditSGValue, GetSGCBValues;
[0150] 6) Reporting Services
[0151] Report, GetBRCBValues, SetBRCBValues, GetURCBValues, SetURCBValues;
[0152] 7) Log service
[0153] GetLCBValues, SetLCBValues, QueryLogByTime, QueryLogAfter, GetLogStatusValues;
[0154] 8) GOOSE control block service
[0155] GetGoCBValues, SetGoCBValues;
[0156] 9)MSV control block service
[0157] GetMSVCBValues,SetMSVCBValues;
[0158] 10) Document Services
[0159] GetFile, SetFile, DeleteFile, GetFileAttributeValues, GetFileDirectory;
[0160] 11) Remote Procedure Call
[0161] GetRpcInterfaceDirectory, GetRpcMethodDIrectory, GetRpcInterfaceDefinition, GetRpcMethodDefinition, RpcCall;
[0162] 12) Testing
[0163] Test.
[0164] In a possible implementation manner, after the tested device is configured with test data and services in step S3, the available test cases are automatically analyzed, and the test cases are automatically checked for display, and test cases that need to be executed can also be added or removed.
[0165] In a possible implementation, step S4 executes each test case in sequence according to the automatically selected test cases, and after a test case is executed individually, a test conclusion is given, such as passed, failed, not applicable, not tested, etc.
[0166] See also Figure 2 The overall process of performing automatic testing according to the selected test case in the embodiment of the present invention includes:
[0167] 1) Monitoring test messages;
[0168] 2) Initialize automatic test parameters, process data, test status, etc.;
[0169] 3) Count the currently selected test cases;
[0170] 4) Take a test case from the test queue and obtain the test case ID and test data;
[0171] 5) According to the test case ID, enter different test cases to execute specific test steps;
[0172] 6) Save the test results and update the test progress.
[0173] Taking a single test case test flow as an example, a test case requires that the DUT should correctly handle the following fixed value modification process:
[0174] Respond to SelectEditSG request to switch the editing area;
[0175] Respond to SetEditSGValue request to modify the set value;
[0176] Respond to GetEditSGValue[FC=SE] request and send the modified value;
[0177] Respond to ConfirmEditSGValues request to confirm.
[0178] See also Figures 4 to 6 , when executing this test case, the automatic testing process is as follows:
[0179] 1) Check the preconditions of the test case. If the conditions are met, proceed to the next step, otherwise the test is interrupted;
[0180] a) Whether the client list is empty;
[0181] b) Whether the configuration supports the services required by the test case (SelectEditSG, GetEditSGValues, SetEditSGValues, ConfirmEditSG);
[0182] c) Whether the model contains a fixed value control block;
[0183] 2) Start message monitoring;
[0184] 3) Select and associate a client. If successful, proceed to the next step, otherwise terminate the test;
[0185] 4) Select multiple fixed values and calculate a new fixed value based on the maximum value, minimum value and step size information of the fixed values;
[0186] 5) Read the value of the fixed value control block;
[0187] 6) Organize the test steps and expected results, and push them into the corresponding queues in sequence;
[0188] a) Select the edit group setting SelectEditSG, and the value of EditSG is the value of AcsSG; the expected result is to return a positive response;
[0189] b) Set the edit group value SetEditSGValues to the new value in step 4; the expected result is a positive response;
[0190] c) GetEditSGValues to get the edit group values. The expected result is to return a positive response.
[0191] d) Compare the read fixed value to see if it is the same as the new value in step 4. The expected result is that it is the same as the new value;
[0192] e) Confirm the edit group setting value ConfirmEditSG, the expected result is a positive response;
[0193] 7) In the step queue, the step information is gradually taken out, sent to the client thread, and the actual result of the step is placed in the actual result queue;
[0194] 8) When the step queue is not empty, repeat step 7), otherwise proceed to the next step;
[0195] 9) Stop packet capture and throw out the end of test case execution;
[0196] 10) Determine whether the number of the actual result queue is the same as the number of the expected result queue. If not, jump to step 14), otherwise proceed to the next step;
[0197] 11) Take out the actual results and compare them with the expected results in turn, judge the positive and negative responses, error codes, time checks, etc. If they meet the expectations, the step passes, otherwise it fails;
[0198] 12) Determine whether the actual queue is empty. If not, repeat step 11), otherwise proceed to the next step;
[0199] 13) If all steps are in line with expectations, the test case passes, otherwise it fails;
[0200] 14) Save messages and test records;
[0201] 15) Update test progress and test case status.
[0202] In a possible implementation, step S5 records the entire test process and test questions in detail and stores them in a database. When the test is finished, the required report format can be exported according to the exported report template.
[0203] The CMS server-side protocol testing method proposed in the embodiment of the present invention has the following advantages compared with the prior art:
[0204] 1. High degree of automation
[0205] Based on the selected device type and data model, the data used is pre-configured, the test system automatically executes all test cases, and automatically records the input, output and service process. It automatically analyzes whether the received positive and negative responses, data types, data formats, and data ranges are correct based on the sent requests. It automatically records and displays problems, interactive messages, etc., and can export relevant records and problems for easy analysis.
[0206] 2. Comprehensive test coverage
[0207] It covers all types of devices in the new generation of substations, supports positive and negative tests and security tests of 57 services on the server side, and has more than 450 test cases, each of which contains multiple test processes, which is quite rich. It covers protection, monitoring, measurement and control, metering, recording, switches, auxiliary control and other device types; positive test cases such as different forward parameters, different data types, different services and combination tests; negative tests such as value range, boundary, disorder, repetition, quantity mismatch, type mismatch, coding error and other test cases, and security tests include transport layer, application layer and other test cases.
[0208] 3. Good test consistency
[0209] During automatic testing, the test cases cover a relatively comprehensive range. For inputs under certain conditions, the corresponding outputs are required to be returned, and the response is automatically judged whether it complies with the substation secondary system communication message regulations. The test process and judgment basis are the same for all tested devices and servers, and the tested devices and servers have a high degree of compliance.
[0210] 4. Rich record information
[0211] For each test case, the test input and output, the interaction process and interaction results (positive and negative responses) in chronological order, the analysis results of each step, and the final result are recorded and distinguished by different colors. The underlying messages of the interaction can also be exported, etc. At the same time, the tester information, environmental information, etc. are recorded. The information is relatively rich, and it is easy to analyze the test problems found.
[0212] Example 2
[0213] See also Figure 7 , a CMS server-side protocol testing system according to an embodiment of the present invention comprises:
[0214] Test data setting module 1, used for setting test data of the device under test;
[0215] Service setting module 2, used for service setting of the device under test;
[0216] The test case selection module 3 is used to automatically analyze and select the test cases to be executed for the device under test that has completed the test data and service settings;
[0217] Automatic testing module 4, used to perform automatic testing according to the selected test cases, record the test process, give test conclusions, and find test problems;
[0218] The test report generation module 5 is used to export the test process, test conclusions and test problems and generate a test report.
[0219] In a possible implementation manner, the device under test test data set by the test data setting module 1 includes pre-set test data and dynamically generated test data.
[0220] Furthermore, the pre-defined test data includes data related to association negotiation services, model and data services, data set services, control services, setting group services, report services, log services, file services, and remote procedure call;
[0221] The associated negotiation service includes the IP address of the device under test and the security certificate format;
[0222] Models and data services are modifiable data indexes;
[0223] The dataset service includes the number of datasets that can be created and the number of entries in each dataset;
[0224] The control service includes supported control modes and corresponding control points, and control return-to-school delay time;
[0225] The set value group service includes set value control block index and set value data set;
[0226] Reporting services include supported report types and report triggering methods;
[0227] The log service includes log triggering methods;
[0228] File services include supported services and the paths and file names of files that can be read, written, and deleted;
[0229] Remote procedure call is a remote call service supported;
[0230] Dynamically generated test data is generated based on the data type, current value, maximum value, minimum value and step size.
[0231] In a possible implementation, the service setting module 2 selects a service type supported by the device under test and performs verification according to the test data. If the corresponding test data is not configured, it is considered that the selected service type is not supported.
[0232] In a possible implementation manner, when the service setting module 2 selects the service type supported by the device under test, it selects from 57 service types specified in the substation secondary system communication message specification.
[0233] In a possible implementation, the step of the automatic testing module 4 performing automatic testing according to the test case includes:
[0234] 1) Check the preconditions of the test case. If the conditions are met, proceed to the next step, otherwise the test is interrupted;
[0235] 2) Start message monitoring;
[0236] 3) Select and associate a client. If successful, proceed to the next step, otherwise, interrupt the test;
[0237] 4) Select multiple fixed values and calculate a new fixed value based on the maximum value, minimum value and step size information of the fixed values;
[0238] 5) Read the value of the fixed value control block;
[0239] 6) Organize the test steps and expected results, and push them into the corresponding queues in sequence;
[0240] 7) In the step queue, the step information is gradually taken out, sent to the client thread, the client thread is called to execute the corresponding service, and the actual result of the step is placed in the actual result queue;
[0241] 8) When the step queue is not empty, repeat step 7), otherwise proceed to the next step;
[0242] 9) Stop packet capture and throw out the end of test case execution;
[0243] 10) Determine whether the number of the actual result queue is the same as the number of the expected result queue. If not, jump to step 14) to execute, otherwise proceed to the next step;
[0244] 11) Take out the actual results and compare them with the expected results in turn, judge the positive and negative responses, error codes, and time checks. If they meet the expectations, the step passes, otherwise it fails;
[0245] 12) Determine whether the actual queue is empty. If not, repeat step 11), otherwise proceed to the next step;
[0246] 13) If all steps are in line with expectations, the test case passes, otherwise it fails;
[0247] 14) Save messages and test records;
[0248] 15) Update test progress and test case status.
[0249] The present invention can achieve the purpose of reducing the intervention of testers, realizing automatic testing, and improving work efficiency. Specifically, necessary rich and varied test parameters are provided through pre-configuration and dynamic methods. The services covered by the test cases are relatively comprehensive, and the test automation can be realized according to the configuration. The test consistency is good, and almost all tests are automatic, ensuring that the test process of the same service of different types of devices is almost the same. The record information is rich, and the entire test process, input and output data, test messages, test results, etc. can be recorded. The degree of automation is relatively high, and the entire test process hardly requires the intervention of testers.
[0250] Example 3
[0251] An electronic device, comprising:
[0252] a memory storing at least one instruction; and
[0253] The processor executes the instructions stored in the memory to implement the CMS server-side protocol testing method.
[0254] Example 4
[0255] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the CMS server-side protocol testing method is implemented.
[0256] The computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, USB flash drive, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium, etc. that can carry the computer program code. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals. For ease of explanation, the above content only shows the part related to the embodiment of the present invention. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The computer-readable storage medium is non-temporary and can be stored in a storage device formed by various electronic devices, which can realize the execution process recorded in the method of the embodiment of the present invention.
[0257] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0258] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0259] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0260] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0261] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A CMS server-side protocol testing method, characterized in that: include: Test data setting of the device under test; Service settings of the device under test; For the equipment under test that has completed the test data and service settings, it automatically analyzes and selects the test cases that need to be executed; Perform automatic testing according to the selected test cases, record the test process, give test conclusions, and identify test problems; Export the test process, test conclusions and test problems, and generate a test report; In the step of setting the service of the device under test, the service setting specifically includes selecting the service type supported by the device under test and verifying it according to the test data. If the corresponding test data is not configured, it is considered that the selected service type is not supported; The step of performing automatic testing according to the selected test case comprises: 1) Check the preconditions of the test case. If the conditions are met, proceed to the next step, otherwise the test is interrupted; 2) Start message monitoring; 3) Select and associate a client. If successful, proceed to the next step, otherwise the test will be terminated; 4) Select multiple fixed values and calculate a new fixed value based on the maximum value, minimum value and step size information of the fixed values; 5) Read the value of the fixed value control block; 6) Set the test steps and push them into the test step queue in sequence, set the expected results and push them into the expected result queue in sequence; The step 6) setting the test steps and sequentially pushing them into the test step queue, setting the expected results and sequentially pushing them into the expected result queue specifically includes: Select Edit Group Setting Value, the expected result is to return a positive response; Set the edit group setting value, the setting value is the new setting value in step 4), and the expected result is to return a positive response; Read edit group setting value, the expected result is to return a positive response; Compare the read value to see if it is the same as the new value in step 4). The expected result is that it is the same as the new value. Confirm the edit group setting, the expected result is a positive response; 7) In the test step queue, the test step information is gradually taken out and sent to the client thread, the client thread is called to execute the corresponding service, and the actual result of the test step is placed in the actual result queue; 8) When the test step queue is not empty, repeat step 7), otherwise proceed to the next step; 9) Stop packet capture and throw out the end of test case execution; 10) Determine whether the number of actual result queues is the same as the expected result queue number. If not, jump to step 14) to execute, otherwise proceed to the next step; 11) Take out the actual results and compare them with the expected results in turn. If they meet the expectations, the step passes, otherwise it fails; 12) Determine whether the actual result queue is empty. If not, repeat step 11), otherwise proceed to the next step; 13) All test steps meet expectations and the corresponding test case results pass, otherwise they fail; 14) Save messages and test records; 15) Update test progress and test case status; In the step of setting the test data of the device under test, the test data includes pre-set test data and dynamically generated test data; The pre-set test data includes data related to association negotiation services, model and data services, data set services, control services, setting group services, report services, log services, file services, and remote procedure calls; The associated negotiation service includes the IP address of the device under test and the security certificate format; Models and data services are modifiable data indexes; The dataset service includes the number of datasets that can be created and the number of entries each dataset contains; The control service includes supported control modes and corresponding control points; The setting group service includes setting control block index and setting data set; Reporting services include supported report types and report triggering methods; The log service includes log triggering methods; File services include supported services and the paths and file names of readable, writable, and deletable files; Remote procedure call is a remote call service supported; The dynamically generated test data is generated according to the data type, current value, maximum value, minimum value and step size.
2. The CMS server-side protocol testing method according to claim 1, characterized in that: The service type is selected from 57 service types specified in the substation secondary system communication message specification.
3. The CMS server-side protocol testing method according to claim 1, characterized in that: The specific contents of the test case precondition check in step 1) include: Whether the client list is empty; Whether the services required by the test case are supported in the configuration; Whether the model contains constant value control blocks.
4. A CMS server-side protocol testing system, characterized in that: include: Test data setting module, used for setting test data of the device under test; Service setting module, used for service setting of the device under test; The test case selection module is used to automatically analyze and select the test cases that need to be executed for the device under test that has completed the test data and service settings; Automatic testing module, used to perform automatic testing according to the selected test cases, record the test process, give test conclusions, and find test problems; Test report generation module, used to export test process, test conclusions and test problems, and generate test reports; The service setting module selects the service type supported by the device under test and verifies it according to the test data. If the corresponding test data is not configured, it is considered that the selected service type is not supported; The step of the automatic testing module performing automatic testing according to the selected test case comprises: 1) Check the preconditions of the test case. If the conditions are met, proceed to the next step, otherwise the test is interrupted; 2) Start message monitoring; 3) Select and associate a client. If successful, proceed to the next step, otherwise, interrupt the test; 4) Select multiple fixed values and calculate a new fixed value based on the maximum value, minimum value and step size information of the fixed values; 5) Read the value of the fixed value control block; 6) Set the test steps and push them into the test step queue in sequence, set the expected results and push them into the expected result queue in sequence; The step 6) setting the test steps and sequentially pushing them into the test step queue, setting the expected results and sequentially pushing them into the expected result queue specifically includes: Select Edit Group Setting Value, the expected result is to return a positive response; Set the edit group setting value, the setting value is the new setting value in step 4), and the expected result is to return a positive response; Read edit group setting value, the expected result is to return a positive response; Compare the read value to see if it is the same as the new value in step 4). The expected result is that it is the same as the new value. Confirm the edit group setting, the expected result is a positive response; 7) In the test step queue, the test step information is gradually taken out and sent to the client thread, the client thread is called to execute the corresponding service, and the actual result of the test step is placed in the actual result queue; 8) When the test step queue is not empty, repeat step 7), otherwise proceed to the next step; 9) Stop packet capture and throw out the end of test case execution; 10) Determine whether the number of actual result queues is the same as the expected result queue number. If not, jump to step 14) to execute, otherwise proceed to the next step; 11) Take out the actual results and compare them with the expected results in turn. If they meet the expectations, the step passes, otherwise it fails; 12) Determine whether the actual result queue is empty. If not, repeat step 11), otherwise proceed to the next step; 13) All test steps meet expectations and the corresponding test case results pass, otherwise they fail; 14) Save messages and test records; 15) Update test progress and test case status; The device under test test data set by the test data setting module includes pre-set test data and dynamically generated test data; The pre-set test data includes data related to association negotiation services, model and data services, data set services, control services, setting group services, report services, log services, file services, and remote procedure calls; The associated negotiation service includes the IP address of the device under test and the security certificate format; Models and data services are modifiable data indexes; The dataset service includes the number of datasets that can be created and the number of entries each dataset contains; The control service includes supported control modes and corresponding control points; The setting group service includes setting control block index and setting data set; Reporting services include supported report types and report triggering methods; The log service includes log triggering methods; File services include supported services and the paths and file names of readable, writable, and deletable files; Remote procedure call is a remote call service supported; The dynamically generated test data is generated according to the data type, current value, maximum value, minimum value and step size.
5. The CMS server-side protocol testing system according to claim 4, characterized in that: When the service setting module selects the service type supported by the device under test, it selects from 57 service types specified in the substation secondary system communication message specification.
6. An electronic device, characterized in that: include: A memory storing at least one instruction; and A processor executes instructions stored in the memory to implement the CMS server-side protocol testing method as described in any one of claims 1 to 3.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the CMS server-side protocol testing method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Consistency testing method and device for transformer substation network and communication protocol
CN104468277A
Transformer substation secondary equipment automatic detection method based on general interface template, server and system
CN110426589A
System for automatically matching test cases according to configuration files
CN111881044A
Consistency testing tool for electric power communication protocol
CN113676366A
