A testing method, device and storage medium for a rail transit algorithm

By obtaining relevant information of the rail transit algorithm, determining the test strategy, obtaining test cases, and testing algorithms based on the test cases and strategy test algorithms, the problem of low testing efficiency in the existing technology is solved, and the efficient testing of the rail transit algorithm and the reliability of the speed measurement module is improved.

CN114048119BActive Publication Date: 2025-05-30TRAFFIC CONTROL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111209792.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-18
Publication Date
2025-05-30
Estimated Expiration
2041-10-18

AI Technical Summary

Technical Problem

In the prior art, the testing efficiency of rail transit algorithms is low and comprehensive and sufficient testing cannot be carried out, resulting in abnormal speed measurement modules and affecting operation and safety.

Method used

By obtaining relevant information of the rail transit algorithm, including interface information, functional information and structural information, determining test strategies, obtaining test cases, and using a combination of multiple test strategies based on test cases and policy testing algorithms, we can improve testing efficiency.

Benefits of technology

It realizes efficient testing of rail transit algorithms, can comprehensively and fully test the algorithms, improves the reliability of the speed measurement module, and reduces operational and safety risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114048119B_ABST
    Figure CN114048119B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a method and apparatus for testing a rail transit algorithm, a storage medium, and an electronic device. By adopting the solution in the present application, relevant information of the rail transit algorithm to be tested is obtained, where the relevant information includes interface information, function information, and structural information of the rail transit algorithm; a test strategy for the rail transit algorithm is determined according to the relevant information; test cases for the rail transit algorithm are obtained according to the test strategy, where the test cases are used to test the data of the rail transit algorithm; the rail transit algorithm is tested according to the test cases and the test strategy, that is, a feasible and effective algorithm-level module test method combined with multiple test strategies solves the technical problem of low test efficiency of rail transit algorithms in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a method and device for testing rail transit algorithms, a storage medium, and an electronic device. Background Art

[0002] The speed measurement module is a key core module in the ATP (Automatic Train Protection) software. The problem of abnormal train speed measurement leading to speed measurement failure has a great impact on operation and safety. For example, when the speed measurement is abnormal, it may cause the on-vehicle ATP to misjudge wheel spin and sliding, resulting in speed measurement failure, which may lead to operational problems such as emergency braking, immediate acceleration followed by immediate braking, etc. Passengers will not only have a poor experience but may even fall and get bruised. Moreover, the speed measurement algorithm is the underlying core logic of the speed measurement module. Due to the influence of test simulation means, the traditional test methods in the rail transit field cannot conduct comprehensive and sufficient tests at the algorithm level.

[0003] In response to the above problems, there is currently no effective solution. Summary of the Invention

[0004] Embodiments of the present invention provide a method and device for testing rail transit algorithms, a storage medium, and an electronic device, so as to at least solve the technical problem of low algorithm test efficiency in the prior art.

[0005] An embodiment of the present application provides a method for testing a rail transit algorithm, including: obtaining relevant information of the rail transit algorithm to be tested, where the relevant information includes interface information, function information, and structure information of the rail transit algorithm; determining a test strategy for the rail transit algorithm according to the relevant information; obtaining test cases for the rail transit algorithm according to the test strategy, where the test cases are used to test data of the rail transit algorithm; and testing the rail transit algorithm according to the test cases and the test strategy.

[0006] Optionally, determining the test strategy for the rail transit algorithm according to the structure information includes: performing different function module tests on the rail transit algorithm according to the function information to determine a function integration strategy; and / or performing hierarchical testing on the rail transit algorithm according to the structure information to determine a module integration testing strategy; and / or performing inter-layer and intra-layer testing on the rail transit algorithm according to the interface information to determine a hierarchical integration strategy.

[0007] Optionally, testing the rail transit algorithm according to the test case and the test strategy includes: when the test result of the rail transit algorithm meets the preset conditions, determining the state of the rail transit algorithm as the normal use state; when the test result of the rail transit algorithm does not meet the preset conditions, adjusting the rail transit algorithm to make the rail transit algorithm meet the preset conditions.

[0008] Optionally, obtaining the test case of the rail transit algorithm according to the test strategy includes: when the test strategy is used to test the normal state of the rail transit algorithm, obtaining the normal use case of the rail transit algorithm; or when the test strategy is used to test the abnormal state of the rail transit algorithm, obtaining the abnormal use case of the rail transit algorithm; or when the test strategy is used to test the extreme state of the rail transit algorithm, obtaining the boundary value use case of the rail transit algorithm.

[0009] Optionally, the method further includes: when the rail transit algorithm is a test speed algorithm and the test strategy is a hierarchical integration test strategy, isolating the device acquisition module corresponding to the test speed algorithm through a preset function; integrating the drive calculation module, data voting module, algorithm fusion module, and output module in the test speed algorithm in sequence to obtain an integrated module; testing the integrated module of the test speed algorithm according to a preset data use case.

[0010] Optionally, before testing the test speed algorithm according to the preset data use case, the method further includes: simulating target test data that cannot be generated by the hardware device in the case of isolating the device acquisition module; determining the target test data as the preset data use case.

[0011] According to the first aspect of the embodiments of the present application, a test device for a rail transit algorithm is provided, including: a first acquisition unit, configured to acquire relevant information of the rail transit algorithm to be tested, where the relevant information includes interface information, function information, and structure information of the rail transit algorithm; a first determination unit, configured to determine a test strategy for the rail transit algorithm according to the relevant information; a second acquisition unit, configured to acquire a test case of the rail transit algorithm according to the test strategy, where the test case is used to test data of the rail transit algorithm; a first test unit, configured to test the rail transit algorithm according to the test case and the test strategy.

[0012] Optionally, the first determination unit includes: a first determination module, configured to perform different function module tests on the rail transit algorithm according to the function information to determine a function integration strategy; and / or a second determination module, configured to perform hierarchical tests on the rail transit algorithm according to the structure information to determine a module integration test strategy; and / or a third determination module, configured to perform inter-layer and intra-layer tests on the rail transit algorithm according to the interface information to determine a hierarchical integration strategy.

[0013] Optionally, the first test unit includes: a fourth determination module, configured to determine that the state of the rail transit algorithm is a normal use state when the test result of the rail transit algorithm meets a preset condition; an adjustment module, configured to adjust the rail transit algorithm to make the rail transit algorithm meet the preset condition when the test result of the rail transit algorithm does not meet the preset condition.

[0014] Optionally, the second acquisition unit includes: a first acquisition module, configured to acquire normal use cases of the rail transit algorithm when the test strategy is used to test the normal state of the rail transit algorithm; or a second acquisition module, configured to acquire abnormal use cases of the rail transit algorithm when the test strategy is used to test the abnormal state of the rail transit algorithm; or a third acquisition module, configured to acquire boundary value use cases of the rail transit algorithm when the test strategy is used to test the extreme state of the rail transit algorithm.

[0015] Optionally, the apparatus further includes: an isolation unit, configured to isolate the device acquisition module corresponding to the test speed algorithm through a preset function when the rail transit algorithm is a test speed algorithm and the test strategy is a hierarchical integration test strategy; an integration unit, configured to integrate the drive calculation module, the data voting module, the algorithm fusion module, and the output module in the test speed algorithm in sequence to obtain an integration module; a second test unit, configured to test the integration module of the test speed algorithm according to preset data use cases.

[0016] Optionally, the apparatus further includes: a simulation unit, configured to simulate target test data that cannot be generated by a hardware device in a case where the device acquisition module is isolated before testing the test speed algorithm according to the preset data use cases; a second determination unit, configured to determine the target test data as the preset data use cases.

[0017] According to a first aspect of the embodiments of the present application, there is provided a computer-readable storage medium, characterized in that a computer program is stored in the storage medium, where the computer program is configured to execute the above-mentioned test method for a rail transit algorithm when running.

[0018] According to the first aspect of the embodiments of the present application, an electronic device is provided, including a memory and a processor. It is characterized in that a computer program is stored in the memory, and the processor is configured to run the computer program to execute the above-mentioned test method for the rail transit algorithm.

[0019] By adopting the test method for the rail transit algorithm provided in the embodiments of the present application, by obtaining relevant information of the rail transit algorithm to be tested, where the relevant information includes interface information, function information, and structural information of the rail transit algorithm; determining a test strategy for the rail transit algorithm according to the relevant information; obtaining test cases for the rail transit algorithm according to the test strategy, where the test cases are used to test the data of the rail transit algorithm; testing the rail transit algorithm according to the test cases and the test strategy, that is, an algorithm-level module test method that is a combination of multiple test strategies and is feasible and effective, solves the technical problem of low test efficiency of the rail transit algorithm in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments and descriptions thereof of the present application are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:

[0021] Figure 1 is a system structure block diagram of an optional test method for a rail transit algorithm according to an embodiment of the present invention;

[0022] Figure 2 is a flowchart of an optional test method for a rail transit algorithm according to an embodiment of the present invention;

[0023] Figure 3 is a flowchart of an optional gray-box test method for a speed measurement algorithm according to an embodiment of the present invention;

[0024] Figure 4 is a schematic diagram of an optional method for use case design and execution based on data according to an embodiment of the present invention;

[0025] Figure 5 is a flowchart of an optional hierarchical test strategy design for a gray-box test method of a speed measurement algorithm according to an embodiment of the present invention;

[0026] Figure 6 is a schematic diagram of an optional implementation of driving code according to an embodiment of the present invention;

[0027] Figure 7 is a schematic diagram of an optional reusable test process example according to an embodiment of the present invention;

[0028] Figure 8It is a schematic diagram of a test device for an optional rail transit algorithm according to an embodiment of the present invention. Detailed implementation manners

[0029] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0030] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0031] To better illustrate the content recorded in the embodiments of the present application, some names are described as follows:

[0032] Automatic Train Protection (ATP for short), also known as train overspeed protection system, its function is to automatically brake when the train exceeds the specified speed. When the on-board equipment receives the ground speed limit information, after information processing, it is compared with the actual speed. When the actual speed of the train exceeds the speed limit, the braking device controls the train braking system to brake.

[0033] It should be noted that the ATP subsystem (Automatic Train Protection System) is a safety control system that ensures the train running speed does not exceed the target speed. It is a subsystem of the Automatic Train Control (ATC) system and also a key device to ensure the safe operation of the train and achieve overspeed protection. This subsystem continuously transmits information such as "target speed" or "target distance" to the train through ATP ground equipment installed beside the track, so as to maintain a safe spacing distance between the following train and the preceding train, and supervise the program control of the opening and closing of the train doors and platform screen doors to ensure their safe operation. The ATP subsystem ground sending equipment usually sends train detection information through track circuits or cross induction loops to check the occupancy and vacancy of the track section. When a train is detected occupying the track section, data information such as "target speed" or "target distance" is transmitted to the train. The on-board ATP equipment receives and interprets data information such as "speed commands", combines relevant conditions such as the actual train speed, braking rate, and wheel wear compensation, realizes overspeed protection control, and cooperates with the Automatic Train Operation (ATO) subsystem to achieve automatic adjustment of the train speed. When the train reaches the positioning stop point, the ATP subsystem transmits information on the opening and closing of the train doors to the train through trackside equipment to control the opening and closing of the train doors. The ATP subsystem mainly includes: the "speed code" system of audio insulated track circuits; the "target speed" system of digital coded track circuits; the "target distance" system of digital message track circuits; the monorail transportation system without rails, which transmits ATP information through a dedicated cross induction loop. A communication-based train control system that uses an inter-rail induction loop to achieve two-way vehicle-ground data communication and complete the function of moving block.

[0034] The test method embodiment of the rail transit algorithm provided by the embodiments of the present application can be executed on a mobile terminal, a computer terminal or a similar computing device. Taking the operation on a mobile terminal as an example, Figure 1 is a hardware structure block diagram of a mobile terminal for the test method of a rail transit algorithm according to an embodiment of the present invention. As Figure 1 shown, the mobile terminal 10 may include one or more ( Figure 1 only one is shown in the figure) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the above mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above mobile terminal. For example, the mobile terminal 10 may further include more or fewer components than those shown in Figure 1 the figure, or have a different configuration from that shown in Figure 1 the figure.

[0035] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the test method of the rail transit algorithm in the embodiments of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the mobile terminal 10 through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.

[0036] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include the wireless network provided by the communication provider of the mobile terminal 10. In one instance, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station and thus can communicate with the Internet. In one instance, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0037] In this embodiment, a test method for a rail transit algorithm is also provided. Figure 2 It is a flowchart of the test method for the rail transit algorithm according to the embodiments of the present invention, as Figure 2 shown. The test method process of the rail transit algorithm includes the following steps:

[0038] Step S202, obtain relevant information of the rail transit algorithm to be tested, where the relevant information includes interface information, function information, and structure information of the rail transit algorithm.

[0039] Step S204, determine the test strategy for the rail transit algorithm according to the relevant information.

[0040] Step S206, obtain test cases for the rail transit algorithm according to the test strategy, where the test cases are used to test the data of the rail transit algorithm.

[0041] Step S208, test the rail transit algorithm according to the test cases and the test strategy.

[0042] In this embodiment, the above test method for the rail transit algorithm is used to test whether the algorithm needs to be updated. When the data tested by the test algorithm does not meet the preset conditions, the rail transit algorithm is adjusted so that the adjusted rail transit algorithm can be used for normal operation.

[0043] Among them, the above rail transit algorithm may include, but is not limited to, a speed measurement algorithm.

[0044] Through the embodiments provided by the present application, by obtaining relevant information of the rail transit algorithm to be tested, where the relevant information includes interface information, function information, and structure information of the rail transit algorithm; determining a test strategy for the rail transit algorithm according to the relevant information; obtaining test cases for the rail transit algorithm according to the test strategy, where the test cases are used to test the data of the rail transit algorithm; testing the rail transit algorithm according to the test cases and the test strategy, that is, according to a feasible and effective algorithm-level module test method combined with multiple test strategies, the technical problem of low test efficiency of the rail transit algorithm in the prior art is solved.

[0045] Optionally, determining the test strategy for the rail transit algorithm according to the structure information may include: performing different function module tests on the rail transit algorithm according to the function information to determine a function integration strategy; and / or performing hierarchical testing on the rail transit algorithm according to the structure information to determine a module integration test strategy; and / or performing inter-layer and intra-layer testing on the rail transit algorithm according to the interface information to determine a hierarchical integration strategy.

[0046] In this embodiment, the rail transit algorithm may include, but is not limited to, being tested according to three test strategies, where the three test strategies may include: a hierarchical integration strategy, a function-based integration strategy, and a "sandwich" integration strategy.

[0047] The hierarchical integration strategy is to verify the stability and interoperability of the hierarchical architecture application system through incremental integration, and different strategies can be flexibly implemented between and within each layer.

[0048] The function-based integration strategy starts from the function and organizes the module integration order according to the criticality of the function to verify the key functions of the system as early as possible and see the key functions as soon as possible. Multiple modules may be added to the key functions, and in terms of progress, it is faster than hierarchical integration and sandwich integration.

[0049] The "sandwich" integration strategy divides the system into three layers, with the middle being the target layer. The upper layer uses top-down integration, the lower layer uses bottom-up integration, and finally the tests converge at the target layer.

[0050] That is to say, in this embodiment, a feasible and effective algorithm-level module test method combined with multiple test strategies improves the test efficiency of the rail transit algorithm.

[0051] Optionally, testing the rail transit algorithm according to test cases and test strategies may include: when the test result of the rail transit algorithm meets the preset conditions, determining the state of the rail transit algorithm as the normal use state; when the test result of the rail transit algorithm does not meet the preset conditions, adjusting the rail transit algorithm to make it meet the preset conditions.

[0052] Optionally, obtaining test cases for the rail transit algorithm according to the test strategy may include: when the test strategy is used to test the normal state of the rail transit algorithm, obtaining the normal use cases of the rail transit algorithm; or when the test strategy is used to test the abnormal state of the rail transit algorithm, obtaining the abnormal use cases of the rail transit algorithm; or when the test strategy is used to test the extreme state of the rail transit algorithm, obtaining the boundary value use cases of the rail transit algorithm.

[0053] In this embodiment, test cases are designed for the object under test. The use case design not only includes normal, abnormal, and boundary value use cases, but also various data use cases designed for testing the algorithm alone. The test process can be repeated and the test effect can be utilized.

[0054] Optionally, the above method may further include: when the rail transit algorithm is a test speed algorithm and the test strategy is a hierarchical integration test strategy, isolating the device acquisition module corresponding to the test speed algorithm through a preset function; integrating the drive calculation module, data voting module, algorithm fusion module, and output module in the test speed algorithm in sequence to obtain an integrated module; testing the integrated module of the test speed algorithm according to the preset data use cases.

[0055] Optionally, before testing the test speed algorithm according to the preset data use cases, the above method may further include: when the device acquisition module is isolated, simulating target test data that cannot be generated by the hardware device; determining the target test data as the preset data use cases.

[0056] As an optional embodiment, the present application also provides a gray box testing method for a speed measurement algorithm. As Figure 3 shown, the flowchart of the gray box testing method for the speed measurement algorithm. The specific implementation steps are as follows.

[0057] Step S301, by analyzing the module and algorithm under test, fully understanding the software architecture, internal and external interfaces, functional characteristics, data structure, etc. of the object under test is a prerequisite for designing the gray box test strategy and test cases.

[0058] Step S302, formulate a gray box test strategy. In this test, 3 strategies are used for testing simultaneously, including a hierarchical integration strategy, a function-based integration strategy, and a "sandwich" integration strategy (equivalent to a module integration test strategy).

[0059] Among them, the hierarchical integration strategy verifies the stability and interoperability of the hierarchical architecture application system through incremental integration, and can flexibly implement different strategies between and within each layer.

[0060] The function-based integration strategy starts from the function and organizes the module integration sequence according to the criticality of the function, verifying the key functions of the system as early as possible and seeing the key functions as soon as possible. Multiple modules may be involved in the key functions, and in terms of progress, it is faster than hierarchical integration and sandwich integration.

[0061] The "sandwich" integration strategy divides the system into three layers, with the middle layer being the target layer. The upper layer uses top-down integration, and the lower layer uses bottom-up integration. Finally, the tests converge at the target layer.

[0062] Step S303: Based on the above strategies, design test cases for the object under test. The use case design not only includes normal, abnormal, and boundary value use cases, but also various data use cases designed for the individual test algorithms.

[0063] Step S304: When implementing gray-box testing, by designing functions such as bottom-layer hardware acquisition and compilers, isolate the hardware and simulate data errors that cannot be generated by the hardware device to fully test the speed measurement module algorithm.

[0064] In related technologies, based on some complex algorithm formulas in the speed measurement algorithm, if a repetitive, standardized, and gray-box test process is not constructed, effective testing cannot be carried out, and the testing efficiency is extremely low.

[0065] In this embodiment, a use case design method based on data is designed. During the execution phase, test data design is realized based on the use cases, and finally, the algorithm is tested in a flexible, comprehensive, and new way. As Figure 4 shown, a schematic diagram of the use case design and execution method based on data.

[0066] It should be noted that for the gray-box testing method of the algorithm based on the combination of multiple strategies, in order to fully test and also consider the efficiency issue, three integration strategies are combined.

[0067] Taking hierarchical integration as an example, according to the overall architecture of the speed measurement module, a 5-layer hierarchical test strategy is designed for testing, as Figure 5 shown, a flowchart of the hierarchical test strategy design for the gray-box testing method of the speed measurement algorithm.

[0068] Among them, as Figure 5 shown, during testing, the test module is divided into device acquisition, driver calculation, data voting, algorithm fusion, and output module layers.

[0069] Among them, the device acquisition layer is an isolation layer. The underlying functions are designed to isolate the hardware, and the acquisition of pulse information of two speed sensors and one radar message is simulated and implemented as the input for the drive calculation layer. The drive calculation layer obtains the speed measurement value and direction information of the speed sensor based on the speed measurement pulse and wheel diameter value of the speed sensor, and obtains the radar speed measurement value information based on the radar message. The data voting layer performs periodic input voting, judges the rationality according to the input of the drive calculation, and votes out the available data information. The algorithm fusion layer calculates and fits information such as speed, acceleration, and impact rate based on the data information, and then sends the fused speed magnitude, direction, status and other information to other modules through the output module.

[0070] For example, when integrating the key third layer, the designed simulated speed fusion scenario incorporates function-based integration. In this embodiment, a drive function is designed to implement: obtain the status of the local SDU data service unit by calling, set the condition for checking the radar status, and perform fusion check and simulation of the speed fusion scenario according to the SDU status. As Figure 6 shown, the schematic diagram of the drive code implementation.

[0071] It should be noted that the test method in this embodiment realizes automation and test process reuse. As Figure 7 shown, the schematic diagram of the reusable test process example.

[0072] It should also be noted that the above grey-box test method for the speed measurement algorithm not only explores the test method for algorithms in the rail transit field, but also overcomes the problems of low efficiency and incomplete simulation of traditional simulation tests. At the same time, automated test execution is adopted in the implementation, which not only reuses test cases, but also reuses test environments, test scripts, test data, etc. When performing grey-box tests on other products that reuse this algorithm, the reuse rate of this test process and results exceeds 80%, saving most of the labor and time costs.

[0073] Among them, through the embodiment provided by this application, the hardware device is isolated, faults are simulated through software code, and testing is realized based on data-based test design; a feasible and effective algorithm-level module test method combining multiple test strategies is provided; based on the reuse of speed measurement data, the test process is automated, and the test effect and process can be reused.

[0074] Compared with the existing technologies, this application has the following advantages: verifying the correctness of a single module and verifying whether the error accumulation of the combination of multiple modules is controllable; being able to verify whether the data passing through the module interface will be lost and directly locate the problem; the test process is repeatable and the test effect can be utilized.

[0075] Through the embodiments provided in this application, relying on the software architecture of the speed measurement algorithm, a gray-box testing method combining three integrated test strategies is used to design a data use case design method by isolating the underlying hardware driver, fully testing the algorithm module, making up for the deficiencies of white-box testing and black-box testing in the traditional rail transit field, and achieving full testing between and outside modules, including flexible fault injection design, boundary value / maximum / minimum value testing, customized scenario verification testing, etc. It not only solves the deficiencies of traditional simulation testing, but also realizes the reuse of the testing process through automation. It can be used as a solution to the difficult algorithm testing in traditional industries.

[0076] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that makes a contribution to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.

[0077] In this embodiment, an early warning device is also provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can implement a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0078] Figure 8 is a structural block diagram of a testing device for a rail transit algorithm according to an embodiment of the present invention. As Figure 8 shown, the testing device for the rail transit algorithm includes:

[0079] A first acquisition unit 81, configured to acquire relevant information of the rail transit algorithm to be tested, where the relevant information includes interface information, function information, and structure information of the rail transit algorithm.

[0080] A first determination unit 83, configured to determine a testing strategy for the rail transit algorithm according to the relevant information.

[0081] A second acquisition unit 85, configured to acquire test cases for the rail transit algorithm according to the testing strategy, where the test cases are used to test the data of the rail transit algorithm.

[0082] A first testing unit 87, configured to test the rail transit algorithm according to the test cases and the testing strategy.

[0083] Through the embodiments provided in this application, the first acquisition unit 81 acquires relevant information of the rail transit algorithm to be tested. Among them, the relevant information includes interface information, function information, and structure information of the rail transit algorithm; the first determination unit 83 determines the test strategy of the rail transit algorithm according to the relevant information; the second acquisition unit 85 acquires test cases of the rail transit algorithm according to the test strategy, where the test cases are used to test the data of the rail transit algorithm; the first test unit 87 tests the rail transit algorithm according to the test cases and the test strategy, that is, according to a feasible and effective algorithm-level module test method combined with multiple test strategies, which solves the technical problem of low test efficiency of the rail transit algorithm in the prior art.

[0084] Optionally, the above-mentioned first determination unit 83 may include: a first determination module, configured to perform different function module tests on the rail transit algorithm according to the function information to determine the function integration strategy; and / or a second determination module, configured to perform hierarchical testing on the rail transit algorithm according to the structure information to determine the module integration test strategy; and / or a third determination module, configured to perform inter-layer and intra-layer testing on the rail transit algorithm according to the interface information to determine the hierarchical integration strategy.

[0085] Optionally, the above-mentioned first test unit 87 may include: a fourth determination module, configured to determine that the state of the rail transit algorithm is the normal use state when the test result of the rail transit algorithm meets the preset conditions; an adjustment module, configured to adjust the rail transit algorithm to make the rail transit algorithm meet the preset conditions when the test result of the rail transit algorithm does not meet the preset conditions.

[0086] Optionally, the above-mentioned second acquisition unit 85 may include: a first acquisition module, configured to acquire normal use cases of the rail transit algorithm when the test strategy is used to test the normal state of the rail transit algorithm; or a second acquisition module, configured to acquire abnormal use cases of the rail transit algorithm when the test strategy is used to test the abnormal state of the rail transit algorithm; or a third acquisition module, configured to acquire boundary value use cases of the rail transit algorithm when the test strategy is used to test the extreme state of the rail transit algorithm.

[0087] Optionally, the above-mentioned device may further include: an isolation unit, configured to isolate the device acquisition module corresponding to the test speed algorithm through a preset function when the rail transit algorithm is the test speed algorithm and the test strategy is the hierarchical integration test strategy; an integration unit, configured to integrate the drive calculation module, data voting module, algorithm fusion module, and output module in the test speed algorithm in sequence to obtain an integrated module; a second test unit, configured to test the integrated module of the test speed algorithm according to preset data use cases.

[0088] Optionally, the above device may further include: a simulation unit, configured to simulate target test data that cannot be generated by a hardware device under the condition that the device acquisition module is isolated, before testing the test speed algorithm according to a preset data case; a second determination unit, configured to determine the target test data as the preset data case.

[0089] According to the first aspect of the embodiments of the present application, there is provided a computer-readable storage medium, characterized in that a computer program is stored in the storage medium, wherein the computer program is configured to execute the above-mentioned test method for a rail transit algorithm when running.

[0090] According to the first aspect of the embodiments of the present application, there is provided an electronic device, including a memory and a processor, characterized in that a computer program is stored in the memory, and the processor is configured to run the computer program to execute the above-mentioned test method for a rail transit algorithm.

[0091] It should be noted that the above-mentioned respective modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited thereto: the above-mentioned modules are all located in the same processor; or, the above-mentioned respective modules are located in different processors in any combination form.

[0092] An embodiment of the present invention also provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps in any one of the above-mentioned method embodiments when running.

[0093] Optionally, in this embodiment, the above storage medium may be configured to store a computer program for executing the following steps:

[0094] S1. Obtain relevant information of the rail transit algorithm to be tested, where the relevant information includes interface information, function information, and structure information of the rail transit algorithm;

[0095] S2. Determine a test strategy for the rail transit algorithm according to the relevant information;

[0096] S3. Obtain test cases for the rail transit algorithm according to the test strategy, where the test cases are used to test the data of the rail transit algorithm;

[0097] S4. Test the rail transit algorithm according to the test cases and the test strategy.

[0098] Optionally, in this embodiment, the above storage medium may include, but is not limited to: various media that can store computer programs such as a USB flash drive, a read-only memory (ROM for short), a random access memory (RAM for short), a mobile hard disk, a magnetic disk, or an optical disc.

[0099] An embodiment of the present invention further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0100] Optionally, the above electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0101] Optionally, in this embodiment, the above processor may be configured to execute the following steps through a computer program:

[0102] S1. Obtain relevant information of the rail transit algorithm to be tested, where the relevant information includes interface information, function information, and structural information of the rail transit algorithm;

[0103] S2. Determine a test strategy for the rail transit algorithm according to the relevant information;

[0104] S3. Obtain test cases for the rail transit algorithm according to the test strategy, where the test cases are used to test the data of the rail transit algorithm;

[0105] S4. Test the rail transit algorithm according to the test cases and the test strategy.

[0106] Optionally, specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and will not be elaborated herein.

[0107] Those skilled in the art should understand that the embodiments of the present application may be provided as a method, a system, or a computer program product. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0108] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate for implementing in the process Figure 1means for the functions specified in one or more processes and / or blocks Figure 1 means for the functions specified in one or more blocks

[0109] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction means that implements the functions in the process Figure 1 means for the functions specified in one or more processes and / or blocks Figure 1 means for the functions specified in one or more blocks

[0110] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus, such that a series of operational steps are performed on the computer or other programmable apparatus to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions in the process Figure 1 means for the functions specified in one or more processes and / or blocks Figure 1 means for the functions specified in one or more blocks

[0111] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the present application

[0112] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations

Claims

1. A testing method for a rail transit algorithm, characterized in that, it includes: Obtain relevant information of the rail transit algorithm to be tested, where the relevant information includes interface information, function information, and structure information of the rail transit algorithm; Determine the test strategy for the rail transit algorithm according to the relevant information; Obtain test cases for the rail transit algorithm according to the test strategy, where the test cases are used to test the data of the rail transit algorithm; Test the rail transit algorithm according to the test cases and the test strategy; The determining the test strategy for the rail transit algorithm according to the relevant information includes: Conduct different functional module tests on the rail transit algorithm according to the function information to determine the function integration strategy; Conduct hierarchical tests on the rail transit algorithm according to the structure information to determine the module integration test strategy; Conduct inter-layer and intra-layer tests on the rail transit algorithm according to the interface information to determine the hierarchical integration strategy.

2. The method according to claim 1, characterized in that, The testing the rail transit algorithm according to the test cases and the test strategy includes: When the test result of the rail transit algorithm meets the preset conditions, determine the state of the rail transit algorithm as the normal use state; When the test result of the rail transit algorithm does not meet the preset conditions, adjust the rail transit algorithm so that the rail transit algorithm meets the preset conditions.

3. The method according to claim 1, characterized in that, The obtaining the test cases for the rail transit algorithm according to the test strategy includes: When the test strategy is used to test the normal state of the rail transit algorithm, obtain the normal use cases of the rail transit algorithm; or When the test strategy is used to test the abnormal state of the rail transit algorithm, obtain the abnormal use cases of the rail transit algorithm; or When the test strategy is used to test the extreme state of the rail transit algorithm, obtain the boundary value use cases of the rail transit algorithm.

4. The method according to claim 1, characterized in that, The method further includes: When the rail transit algorithm is a test speed algorithm and the test strategy is a hierarchical integration test strategy, isolate the device acquisition module corresponding to the test speed algorithm through a preset function; Integrate the drive calculation module, data voting module, algorithm fusion module, and output module in the test speed algorithm in sequence to obtain an integrated module; Test the integrated module of the test speed algorithm according to the preset data use cases.

5. The method according to claim 4, characterized in that, Before the testing the test speed algorithm according to the preset data use cases, the method further includes: Simulate target test data that cannot be generated by the hardware device under the condition that the device acquisition module is isolated; Determine the target test data as the preset data use cases.

6. A testing device for a rail transit algorithm, characterized in that, it includes: A first acquisition unit, configured to acquire relevant information of a rail transit algorithm to be tested, where the relevant information includes interface information, function information, and structure information of the rail transit algorithm; A first determination unit, configured to determine a test strategy for the rail transit algorithm according to the relevant information; A second acquisition unit, configured to acquire test cases for the rail transit algorithm according to the test strategy, where the test cases are used to test data of the rail transit algorithm; A first test unit, configured to test the rail transit algorithm according to the test cases and the test strategy; The first determination unit includes: A first determination module, configured to perform different function module tests on the rail transit algorithm according to the function information, and determine a function integration strategy; A second determination module, configured to perform hierarchical tests on the rail transit algorithm according to the structure information, and determine a module integration test strategy; A third determination module, configured to perform inter-layer and intra-layer tests on the rail transit algorithm according to the interface information, and determine a hierarchical integration strategy.

7. The apparatus according to claim 6, wherein, The first test unit includes: A fourth determination module, configured to determine that the state of the rail transit algorithm is a normal use state when the test result of the rail transit algorithm meets a preset condition; An adjustment module, configured to adjust the rail transit algorithm to make the rail transit algorithm meet the preset condition when the test result of the rail transit algorithm does not meet the preset condition.

8. The apparatus according to claim 6, wherein, The second acquisition unit includes: A first acquisition module, configured to acquire normal use cases of the rail transit algorithm when the test strategy is used to test the normal state of the rail transit algorithm; or A second acquisition module, configured to acquire abnormal use cases of the rail transit algorithm when the test strategy is used to test the abnormal state of the rail transit algorithm; or A third acquisition module, configured to acquire boundary value use cases of the rail transit algorithm when the test strategy is used to test the extreme state of the rail transit algorithm.

9. The apparatus according to claim 6, wherein, The apparatus further includes: An isolation unit, configured to isolate a device acquisition module corresponding to the test speed algorithm through a preset function when the rail transit algorithm is a test speed algorithm and the test strategy is a hierarchical integration test strategy; An integration unit, configured to integrate a drive calculation module, a data voting module, an algorithm fusion module, and an output module in the test speed algorithm in sequence to obtain an integration module; A second test unit, configured to test the integration module of the test speed algorithm according to preset data use cases.

10. The apparatus according to claim 9, wherein, The apparatus further includes: A simulation unit, configured to simulate target test data that cannot be generated by a hardware device when the device acquisition module is isolated before testing the test speed algorithm according to the preset data use cases; A second determination unit, configured to determine the target test data as the preset data use cases.

11. A computer-readable storage medium, characterized in that, a computer program is stored in the storage medium, wherein the computer program is configured to execute the method described in any one of claims 1 to 5 when running.

12. An electronic device, comprising a memory and a processor, characterized in that, a computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and device for test data generation based on data decision, and computer equipment

    CN111176990A