A fault injection test method, device, equipment and medium for switch machine board
By simulating the test data to be tested in the software simulation layer of the machine board card and injecting the test, the problem of insufficient test coverage of the machine board card test is solved, and the efficient and fast fault injection test is achieved. Comprehensiveness and coverage.
Patent Information
- Application Number
- CN202411407101.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-10-10
AI Technical Summary
The test coverage of the switchboard card is insufficient, the tester invests a lot, and the test time span is long, resulting in insufficient comprehensiveness and coverage of the fault injection test.
Use the software simulation layer fault injection test method. Through the simulation of testing data, detect failure injection instructions, the test data is injected in accordance with business needs, including the fault injection of types of fault injection such as communication data, voltage current, relay recovery, and road fork representation. Send the injected data to the transition machine board card for processing, analyze the processing results and generate an abnormal alarm prompt information.
The comprehensiveness and coverage of the fault injection test of the rutual board card was increased, the testers' investment and time span were reduced, the destruction and modification of the original hardware circuit was avoided, and the efficient and fast test was achieved.
Smart Images

Figure CN118914827B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a fault injection test method, device, equipment and medium for a switch machine board. Background Art
[0002] The fully electronic execution unit is a very critical low-level module device in the field of rail transit. The fully electronic execution unit is generally used to receive control instructions to realize the drive control of signal lights and switch machines. Since the switch machine module is basically composed of hardware such as relays and solid-state switches, and the switch machine module needs to collect analog information such as drive voltage and drive circuit in real time, it is more difficult to inject faults into the switch machine board. Currently, there are relatively few testing methods for switch machine boards, mainly the following technical means: (1) Code walkthrough and software white box testing: This method requires a lot of manpower and material resources, and the test results are not sufficient. It can only verify whether the function of a certain function is as expected, but cannot verify whether a certain requirement is complete. It is even impossible to test some more complex functions; (2) Piling the test code: This essentially modifies the original test object, the test results are not sufficient, and the injection of the spiking test is relatively single, and it is impossible to test dynamically; (3) Destroying the original hardware circuit for fault injection: It is impossible to inject faults randomly, and modifying the circuit may cause hardware damage. The scenarios that can be tested are relatively limited, and there is a certain risk of destroying the original hardware circuit for testing; (4) External dedicated test tooling: It can only test some faults outside the switch machine module, and cannot test faults inside the switch machine.
[0003] From the above, it can be seen that how to solve the problems of insufficient test coverage, large test personnel investment, and long test time span in switch machine board testing, and improve the comprehensiveness and coverage of fault injection testing of switch machine boards are issues to be solved in this field. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a fault injection test method, device, equipment and medium for a switch machine board, which can solve the problems of insufficient test coverage, large test personnel investment and long test time span in the switch machine board test, and improve the comprehensiveness and coverage of the fault injection test of the switch machine board. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a fault injection test method for a switch machine board, which is applied to a software simulation layer and includes:
[0006] Simulate the test data of the switch machine board to be tested;
[0007] When a fault injection instruction is detected, the data to be tested is subjected to fault injection according to business requirements to obtain the data to be tested after fault injection; the types of fault injection include communication data, voltage and current, relay recovery and switch representation;
[0008] Sending the test data after the fault injection to the switch machine board to be tested, so that the switch machine board to be tested processes the test data after the fault injection to obtain a processing result;
[0009] The processing result sent by the switch machine board to be tested is obtained, and the processing result is analyzed. If the processing result is an abnormal alarm, abnormal alarm prompt information is generated and displayed.
[0010] Optionally, the number of tests to be tested of the simulated switch machine board to be tested includes:
[0011] A software simulation layer including a safety platform layer and a safety platform-driver layer is constructed to simulate the test data for performing a fault injection test on the switch machine board to be tested.
[0012] Optionally, when a fault injection instruction is detected, performing fault injection on the data to be tested according to business requirements to obtain the data to be tested after the fault injection, including:
[0013] When it is detected that the program cycle operation pause button is triggered, a fault injection instruction is generated;
[0014] When a fault injection instruction is generated and detected, the type of fault injection is determined according to business requirements, and the data to be tested is subjected to fault injection based on the type and according to the business requirements to obtain the data to be tested after fault injection.
[0015] Optionally, determining the type of fault injection according to business requirements, and injecting the fault into the data to be tested based on the type and according to the business requirements to obtain the data to be tested after the fault injection, includes:
[0016] Determine the type of fault injection based on business requirements;
[0017] If the type is communication data, then according to the business requirements, communication data fault injection is performed on the source identity identifier, destination identity identifier, message sequence number and cyclic redundancy check information in the communication data in the test data to obtain the test data after fault injection;
[0018] If the type is voltage and current, determining the voltage and current fault injection type according to the business demand, and performing voltage and current fault injection on the data to be tested according to the voltage and current fault injection type and according to the business demand to obtain the data to be tested after fault injection;
[0019] If the type is relay recovery, then determine the type of relay recovery fault injection according to the business requirements, perform relay recovery fault injection on the data to be tested according to the type of relay recovery fault injection and according to the business requirements to obtain the data to be tested after fault injection;
[0020] If the type is switch representation, the switch representation fault injection type is determined according to the business requirements, and the switch representation fault injection is performed on the data to be tested according to the switch representation fault injection type and the business requirements to obtain the data to be tested after the fault injection.
[0021] Optionally, sending the test data after the fault injection to the switch machine board to be tested includes:
[0022] The data to be tested after the fault injection is verified and packaged, and then the verified and packaged data to be tested after the fault injection is sent to the switch machine board to be tested.
[0023] Optionally, after analyzing the processing result, the method further includes:
[0024] If the processing result is normal, determine the current operation cycle, and judge whether the current operation cycle is less than the test cycle corresponding to the business requirement;
[0025] If the current operation cycle is less than the test cycle corresponding to the business requirement, new test data is generated based on the processing result, and the fault injection process is repeated;
[0026] When the current operation cycle is not less than the test cycle corresponding to the business demand, the current processing result is obtained. If the current processing result is normal, the process of the fault injection test on the switch machine board to be tested is terminated.
[0027] In a second aspect, the present application discloses a fault injection test device for a switch machine board, which is applied to a software simulation layer and includes:
[0028] A data simulation module is used to simulate the test data of the switch machine board to be tested;
[0029] A fault injection module is used to inject faults into the data to be tested according to business requirements when a fault injection instruction is detected, so as to obtain the data to be tested after fault injection; the types of fault injection include communication data, voltage and current, relay recovery and turnout representation;
[0030] A processing module, used for sending the data to be tested after the fault injection to the switch machine board to be tested, so that the switch machine board to be tested processes the data to be tested after the fault injection to obtain a processing result;
[0031] The abnormal alarm module is used to obtain the processing result sent by the switch machine board to be tested, analyze the processing result, and if the processing result is an abnormal alarm, generate and display abnormal alarm prompt information.
[0032] Optionally, the fault injection module includes:
[0033] An instruction generation module, used for generating a fault injection instruction when it is detected that the program cycle operation pause button is triggered;
[0034] The fault injection type determination module is used to determine the type of fault injection according to business requirements when a fault injection instruction is generated and detected, and to perform fault injection on the data to be tested based on the type and according to the business requirements to obtain the data to be tested after fault injection.
[0035] In a third aspect, the present application discloses an electronic device, comprising:
[0036] Memory, used to store computer programs;
[0037] The processor is used to execute the computer program to implement the aforementioned fault injection test method for the switch machine board.
[0038] In a fourth aspect, the present application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the fault injection test method for the switch machine board disclosed above are implemented.
[0039] It can be seen that the present application provides a fault injection test method for a switch machine board, including simulating the test data of the switch machine board to be tested; when a fault injection instruction is detected, fault injection is performed on the data to be tested according to business requirements to obtain the data to be tested after fault injection; the types of fault injection include communication data, voltage and current, relay recovery and turnout indication; the data to be tested after fault injection is sent to the switch machine board to be tested, so that the switch machine board to be tested processes the data to be tested after fault injection to obtain a processing result; the processing result sent by the switch machine board to be tested is obtained, the processing result is analyzed, and if the processing result is an abnormal alarm, an abnormal alarm prompt information is generated and displayed. The present application is applied to the software simulation layer. It does not require too much manpower and material resources. Only one person is needed to complete the test. The test data of the switch machine board to be tested is simulated, and faults are injected into the test data according to business needs. The test data after fault injection is sent to the switch machine board to be tested for processing, and the processing result is analyzed. If the processing result is an abnormal alarm, an abnormal alarm prompt message is generated and displayed. There is no need to change the original test object or destroy any hardware circuit. The problems of insufficient test coverage, large test personnel investment, and long test time span in the switch machine board test are solved, and the comprehensiveness and coverage of the fault injection test of the switch machine board are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0041] Figure 1 A flow chart of a fault injection test method for a switch machine board disclosed in the present application;
[0042] Figure 2 A traditional switch machine board architecture and information flow chart disclosed in this application;
[0043] Figure 3 The architecture and information flow diagram of a software simulation layer and a switch machine board disclosed in this application;
[0044] Figure 4 A flow chart of a fault injection test method for a switch machine board disclosed in the present application;
[0045] Figure 5 A flow chart of a communication data fault injection disclosed in this application;
[0046] Figure 6 A flow chart of a voltage and current fault injection disclosed in this application;
[0047] Figure 7 A flow chart of a relay recovery fault injection disclosed in the present application;
[0048] Figure 8 A flow chart showing fault injection for a turnout disclosed in the present application;
[0049] Fig. 9 This is a schematic diagram of the structure of a fault injection test device for a switch machine board disclosed in the present application;
[0050] Fig.10 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] The fully electronic execution unit is a very critical low-level module device in the field of rail transit. The fully electronic execution unit is generally used to receive control instructions to realize the drive control of signal lights and switch machines. Since the switch machine module is basically composed of hardware such as relays and solid-state switches, and the switch machine module needs to collect analog information such as drive voltage and drive circuit in real time, it is more difficult to inject faults into the switch machine board. At present, there are few testing methods for switch machine boards, mainly the following technical means: (1) Code inspection and software white box testing: It requires a lot of manpower and material resources, and the test results are not sufficient. It can only verify whether the function of a certain function is as expected, but cannot verify whether a certain requirement is complete. It is even impossible to test some more complex functions; (2) Pile the test code: It essentially modifies the original test object, the test results are not sufficient, and the injection of the spiking test is relatively single, and it is impossible to test dynamically; (3) Destroy the original hardware circuit for fault injection: It is impossible to inject faults randomly, and modifying the circuit may cause hardware damage. The scenarios that can be tested are relatively limited, and there is a certain risk of destroying the original hardware circuit for testing; (4) External dedicated test tooling: It can only test some faults outside the switch machine module, and cannot test faults inside the switch machine. As can be seen from the above, how to solve the problems of insufficient test coverage, large test personnel investment, and long test time span in the switch machine board test, and improve the comprehensiveness and coverage of the fault injection test of the switch machine board are problems to be solved in this field.
[0053] See also Figure 1 As shown, the embodiment of the present invention discloses a fault injection test method for a switch machine board, which is applied to the software simulation layer and may specifically include:
[0054] Step S11: simulating the test data of the switch machine board to be tested.
[0055] In this embodiment, a software simulation layer including a safety platform layer and a safety platform-driver layer is constructed to simulate the test data for performing a fault injection test on the switch machine board to be tested.
[0056] The architecture and information flow of the traditional switch machine module application (i.e. switch machine board) are as follows: Figure 2As shown in the figure, the safety platform-driver layer sends various data collected by the driver to the safety platform layer, including communication data, voltage and current analog information, display collection data, relay collection data, etc. The safety platform layer verifies, packages, and 2O2 (two independent items Composite Fail-Safety) interactively removes redundancy on the received information and sends it to the switch machine application. The application parses the information in the data packet and processes it according to the switch machine module application logic. The processed commands and data are sent to the safety platform.
[0057] This application constructs a software simulation layer including a safety platform layer and a safety platform-driver layer. The software fault injection is based on the data flow of the actual switch machine module, and the driver layer and the platform layer are modified into the form of upper computer software simulation. The specific architecture and process are as follows Figure 3 As shown, the present application jointly compiles the software simulation layer and the switch machine application program into an executable program, and the software simulation layer performs data packaging and controls the program cycle operation, thereby realizing the fault injection test of the switch machine board. The software simulation layer can control the program single-step execution and continuous execution, more accurately simulating the fault scenario in the actual operation process, which is convenient and fast and will not cause damage to circuit components.
[0058] Step S12: When a fault injection instruction is detected, a fault is injected into the data to be tested according to business requirements to obtain the data to be tested after fault injection; the types of fault injection include communication data, voltage and current, relay recovery and switch representation.
[0059] Step S13: sending the data to be tested after the fault injection to the switch machine board to be tested, so that the switch machine board to be tested processes the data to be tested after the fault injection to obtain a processing result.
[0060] In this embodiment, the data to be tested after fault injection is verified and packaged, and then the verified and packaged data to be tested after fault injection is sent to the switch machine board to be tested, so that the switch machine board to be tested processes the data to be tested after fault injection to obtain a processing result.
[0061] Step S14: obtaining the processing result sent by the switch machine board to be tested, analyzing the processing result, and if the processing result is an abnormal alarm, generating and displaying abnormal alarm prompt information.
[0062] In this embodiment, the processing result is analyzed. If the processing result is normal, the current operation cycle is determined, and it is judged whether the current operation cycle is less than the test cycle corresponding to the business demand; if the current operation cycle is less than the test cycle corresponding to the business demand, new test data is generated based on the processing result, and the fault injection process is repeated; when the current operation cycle is not less than the test cycle corresponding to the business demand, the current processing result is obtained. If the current processing result is normal, the fault injection test process of the switch machine board to be tested is terminated.
[0063] For example: the test cycle corresponding to the business demand is three cycles. When a fault injection instruction is detected, fault injection can be performed on the test data. If the processing result corresponding to the first running cycle is normal, new test data is generated based on the first processing result, and the fault injection process is repeated. If the second processing result is abnormal, an abnormal alarm prompt message is directly generated and displayed. If the second processing result is normal, new test data is generated again based on the second processing result, and the fault injection process is continued. If the third processing result is also normal, the fault injection test process of the switch machine board to be tested is terminated.
[0064] The software fault injection method proposed in this application can avoid damaging the original hardware circuit, reduce costs, simplify operation complexity, and is convenient and fast. It allows users to easily change parameters and conditions to observe the behavior of the system under different circumstances. It can reflect the system response after modifying the parameters in real time, and can be repeated indefinitely to ensure the consistency and reliability of the experimental results. It has higher coverage, refines various fault types, and can perform single fault tests or combined tests. It can more comprehensively simulate actual test scenarios, realize cycle pauses, and more accurately simulate situations where problems occur in specific cycles.
[0065] In this embodiment, the test data of the switch machine board to be tested is simulated; when a fault injection instruction is detected, the fault injection is performed on the data to be tested according to business requirements to obtain the data to be tested after the fault injection; the types of the fault injection include communication data, voltage and current, relay recovery and turnout indication; the data to be tested after the fault injection is sent to the switch machine board to be tested, so that the switch machine board to be tested processes the data to be tested after the fault injection to obtain a processing result; the processing result sent by the switch machine board to be tested is obtained, and the processing result is analyzed. If the processing result is an abnormal alarm, an abnormal alarm prompt information is generated and displayed. The present application is applied to the software simulation layer. It does not require too much manpower and material resources. Only one person is needed to complete the test. The test data of the switch machine board to be tested is simulated, and faults are injected into the test data according to business needs. The test data after fault injection is sent to the switch machine board to be tested for processing, and the processing result is analyzed. If the processing result is an abnormal alarm, an abnormal alarm prompt message is generated and displayed. There is no need to change the original test object or destroy any hardware circuit. The problems of insufficient test coverage, large test personnel investment, and long test time span in the switch machine board test are solved, and the comprehensiveness and coverage of the fault injection test of the switch machine board are improved.
[0066] See also Figure 4 As shown, the embodiment of the present invention discloses a fault injection test method for a switch machine board, which is applied to the software simulation layer and may specifically include:
[0067] Step S21: simulating the test data of the switch machine board to be tested.
[0068] Step S22: When it is detected that the program cycle pause button is triggered, a fault injection instruction is generated. When the fault injection instruction is generated and detected, the type of fault injection is determined according to business requirements, and the data to be tested is fault injected based on the type and according to the business requirements to obtain the data to be tested after fault injection; the types of fault injection include communication data, voltage and current, relay recovery and switch representation.
[0069] In this embodiment, when a fault injection instruction is generated and detected, the type of fault injection is determined according to business requirements; if the type is communication data, communication data fault injection is performed on the source identity, destination identity, message sequence number and cyclic redundancy check information in the communication data in the data to be tested according to the business requirements to obtain the data to be tested after fault injection; if the type is voltage and current, the voltage and current fault injection type is determined according to the business requirements, and the voltage and current fault injection is performed on the data to be tested according to the voltage and current fault injection type and according to the business requirements to obtain the data to be tested after fault injection; if the type is relay recovery, the relay recovery fault injection type is determined according to the business requirements, and the relay recovery fault injection is performed on the data to be tested according to the relay recovery fault injection type and according to the business requirements to obtain the data to be tested after fault injection; if the type is turnout representation, the turnout representation fault injection type is determined according to the business requirements, and the turnout representation fault injection is performed on the data to be tested according to the turnout representation fault injection type and according to the business requirements to obtain the data to be tested after fault injection.
[0070] Step S23: sending the data to be tested after the fault injection to the switch machine board to be tested, so that the switch machine board to be tested processes the data to be tested after the fault injection to obtain a processing result.
[0071] Step S24: obtaining the processing result sent by the switch machine board to be tested, analyzing the processing result, and if the processing result is an abnormal alarm, generating and displaying abnormal alarm prompt information.
[0072] Specifically, the process of communication data fault injection is as follows: Figure 5As shown in the figure: Communication data reflects the communication quality between the software simulation layer and the switch board. By modifying the relevant parameters, different communication failures can be simulated to cause communication problems. The software simulation layer periodically and automatically generates the communication messages required by the switch module, without the need to use other devices to send data. The communication content mainly includes: source ID (Identity document), destination ID, message sequence number, some basic configuration, CRC (Cyclic Redundancy Check) and other information. When a fault injection instruction is detected, the cycle is paused and fault injection is performed. The source destination ID, message sequence number, CRC and other message contents can be modified according to business needs. At the same time, the software simulation layer allows the program to run in a single cycle, that is, the program runs for one cycle and checks the output once. This can ensure the coverage of relevant communication tests to obtain the test data after fault injection, and send the test data after the fault input to the switch machine board to be tested for processing. If the processing result returned by the switch machine board to be tested is a crash, indicating that the processing result is an abnormal alarm, an abnormal alarm prompt message is generated and displayed. If the processing result is normal, it is decided whether to repeat the fault injection process according to the test cycle corresponding to the business needs.
[0073] The process of voltage and current fault injection is as follows: Figure 6 As shown in the figure: the switch machine module application software periodically checks the AC380 drive power supply voltage. If the voltage value exceeds the threshold, the switch machine module application crashes; if no input voltage is detected, the switch machine module application alarms. The software simulation layer periodically simulates the current situation of the real switch machine based on the output of the application and provides the voltage and current data to the application for processing. For the voltage and current data, the software simulation layer can perform different types of voltage and current fault injection according to business needs: (1) Dual CPU (Central Processing Unit) voltage and current data inconsistency: The software simulation layer can inject different data faults for the first CPU and the second CPU; (2) Abnormal voltage and current data: The software simulation layer can inject any abnormal voltage and current data at any time. In this way, it is convenient and quick to detect whether the logical judgment of the voltage and current of the application software is correct without damaging the electrical components.
[0074] The process of relay recovery fault injection is as follows Figure 7As shown in the figure, the application software periodically checks whether the driving state of the relay in the board meets the expectation. By setting the suction or drop state of relays K1, K2, and K3 in the software simulation layer, the situation where the relay acquisition value is inconsistent with the drive instruction during the initialization self-test phase and the single-cycle operation phase can be simulated. The types of relay acquisition fault injection that can be injected into the software simulation layer for relay acquisition faults include: (1) the acquisition state of the first CPU and the second CPU is inconsistent; (2) the relay acquisition state is inconsistent with the drive state.
[0075] The turnout indicates the process of fault injection as follows Figure 8 As shown in the figure: The turnout acquisition position refers to the actual position status of the turnout acquired by the system in real time. The turnout position indication status is divided into positioning, reverse position and four-way. The acquisition data of the optocoupler and square wave are used in the software simulation layer to determine the turnout acquisition position. By setting the acquisition values of the square wave and optocoupler in the software simulation layer, the fault of the turnout acquisition can be simulated. The types of turnout indication fault injection for the turnout indication in the software simulation layer include: (1) the internal acquisition optocoupler of the board breaks down; (2) the internal acquisition optocoupler of the board is open; (3) the external diode of the board is open; (4) the external diode of the board is short-circuited; (5) the first CPU and the second CPU are inconsistent in acquisition.
[0076] The advantages of the present invention are: it does not require too much manpower and material resources, and there is no safety related to strong electricity. Only one person is needed to complete the test, and the completeness of the requirements can be verified conveniently and quickly. In addition, complex functional requirements can also be tested; there is no need to change the original test object, and single injection or combined injection can be performed, and the test results are sufficient. The periodic pause function ensures that the system can be dynamically tested; there is no need to destroy any hardware circuits, and software is used to simulate various hardware devices such as relays and switch machines to perform fault injection, and the test scenarios are comprehensive; there is no need to use external special test tools to test the internal program problems of the switch machine module and the external faults of the test module, and the test coverage is higher; the single-cycle operation and pause function designed by the present invention can realize fault injection at any time, which significantly improves the coverage of business needs.
[0077] In this embodiment, the test data of the switch machine board to be tested is simulated; when a fault injection instruction is detected, the fault injection is performed on the data to be tested according to business requirements to obtain the data to be tested after the fault injection; the types of the fault injection include communication data, voltage and current, relay recovery and turnout indication; the data to be tested after the fault injection is sent to the switch machine board to be tested, so that the switch machine board to be tested processes the data to be tested after the fault injection to obtain a processing result; the processing result sent by the switch machine board to be tested is obtained, and the processing result is analyzed. If the processing result is an abnormal alarm, an abnormal alarm prompt information is generated and displayed. The present application is applied to the software simulation layer. It does not require too much manpower and material resources. Only one person is needed to complete the test. The test data of the switch machine board to be tested is simulated, and faults are injected into the test data according to business needs. The test data after fault injection is sent to the switch machine board to be tested for processing, and the processing result is analyzed. If the processing result is an abnormal alarm, an abnormal alarm prompt message is generated and displayed. There is no need to change the original test object or destroy any hardware circuit. The problems of insufficient test coverage, large test personnel investment, and long test time span in the switch machine board test are solved, and the comprehensiveness and coverage of the fault injection test of the switch machine board are improved.
[0078] See also Fig. 9 As shown, the embodiment of the present invention discloses a fault injection test device for a switch machine board, which is applied to a software simulation layer and may specifically include:
[0079] The data simulation module 11 is used to simulate the test data of the switch machine board to be tested;
[0080] A fault injection module 12 is used for, when a fault injection instruction is detected, injecting a fault into the data to be tested according to business requirements to obtain the data to be tested after the fault injection; the types of the fault injection include communication data, voltage and current, relay recovery and turnout representation;
[0081] The processing module 13 is used to send the test data after the fault injection to the switch machine board to be tested, so that the switch machine board to be tested processes the test data after the fault injection to obtain a processing result;
[0082] The abnormal alarm module 14 is used to obtain the processing result sent by the switch machine board to be tested, analyze the processing result, and if the processing result is an abnormal alarm, generate and display abnormal alarm prompt information.
[0083] In this embodiment, the test data of the switch machine board to be tested is simulated; when a fault injection instruction is detected, the fault injection is performed on the data to be tested according to business requirements to obtain the data to be tested after the fault injection; the types of the fault injection include communication data, voltage and current, relay recovery and turnout indication; the data to be tested after the fault injection is sent to the switch machine board to be tested, so that the switch machine board to be tested processes the data to be tested after the fault injection to obtain a processing result; the processing result sent by the switch machine board to be tested is obtained, and the processing result is analyzed. If the processing result is an abnormal alarm, an abnormal alarm prompt information is generated and displayed. The present application is applied to the software simulation layer. It does not require too much manpower and material resources. Only one person is needed to complete the test. The test data of the switch machine board to be tested is simulated, and faults are injected into the test data according to business needs. The test data after fault injection is sent to the switch machine board to be tested for processing, and the processing result is analyzed. If the processing result is an abnormal alarm, an abnormal alarm prompt message is generated and displayed. There is no need to change the original test object or destroy any hardware circuit. The problems of insufficient test coverage, large test personnel investment, and long test time span in the switch machine board test are solved, and the comprehensiveness and coverage of the fault injection test of the switch machine board are improved.
[0084] In some specific embodiments, the data simulation module 11 may specifically include:
[0085] The construction module is used to construct a software simulation layer including a safety platform layer and a safety platform-driver layer, so as to simulate the test data used for performing a fault injection test on the switch machine board to be tested.
[0086] In some specific embodiments, the fault injection module 12 may specifically include:
[0087] An instruction generation module, used for generating a fault injection instruction when it is detected that the program cycle operation pause button is triggered;
[0088] The fault injection module is used to determine the type of fault injection according to business requirements when a fault injection instruction is generated and detected, and to perform fault injection on the data to be tested based on the type and according to the business requirements to obtain the data to be tested after fault injection.
[0089] In some specific embodiments, the fault injection module 12 may specifically include:
[0090] A type determination module is used to determine the type of fault injection according to business requirements;
[0091] A communication data fault injection module, for, if the type is communication data, injecting a communication data fault into the source identity, destination identity, message sequence number and cyclic redundancy check information in the communication data in the data to be tested according to the business requirements, so as to obtain the data to be tested after the fault injection;
[0092] A voltage and current fault injection module, for, if the type is voltage and current, determining a voltage and current fault injection type according to the business requirement, and performing voltage and current fault injection on the data to be tested according to the voltage and current fault injection type and the business requirement, so as to obtain the data to be tested after fault injection;
[0093] A relay recovery fault injection module is used to determine the type of relay recovery fault injection according to the business requirements if the type is relay recovery, and perform relay recovery fault injection on the data to be tested according to the type of relay recovery fault injection and the business requirements to obtain the data to be tested after fault injection;
[0094] A switch representation fault injection module is used to determine the type of switch representation fault injection according to the business requirements if the type is switch representation, and perform switch representation fault injection on the data to be tested according to the switch representation fault injection type and the business requirements to obtain the data to be tested after fault injection.
[0095] In some specific embodiments, the processing module 13 may specifically include:
[0096] The verification and packaging module is used to verify and package the data to be tested after the fault injection, and then send the verified and packaged data to be tested after the fault injection to the switch machine board to be tested.
[0097] In some specific embodiments, the abnormality alarm module 14 may specifically include:
[0098] A test cycle judgment module is used to determine the current operation cycle if the processing result is normal, and to judge whether the current operation cycle is less than the test cycle corresponding to the business requirement;
[0099] A repeated execution module, configured to generate new test data based on the processing result and repeat the fault injection process if the current operation cycle is less than the test cycle corresponding to the business requirement;
[0100] The process ending module is used to obtain the current processing result when the current operation cycle is not less than the test cycle corresponding to the business demand. If the current processing result is normal, the process of fault injection test on the switch machine board to be tested is ended.
[0101] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the fault injection test method of the switch machine board executed by the electronic device disclosed in any of the aforementioned embodiments.
[0102] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0103] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.
[0104] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20 to realize the operation and processing of the data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the fault injection test method of the switch machine board executed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to including data transmitted from an external device received by the fault injection test device of the switch machine board, the data 223 can also include data collected by its own input and output interface 25, etc.
[0105] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0106] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the fault injection test method for the switch machine board disclosed in any of the aforementioned embodiments are implemented.
[0107] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0108] The above is a detailed introduction to the fault injection test method, device, equipment and storage medium of a switch machine board provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A fault injection test method for a switch machine board, characterized in that: Applied to the software simulation layer, including: Simulate the test data of the switch machine board to be tested; When a fault injection instruction is detected, the data to be tested is subjected to fault injection according to business requirements to obtain the data to be tested after fault injection; the types of fault injection include communication data, voltage and current, relay recovery and switch representation; Sending the test data after the fault injection to the switch machine board to be tested, so that the switch machine board to be tested processes the test data after the fault injection to obtain a processing result; Obtaining the processing result sent by the switch machine board to be tested, analyzing the processing result, and if the processing result is an abnormal alarm, generating and displaying abnormal alarm prompt information; Wherein, the method of determining the type of fault injection according to business requirements, and injecting faults into the data to be tested based on the type and according to the business requirements to obtain the data to be tested after fault injection includes: determining the type of fault injection according to business requirements; if the type is communication data, injecting communication data faults into the source identity identifier, destination identity identifier, message sequence number, and cyclic redundancy check information in the communication data in the data to be tested according to the business requirements to obtain the data to be tested after fault injection; if the type is voltage and current, determining the type of voltage and current fault injection according to the business requirements, and injecting faults into the data to be tested according to the voltage and current fault injection type and according to the business requirements; According to the business requirements, voltage and current faults are injected into the data to be tested to obtain the data to be tested after the fault injection; if the type is relay recovery, the relay recovery fault injection type is determined according to the business requirements, and the relay recovery fault injection is performed on the data to be tested according to the relay recovery fault injection type and the business requirements to obtain the data to be tested after the fault injection; if the type is turnout representation, the turnout representation fault injection type is determined according to the business requirements, and the turnout representation fault injection type is performed on the data to be tested according to the business requirements to obtain the data to be tested after the fault injection.
2. The fault injection test method of the switch machine board according to claim 1, characterized in that: The test data of the simulated switch machine board to be tested includes: A software simulation layer including a safety platform layer and a safety platform-driver layer is constructed to simulate the test data for performing a fault injection test on the switch machine board to be tested.
3. The fault injection test method of the switch machine board according to claim 1, characterized in that: When a fault injection instruction is detected, the fault injection is performed on the data to be tested according to business requirements to obtain the data to be tested after the fault injection, including: When it is detected that the program cycle operation pause button is triggered, a fault injection instruction is generated; When a fault injection instruction is generated and detected, the type of fault injection is determined according to business requirements, and the data to be tested is subjected to fault injection based on the type and according to the business requirements to obtain the data to be tested after fault injection.
4. The fault injection test method for a switch machine board according to claim 1, characterized in that: The step of sending the test data after the fault injection to the switch machine board to be tested comprises: The data to be tested after the fault injection is verified and packaged, and then the verified and packaged data to be tested after the fault injection is sent to the switch machine board to be tested.
5. The fault injection test method for a switch machine board according to any one of claims 1 to 4, characterized in that: After analyzing the processing result, the method further includes: If the processing result is normal, determine the current operation cycle, and judge whether the current operation cycle is less than the test cycle corresponding to the business requirement; If the current operation cycle is less than the test cycle corresponding to the business requirement, new test data is generated based on the processing result, and the fault injection process is repeated; When the current operation cycle is not less than the test cycle corresponding to the business demand, the current processing result is obtained. If the current processing result is normal, the process of the fault injection test on the switch machine board to be tested is terminated.
6. A fault injection test device for a switch machine board, characterized in that: Applied to the software simulation layer, including: A data simulation module is used to simulate the test data of the switch machine board to be tested; A fault injection module is used to inject faults into the data to be tested according to business requirements when a fault injection instruction is detected, so as to obtain the data to be tested after fault injection; the types of fault injection include communication data, voltage and current, relay recovery and turnout representation; A processing module, used for sending the data to be tested after the fault injection to the switch machine board to be tested, so that the switch machine board to be tested processes the data to be tested after the fault injection to obtain a processing result; An abnormal alarm module is used to obtain the processing result sent by the switch machine board to be tested, analyze the processing result, and if the processing result is an abnormal alarm, generate and display abnormal alarm prompt information; Wherein, the method of determining the type of fault injection according to business requirements, and injecting faults into the data to be tested based on the type and according to the business requirements to obtain the data to be tested after fault injection includes: determining the type of fault injection according to business requirements; if the type is communication data, injecting communication data faults into the source identity identifier, destination identity identifier, message sequence number, and cyclic redundancy check information in the communication data in the data to be tested according to the business requirements to obtain the data to be tested after fault injection; if the type is voltage and current, determining the type of voltage and current fault injection according to the business requirements, and injecting faults into the data to be tested according to the voltage and current fault injection type and according to the business requirements; According to the business requirements, voltage and current faults are injected into the data to be tested to obtain the data to be tested after the fault injection; if the type is relay recovery, the relay recovery fault injection type is determined according to the business requirements, and the relay recovery fault injection is performed on the data to be tested according to the relay recovery fault injection type and the business requirements to obtain the data to be tested after the fault injection; if the type is turnout representation, the turnout representation fault injection type is determined according to the business requirements, and the turnout representation fault injection type is performed on the data to be tested according to the business requirements to obtain the data to be tested after the fault injection.
7. The fault injection test device for the switch machine board according to claim 6, characterized in that: The fault injection module comprises: An instruction generation module, used for generating a fault injection instruction when it is detected that the program cycle operation pause button is triggered; The fault injection type determination module is used to determine the type of fault injection according to business requirements when a fault injection instruction is generated and detected, and to perform fault injection on the data to be tested based on the type and according to the business requirements to obtain the data to be tested after fault injection.
8. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the fault injection test method for the switch machine board as described in any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the fault injection test method for the switch machine board card according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Detection circuit for controlling switch machine
CN107380209A
Test method and device based on fault injection, computer equipment and storage medium
CN111831569A
Equipment fault injection method and device, electronic equipment and storage medium
CN118068813A