Railway locomotive signal localization host system test case generation system and method
By automatically building test cases for domestic host system of railway locomotive signals, the problem of low testing efficiency in the existing technology is solved, a fast and clear testing process is achieved, and the testing efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202510453822.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-07-29
AI Technical Summary
In the prior art, the software testing efficiency of the domestic host system for railway locomotive signals is low, and the test case design relies on manual labor, resulting in inefficiency.
Provides test case generation system and methods for domestic host system test case generation of railway locomotive signals, including TAX box simulator information modification module, standard code generation module, carrier frequency locking use case generation module, interference signal use case generation module and fault scenario design module, through these modules, test cases are automatically constructed and stored.
Testers do not need to repeat the use cases, but can directly reuse the test cases, improve testing efficiency, ensure the rapid, clear and concise test process, avoid missed items, and save testing time.
Smart Images

Figure CN120386729A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and particularly to a test case generation system and method for a domesticated mainframe system of railway locomotive signals. Background Art
[0002] The domesticated mainframe of railway locomotive signals is the core equipment of the railway signal system, responsible for receiving and processing track signals. The stability and reliability of its software are directly related to the safety of railway transportation. Therefore, the software testing of the domesticated mainframe of locomotive signals becomes particularly important. Among them, test cases, as the leading means of testing, are the core of the overall testing process.
[0003] The main function of the domesticated mainframe of locomotive signals is to receive track signals, decode them, and provide correct lamp color displays to railway drivers according to the decoding results to ensure the normal operation of railway safety. The software testing of this system mainly involves sending different low-frequency lamp color information to the domesticated mainframe of locomotive signals and checking whether the locomotive signal lamp mechanism lights up according to the lamp color decoding rules. The traditional design of software test cases mainly relies on testers to manually cover multi-scenario test cases according to the required functions, resulting in low test efficiency. Summary of the Invention
[0004] The purpose of the present invention is to provide a test case generation system and method for a domesticated mainframe system of railway locomotive signals in view of the problem of low test efficiency of the existing test methods.
[0005] The technical solution adopted by the present invention to solve the above technical problems is as follows:
[0006] A test case generation system for a domesticated mainframe system of railway locomotive signals, the system includes a TAX box simulator information modification module, a signal encoding test case generation module, a carrier frequency locking test case generation module, an interference signal test case generation module, a fault scenario design module, and a test case storage module;
[0007] The TAX box simulator information modification module is used to modify the vehicle information in the TAX box simulator;
[0008] The signal encoding test case generation module is used to obtain lamp color information, save the lamp color information in the form of a list, and then filter the corresponding lamp colors through the Filter higher-order function to construct signal encoding test cases;
[0009] The carrier frequency locking test case generation module is used to identify a preset low frequency. When the low frequency is identified, it triggers a carrier frequency locking function. The carrier frequency locking function randomly matches according to the double yellow light system / double yellow flashing light system to construct carrier frequency locking test cases;
[0010] The interference signal use case generation module is used to add interference signals to the locomotive signal host during the test process to construct interference signal test cases;
[0011] The fault scenario design module is used to design fault scenario test cases;
[0012] The test case storage module is used to store all the generated test cases.
[0013] Furthermore, the vehicle information includes TAX box time, locomotive number, train number, speed information, and station number.
[0014] Furthermore, the lamp color information is obtained according to the TB / T 3287-2013 standard.
[0015] Furthermore, the screening conditions in the system code generation use case generation module include random combination mode and conditional combination mode;
[0016] The random combination mode is based on the number of input use cases, and uses the filter function to filter the lamp color information stored in the numPy array, randomly samples the lamp color information to obtain the corresponding number of lamp color information, and finally converts the obtained lamp color information into a list;
[0017] The conditional combination mode extracts elements that meet specific conditions from the lamp color information through list comprehension and combines conditional expressions. The conditional expression is specifically:
[0018] If the condition is up, and the result is True, then the up system combination is screened out; otherwise, the down system combination is screened out.
[0019] Furthermore, the test cases stored in the test case storage module are saved in tabular form through the pandas and openpyxl libraries.
[0020] A method for generating test cases for the domesticated host system of railway locomotive signals, the method comprising the following steps:
[0021] Step 1: Modify the vehicle information in the TAX box simulator;
[0022] Step 2: Obtain the lamp color information, save the lamp color information in list form, and then filter the corresponding lamp colors through the Filter higher-order function to construct system code test cases;
[0023] Step 3: Identify the preset low frequency. When the low frequency is identified, trigger the carrier frequency locking function. The carrier frequency locking function randomly matches according to the double yellow light system / double yellow flashing light system to construct carrier frequency locking test cases;
[0024] Step 4: Add interference signals to the locomotive signal host during the test process to construct interference signal test cases;
[0025] Step 5: Design fault scenario test cases;
[0026] Step 6: Store all the generated test cases.
[0027] Furthermore, the vehicle information includes the TAX box time, locomotive number, train number, speed information, and station number.
[0028] Furthermore, the lamp color information is obtained according to the TB / T 3287-2013 standard.
[0029] Furthermore, the screening conditions in Step 2 include the random combination mode and the conditional combination mode;
[0030] In the random combination mode, according to the number of input test cases, the filter function is used to filter the lamp color information stored in the numPy array, and random sampling is performed on the lamp color information to obtain the corresponding number of lamp color information. Finally, the obtained lamp color information is converted into a list;
[0031] In the conditional combination mode, through the method of list comprehension and combined with conditional expressions, elements that meet specific conditions are extracted from the lamp color information. The conditional expression is specifically:
[0032] If the condition is for the up direction, and the result is True, then the up-line system combination is screened out; otherwise, the down-line system combination is screened out.
[0033] Furthermore, the test cases stored in Step 6 are saved in the form of a table through the pandas and openpyxl libraries.
[0034] The beneficial effects of the present invention are:
[0035] Through the technical solution of the present application, testers can directly reuse test cases without repeating the design of test cases. For example, for the fault injection scenario, testers do not need to compare complex circuit diagrams every time. They can directly know the fault injection location, method, etc. through this tool. Therefore, the technical solution of the present application can greatly improve the test efficiency.
[0036] In addition, the technical solution of the present application can quickly, clearly, and concisely design various cross-combination scenario test cases and abnormal scenario test cases for complex coding input information. There are no missing items in the direct retrieval. The entire test scenario and test cases can be exported and displayed in the form of a result report, making the entire test case design process clearer and more definite, and saving test time. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a schematic diagram of the overall process of the present application. Specific implementation manners
[0038] It should be specifically noted that, without conflict, the various implementation manners disclosed in this application can be combined with each other.
[0039] Specific implementation manner 1: The test case generation system for the domesticated mainframe system of railway locomotive signals in this implementation manner. The system includes a TAX box simulator information modification module, a signal generation test case generation module for different systems, a carrier frequency locking test case generation module, an interference signal test case generation module, a fault scenario design module, and a test case storage module;
[0040] The TAX box simulator information modification module is used to modify the vehicle information in the TAX box simulator;
[0041] The signal generation test case generation module for different systems is used to obtain the lamp color information, save the lamp color information in the form of a list, and then filter the corresponding lamp colors through the Filter higher-order function to construct the signal generation test cases for different systems;
[0042] The carrier frequency locking test case generation module is used to identify a preset low frequency. When the low frequency is identified, it triggers the carrier frequency locking function. The carrier frequency locking function makes a random match according to the double yellow light system / double yellow flashing light system to construct the carrier frequency locking test cases;
[0043] The interference signal test case generation module is used to add interference signals to the locomotive signal mainframe during the test to construct the interference signal test cases;
[0044] The fault scenario design module is used to design the fault scenario test cases;
[0045] The test case storage module is used to store all the generated test cases.
[0046] At the same time, the standardized test cases can also be used as training materials to help new employees quickly familiarize themselves with the test work of this product;
[0047] High adaptability of the test tool: It can be adapted to the design of test cases for various railway locomotive signal mainframes based on the TB / T 3287-2013 standard. For example: optimization of locomotive signal software and hardware, domestication of locomotive signal mainframes, evolution of locomotive signal products, etc. Only simple modifications need to be made to the tool configuration table according to different rules;
[0048] Convenience for testers to use: Testers can directly select various function buttons through the UI interface of this tool for test case design. The process is simple and convenient, greatly shortening the test case design time.
[0049] This application is a tool for generating automated test cases for a domesticated mainframe system of railway locomotive signals, which is used to quickly and comprehensively generate test cases and is used in conjunction with the overall test process. This tool includes the following modules: TAX box simulator information modification module, signaling case generation module for different systems, carrier frequency locking case generation module, interference signal case generation module, fault injection case generation module, and test case storage module. The workflow is as follows: First, confirm the locomotive information of the TAX box simulator -> Import rule configuration information such as signaling systems -> Select test case generation scenarios according to test functions (signaling case generation scenario for different systems, carrier frequency locking scenario, interference signal transmission scenario, interference signal transmission scenario) -> Automatically generate test cases -> Save test cases and scenarios -> Generate a test case report -> For use by testers.
[0050] Interference signal transmission scenario
[0051] In the on-site railway scenario, interference signals have an impact on the equipment. During the test, interference signals (adjacent line interference, 50HZ interference, etc.) are added to the locomotive signal mainframe to simulate the on-site situation and check whether the decoding result of the mainframe is normal and how the system processes the interference signals.
[0052] The implementation method of the interference signal transmission scenario of this tool is as follows: When it is judged under the if condition that the interference amplitude is greater than the signaling amplitude, the interference result is returned, and then the interference lamp color is displayed. Otherwise, no interference is performed and the main lamp color is returned. When adding adjacent line interference signals of the specified shift frequency, after determining the signaling system and amplitude to be sent currently, interference signals of that system are generated. An example of the generated case content is shown as follows:
[0053] Serial number Encoding system Encoding amplitude Interference system Interference amplitude Expected result Whether passed 1 Frequency shift 550 9.5HZ green light 4 Frequency shift 750 15HZ yellow light 2 9.5HZ green light 2 Frequency shift 550 9.5HZ green light 4 Frequency shift 750 15HZ yellow light 6 15HZ yellow light
[0054] Fault injection scenario
[0055] During the actual on-site use, there is a risk of faults in the domesticated mainframe of the locomotive signal. When a fault occurs, the locomotive signal mainframe needs to have an early warning mechanism and display the alarm prompt on the digital tube so that the staff can be aware. Therefore, comprehensive fault tests are required to check whether the processing method of the domesticated mainframe of the locomotive signal meets the expectations.
[0056] This tool provides functions for displaying fault scenarios and fault creation. The implementation logic is as follows: The content of the imported fault and fault creation description file is saved in the database for reuse of this rule in the next test. According to the imported rules, the fault creation method is identified, and then the fault items corresponding to the fault creation method are judged and displayed according to the selected items. The generated fault scenarios are divided into the following two modules:
[0057] ① Single fault scenario: It is displayed according to the imported fault situation. When the "Fault exists at both ends I and II" is selected, the fault manufacturing method is displayed (both the coils at ends I and II are connected, the operating end is set as the test end, and both buttons at ends I and II are long-pressed simultaneously), and test cases are automatically generated. The tester conducts tests according to the generated cases and steps;
[0058] ② Cross fault scenario: When multiple faults are manufactured simultaneously, there are some fault conflict situations, which are likely to cause damage to the host. For this problem, use case generation for the cross fault scenario is designed. When multiple different types of faults are to be manufactured simultaneously, this tool saves the imported fault names and manufacturing methods as a dictionary, judges whether the key values in the dictionary conflict, and then can randomly generate multiple non-conflicting faults and display the fault manufacturing methods;
[0059] Test case report
[0060] There are the following two saving methods for automatically generated test cases, and the specific implementation methods are as follows:
[0061] ① After the test cases generated in different scenarios are saved to the Excel table, this tool saves the test case report to the tool installation directory according to different scenario names. Any test scenario can be saved separately, or all test scenarios can be saved. The column of "Whether Passed" is directly displayed in the generated test case report, and the tester can check it according to the test situation. The test cases clarify each test step and expected result, making the test process more standardized;
[0062] ② During the generation process of test cases for each scenario, the generated content is updated and displayed in real time to the tool interface log, which is convenient for the tester to view the test scenario use cases at any time.
[0063] Specific implementation method 2: This implementation method is a further description of Specific implementation method 1. The difference between this implementation method and Specific implementation method 1 is that the vehicle information includes TAX box time, locomotive number, train number, speed information, and station number.
[0064] Modify the TAX box simulator information
[0065] The domesticated mainframe of the locomotive signal obtains the basic train information by connecting to the TAX box simulator (this device is used to save a set of fixed vehicle information and send it to the mainframe through the X23 interface to simulate the on-site vehicle condition information). To test different on-site scenarios, this tool realizes the modification of the content of the TAX box simulator through serial communication so as to cover more on-site vehicle scenario situations. The specific implementation is as follows: The basic vehicle information such as the TAX box time, locomotive number, train number, speed information, and station number can be modified respectively. After the saving is successful, reconnect the TAX box simulator to the domesticated mainframe of the locomotive signal, and then send the code for testing again to realize the operation in the simulated new train environment.
[0066] Specific embodiment three: This embodiment is a further explanation of specific embodiment two. The difference between this embodiment and specific embodiment two is that the light color information is obtained according to the TB / T 3287-2013 standard.
[0067] Specific embodiment 4: This embodiment is a further explanation of specific embodiment 3. The difference between this embodiment and specific embodiment 3 is that the screening conditions in the standard code issuance use case generation module include a random combination mode and a conditional combination mode;
[0068] The random combination mode uses the filter function to filter the light color information stored in the numPy array according to the number of input use cases, randomly samples the light color information, obtains the corresponding number of light color information, and finally converts the obtained light color information into a list;
[0069] The conditional combination mode uses the list parsing method and combines conditional expressions to extract elements that meet specific conditions from the light color information. The specific conditional expressions are:
[0070] If the condition is uplink, the result is True to filter out the uplink standard combination, otherwise, filter out the downlink standard combination.
[0071] Standard code issuance scenario
[0072] In accordance with the TB / T 3287-2013 standard, all light color information is configured into the tool, and multi-scenario test cases are automatically generated based on the selected function items. Testers directly send track signals of different formats, carrier frequencies, and low frequencies based on the automatically generated test cases. The domestically produced locomotive signal host decodes the input track signals to verify whether the system decoding function meets expectations.
[0073] The tool is implemented as follows: it identifies the imported information, saves it in a list format, and filters out the corresponding data based on the given filtering conditions (random combination mode, conditional combination mode) through the Filter high-order function. The specific mode is as follows:
[0074] ① Random combination: Suitable for random testing without fixed test items. The tool can generate the number of use cases according to the input (note: the number of use cases is generated with low frequency as the minimum unit). When the number of input use cases is 50, the tool uses the filter function to filter the elements in the numPy array for random sampling, randomly selects 50 light color information from the configuration items, and converts the result into a list;
[0075] ②Combined according to up / down direction: This tool uses list comprehension and conditional expressions. (When the if condition is for the up direction and the result is True, the up-mode combinations are filtered out; otherwise, the down-mode combinations are filtered out, and the corresponding code blocks are executed according to the condition.) It efficiently extracts elements that meet specific conditions from the original data.
[0076] The list results generated above are converted from list to Excel through the pandas and openpyxl libraries and saved in the test case report.
[0077] Carrier frequency locking scenario
[0078] The method for implementing the carrier frequency locking scenario function of this tool is as follows: Through a callback function, when a specific low frequency (25.7HZ) is recognized, the carrier frequency locking function is triggered: Random matching is performed according to the double yellow light / double yellow flashing light mode in the imported code sending configuration table. After the carrier frequency is locked, the locomotive signal host can only receive and process the light color information in the locked mode and does not decode the light color information of other modes.
[0079] The specific implementation results are shown as follows: When designing to lock the light color of the ZPW2000 1700-1 mode and save after selecting the 1700-1 option, this tool will generate test cases under this condition. An example of the test case content is shown as follows:
[0080]
[0081] Specific implementation method five: This implementation method is a further explanation of specific implementation method four. The difference between this implementation method and specific implementation method four is that the test cases stored in the test case storage module are saved in tabular form through the pandas and openpyxl libraries.
[0082] Specific implementation method six: The difference between this implementation method and specific implementation method five is the method for generating test cases for the domesticated main engine system of railway locomotive signals. The method includes the following steps:
[0083] Step 1: Modify the vehicle information in the TAX box simulator;
[0084] Step 2: Obtain the light color information and save the light color information in list form. Then, filter the corresponding light colors through the Filter higher-order function to construct the mode code sending test cases.
[0085] Step 3: Identify the preset low frequency. When the low frequency is recognized, trigger the carrier frequency locking function. The carrier frequency locking function performs random matching according to the double yellow light mode / double yellow flashing light mode to construct the carrier frequency locking test cases.
[0086] Step 4: Add interference signals to the locomotive signal host during the test to construct interference signal test cases;
[0087] Step 5: Design test cases for fault scenarios;
[0088] Step 6: Store all the generated test cases.
[0089] Specific Embodiment Seven: This embodiment is a further elaboration of Specific Embodiment Six. The difference between this embodiment and Specific Embodiment Six is that the vehicle information includes TAX box time, locomotive number, train number, speed information, and station number.
[0090] Specific Embodiment Eight: This embodiment is a further elaboration of Specific Embodiment Seven. The difference between this embodiment and Specific Embodiment Seven is that the lamp color information is obtained according to the TB / T 3287-2013 standard.
[0091] Specific Embodiment Nine: This embodiment is a further elaboration of Specific Embodiment Eight. The difference between this embodiment and Specific Embodiment Eight is that the screening conditions in Step 2 include a random combination mode and a conditional combination mode;
[0092] In the random combination mode, according to the number of input test cases, the filter function is used to filter the lamp color information stored in the numPy array, randomly sample the lamp color information to obtain the corresponding number of lamp color information, and finally convert the obtained lamp color information into a list;
[0093] In the conditional combination mode, through the method of list comprehension and combined with conditional expressions, elements that meet specific conditions are extracted from the lamp color information. The conditional expression is specifically:
[0094] If the condition is "upward", and the result is True, then the upward system combination is screened out; otherwise, the downward system combination is screened out.
[0095] Specific Embodiment Ten: This embodiment is a further elaboration of Specific Embodiment Nine. The difference between this embodiment and Specific Embodiment Nine is that the test cases stored in Step 6 are saved in tabular form through the pandas and openpyxl libraries.
[0096] It should be noted that the specific embodiments are only explanations and illustrations of the technical solutions of the present invention, and the scope of the right protection cannot be limited thereby. Any changes that are only partial according to the claims and the description of the present invention should still fall within the protection scope of the present invention.
Claims
1. A test case generation system for the domesticated mainframe system of railway locomotive signals, characterized in that The system includes a TAX box simulator information modification module, a signaling case generation module for different systems, a carrier frequency locking case generation module, an interference signal case generation module, a fault scenario design module, and a test case storage module; The TAX box simulator information modification module is used to modify the vehicle information in the TAX box simulator; The signaling case generation module for different systems is used to obtain the signal color information, save the signal color information in the form of a list, and then filter the corresponding signal colors through the Filter higher-order function to construct signaling test cases for different systems; The carrier frequency locking case generation module is used to identify a preset low frequency. When the low frequency is identified, the carrier frequency locking function is triggered. The carrier frequency locking function randomly matches according to the double yellow light system / double yellow flashing light system to construct carrier frequency locking test cases; The interference signal case generation module is used to add interference signals to the locomotive signal host during the test to construct interference signal test cases; The fault scenario design module is used to design fault scenario test cases; The test case storage module is used to store all the generated test cases.
2. The test case generation system for the domesticated mainframe system of railway locomotive signals according to claim 1, wherein The vehicle information includes the TAX box time, locomotive number, train number, speed information, and station number.
3. The test case generation system for the domesticated mainframe system of railway locomotive signals according to claim 2, characterized in that The signal color information is obtained according to the TB / T 3287-2013 standard.
4. The test case generation system for the domesticated mainframe system of railway locomotive signals according to claim 3, characterized in that The screening conditions in the signaling case generation module for different systems include a random combination mode and a conditional combination mode; In the random combination mode, according to the number of input cases, the signal color information stored in the numPy array is filtered using the filter function, and random sampling is performed on the signal color information to obtain the corresponding number of signal color information, and finally the obtained signal color information is converted into a list; In the conditional combination mode, by means of list comprehension and combined with conditional expressions, elements that meet specific conditions are extracted from the signal color information. The specific conditional expression is: If the condition is for the up direction, and the result is True, then the up direction signaling combination is selected; otherwise, the down direction signaling combination is selected.
5. The test case generation system for the domesticated mainframe system of railway locomotive signals according to claim 4, characterized in that The test cases stored in the test case storage module are saved in tabular form through the pandas and openpyxl libraries.
6. Method for generating test cases for domesticated mainframe system of railway locomotive signal, characterized in that The method includes the following steps: Step 1: Modify the vehicle information in the TAX box simulator; Step 2: Obtain the signal color information, save the signal color information in the form of a list, and then filter the corresponding signal colors through the Filter higher-order function to construct signaling test cases for different systems; Step 3: Identify a preset low frequency. When the low frequency is identified, the carrier frequency locking function is triggered. The carrier frequency locking function randomly matches according to the double yellow light system / double yellow flashing light system to construct carrier frequency locking test cases; Step 4: Add interference signals to the locomotive signal host during the test to construct interference signal test cases; Step 5: Design fault scenario test cases; Step 6: Store all the generated test cases.
7. The method for generating test cases for the domesticated mainframe system of railway locomotive signals according to claim 6, characterized in that The vehicle information includes the TAX box time, locomotive number, train number, speed information, and station number.
8. The method for generating test cases for the domesticated mainframe system of railway locomotive signals according to claim 7, characterized in that The signal color information is obtained according to the TB / T 3287-2013 standard.
9. The method for generating test cases for the domesticated mainframe system of railway locomotive signals according to claim 8, wherein The screening conditions in Step 2 include a random combination mode and a conditional combination mode; The random combination pattern is based on the number of input test cases, and uses the filter function to filter the lamp color information stored in the numPy array, randomly sample the lamp color information to obtain the corresponding number of lamp color information, and finally convert the obtained lamp color information into a list; The conditional combination pattern extracts elements that meet specific conditions from the lamp color information through list comprehension and in combination with a conditional expression. The specific conditional expression is: If the condition is up, and the result is True, then the up-link system combination is filtered out; otherwise, the down-link system combination is filtered out.
10. The method for generating test cases for the domesticated mainframe system of railway locomotive signals according to claim 9, characterized in that The test cases stored in step 6 are saved in tabular form through the pandas and openpyxl libraries.