Event generation strategy and calibration method for automatic test case

In the automated testing of LKJ train operation control equipment, timing backtracking or pre-testing methods are used to calibrate the event execution time, and the strategy of mileage first and time sub-strategy is used to solve the difficulty in obtaining automated test cases and inaccurate signal input timing. problem, achieving the accuracy of event execution timing and the correctness of automatic test results.

CN118733436APending Publication Date: 2024-10-01HENAN THINKER TRACK TRAFFIC TECH RES INST
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410666394.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

It is difficult to obtain automated test cases for LKJ train operation control equipment, and it is difficult for manual editors to cover thousands of complex application scenarios. When directly using operation record files to perform tests, the timing of external signal input is inaccurate, which affects the test results.

Method used

Use timing backtracking or pre-trial heuristic methods to calibrate the event execution time, and adopt the event execution strategy of mileage priority and time sub-sequence. Set the attributes of the event type and the backtrace value through a two-dimensional table, and adjust the event occurrence time to ensure that the signal is sent. accuracy.

Benefits of technology

Ensure the accuracy of event execution timing, accurate signal transmission and judgment, and improve the accuracy of automatic test results. It is suitable for LKJ simulation test systems to accurately restore the execution process of running record files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733436A_ABST
    Figure CN118733436A_ABST
Patent Text Reader

Abstract

The invention discloses an event generation strategy and a calibration method for an automatic test case, which are characterized in that event execution time is calibrated by adopting a timed backtracking or pre-probing method according to event types in a time dimension, and all events after time calibration are subjected to event execution strategies with mileage priority and time subordinate; the event execution time in the automatic test case is calibrated, so that the event execution time is accurate, signal transmission and judgment are accurate, the correctness of an automatic test result is ensured, the method is applied to a self-developed LKJ simulation test system, the execution process of an LKJ operation record file is accurately restored, and a solid foundation is provided for judgment of the operation result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of LKJ automated testing technology, and in particular relates to an event generation strategy and a calibration method capable of automatically testing case studies. Background Art

[0002] LKJ is a train operation control device with independent intellectual property rights in China, which is very important to ensure the safety of railway operation. The control logic of LKJ embedded software requires automated testing, and the acquisition of automated test cases has always been a pain point.

[0003] For simulation testing, automated test cases are the basis of automatic testing. Without automated test cases, automated testing will be out of the question. Since LKJ operation involves many external conditions and complex application scenarios, manual editing is difficult to cover thousands of application scenarios.

[0004] The LKJ operation record file is a record file generated by the user's correct use of LKJ on site. The LKJ operation record file records in detail the external control signals, driver operations, and LKJ control modes during the LKJ operation process.

[0005] like Figure 1 The following shows part of the contents of the LKJ operation log file. Each line of the LKJ operation log file records an event. Each event includes the event name, the time (hour, minute, second) when the event occurred, the mileage (kilometer mark of the railway line) and the event content.

[0006] Extracting automated test cases from LKJ run record files is reliable, trustworthy and convenient.

[0007] like Figure 2 The following is part of the contents of an automated test case. Each line of the automated test case is an event. Each event also includes the event name, the time when the event occurred (hour, minute, second), mileage, and event content.

[0008] The simulation test system automatically executes automated test cases, drives external devices, and generates external signals required by LKJ, such as Figure 2 Set the speed to 5, set the signal to green, and then collect the output information of LKJ to determine whether the speed limit is 41km / h. If the speed limit value is within the set error range, the test is considered to have passed, otherwise the test is considered to have failed.

[0009] Since the external signal may go through an event t from being generated to being transmitted to LKJ, and then being smoothed by LKJ and recorded in the operation record file, and different events and different event parameters result in different t, and the t of some events may be as long as 5 seconds. If the original LKJ operation record file is directly used to perform the test, the input timing of the external signal cannot be guaranteed to be accurate, which will cause great interference to the test results. It is necessary to seriously consider the event execution timing strategy and calibrate the event execution timing. Summary of the invention

[0010] In order to solve the above technical problems, the present invention provides an event generation strategy and calibration method for automatic test cases.

[0011] The specific plan is as follows: An event generation strategy and calibration method for automatic test cases calibrates the event execution time in the time dimension by using a timed backtracking or pre-trial method according to the event type, and adopts an event execution strategy of mileage first and time second for all events after time calibration.

[0012] The method of timing backtracking is to express the attributes of the event type in a two-dimensional table and set the backtracking value of the timing backtracking.

[0013] The pre-exploration method comprises the following steps: P1): Start the automatic simulation test equipment, send out signals one by one for the pre-test type events, and read the feedback from LKJ; P2): The automatic simulation test equipment calculates the event difference between the sending timing and the feedback timing, and uses the event difference as the backtracking value of the event.

[0014] Calibration of event execution time includes the following steps: S1): Looping to determine the type of events in the test case, the event types include events with fixed event errors and other events. If the event type is an event with fixed event errors, a timed backtracking method is used to set the backtracking value of the event. If the event type is other events, a pre-trial method is used to set the backtracking value of the event. S2): Adjust the time when the event occurs according to the backtracking value of the set event; S3): Sort all events according to their occurrence time.

[0015] The event execution strategy that uses mileage first and time second includes the following steps: S1): Calculate all events in the test case in turn and calculate event E n With event E n-1 The time difference is recorded in event E nAmong the properties, E n Represents any event in the test case, n is a positive integer, and n≥1. When n=1, the time difference is zero, and the time difference is accurate to milliseconds; S2): Start looping and executing all events in the test case; S3): After executing all events in the test case, send the execution end flag.

[0016] Step S2) loops through all events in the test case and includes the following steps: S21): Read the LKJ control mode to determine whether the current mileage is of practical significance; S22): If the mileage is meaningful, the mileage data sent by LKJ is continuously read to determine whether the mileage has reached the expected value; if the mileage is not meaningful, the system clock is continuously read to determine whether it has reached the value corresponding to the previous event E. n-1 time difference; S23): If the execution condition is met, execute E n , and record E n The execution time of the execution condition includes the mileage reaching the expected time or event E n With the previous event E n-1 The time difference reaches the set time difference.

[0017] The present invention discloses an event generation strategy and calibration method for an automatic test case, which calibrates the event execution timing in the automated test case, so that the event execution timing is accurate, the signal sending and judgment are accurate, and the correctness of the automatic test result is guaranteed. The method is applied to a self-developed LKJ simulation test system, and the execution process of the LKJ operation record file is accurately restored, providing a solid foundation for the judgment of the operation result. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is the table of LKJ operation record file.

[0019] Figure 2 Is a table of automated test cases.

[0020] Figure 3 It is a two-dimensional table of timed backtracking methods. DETAILED DESCRIPTION

[0021] The following will be combined with the accompanying drawings in 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 implementation of the present invention, not all of the implementations. 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.

[0022] Considering that it takes a certain amount of time for the generation, transmission, LKJ acquisition and recording of external signals, and the time is different for different types of signals, and there is an overall lag, it is inappropriate to directly use the time in the running record file as a test case. Therefore, it is necessary to recalibrate the running time, and after calibration, it can ensure that the external conditions act on the LKJ according to the actual running scenario.

[0023] An event generation strategy and calibration method for automatic test cases calibrates the event execution time in the time dimension by using a timed backtracking or pre-trial method according to the event type, and adopts an event execution strategy of mileage first and time second for all events after time calibration.

[0024] In this embodiment, in the time dimension, there is a certain error between the recording time of the event and the actual occurrence time. The strategy of "periodic backtracking + preliminary trial" is adopted to calibrate the time. Different strategies are adopted for different event types. The method of periodic backtracking is adopted for events with fixed errors of known events, and the method of preliminary trial is adopted for other events. In addition, considering the reality that mileage is more accurate and there are cumulative errors in time, the execution strategy of mileage first and time second is adopted for the execution timing of the event.

[0025] The method of timing backtracking is to express the attributes of the event type in a two-dimensional table and set the backtracking value of the timing backtracking. Figure 3 As shown, the backtracking values ​​of some event types are fixed. In this embodiment, event type 1 indicates that the locomotive signal is green, and the set backtracking value is -500 milliseconds. Event type 2 indicates that the locomotive signal is red and yellow, and the corresponding set backtracking value is -800 milliseconds. Event type 3 indicates the change of train pipe pressure, and the corresponding set backtracking value is -1000 milliseconds. If the time of event type 1 is calibrated, that is, the event of locomotive signal-green light, the backtracking value can be set to -500 milliseconds, that is, when an event E n When the locomotive signal is green, turn E n The calibration of the timed backtracking can be completed by adding the occurrence event and a specific backtracking value of -500 milliseconds.

[0026] The pre-exploration method comprises the following steps: P1): Start the automatic simulation test equipment, send out signals one by one for the pre-test type events, and read the feedback from LKJ; P2): The automatic simulation test equipment calculates the event difference between the sending timing and the feedback timing, and uses the event difference as the backtracking value of the event.

[0027] Calibration of event execution time includes the following steps: S1): Looping to determine the type of events in the test case, the event types include events with fixed event errors and other events. If the event type is an event with fixed event errors, a timed backtracking method is used to set the backtracking value of the event. If the event type is other events, a pre-trial method is used to set the backtracking value of the event. S2): Adjust the time when the event occurs according to the backtracking value of the set event; S3): Sort all events according to their occurrence time.

[0028] The event execution strategy that uses mileage first and time second includes the following steps: S1): Calculate all events in the test case in turn and calculate event E n With event E n-1 The time difference is recorded in event E n Among the properties, E n Represents any event in the test case, n is a positive integer, and n≥1. When n=1, the time difference is zero, and the time difference is accurate to milliseconds; S2): Start looping and executing all events in the test case; S3): After executing all events in the test case, send the execution end flag.

[0029] Step S2) loops through all events in the test case and includes the following steps: S21): Read the LKJ control mode to determine whether the current mileage is of practical significance; S22): If the mileage is meaningful, the mileage data sent by LKJ is continuously read to determine whether the mileage has reached the expected value; if the mileage is not meaningful, the system clock is continuously read to determine whether it has reached the value corresponding to the previous event E. n-1 time difference; S23): If the execution condition is met, execute E n , and record E n The execution time of the execution condition includes the mileage reaching the expected time or event E n With the previous event E n-1 The time difference reaches the set time difference.

[0030] In this embodiment, if the mileage at which the event occurs is within five meters of the mileage data sent by LKJ, the mileage meets expectations, that is, the execution conditions are met.

[0031] The present invention discloses an event generation strategy and calibration method for an automatic test case, which calibrates the event execution timing in the automated test case, so that the event execution timing is accurate, the signal sending and judgment are accurate, and the correctness of the automatic test result is guaranteed. The method is applied to a self-developed LKJ simulation test system, and the execution process of the LKJ operation record file is accurately restored, providing a solid foundation for the judgment of the operation result.

[0032] The technical means disclosed in the scheme of the present invention are not limited to the technical means disclosed in the above-mentioned implementation mode, but also include technical schemes composed of any combination of the above-mentioned technical features. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications are also regarded as the protection scope of the present invention.

Claims

1. An event generation strategy and calibration method for automatic test cases, characterized in that: In the time dimension, the event execution time is calibrated by periodic backtracking or pre-trial methods according to the event type, and the event execution strategy of mileage first and time second is adopted for all events after time calibration.

2. The event generation strategy and calibration method of the automatic test case according to claim 1, characterized in that: The method of timing backtracking is to express the attributes of the event type in a two-dimensional table and set the backtracking value of the timing backtracking.

3. The event generation strategy and calibration method of the automatic test case according to claim 1, characterized in that: The pre-exploration method comprises the following steps: P1): Start the automatic simulation test equipment, send out signals one by one for the pre-test type events, and read the feedback from LKJ; P2): The automatic simulation test equipment calculates the event difference between the sending timing and the feedback timing, and uses the event difference as the backtracking value of the event.

4. The event generation strategy and calibration method of the automatic test case according to claim 1, characterized in that: Calibration of event execution time includes the following steps: S1): Looping to determine the type of events in the test case, the event types include events with fixed event errors and other events. If the event type is an event with fixed event errors, a timed backtracking method is used to set the backtracking value of the event. If the event type is other events, a pre-trial method is used to set the backtracking value of the event. S2): Adjust the time when the event occurs according to the backtracking value of the set event; S3): Sort all events according to their occurrence time.

5. The event generation strategy and calibration method of the automatic test case according to claim 1, characterized in that: The event execution strategy that uses mileage first and time second includes the following steps: S1): Calculate all events in the test case in turn and calculate event E n With event E n-1 The time difference is recorded in event E n Among the properties, E n Represents any event in the test case, n is a positive integer, and n≥1. When n=1, the time difference is zero, and the time difference is accurate to milliseconds; S2): Start looping and executing all events in the test case; S3): After executing all events in the test case, send the execution end flag.

6. The event generation strategy and calibration method of the automatic test case according to claim 5, characterized in that: Step S2) loops through all events in the test case and includes the following steps: S21): Read the LKJ control mode to determine whether the current mileage is of practical significance; S22): If the mileage is meaningful, the mileage data sent by LKJ is continuously read to determine whether the mileage has reached the expected value; if the mileage is not meaningful, the system clock is continuously read to determine whether it has reached the value corresponding to the previous event E. n-1 time difference; S23): If the execution condition is met, execute E n , and record E n The execution time of the execution condition includes the mileage reaching the expected time or event E n With the previous event E n-1 The time difference reaches the set time difference.

Citation Information

Cited By

  • Data reading method, testing device, testing equipment, testing system and storage medium for whole vehicle testing

    CN119226175A