A signal equipment testing method and testing engine

By using the interface protocol library of simulation equipment in signal device testing, the problem of long test cycle and high cost is solved, the reusability and environmental stability of the test engine are achieved, and maintenance costs are reduced.

CN111897717BActive Publication Date: 2025-01-07CRSC URBAN RAIL TRANSIT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010610303.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-29
Publication Date
2025-01-07
Estimated Expiration
2040-06-29

AI Technical Summary

Technical Problem

In the existing signal equipment testing methods, the long test cycle, high test cost, low reusability and high maintenance costs have resulted in a lot of manpower and time required for the design, development and debugging of test engines. Different test engines require different hardware and software environments. Increased maintenance difficulty.

Method used

Determine the test command and preset output based on the test script of the signal device to be tested, use the interface protocol library of the simulation device to be tested to encapsulate and parse the test commands, realize simulation tests, and determine the test results based on the preset and actual outputs to improve the test engine reusability and stability of the test environment.

Benefits of technology

Shorten the test cycle, reduce the testing and maintenance costs, improve the reusability of the test engine and the stability of the test environment, so that different signal devices can use the same test engine for testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111897717B_ABST
    Figure CN111897717B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a signal device testing method and a testing engine, the method comprising: based on the test script of the signal device to be tested, determining a number of test commands of the signal device and the preset test output of the signal device; based on the interface protocol library of the simulation device corresponding to any pre-loaded test command, encapsulating the test command to obtain the simulation command corresponding to the test command; sending the simulation commands corresponding to each test command to the corresponding simulation device one by one, so that the corresponding simulation device can perform simulation test on the signal device and return the simulation output; based on the interface protocol library of the simulation device corresponding to the simulation output, parsing the simulation output to obtain the actual test output; based on the preset test output and the actual test output, determining the test result of the signal device. The signal device testing method and the testing engine provided by the embodiment of the present invention improve the reusability of the test engine and the stability of the test environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automatic control system testing, and in particular to a signal equipment testing method and a testing engine. Background Art

[0002] Signal devices in control systems are required to have high security and high reliability. Therefore, they need to be tested during the development of signal devices. The existing signal device test environment includes a test engine and signal devices, as well as multiple external devices connected to the test engine and signal devices respectively. Since the protocols for data interaction between signal devices and each external device are different, the signal device test environment has the characteristics of numerous interfaces and complex data formats.

[0003] In the existing signal device testing methods, the test input interface and simulation device interface of the test engine are different, so the test input and simulation device of the test environment of each signal device cannot be reused. Therefore, it is necessary to develop a test engine for each signal device separately, define and implement different test input interfaces and simulation device interfaces. The design, development and debugging of the test engine will cost a lot of manpower and time, thus prolonging the test cycle of the entire signal device. Moreover, different test engines make the hardware environment and software environment required for the test environment of the signal device different, which increases the maintenance cost of the test environment. Summary of the invention

[0004] The embodiment of the present invention provides a signal device testing method and a testing engine to solve the defects of long testing cycle, high testing cost, low reusability and high maintenance cost in the prior art, thereby improving the reusability of the testing engine and the stability of the testing environment.

[0005] An embodiment of the present invention provides a signal device testing method, including:

[0006] Determining, based on a test script of a signal device to be tested, a plurality of test commands for the signal device and a preset test output of the signal device;

[0007] Based on the interface protocol library of the simulation device corresponding to any pre-loaded test command, encapsulate the test command to obtain the simulation command corresponding to the test command;

[0008] Sending simulation commands corresponding to each test command to corresponding simulation devices one by one, so that the corresponding simulation devices can perform simulation tests on the signal devices and return simulation outputs;

[0009] Based on the interface protocol library of the simulation device corresponding to the simulation output, the simulation output is parsed to obtain the actual test output;

[0010] A test result of the signal device is determined based on the preset test output and the actual test output.

[0011] According to a signal device testing method of one embodiment of the present invention, the test command is represented in the form of a receiving object, a command name and a command attribute set, and the preset test output is represented in the form of a return object, an output name and an output attribute set.

[0012] According to a signal device testing method according to an embodiment of the present invention, the interface protocol library of the simulation device corresponding to any pre-loaded test command encapsulates the test command to obtain the simulation command corresponding to the test command, specifically comprising:

[0013] Determine a protocol encapsulation method corresponding to any test command based on any test command and an interface protocol library of a simulation device corresponding to any test command;

[0014] Based on any one of the test commands and a protocol encapsulation method corresponding to any one of the test commands, a simulation command corresponding to any one of the test commands is determined.

[0015] According to a signal device testing method according to an embodiment of the present invention, the interface protocol library of the simulation device corresponding to the simulation output is used to parse the simulation output to obtain the actual test output, which specifically includes:

[0016] Based on the simulation output and the interface protocol library of the simulation device corresponding to the simulation output, determine the protocol parsing method corresponding to the simulation output;

[0017] The actual test output is determined based on the simulation output and a protocol parsing method corresponding to the simulation output.

[0018] According to a signal device testing method according to an embodiment of the present invention, determining the test result of the signal device based on the preset test output and the actual test output specifically includes:

[0019] If the preset test output and the actual test output meet the preset judgment condition, it is determined that the test result of the signal device is normal; otherwise, it is determined that the test result of the signal device is faulty.

[0020] According to an embodiment of the present invention, the signal device testing method further includes:

[0021] Get the configuration file of the test environment;

[0022] Based on the configuration file, an interface protocol library corresponding to each simulation device in the test environment is loaded.

[0023] The embodiment of the present invention further provides a test engine, including:

[0024] A test script parsing module, used to determine a number of test commands of the signal device and a preset test output of the signal device based on a test script of the signal device to be tested;

[0025] A simulation command encapsulation module, used to encapsulate any test command based on the interface protocol library of the simulation device corresponding to any pre-loaded test command, to obtain the simulation command corresponding to any test command;

[0026] An interactive module, used for sending the simulation commands corresponding to each test command to the corresponding simulation device one by one, so that the corresponding simulation device can perform simulation test on the signal device and return the simulation output;

[0027] A simulation output parsing module, used to parse the simulation output based on the interface protocol library of the simulation device corresponding to the simulation output to obtain the actual test output;

[0028] A test result determination module is used to determine the test result of the signal device based on the preset test output and the actual test output.

[0029] The test engine according to one embodiment of the present invention further includes:

[0030] A configuration file acquisition module is used to obtain the configuration file of the test environment;

[0031] The interface protocol library loading module is used to load the interface protocol library corresponding to each simulation device in the test environment based on the configuration file.

[0032] An embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned signal device testing methods are implemented.

[0033] An embodiment of the present invention further provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned signal device testing methods are implemented.

[0034] A signal device testing method and a testing engine provided by an embodiment of the present invention encapsulate test commands based on an interface protocol library of a simulation device corresponding to the test commands, and encapsulate simulation outputs based on an interface protocol library of a simulation device corresponding to the simulation outputs, thereby improving the reusability of the test engine and the stability of the test environment, shortening the test cycle, and reducing test costs and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0036] Figure 1 This is a schematic diagram of the structure of the existing test environment;

[0037] Figure 2 A schematic diagram of a flow chart of a signal device testing method provided by an embodiment of the present invention;

[0038] Figure 3 A schematic diagram of the structure of a test engine provided by an embodiment of the present invention;

[0039] Figure 4 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] Figure 1 The schematic diagram of the existing test environment is as follows: Figure 1 As shown, the existing test environment includes a test engine and a signal device, as well as multiple simulation devices connected to the test engine and the signal device respectively. The test engine is used to obtain test scripts from the outside, drive each simulation device and the signal device to communicate, obtain the output of the signal device through the simulation device, and return the test output. The simulation device is used to translate the test command issued by the test engine into an input that can be recognized by the signal device, drive the signal device to output, translate the output of the signal device and forward it to the test engine.

[0042] Based on the above test environment, the test input interface and simulation device interface of the test engine in the existing signal device test method are different, so that the test input and simulation device of the test environment of each signal device cannot be reused with each other, and it is necessary to develop a test engine for each signal device separately, define and implement different test input interfaces and simulation device interfaces, and the design, development and debugging of the test engine will cost a lot of manpower and time costs, thereby lengthening the test cycle of the entire signal device. Moreover, different test engines make the hardware environment and software environment required for the test environment of the signal device different, which increases the maintenance cost of the test environment.

[0043] Therefore, existing signal equipment testing methods have problems such as long testing cycle, high testing cost, low reusability and high maintenance cost.

[0044] In this regard, an embodiment of the present invention provides a signal device testing method. Figure 2 A flow chart of a signal device testing method provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the method includes:

[0045] Step 110, based on the test script of the signal device to be tested, determining a plurality of test commands of the signal device and a preset test output of the signal device;

[0046] Step 120, based on the interface protocol library of the simulation device corresponding to any pre-loaded test command, encapsulate the test command to obtain the simulation command corresponding to the test command;

[0047] Step 130, sending the simulation commands corresponding to each test command to the corresponding simulation device one by one, so that the corresponding simulation device performs simulation test on the signal device and returns the simulation output;

[0048] Step 140, parsing the simulation output based on the interface protocol library of the simulation device corresponding to the simulation output to obtain the actual test output;

[0049] Step 150: Determine the test result of the signal device based on the preset test output and the actual test output.

[0050] Specifically, the signal device to be tested is a signal device that needs to be functionally tested, and the test script is used to define the entire test process. The test script includes a number of test commands and their corresponding sequences, as well as preset outputs of the signal device. Among them, the test command can be information sent by the simulation device to the signal device, and the preset test output can be information that the signal device is expected to output after the simulation test based on the number of test commands.

[0051] Taking CBTC (Communication Based Train Control) of urban rail transit as an example, the signal device can be any device among ATS (Automatic Train Supervision), ZC (Zone Controller), CI (Computer Interlocking) and VOBC (Vehicle On Board Controller), and the simulation device is an external device connected to the simulation signal device. When the signal device is ZC, the external device corresponding to the simulation device may include ATS, VOBC and CI. The test command may include information on the train position, speed and running direction sent by VOBC, information on the train route and turnout status sent by CI, and temporary speed limit information sent by ATS; the preset test output may be the movement authorization of the train calculated by ZC. It should be noted that the embodiment of the present invention only takes CBTC as an example for explanation, and the signal device testing method provided in the embodiment of the present invention is not only applicable to urban rail transit control systems, but also to other automatic control systems.

[0052] The execution subject of the signal device test method provided by the embodiment of the present invention can be a test engine. The test engine pre-loads the interface protocol library of all simulation devices in the test environment, and each simulation device corresponds to an interface protocol library. The interface protocol library of any simulation device stores the communication protocol between the test engine and the simulation device. Based on the acquired test script, after parsing to obtain several test commands and preset test outputs, the test engine obtains the information of the simulation device that receives the test command based on any test command, and encapsulates the test command based on the interface protocol library of the simulation device corresponding to the test command, and obtains the simulation command corresponding to the test command. Among them, the test command may include the information of the simulation device corresponding to it, and the simulation command may be a command after encapsulating the test command based on the protocol format between the test engine and the simulation device corresponding to the test command, which is used to drive the simulation device corresponding to the test command to output the signal device.

[0053] After the test engine completes the encapsulation of the test command, it sends the simulation command corresponding to the test command to the corresponding simulation device. After the simulation device receives the simulation command sent by the test engine, it sends the translated simulation command to the signal device. The test engine sends the simulation command corresponding to each test command to the corresponding simulation device one by one, wherein the sending order of the simulation commands is determined based on the order of the corresponding test commands in the test script. After receiving the feedback from the signal device, the simulation device sends the corresponding simulation output to the test engine. The simulation output can be the output information of the feedback of the signal device after being translated by the simulation device.

[0054] After receiving the simulation output sent by the simulation device, the test engine obtains the information of the simulation device that sent the simulation output. Based on the interface protocol library of the simulation device corresponding to the simulation output, the simulation output is parsed to obtain the actual test output corresponding to the simulation output. Among them, the simulation output may include the information of the simulation device corresponding to it, and the actual test output may be the information actually output by the signal device after the simulation test based on several test commands.

[0055] The test engine compares the actual test output with the preset test output to obtain the test result of the signal device, wherein the test result of the signal device is used to characterize the actual operation of the signal device, and the test result of the signal device may include normal equipment and equipment failure.

[0056] The test engine encapsulates the test commands sent to the simulation device and parses the simulation output received from the simulation device through the pre-loaded interface protocol library of the simulation device. When the test environment needs to add simulation devices, you only need to pre-load the interface protocol library of the newly added simulation device in the test engine to realize the data interaction between the test engine and the newly added simulation device without changing the test engine. For example, in the CBTC system, when the signal device is ZC, CI, VOBC or ATS, the same test engine can be used to complete the test of different signal devices.

[0057] When the interface protocol of a certain simulation device in the test environment needs to be changed, it is only necessary to change the interface protocol library of the corresponding simulation device in the test engine accordingly, without designing a new test engine to adapt to the changed interface protocol. The signal device testing method provided by the embodiment of the present invention is based on a universal test engine, and by changing the interface protocol library of the corresponding simulation device to adapt to the change of the simulation device interface or interface protocol, the reusability of the test engine and the stability of the test environment are improved, the test cycle is shortened, and the test cost and maintenance cost are reduced.

[0058] The signal device testing method provided by the embodiment of the present invention encapsulates the test command based on the interface protocol library of the simulation device corresponding to the test command, and parses the simulation output based on the interface protocol library of the simulation device corresponding to the simulation output, thereby improving the reusability of the test engine and the stability of the test environment, shortening the test cycle, and reducing the test cost and maintenance cost.

[0059] Based on the above embodiment, in this method, the test command is represented in the form of a receiving object, a command name and a command attribute set, and the preset test output is represented in the form of a return object, an output name and an output attribute set.

[0060] Specifically, the test commands and preset test outputs in the test script are expressed in a unified form. The test commands are expressed in the form of a receiving object, a command name, and a command attribute set, which can be expressed in the following form: (R, N, A), where R is the receiving object, N is the command name, and A is the command attribute set. The receiving object is a simulation device that receives the test command, and the command attribute set can include several command attribute names and their corresponding attribute values.

[0061] The preset test output is expressed in the form of a return object, an output name, and an output attribute set, which can be expressed in the following form: (S, N, A), where S is the return object, N is the output name, and A is the output attribute set. The return object is the simulation device that sends the simulation output, and the output attribute set can include several output attribute names and their corresponding attribute values. It should be noted that the receiving object and the return object in the test command and the preset test output, as well as the command name and the output name cannot be omitted, and the command attribute set and the output attribute set can be empty or not empty.

[0062] Since the test commands and preset test outputs in the test script are represented in a unified form, for different test scripts, the test engine can parse the test scripts through standard parsing methods to obtain several test commands and preset test outputs, so that the test engine can be applied to different test scripts, further improving the reusability of the test engine.

[0063] The signal device testing method provided by the embodiment of the present invention represents the test commands and preset test outputs in the test script in a unified form, so that the test engine can be applicable to different test scripts, further improving the reusability of the test engine.

[0064] Based on any of the above embodiments, in the method, step 120 specifically includes:

[0065] Step 121, based on the test command and the interface protocol library of the simulation device corresponding to the test command, determine the protocol encapsulation method corresponding to the test command;

[0066] Step 122: Determine a simulation command corresponding to the test command based on the test command and the protocol encapsulation method corresponding to the test command.

[0067] Specifically, since different test commands have different data formats, different protocol encapsulation methods need to be used to encapsulate test commands with different data formats. The interface protocol library of the simulation device stores the protocol encapsulation methods corresponding to all test commands received by the simulation device. Based on any test command, the test engine obtains the simulation device corresponding to the test command and the command name of the test command. Based on the command name of the test command, the protocol encapsulation method corresponding to the test command is extracted from the interface protocol library of the simulation device corresponding to the test command, and based on the protocol encapsulation method, the test command is encapsulated.

[0068] The signal device testing method provided by the embodiment of the present invention determines the protocol encapsulation method corresponding to the test command based on the test command and the interface protocol library of the simulation device corresponding to the test command, and adopts different protocol encapsulation methods for different types of test commands, so that the interface protocol library of the simulation device can be applicable to multiple types of test commands.

[0069] Based on any of the above embodiments, in the method, step 140 specifically includes:

[0070] Step 141, based on the simulation output and the interface protocol library of the simulation device corresponding to the simulation output, determine the protocol parsing method corresponding to the simulation output;

[0071] Step 142, based on the simulation output and the protocol parsing method corresponding to the simulation output, determine the actual test output.

[0072] Specifically, since different test commands will result in different simulation outputs, and different simulation outputs have different data formats, different protocol parsing methods are required to parse simulation outputs with different data formats. The interface protocol library of the simulation device stores the protocol parsing methods corresponding to all simulation outputs sent by the simulation device. Based on the simulation output, the test engine obtains the simulation device corresponding to the simulation output and the output name of the simulation output. Based on the output name of the simulation output, the protocol parsing method corresponding to the simulation output is extracted from the interface protocol library of the simulation device corresponding to the simulation output, and based on the protocol parsing method, the simulation output is parsed.

[0073] The signal equipment testing method provided by the embodiment of the present invention determines the protocol parsing method corresponding to the simulation output based on the simulation output and the interface protocol library of the simulation equipment corresponding to the simulation output, and adopts different protocol parsing methods for different types of simulation outputs, so that the interface protocol library of the simulation equipment can be applicable to various types of simulation outputs.

[0074] Based on any of the above embodiments, in the method, step 150 specifically includes:

[0075] If the preset test output and the actual test output meet the preset judgment conditions, the test result of the signal device is determined to be normal; otherwise, the test result of the signal device is determined to be a device failure.

[0076] Specifically, if the preset test output and the actual test output meet the preset judgment conditions, it means that the signal device to be tested can achieve the expected function, has passed the test, can be put into actual production and use, and the test result of the signal device is determined to be normal. If the preset test output and the actual test output do not meet the preset judgment conditions, it means that the signal device to be tested cannot achieve the expected function, the test fails, and further debugging is required, and the test result of the signal device is determined to be a device failure. Among them, the preset judgment condition can be that the attribute value of the corresponding attribute in the preset test output and the actual test output is the same, or it can be that the attribute value of the corresponding attribute in the preset test output and the actual test output satisfies a specific relationship.

[0077] Based on any of the above embodiments, in the method, before step 110, the method further includes:

[0078] Step 101, obtaining a configuration file of a test environment;

[0079] Step 102: Load the interface protocol library corresponding to each simulation device in the test environment based on the configuration file.

[0080] Specifically, the configuration file may include information of the signal device to be tested and information of the corresponding simulation device. The test engine first obtains the configuration file of the test environment, and based on the configuration file, obtains information of each simulation device in the test environment, such as the identification of the simulation device, the number of the simulation device, or the name of the simulation device. Based on the information of each simulation device, the test engine loads the interface protocol library corresponding to each simulation device, wherein each simulation device corresponds to an interface protocol library. After completing the loading of the interface protocol libraries corresponding to all simulation devices, the test engine starts to test the signal device.

[0081] Based on any of the above embodiments, Figure 3 A schematic diagram of the structure of the test engine provided by the embodiment of the present invention, such as Figure 3 As shown, the test engine includes:

[0082] A test script parsing module 310, for determining a number of test commands of the signal device and a preset test output of the signal device based on a test script of the signal device to be tested;

[0083] The simulation command encapsulation module 320 is used to encapsulate any test command based on the interface protocol library of the simulation device corresponding to any test command pre-loaded, so as to obtain the simulation command corresponding to the any test command;

[0084] The interaction module 330 is used to send the simulation commands corresponding to each test command to the corresponding simulation device one by one, so that the corresponding simulation device can perform simulation test on the signal device and return the simulation output;

[0085] A simulation output parsing module 340 is used to parse the simulation output based on the interface protocol library of the simulation device corresponding to the simulation output to obtain the actual test output;

[0086] The test result determination module 350 is used to determine the test result of the signal device based on the preset test output and the actual test output.

[0087] The test engine provided by the embodiment of the present invention encapsulates the test commands based on the interface protocol library of the simulation device corresponding to the test commands, and parses the simulation output based on the interface protocol library of the simulation device corresponding to the simulation output, thereby improving the reusability of the test engine and the stability of the test environment, shortening the test cycle, and reducing the test cost and maintenance cost.

[0088] Based on any of the above embodiments, the test engine further includes:

[0089] Configuration file acquisition module 301, used to acquire the configuration file of the test environment;

[0090] The interface protocol library loading module 302 is used to load the interface protocol library corresponding to each simulation device in the test environment based on the configuration file.

[0091] Based on any of the above embodiments, in the test engine, the test command is represented in the form of a receiving object, a command name and a command attribute set, and the preset test output is represented in the form of a return object, an output name and an output attribute set.

[0092] The test engine provided by the embodiment of the present invention represents the test commands and preset test outputs in the test input in a unified form, so that the test engine can be applicable to different test scripts, further improving the reusability of the test engine.

[0093] Based on any of the above embodiments, in the test engine, the simulation command encapsulation module 320 is specifically used for:

[0094] Determine a protocol encapsulation method corresponding to any test command based on any test command and an interface protocol library of a simulation device corresponding to any test command;

[0095] Based on any one of the test commands and a protocol encapsulation method corresponding to any one of the test commands, a simulation command corresponding to any one of the test commands is determined.

[0096] Based on any of the above embodiments, in the test engine, the simulation output parsing module 340 is specifically used for:

[0097] Based on the simulation output and the interface protocol library of the simulation device corresponding to the simulation output, determine the protocol parsing method corresponding to the simulation output;

[0098] The actual test output is determined based on the simulation output and a protocol parsing method corresponding to the simulation output.

[0099] Based on any of the above embodiments, in the test engine, the test result determination module 350 is specifically used for:

[0100] If the preset test output and the actual test output meet the preset judgment condition, it is determined that the test result of the signal device is normal; otherwise, it is determined that the test result of the signal device is faulty.

[0101] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 complete mutual communication through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the signal device test method, which includes: determining a plurality of test commands of the signal device and the preset test output of the signal device based on the test script of the signal device to be tested; encapsulating the test command based on the interface protocol library of the simulation device corresponding to any pre-loaded test command to obtain the simulation command corresponding to the test command; sending the simulation commands corresponding to each test command to the corresponding simulation device one by one, so that the corresponding simulation device performs simulation test on the signal device and returns the simulation output; parsing the simulation output based on the interface protocol library of the simulation device corresponding to the simulation output to obtain the actual test output; determining the test result of the signal device based on the preset test output and the actual test output.

[0102] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0103] On the other hand, an embodiment of the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the signal device testing method provided by the above-mentioned method embodiments, the method including: based on the test script of the signal device to be tested, determining a number of test commands for the signal device, and a preset test output of the signal device; based on the interface protocol library of the simulation device corresponding to any pre-loaded test command, encapsulating the test command to obtain a simulation command corresponding to the test command; sending the simulation commands corresponding to each test command to the corresponding simulation device one by one, so that the corresponding simulation device can perform simulation testing on the signal device and return the simulation output; based on the interface protocol library of the simulation device corresponding to the simulation output, parsing the simulation output to obtain the actual test output; determining the test result of the signal device based on the preset test output and the actual test output.

[0104] On the other hand, an embodiment of the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the signal device testing method provided by the above-mentioned embodiments, the method comprising: based on the test script of the signal device to be tested, determining a number of test commands for the signal device and a preset test output of the signal device; based on an interface protocol library of a simulation device corresponding to any pre-loaded test command, encapsulating the test command to obtain a simulation command corresponding to the test command; sending the simulation commands corresponding to each test command to the corresponding simulation device one by one, so that the corresponding simulation device can perform a simulation test on the signal device and return the simulation output; based on the interface protocol library of the simulation device corresponding to the simulation output, parsing the simulation output to obtain an actual test output; and determining the test result of the signal device based on the preset test output and the actual test output.

[0105] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0106] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0107] 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 aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A signal equipment testing method, characterized in that: include: Determining, based on a test script of a signal device to be tested, a plurality of test commands for the signal device and a preset test output of the signal device; Based on the interface protocol library of the simulation device corresponding to any pre-loaded test command, encapsulate the test command to obtain the simulation command corresponding to the test command, wherein each simulation device corresponds to an interface protocol library, the interface protocol library of any simulation device stores the communication protocol between the test engine and the simulation device, the interface protocol library of the simulation device stores the protocol encapsulation method corresponding to all test commands received by the simulation device, and the interface protocol library of the simulation device stores the protocol parsing method corresponding to all simulation outputs sent by the simulation device; Sending simulation commands corresponding to each test command to corresponding simulation devices one by one, so that the corresponding simulation devices can perform simulation tests on the signal devices and return simulation outputs; Based on the interface protocol library of the simulation device corresponding to the simulation output, the simulation output is parsed to obtain the actual test output; Determining a test result of the signal device based on the preset test output and the actual test output; The test command is represented in the form of a receiving object, a command name, and a command attribute set, and the preset test output is represented in the form of a returning object, an output name, and an output attribute set; The interface protocol library of the simulation device corresponding to any pre-loaded test command encapsulates any test command to obtain the simulation command corresponding to any test command, specifically including: Determine a protocol encapsulation method corresponding to any test command based on any test command and an interface protocol library of a simulation device corresponding to any test command; Determine a simulation command corresponding to any test command based on any test command and a protocol encapsulation method corresponding to any test command; The interface protocol library of the simulation device corresponding to the simulation output is used to parse the simulation output to obtain the actual test output, specifically including: Based on the simulation output and the interface protocol library of the simulation device corresponding to the simulation output, determine the protocol parsing method corresponding to the simulation output; The actual test output is determined based on the simulation output and a protocol parsing method corresponding to the simulation output.

2. The signal equipment testing method according to claim 1, characterized in that: The determining the test result of the signal device based on the preset test output and the actual test output specifically includes: If the preset test output and the actual test output meet the preset judgment condition, it is determined that the test result of the signal device is normal; otherwise, it is determined that the test result of the signal device is faulty.

3. The signal equipment testing method according to claim 1, characterized in that: Before determining a plurality of test commands for the signal device and a preset test output of the signal device based on a test script of the signal device to be tested, the method further includes: Get the configuration file of the test environment; Based on the configuration file, an interface protocol library corresponding to each simulation device in the test environment is loaded.

4. A test engine for implementing the signal device test method according to any one of claims 1 to 3, characterized in that: include: A test script parsing module, used to determine a number of test commands of the signal device and a preset test output of the signal device based on a test script of the signal device to be tested; A simulation command encapsulation module is used to encapsulate any test command based on the interface protocol library of the simulation device corresponding to any pre-loaded test command, so as to obtain the simulation command corresponding to any test command, wherein each simulation device corresponds to an interface protocol library, the interface protocol library of any simulation device stores the communication protocol between the test engine and the simulation device, the interface protocol library of the simulation device stores the protocol encapsulation method corresponding to all test commands received by the simulation device, and the interface protocol library of the simulation device stores the protocol parsing method corresponding to all simulation outputs sent by the simulation device; An interactive module, used for sending the simulation commands corresponding to each test command to the corresponding simulation device one by one, so that the corresponding simulation device can perform simulation test on the signal device and return the simulation output; A simulation output parsing module, used to parse the simulation output based on the interface protocol library of the simulation device corresponding to the simulation output to obtain the actual test output; A test result determination module is used to determine the test result of the signal device based on the preset test output and the actual test output.

5. The test engine according to claim 4, characterized in that: Also includes: A configuration file acquisition module is used to obtain the configuration file of the test environment; The interface protocol library loading module is used to load the interface protocol library corresponding to each simulation device in the test environment based on the configuration file.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the signal device testing method according to any one of claims 1 to 3 are implemented.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the signal device testing method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • A multi-function protocol parser and its realization method

    CN101262472A

  • Protocol configuration method, device and equipment and medium

    CN110113196A