Railway interlocking system test method, device and equipment and storage medium
By using preset test keyword databases and engineering interlocking tables in the railway interlocking system to generate test cases, the problem of time-consuming and inconvenient maintenance of test cases in the existing technology is solved, and efficient and accurate test case generation and maintenance is achieved.
Patent Information
- Application Number
- CN202510372741.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-05-02
AI Technical Summary
When generating test cases, existing computer interlocking systems need to replace the device name and expected value of the original test cases, which makes it time-consuming to generate when the use case scale is huge, and must be regenerated when the test case template changes, resulting in inconvenient maintenance.
Read the engineering interlock table and site data through the preset test keyword library, determine the equipment information of the equipment to be tested, and use the project interlock table and the template number of the preset test case template to generate test cases, avoid modification of the template content, and thus decouple the template and test cases.
It improves the efficiency and accuracy of test case generation, reduces the generation time and storage space of test cases, and maintains test cases and templates in practical applications.
Smart Images

Figure CN119917418A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of railway transportation, and in particular to a railway interlocking system testing method, device, equipment and storage medium. Background Art
[0002] At present, when a computer interlocking system automatically generates a test case, it can traverse the test template elements and generate a separate test case file for each test template element. That is to say, when generating a test case for a device to be tested, it is necessary to generate an original test case and replace the device name and expected value of each original test case to generate a test case for each related device. However, when the above method generates a test case, since it is necessary to replace the device name and expected value of each original test case, the test case generation is relatively time-consuming when the test case scale is huge, and the test case must be regenerated when the test case template changes, which makes the test case maintenance very inconvenient. Therefore, how to improve the efficiency of test case generation is a problem to be solved in this field. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide a railway interlocking system testing method, device, equipment and storage medium, which generates test cases through test case templates without modifying the template content, thereby decoupling the template and the test case, which helps to improve the test efficiency and accuracy of the interlocking system. The specific scheme is as follows:
[0004] In a first aspect, the present application provides a railway interlocking system testing method, which is applied to a preset test keyword library, comprising:
[0005] Read the engineering interlocking table and station data in the target server through the preset test keyword library, and determine the device information of the device to be tested in the railway interlocking system according to the engineering interlocking table and station data;
[0006] Determine a preset test case template corresponding to the device information, and generate a test case corresponding to the device under test using the engineering interlocking table and the template number of the preset test case template;
[0007] A device test command is received through the command receiving interface of the preset test keyword library, and based on the device test command, the test instructions in the test case are sent to the tested environment of the device under test, so as to execute the test of the device under test in the tested environment.
[0008] Optionally, after sending the test instructions in the test case to the tested environment of the device under test based on the device test command, the method further includes:
[0009] The test information returned by the tested environment is collected, and the test case script corresponding to the test case is used to execute assertions according to the test information to determine whether the device under test passes the test, and a test report corresponding to the device under test is generated based on the obtained determination result and the test information.
[0010] Optionally, before determining the preset test case template corresponding to the device information, the method further includes:
[0011] Receive a template generation instruction from a user, and determine a target library corresponding to the template generation instruction in the preset test keyword library;
[0012] The target library is used to generate the corresponding preset test case template based on the template generation instruction.
[0013] Optionally, the generating the corresponding preset test case template using the target library based on the template generating instruction includes:
[0014] Generate the corresponding preset test case templates using the keywords in the target library based on the template generation instruction, and determine the test device type corresponding to each preset test case template; the keywords are all written in Chinese;
[0015] The preset test case template is saved to a corresponding folder based on the test device type, and the folder is saved to a preset database server.
[0016] Optionally, the step of generating a test case corresponding to the device under test by using the engineering interlocking table and the template number of the preset test case template includes:
[0017] Determine the test device type of the device under test, and determine a corresponding target folder from the folder according to the test device type of the device under test;
[0018] According to all the preset test case templates in the target folder, and using the engineering interlocking table and the template number of the preset test case template, the test case corresponding to the device under test is generated.
[0019] Optionally, reading the engineering interlocking table in the target server through a preset test keyword library includes:
[0020] Reading the engineering interlocking table in the target server through the preset test keyword library, and classifying the equipment information in the engineering interlocking table according to preset information classification rules to obtain a corresponding classification file;
[0021] Correspondingly, the device information of the device to be tested in the railway interlocking system is determined according to the engineering interlocking table and the station data, including:
[0022] The device information corresponding to the device to be tested in the railway interlocking system is determined according to the classification file and the station data.
[0023] Optionally, before sending the test instructions in the test case to the tested environment of the device under test based on the device test command, the method further includes:
[0024] Building a test case feature database according to the station data of the railway interlocking system and the test case labels corresponding to each of the test cases, and saving the test cases to the test case feature database;
[0025] Accordingly, sending the test instructions in the test case to the tested environment of the device under test based on the device test command includes:
[0026] Based on the device test command, a corresponding target test case is screened out from the test case feature database, and the test instructions in the target test case are sent to the tested environment of the device to be tested.
[0027] In a second aspect, the present application provides a railway interlocking system testing device, which is applied to a preset test keyword library, including:
[0028] An information determination module is used to read the engineering interlocking table and station data in the target server through a preset test keyword library, and determine the device information of the device to be tested in the railway interlocking system according to the engineering interlocking table and station data;
[0029] A test case generation module, used to determine a preset test case template corresponding to the device information, and generate a test case corresponding to the device under test by using the engineering interlocking table and the template number of the preset test case template;
[0030] The device testing module is used to receive a device testing command through the command receiving interface of the preset test keyword library, and send the test instructions in the test case to the tested environment of the device under test based on the device testing command, so as to execute the test of the device under test in the tested environment.
[0031] In a third aspect, the present application provides an electronic device, comprising a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the aforementioned railway interlocking system testing method.
[0032] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, which implements the aforementioned railway interlocking system testing method when executed by a processor.
[0033] In this application, the engineering interlocking table and station data in the target server are first read through the preset test keyword library, and the equipment information of the equipment to be tested in the railway interlocking system is determined according to the engineering interlocking table and the station data, and then the preset test case template corresponding to the equipment information is determined, and the template number of the engineering interlocking table and the preset test case template is used to generate the test case corresponding to the equipment to be tested. After receiving the equipment test command through the command receiving interface of the preset test keyword library, the test instructions in the test case are sent to the tested environment of the equipment to be tested based on the equipment test command, so as to perform the test of the equipment to be tested in the tested environment. In this way, when the present application generates test cases through the test case template, non-invasive generation is adopted, and the template number is directly referenced without modifying the template content, thereby decoupling the template and the test case, generating the test case quickly, occupying less storage space, and convenient maintenance of the test case and template in the actual application process, which helps to improve the test efficiency and accuracy of the interlocking system. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, 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 embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0035] Figure 1 A flow chart of a railway interlocking system testing method provided for this application;
[0036] Figure 2 A specific railway interlocking system test flow chart provided for this application;
[0037] Figure 3 A partial schematic diagram of an engineering interlocking table information provided for this application;
[0038] Figure 4 A schematic diagram of a test case suite provided for this application;
[0039] Figure 5 A schematic diagram of the structure of a railway interlocking system test device provided in this application;
[0040] Figure 6 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0042] At present, when a computer interlocking system generates a test case for a device to be tested, it is necessary to generate an original test case and replace the device name and expected value of each original test case to generate a test case for each related device. Therefore, when the scale of the test case is huge, the test case generation is time-consuming, which makes the test case maintenance very inconvenient. The present application discloses an automated test keyword library dedicated to railway signals, and proposes a solution for automatically generating test cases for all devices under test. The test case generation adopts a non-intrusive call case template, and the keywords used in the template are all in Chinese. The test case occupies a small space, has a fast generation speed, has a high maintainability of the template maintenance, has a low coupling between the template and the test case, and the test case is not affected by changes in the template content.
[0043] See also Figure 1 As shown, an embodiment of the present invention discloses a railway interlocking system testing method, which is applied to a preset test keyword library, including:
[0044] Step S11, reading the engineering interlocking table and station data in the target server through a preset test keyword library, and determining the device information of the device to be tested in the railway interlocking system according to the engineering interlocking table and station data.
[0045] It should be noted that the preset test keyword library in this embodiment is Figure 2 CiTestLib is the core module that can realize the intelligent test of computer interlocking. All automated test scripts are written based on this keyword library and can be developed in Python. Its main tasks are to automatically generate test cases, store test cases in the database, and execute test cases according to user settings. Figure 2As shown, CiTestLib can read the test case template, and generate test cases in combination with project input information such as the engineering interlocking table, and then start the automated testing process according to the user's command. During the test, CiTestLib sends the test instructions in the test case script to the tested environment and collects the feedback information of the test environment, and executes the assertion in the test case script to determine whether the case passes, and generates a test report after the test is completed. And the generation of the above test cases is based on the test case template, and the test case template is manually written using the test keyword library provided by CiTestLib. It can be understood that the programming language used in this embodiment is Python, but it is not limited to a specific programming language, and other computer languages can also be used. And the following technical solutions in this embodiment are implemented based on the computer interlocking system of the TECIS (Times Electric Computer Interlocking System) platform, but this embodiment is not limited to a specific platform, and computer interlocking systems of other platforms can also be used. Among them, the above keyword library contains the following sub-libraries in total:
[0046] Table 1 Schematic table of keyword library sub-libraries
[0047]
[0048] Next, in this embodiment, examples of the above-mentioned keyword libraries will be given to illustrate the design ideas of the keyword library in detail. It can be understood that the parameters that make up the keyword library can be obtained according to actual conditions, and other keywords can be created according to the specific needs of this profession, which will not be elaborated here.
[0049] Table 2 Linkage table library design table
[0050]
[0051] The keywords in Table 2 above can be used to obtain various information of the interlock table. A partial example of the interlock table is as follows: Figure 3 shown.
[0052] Table 3 IO library design table
[0053]
[0054] Table 4 ATS library design table
[0055]
[0056] Table 5 VOBC library design table
[0057]
[0058] Table 6 ZC library design table
[0059]
[0060] Table 7 System library design table
[0061]
[0062] Based on the above keyword library and engineering interlocking table, in this embodiment, the engineering interlocking table in the target server can be read through the preset test keyword library, and the equipment information in the engineering interlocking table is classified according to the preset information classification rules to obtain the corresponding classification file, and then the equipment information corresponding to the equipment to be tested in the railway interlocking system is determined according to the classification file and the station data. That is to say, in this embodiment, after CiTestLib is started, it will read the Excel format such as Figure 3 The engineering interlocking table shown in the figure is used, and all the equipment information in the interlocking table is classified and stored according to different tested objects such as signal machines, turnouts, sections, basic routes, guided routes, automatic reversals, scattered equipment, and non-route shunting for subsequent query and use. In this way, compared with the errors caused by the introduction of station data due to human factors, the test basis in this embodiment is the direct input file of the engineering interlocking table and other items, which can eliminate the test errors introduced by human factors to the greatest extent.
[0063] Step S12: determine a preset test case template corresponding to the device information, and generate a test case corresponding to the device under test by using the engineering interlocking table and the template number of the preset test case template.
[0064] In this embodiment, before determining the preset test case template, the user's template generation instruction can be received, and the target library corresponding to the template generation instruction in the preset test keyword library can be determined, and then the corresponding preset test case template can be generated using the target library based on the template generation instruction. Specifically, the corresponding preset test case template can be generated based on the template generation instruction using the keywords in the target library, and the test equipment type corresponding to each preset test case template can be determined, and then the preset test case template can be saved to the corresponding folder based on the test equipment type, and the folder can be saved to the preset database server. The above keywords are all written in Chinese. In other words, the test case template can be written using the keywords provided by CiTestLib and stored in the database, wherein all the above templates are classified according to the following types of equipment: signal, turnout, section, basic route, guided route, automatic return, scattered equipment, non-route shunting, smoke test, etc. After that, each template can be placed in different folders for storage, and each folder can have multiple resource files for storing template scripts. The following is an example of a basic route for explanation, as shown below for a specific test case template:
[0065] KW-TC30002-000-CBTC-CI-F:
[0066] [Arguments]@{ROUTE};
[0067] [Tags] Basic route intrusion limit section;
[0068] [Documentation]Test purpose: To check the intrusion section properties of the route under test.
[0069] ...Test case description:
[0070] ...1. Press the start and end of the route to be tested, the route is established, the route is established, and the signal is open;
[0071] ...2. Occupy the restricted section and close the signal of the approach route being tested.
[0072] [Timeout] 600s;
[0073] ${route} LSB obtains a basic route in the interlocking table @{ROUTE};
[0074] @{sectlist} LSB obtains the list of restricted sections of the basic route element ${route};
[0075] ${len} Get Length @{sectlist};
[0076] Skip If $len == 0 No intrusion limit section, skip;
[0077] ${start_singal} LSB obtains the basic route element ${route} starting signal;
[0078] ${end_singal} LSB obtains the basic route element ${route} terminal signal;
[0079] ${overlap_state} PD determines whether route ${route} contains a protection section;
[0080] ${sig_sta} LSB obtains the basic route element ${route} to display the light color;
[0081] ${type} PD determines that the route ${route} contains conditional intrusion;
[0082] Skip If ${type} != ${True} Unconditional violation of the restriction condition;
[0083] IF '${overlap_state}' == 'True';
[0084] ${btns}=Create List ${start_singal} ${end_singal};
[0085] ATS protection access processing ${btns} 1;
[0086] ELSE;
[0087] ATS main access process ${start_singal} ${end_singal};
[0088] END;
[0089] ${type} PD determines the route status ${route} has been established;
[0090] ${ats_sig_sta} ATS obtains the equipment status ATS signal machine displays ${start_singal};
[0091] IF ${ats_sig_sta} != ${sig_sta} Fail The route is not established and the signal is not open;
[0092] FOR ${sectindex1} IN RANGE 0 ${len} 1;
[0093] ${sect1} Get From List ${sectlist} ${sectindex1};
[0094] ${sect_name1} LSB gets the section attributes ${sect1} section name;
[0095] ${sect_switchlist1} LSB gets the section attributes ${sect1} section switch conditions;
[0096] ${len2} = Get Length ${sect_switchlist1};
[0097] IF $len2 != 2 Continue For Loop;
[0098] END;
[0099] END;
[0100] [Teardown]:
[0101] IO SEGMENT COMMAND ${sect_name} IDLE;
[0102] ATS needs to confirm the command to send manual unlock ${start_singal}.
[0103] As shown in the test case template above, KW-TC30002-000-CBTC-CI-F is the template number; [Arguments]@{ROUTE} is the input parameter of this template, which represents a route. This parameter can be used to find all the information of the corresponding route in the interlocking table. For a specific interlocking table partial information, see Figure 3 As shown; the [Tags] field is the key information of this template to facilitate database screening and query; the [Documentation] field is the text description information of this template, which describes the test purpose and test steps of this template; the [Timeout] field is the timeout period for the execution of this template; the remaining part is the script of this template. And in this embodiment, based on the above-mentioned keyword libraries, it can be understood that the keywords in this embodiment are all written in Chinese, so that the readability and maintainability of the script can be very good. At the same time, in this embodiment, hundreds of test templates can be written for the test items of the basic approach. After these templates are written and debugged, no changes are required when generating test cases, which can greatly improve the automatic generation speed of test cases and reduce the storage space consumption of test cases.
[0104] In this embodiment, when the test case corresponding to the device under test is generated by using the engineering interlocking table and the template number of the preset test case template, the test device type of the device under test can be determined first, and the corresponding target folder can be determined from the folder according to the test device type of the device under test, and then the test case corresponding to the device under test is generated according to all the preset test case templates in the target folder and the template number of the engineering interlocking table and the preset test case template. That is to say, in this embodiment, when the user clicks the "Generate Test Case" button on the system page, a corresponding command will be issued to CiTestLib. After receiving the command, CiTestLib will traverse all the test templates of the corresponding type for a certain type of device under test according to different objects under test, and use non-invasive generation of test cases for the test case templates. After traversing all devices, a complete test case is finally formed according to the traversal results obtained. In a specific embodiment, the basic route is used as an example as follows: CiTestLib has already identified all route information after reading the interlocking table. For example, this station has 50 basic routes. The first route is X1204-X1103, the second route is S1203-S1301, and so on. Each route generates a test suite as follows Figure 4 The .robot file shown in the figure is used for each test suite, and each test suite takes up very little space. The following is a specific test suite:
[0105] *** Variables ***
[0106] @{BUTTONS}S2201AS2309A
[0107] *** Test Cases ***
[0108] TC00013-000-CBTC-CI-F
[0109] KW-TC00013-000-CBTC-CI-F@{BUTTONS}
[0110] TC00014-000-CBTC-CI-F
[0111] KW-TC00014-000-CBTC-CI-F@{BUTTONS}
[0112] TC00017-000-CBTC-CI-F
[0113] KW-TC00017-000-CBTC-CI-F@{BUTTONS}
[0114] TC00019-000-CBTC-CI-F
[0115] KW-TC00019-000-CBTC-CI-F@{BUTTONS}
[0116] TC00020-000-CBTC-CI-F
[0117] KW-TC00020-000-CBTC-CI-F@{BUTTONS}
[0118] TC00021-000-CBTC-CI-F
[0119] KW-TC00021-000-CBTC-CI-F@{BUTTONS}
[0120] TC00022-000-CBTC-CI-F
[0121] KW-TC00022-000-CBTC-CI-F@{BUTTONS}
[0122] TC00023-000-CBTC-CI-F
[0123] KW-TC00023-000-CBTC-CI-F@{BUTTONS}
[0124] TC00024-000-CBTC-CI-F
[0125] KW-TC00024-000-CBTC-CI-F@{BUTTONS}
[0126] TC00025-000-CBTC-CI-F
[0127] KW-TC00025-000-CBTC-CI-F@{BUTTONS}
[0128] TC00026-000-CBTC-CI-F
[0129] KW-TC00026-000-CBTC-CI-F@{BUTTONS}
[0130] TC00029-000-CBTC-CI-F
[0131] KW-TC00029-000-CBTC-CI-F@{BUTTONS}
[0132] TC00030-000-CBTC-CI-F
[0133] KW-TC00030-000-CBTC-CI-F@{BUTTONS}
[0134] TC00031-000-CBTC-CI-F
[0135] KW-TC00031-000-CBTC-CI-F@{BUTTONS}
[0136] TC00032-000-CBTC-CI-F
[0137] KW-TC00032-000-CBTC-CI-F@{BUTTONS}
[0138] As shown above, in the content of each test suite, "@{BUTTONS} S2201A S2309" is the current route parameter, such as "TC00013-000-CBTC-CI-F" is the test case number, and "KW-TC00013-000-CBTC-CI-F" is the test case template number. It can be seen that the test case only needs to reference the test case template number, and there is no need to modify the test case template. Therefore, the automatic generation speed of the test case can be very fast. In actual use, 30,000 test cases can be generated in just 1 to 2 seconds. In addition, because the test case generation adopts non-intrusive call of the test case template, when the test case template changes, the test case does not need to be regenerated. The test case occupies a small space, has a fast generation speed, and has high maintainability of template maintenance. The coupling between the template and the test case is low, and the test case is not affected by the change of the template content, which is extremely simple in engineering application.
[0139] Step S13: receiving a device test command through the command receiving interface of the preset test keyword library, and sending the test instructions in the test case to the tested environment of the device under test based on the device test command, so as to execute the test of the device under test in the tested environment.
[0140] In this embodiment, when a device test command is received through a command receiving interface of a preset test keyword library, the test instructions in the test case can be sent to the tested environment of the device to be tested based on the device test command, and it should be pointed out that before sending the test instruction, a test case feature database can also be constructed based on the station data of the railway interlocking system and the test case labels corresponding to each test case, and the test case can be saved in the test case feature database, and then the corresponding target test case can be screened out from the test case feature database based on the device test command, and the test instructions in the target test case can be sent to the tested environment of the device to be tested. That is to say, in this embodiment, CiTestLib can establish a test case feature database by integrating the test case label and the station XML (Extensible Markup Language) data, through which CiTestLib can automatically analyze the test cases applicable to the station and the test cases not applicable to the station in various station types, and can automatically screen the test cases to be executed according to the station characteristics and the test case characteristics, so as to realize intelligent test case screening, so as to conduct intelligent testing on the station in a more targeted manner. In a specific embodiment, if a test case label has "limited section violation", and there is no limit violation scenario in this station, then this case does not need to be tested. After that, when the user clicks the start test button, CiTestLib starts to automatically filter out the test cases that need to be executed according to the station characteristics and the test case feature database, and starts to execute them in sequence, and automatically generates test results after execution. At the same time, CiTestLib can perform reverse verification based on the test results to ensure the accuracy of the test results. That is to say, in this embodiment, after sending the test instruction to the tested environment of the device under test, the test information returned by the tested environment can be collected, and the test case script corresponding to the test case can be used to execute assertions according to the test information to determine whether the device under test passes the test, and generate a test report corresponding to the device under test based on the obtained judgment result and test information. Based on the above technical solution, this embodiment can test more efficiently and shorten the project delivery cycle. It can be understood that the above technical solution is implemented based on the computer interlocking of the CBTC system, but point-type, FAO (Fully Automatic Operation, development of fully automatic operation system), and large-scale conventional and high-speed railway interlocking can also implement related solutions.It can be understood that the above technical solution in this embodiment is implemented based on computer interlocking, but after a slight expansion of CiTestLib under this architecture, other products such as ATS, ZC, OC (Object Controller), VOBC, CTC (Centralized traffic control), TCC (Train Control Center), RBC (RadioBlock Center), TIS (Train Integrity System), LKJ (train operation monitoring device), etc. can be placed in the tested environment to realize automatic data generation and testing.
[0141] In this embodiment, the engineering interlocking table and station data in the target server can be read through the preset test keyword library, and the equipment information of the equipment to be tested in the railway interlocking system can be determined according to the engineering interlocking table and the station data, and then the preset test case template corresponding to the equipment information can be determined, and the template number of the engineering interlocking table and the preset test case template can be used to generate the test case corresponding to the equipment to be tested. After receiving the equipment test command through the command receiving interface of the preset test keyword library, the test instruction in the test case is sent to the tested environment of the equipment to be tested based on the equipment test command, so as to perform the test of the equipment to be tested in the tested environment. Through the above technical scheme, the keyword library in this embodiment can be used as an engine for automated testing to identify the information of the equipment to be tested by reading the engineering interlocking table and the station map XML file, and generate test cases according to the engineering interlocking table and the test case template written in advance, and non-intrusive generation is adopted in the process of generating test cases, without modifying the template content, directly quoting the template number, decoupling the template and the test case, generating the test case quickly, occupying less storage space, and conveniently maintaining the test case and template. After the test starts, the present embodiment can autonomously screen the test case and execute it, thereby greatly improving the efficiency and maintainability of test case generation.
[0142] See also Figure 5 As shown, the embodiment of the present application also discloses a railway interlocking system testing device, which is applied to a preset test keyword library, including:
[0143] The information determination module 11 is used to read the engineering interlocking table and the station data in the target server through the preset test keyword library, and determine the device information of the device to be tested in the railway interlocking system according to the engineering interlocking table and the station data;
[0144] A test case generation module 12, used to determine a preset test case template corresponding to the device information, and generate a test case corresponding to the device under test by using the engineering interlocking table and the template number of the preset test case template;
[0145] The device testing module 13 is used to receive a device testing command through the command receiving interface of the preset test keyword library, and send the test instructions in the test case to the tested environment of the device under test based on the device testing command, so as to execute the test of the device under test in the tested environment.
[0146] This embodiment can read the engineering interlocking table and station data in the target server through the preset test keyword library, and determine the device information of the device to be tested in the railway interlocking system according to the engineering interlocking table and the station data, and then determine the preset test case template corresponding to the device information, and use the template number of the engineering interlocking table and the preset test case template to generate the test case corresponding to the device to be tested. After receiving the device test command through the command receiving interface of the preset test keyword library, the test instructions in the test case are sent to the tested environment of the device to be tested based on the device test command, so as to perform the test of the device to be tested in the tested environment. Through the above technical scheme, when generating test cases through the test case template, non-intrusive generation is adopted, without modifying the template content, and the template number is directly referenced, thereby decoupling the template and the test case, generating the test case quickly, occupying less storage space, and conveniently maintaining the test case and template in the actual application process, which helps to improve the test efficiency and accuracy of the interlocking system.
[0147] In some specific embodiments, the railway interlocking system testing device further includes:
[0148] A result judgment module is used to collect the test information returned by the tested environment, and use the test case script corresponding to the test case to execute assertions according to the test information to determine whether the device under test passes the test, and generate a test report corresponding to the device under test based on the obtained judgment result and the test information.
[0149] In some specific embodiments, the railway interlocking system testing device further includes:
[0150] A database determination module, used for receiving a template generation instruction from a user, and determining a target library corresponding to the template generation instruction in the preset test keyword library;
[0151] A template generation module is used to generate the corresponding preset test case template using the target library based on the template generation instruction.
[0152] In some specific embodiments, the template generation module specifically includes:
[0153] A template generation unit, used to generate the corresponding preset test case templates using the keywords in the target library based on the template generation instruction, and determine the test device type corresponding to each preset test case template; the keywords are all written in Chinese;
[0154] The template saving unit is used to save the preset test case template to a corresponding folder based on the test device type, and save the folder to a preset database server.
[0155] In some specific embodiments, the use case generation module 12 specifically includes:
[0156] A folder determining unit, used to determine the test device type of the device under test, and determine a corresponding target folder from the folder according to the test device type of the device under test;
[0157] A case generation unit is used to generate the test case corresponding to the device under test according to all the preset test case templates in the target folder and using the engineering interlocking table and the template number of the preset test case template.
[0158] In some specific embodiments, the information determination module 11 specifically includes:
[0159] An information classification unit, used to read the engineering interlocking table in the target server through the preset test keyword library, and classify the equipment information in the engineering interlocking table according to a preset information classification rule to obtain a corresponding classification file;
[0160] An information determination unit is used to determine the device information corresponding to the device to be tested in the railway interlocking system according to the classification file and the station data.
[0161] In some specific embodiments, the railway interlocking system testing device further includes:
[0162] A database construction module, used to construct a test case feature database according to the station data of the railway interlocking system and the test case label corresponding to each test case, and save the test case to the test case feature database;
[0163] Accordingly, the device testing module 13 specifically includes:
[0164] A case screening unit is used to screen out corresponding target test cases from the test case feature database based on the device test command, and send the test instructions in the target test cases to the tested environment of the device under test.
[0165] Furthermore, the present application also discloses an electronic device. Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0166] Figure 6 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the railway interlocking system test method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0167] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0168] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0169] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the railway interlocking system test method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.
[0170] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the railway interlocking system testing method disclosed above is implemented. The specific steps of the method can be referred to the corresponding contents disclosed in the above embodiments, and will not be repeated here.
[0171] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0172] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0173] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0174] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0175] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A railway interlocking system testing method, characterized in that: Applied to preset test keyword library, including: Read the engineering interlocking table and station data in the target server through the preset test keyword library, and determine the device information of the device to be tested in the railway interlocking system according to the engineering interlocking table and station data; Determine a preset test case template corresponding to the device information, and generate a test case corresponding to the device under test using the engineering interlocking table and the template number of the preset test case template; A device test command is received through the command receiving interface of the preset test keyword library, and based on the device test command, the test instructions in the test case are sent to the tested environment of the device under test, so as to execute the test of the device under test in the tested environment.
2. The railway interlocking system testing method according to claim 1, characterized in that: After sending the test instructions in the test case to the tested environment of the device under test based on the device test command, the method further includes: The test information returned by the tested environment is collected, and the test case script corresponding to the test case is used to execute assertions according to the test information to determine whether the device under test passes the test, and a test report corresponding to the device under test is generated based on the obtained determination result and the test information.
3. The railway interlocking system testing method according to claim 1, characterized in that: Before determining the preset test case template corresponding to the device information, the method further includes: Receive a template generation instruction from a user, and determine a target library corresponding to the template generation instruction in the preset test keyword library; The target library is used to generate the corresponding preset test case template based on the template generation instruction.
4. The railway interlocking system testing method according to claim 3, characterized in that: The generating the corresponding preset test case template using the target library based on the template generating instruction includes: Generate the corresponding preset test case templates using the keywords in the target library based on the template generation instruction, and determine the test device type corresponding to each preset test case template; the keywords are all written in Chinese; The preset test case template is saved to a corresponding folder based on the test device type, and the folder is saved to a preset database server.
5. The railway interlocking system testing method according to claim 4, characterized in that: The step of generating a test case corresponding to the device under test by using the engineering interlocking table and the template number of the preset test case template includes: Determine the test device type of the device under test, and determine a corresponding target folder from the folder according to the test device type of the device under test; According to all the preset test case templates in the target folder, and using the engineering interlocking table and the template number of the preset test case template, the test case corresponding to the device under test is generated.
6. The railway interlocking system testing method according to claim 1, characterized in that: The step of reading the engineering interlocking table in the target server through the preset test keyword library includes: Reading the engineering interlocking table in the target server through the preset test keyword library, and classifying the equipment information in the engineering interlocking table according to preset information classification rules to obtain a corresponding classification file; Correspondingly, the device information of the device to be tested in the railway interlocking system is determined according to the engineering interlocking table and the station data, including: The device information corresponding to the device to be tested in the railway interlocking system is determined according to the classification file and the station data.
7. The railway interlocking system testing method according to claim 1, characterized in that: Before sending the test instructions in the test case to the tested environment of the device under test based on the device test command, the method further includes: Building a test case feature database according to the station data of the railway interlocking system and the test case labels corresponding to each of the test cases, and saving the test cases to the test case feature database; Accordingly, sending the test instructions in the test case to the tested environment of the device under test based on the device test command includes: Based on the device test command, a corresponding target test case is screened out from the test case feature database, and the test instructions in the target test case are sent to the tested environment of the device to be tested.
8. A railway interlocking system testing device, characterized in that: Applied to preset test keyword library, including: An information determination module is used to read the engineering interlocking table and station data in the target server through a preset test keyword library, and determine the device information of the device to be tested in the railway interlocking system according to the engineering interlocking table and station data; A test case generation module, used to determine a preset test case template corresponding to the device information, and generate a test case corresponding to the device under test by using the engineering interlocking table and the template number of the preset test case template; The device testing module is used to receive a device testing command through the command receiving interface of the preset test keyword library, and send the test instructions in the test case to the tested environment of the device under test based on the device testing command, so as to execute the test of the device under test in the tested environment.
9. An electronic device, characterized in that: The electronic device comprises a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the railway interlocking system testing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the railway interlocking system testing method as described in any one of claims 1 to 7.