System security test method and device, storage medium and electronic equipment

By adjusting the judgment conditions of the monitoring program, simulating software faults and verifying the effectiveness of the safety mechanism, the interference and destructive problems of existing system safety testing methods are solved, and effective verification of software functional safety is achieved.

CN118779165APending Publication Date: 2024-10-15CHINA AUTOMOTIVE INNOVATION CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410779978.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Existing system security testing methods are highly intrusive and destructive to software functions, making it difficult to effectively verify the effectiveness of software faults and safety mechanisms without affecting the normal operation of the software.

Method used

By obtaining the change instruction information, the judgment conditions of the monitoring program are adjusted so that normally running software is mistakenly judged to be faulty, thereby simulating software faults, triggering the safety mechanism and verifying its effectiveness.

Benefits of technology

Without interfering with the normal operation of the software, it effectively verifies the function of the system security mechanism, solves the problem of interference and destructiveness of the system security testing method, and improves the accuracy and coverage of the test.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779165A_ABST
    Figure CN118779165A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a system security test method and device, a storage medium and electronic equipment, and the method comprises the steps: obtaining change indication information which is used for indicating the change of a specified judgment condition of a target monitoring program, the specified judgment condition is a condition met by judging that specified software of the target system has a specified software fault, and the target monitoring program is used for triggering the target system to start a specified security mechanism under the condition of monitoring that the specified software has the specified software fault; in response to the obtained change indication information, changing a specified judgment condition of the target monitoring program; and under the condition that the specified software is judged to have the specified software fault based on the changed specified judgment condition, performing validity verification on the specified security mechanism based on whether the target system successfully starts the specified security mechanism or not. The problem that a system security test method in the prior art is large in interference and high in destructiveness on software functions is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of system integration testing, and in particular, to a system security testing method and device, a storage medium, and an electronic device. Background Art

[0002] The purpose of considering functional safety in automotive E / E systems is to control the possibility of abnormal functions of E / E systems within a reasonable range. The causes of functional abnormalities are divided into random hardware failures and systematic failures. Therefore, in functional safety forward design, it is necessary not only to consider designing safety mechanisms for random hardware failures; it is also necessary to consider designing safety mechanisms for systematic failures. In functional safety verification, effectively, accurately, and repeatably injecting failures that cause functional abnormalities to activate safety mechanisms and verify the effectiveness of functional safety designs is a key technology supporting functional safety testing.

[0003] Software failures usually fall into the following categories: software functions are mistakenly executed when they are not requested; software functions are mistakenly requested to be executed when they should not be executed; software function execution starts too early or too late; software function execution takes longer or shorter than expected; the current program flow of the software function is different from the expected program flow, etc. They can be summarized into three categories: execution anomalies, program flow disorder, and timing disorder.

[0004] For the simulation injection of the above software faults, one method is to embed the software fault into the program before compilation. However, since the fault is embedded in the code, it is easy to hide bugs (vulnerabilities), which will bring unpredictable destructive effects to the original software code. Another method is to inject script faults into the reserved parameter interface in the software when the software is compiled and run. However, the failure coverage of this method is very limited, and it can only inject faults caused by interface parameter exceeding the limit; moreover, the interface directly calls the parameters exceeding the limit, which is easy to cause unknown interference to other functions of the software.

[0005] It can be seen that the system security testing methods in the relevant technology have the problem of great interference and destructiveness to software functions. Summary of the invention

[0006] The embodiments of the present application provide a system security testing method and device, a storage medium and an electronic device to at least solve the problem that the system security testing method in the related art has a large interference and strong destructiveness to the software function.

[0007] According to one embodiment of the present application, a system safety testing method is provided, comprising: obtaining change indication information, wherein the change indication information is used to indicate a specified judgment condition of a change target monitoring program, wherein the specified judgment condition is a condition satisfied for determining that a specified software failure occurs in specified software of a target system, wherein the target monitoring program is used to monitor the specified software based on the specified judgment condition, and trigger the target system to start a specified safety mechanism when the specified software is monitored to have the specified software failure; in response to the obtained change indication information, changing the specified judgment condition of the target monitoring program, wherein the changed specified judgment condition is used to determine that the normally running specified software has the specified software failure, so as to simulate the specified software failure; and in the case where it is determined that the specified software has the specified software failure based on the changed specified judgment condition, verifying the effectiveness of the specified safety mechanism based on whether the target system successfully starts the specified safety mechanism.

[0008] According to another embodiment of the present application, a system safety testing device is provided, including: an acquisition unit, used to acquire change indication information, wherein the change indication information is used to indicate a specified judgment condition of a change target monitoring program, wherein the specified judgment condition is a condition satisfied for determining that a specified software failure occurs in specified software of a target system, and the target monitoring program is used to monitor the specified software based on the specified judgment condition, and trigger the target system to start a specified safety mechanism when the specified software is monitored to have the specified software failure; a change unit, used to change the specified judgment condition of the target monitoring program in response to the acquired change indication information, wherein the changed specified judgment condition is used to determine that the normally running specified software has the specified software failure, so as to simulate the specified software failure; a verification unit, used to verify the effectiveness of the specified safety mechanism based on whether the target system successfully starts the specified safety mechanism when it is determined that the specified software has the specified software failure based on the changed specified judgment condition.

[0009] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned system security testing method when running.

[0010] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the system safety testing method through the computer program.

[0011] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, which implements the steps in any of the above-mentioned system safety testing method embodiments when executed by a processor.

[0012] Through the embodiments of the present application, after activating software fault injection, the specified judgment conditions of the original target monitoring program are changed. When the software is operating normally, the system is mistakenly believed to have a software fault based on the changed specified judgment conditions. When the system safety mechanism is started, the effectiveness of the system safety mechanism is confirmed. The functional safety of the system can be verified without interfering with the normal operation of the software, which solves the problem that the system safety testing method in the related art has a large interference and strong destructiveness to the software function. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 is a flowchart of an optional system safety testing method according to an embodiment of the present application;

[0014] Figure 2 is a schematic diagram of an optional software fault injection point according to an embodiment of the present application;

[0015] Figure 3 is a schematic diagram of an optional system-level software fault injection timing control according to an embodiment of the present application;

[0016] Figure 4 is a schematic diagram of an optional software execution abnormal fault source determination criterion according to an embodiment of the present application;

[0017] Figure 5 is a schematic diagram of an optional determination criterion after a software execution abnormal failure is changed according to an embodiment of the present application;

[0018] Figure 6 is a schematic diagram of an optional software program flow / timing source monitoring determination criterion according to an embodiment of the present application;

[0019] Figure 7 is a schematic diagram of a determination criterion after a change in an optional software program flow / timing monitoring according to an embodiment of the present application;

[0020] Figure 8 is a structural block diagram of an optional system safety testing device according to an embodiment of the present application;

[0021] Fig. 9 It is a structural block diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0024] According to one aspect of an embodiment of the present application, a system security testing method is provided. Figure 1 is a flow chart of an optional system safety testing method according to an embodiment of the present application, such as Figure 1 As shown, the process of the method may include the following steps:

[0025] Step S102, obtaining change indication information, wherein the change indication information is used to indicate a specified judgment condition of changing the target monitoring program, the specified judgment condition is a condition satisfied for determining that a specified software failure occurs in the specified software of the target system, and the target monitoring program is used to monitor the specified software based on the specified judgment condition, and trigger the target system to start a specified safety mechanism when a specified software failure is detected in the specified software.

[0026] Optionally, in this embodiment, the above-mentioned system safety testing method can be applied to the automotive E / E system. Here, the automotive E / E system (Electrical / Electronic Systems) includes electrical and electronic systems in the car. E / E systems are important components of the car, and they are responsible for managing and controlling various functions of the car. Among them, the electrical system is mainly responsible for the energy supply and distribution of the car, while the electronic system is responsible for processing and transmitting information. Specifically, the electrical system includes batteries, generators, starters, ignition systems, etc. These components provide power to the car to drive the engine and other electrical equipment; the electronic system includes various sensors, controllers and actuators, which are responsible for collecting data, processing information and performing corresponding operations to realize various functions of the car, such as navigation, audio, safety systems, etc. Software is used to control and manage various electronic devices to ensure that they operate normally and work in conjunction with other systems. In addition, software can also be used to update and optimize the performance of the car.

[0027] The system safety testing method in this embodiment can be applied to the scenario of testing the safety of automobile systems. The automobile E / E system considers functional safety, and the goal is to control the possibility of abnormal functions of the E / E system within a reasonable range. The causes of functional abnormalities are divided into random hardware failures and systematic failures. Therefore, in the forward design of functional safety, it is necessary not only to consider designing safety mechanisms for random hardware failures; it is also necessary to consider designing safety mechanisms for systematic failures. During functional safety verification, effective, accurate, and repeatable injection of failures that cause functional abnormalities to activate safety mechanisms to verify the effectiveness of functional safety designs is a key technology supporting functional safety testing.

[0028] Fault injection techniques are generally divided into two categories: hardware fault injection and software fault injection. The cost, accuracy, and repeatability of fault injection will affect the final (hardware / software injection) method selection.

[0029] The types of faults suitable for hardware fault injection are:

[0030] 1. Open short circuit fault;

[0031] 2. Bridging failure;

[0032] 3. Fixed fault (a certain signal in the circuit is uncontrollable and always fixed at the same value);

[0033] 4. Stray current fault (refers to the current flowing due to leakage outside the designed circuit);

[0034] 5. Surge fault (the voltage momentarily exceeds the normal operating voltage).

[0035] The types of faults suitable for software fault injection are:

[0036] 1. Storage data is damaged (such as registers, memory, disk);

[0037] 2. Communication data loss (such as bus and communication network);

[0038] 3. Software defects (machine-level or higher-level software defects).

[0039] At present, the fault injection technical solutions related to functional safety in related technologies are all based on the physical simulation of hardware faults at the real vehicle test level. However, there are almost no technical solutions related to simulated software fault injection for the functional safety real vehicle test or system-level integration test of automotive E / E systems.

[0040] Software safety mechanisms are mostly developed based on the software application layer, and the fault injection points of the software need to be designed according to the software's own functions, which is relatively flexible. After the experience of related technical solutions is migrated, it is only applicable to software layer testing, and the fault injection of software interfaces with parameters exceeding the limit cannot effectively simulate other types of software faults. In the functional safety system layer integration test, there is no effective technical solution to perform system layer safety mechanism (safe state + FTTI) performance verification after injecting software faults. Among them, FTTI (Fault Tolerance Time Interval) refers to the shortest time interval from the occurrence of internal faults of related items to the possible occurrence of hazardous events when the safety mechanism is not activated. FTTI includes fault diagnosis time, fault response time and time to enter the safe state.

[0041] Application layer software failures usually fall into the following categories: software functions are mistakenly executed when they are not requested to be executed; software functions are mistakenly requested to be executed when they should not be executed; software function execution starts too early or too late; software function execution takes longer or shorter than expected; the current program flow of the software function is different from the expected program flow, etc. They can be summarized into three categories: execution anomalies, program flow disorder, and timing disorder.

[0042] One way to simulate the above software faults is to embed the software faults into the program before compilation. However, since the faults are embedded in the code, it is easy to hide bugs and bring unpredictable destructive effects to the original software code.

[0043] Another way is to inject script faults into the reserved parameter interface in the software after the software is compiled and run. However, the failure coverage of this method is very limited, and only the fault of exceeding the limit of interface parameters can be injected; and the interface directly calls the parameters exceeding the limit, which is easy to cause unknown interference to other functions of the software.

[0044] In order to at least partially solve the above-mentioned problems, in the present embodiment, a technical solution for the failure of an external monitoring device (e.g., a watchdog manager) is designed based on software function failures, so as to avoid implanting fault codes in the software function codes and affecting / interfering with the operation of the software functions, and to cover most of the application layer software failures and to perform efficient fault simulation of software functions.

[0045] In this embodiment, the software fault injection point is as follows: Figure 2 As shown, instead of directly implanting fault code at fault injection point A to damage / interfere with the software, a fault injection scheme is designed at fault injection point B. This can keep the software function running normally, and only adjust the criteria for determining functional abnormalities to indirectly create software faults, which well simulates the fault detection time interval FDTI time when the software fault is actually detected.

[0046] When software faults are injected, external hard-wired buttons can be designed at the system level for manual control, such as Figure 3 Assuming that the hard-wired signal is valid at high level, then:

[0047] While(PinA=low->high)

[0048] {

[0049] Activate software fault injection

[0050] }

[0051] When the "software fault injection" action is manually activated, the system can obtain change indication information, where the change indication information is used to indicate the specified judgment conditions of the change target monitoring program, and the specified judgment conditions are the conditions that are satisfied for determining that a specified software fault occurs in the specified software of the target system. The target monitoring program is used to monitor the specified software based on the specified judgment conditions, and trigger the target system to start the specified safety mechanism when the specified software is monitored to have a specified software fault.

[0052] Taking the intelligent cockpit controller in the automotive E / E system as an example, when a safety-related software function failure occurs, the response of the watchdog manager to the software failure can be divided into three categories when mapped to the system layer:

[0053] 1. The watchdog manager sends information about the detected fault. The system layer can see the sound and light prompt of the fault icon on the instrument within the FTTI time limit, or detect the CAN information of the abnormal system working state on the CAN bus, or receive the fault code;

[0054] 2. The watchdog manager starts the reset of the microcontroller after the watchdog times out. The system layer can see that the instrument freezes and then returns to normal, or the instrument restarts with a black screen within the FTTI time limit;

[0055] 3. The watchdog manager starts to reset the microcontroller immediately. The system layer can see that the instrument restarts with a black screen within the FTTI time limit;

[0056] During the test, observe three types of performance at the system level, that is, verify that the safety mechanism at the system level is correctly implemented. It is also difficult to determine the performance of FTTI: FTTI = FDTI + FHTI, FDTI is the fault detection time, and FHTI is the fault handling time. If you do not inject software faults, but directly simulate the microcontroller to reach a failure state, the FTTI obtained from the test will be inaccurate, and the actual detection time FDTI of the software fault will be lost, as well as part of the FDTI time to stimulate the microcontroller to reach a failure state after the software fault occurs.

[0057] Step S104, in response to the acquired change indication information, changing the designated determination condition of the target monitoring program, wherein the changed designated determination condition is used to determine that the normally running designated software has a designated software failure, so as to simulate the designated software failure.

[0058] In order to simulate software failures and test the effectiveness of the system safety mechanism when the software functions normally, after obtaining change indication information for indicating a change in the specified judgment condition of the target monitoring program, the specified judgment condition of the target monitoring program can be changed in response to the obtained change indication information, wherein the changed specified judgment condition is used to judge the normally running specified software as having a specified software failure to simulate the specified software failure, and here, the target monitoring program includes a watchdog manager.

[0059] Here, the watchdog manager refers to a hardware or software tool used to monitor and manage the operating status of the system. The watchdog manager can monitor the operating status of the system, and if an abnormality or failure is detected, it can take corresponding measures; if the system fails or is unresponsive for a long time, the watchdog manager can trigger a system reset to restore normal operating status; the watchdog manager can monitor the execution of software programs to ensure that the programs run as expected and prevent problems such as dead loops or memory leaks; the watchdog manager can also monitor the status of hardware devices, such as power, temperature, voltage, etc., to ensure the normal operation of the hardware devices.

[0060] Step S106 , when it is determined that a designated software failure occurs in the designated software based on the changed designated determination condition, the effectiveness of the designated safety mechanism is verified based on whether the target system successfully starts the designated safety mechanism.

[0061] The changed specified judgment condition is at least partially different from the indication information of the operating status of the normally running software function. The specified software is determined to have a specified software failure based on the changed specified judgment condition. This can verify the effectiveness of the system safety mechanism when the specified software is running normally, and can avoid implanting fault codes in the software function code to affect / interfere with the software function operation.

[0062] When it is determined that a designated software failure occurs in the designated software based on the changed designated determination condition, the effectiveness of the designated safety mechanism is verified based on whether the target system successfully starts the designated safety mechanism, where the designated safety mechanism corresponds to the designated software failure.

[0063] Here, the safety mechanism corresponding to the software failure is a measure taken to mitigate or prevent the safety issues caused by the software failure. The safety mechanism includes but is not limited to at least one of the following:

[0064] 1. Error handling: Design an error handling mechanism to ensure that when an error occurs, the system can provide degraded services or provide alternative solutions instead of crashing directly.

[0065] 2. Anomaly detection: By monitoring system behavior, abnormal activities or states can be detected so that timely measures can be taken when software failures occur.

[0066] 3. Redundant design: By designing a redundant system, it is ensured that when one component fails, other components can take over its functions, thereby maintaining the overall availability of the system.

[0067] 4. Regular updates and maintenance: Regularly update the software to fix known vulnerabilities and defects and reduce security risks caused by software problems.

[0068] 5. Code review and testing: Through code review and automated testing, potential software defects and security vulnerabilities can be discovered as early as possible.

[0069] 6. Secure Coding Practices: Follow secure coding best practices such as input validation, error handling, secure configuration, etc. to reduce the possibility of software failures.

[0070] 7. Isolation and limitation: By isolating critical systems and services, the scope of fault propagation is limited and the overall risk caused by a single fault is reduced.

[0071] 8. Backup and recovery plan: Establish a data backup and recovery mechanism to enable rapid recovery when data is lost due to software failure.

[0072] 9. Fault recovery strategy: Develop a fault recovery strategy to ensure that normal operations can be restored quickly after a software failure occurs.

[0073] The purpose of the security mechanism is to improve the reliability and stability of the software, reduce the impact of software failures on system security, and ensure that services can be quickly restored when a failure occurs.

[0074] Through the above steps S102 to S106, change indication information is obtained, wherein the change indication information is used to indicate the change of the specified judgment condition of the target monitoring program, the specified judgment condition is the condition satisfied for determining that the specified software of the target system has a specified software fault, the target monitoring program is used to monitor the specified software based on the specified judgment condition, and trigger the target system to start the specified safety mechanism when the specified software is monitored to have a specified software fault; in response to the obtained change indication information, the specified judgment condition of the target monitoring program is changed, wherein the changed specified judgment condition is used to determine that the normally running specified software has a specified software fault, so as to simulate the specified software fault; when it is determined that the specified software has a specified software fault based on the changed specified judgment condition, the effectiveness of the specified safety mechanism is verified based on whether the target system successfully starts the specified safety mechanism, thereby solving the problem that the system safety testing method in the related art has a large interference and strong destructiveness to the software function.

[0075] In an exemplary embodiment, the specified software fault includes an execution abnormality fault, which refers to a fault in which the specified software is in an abnormal execution state; the specified judgment condition includes failure to monitor a target number of heartbeat messages within a specified time period, and the heartbeat message is sent by the specified software to the target monitoring program;

[0076] In response to the acquired change indication information, the specified determination condition of the target monitoring program is changed, including:

[0077] S11, in response to the acquired change indication information, changing the specified time period in the specified determination condition from the first time period to the second time period, to obtain the changed specified determination condition, wherein the second time period is shorter than the first time period.

[0078] When the specified software operates normally, the target monitoring program can monitor the target number of heartbeat messages within the specified time period. When the obtained change indication message is used to indicate that the simulated specified software failure is an execution exception failure, in response to the obtained change indication information, the specified time period in the specified judgment condition is changed from the first time period to the second time period to obtain the changed specified judgment condition, wherein the second time period is smaller than the first time period.

[0079] Here, the execution abnormality failure refers to a failure in which the specified software is in an abnormal execution state; the specified judgment condition includes failure to monitor a target number of heartbeat messages within a specified time period, and the heartbeat message is sent by the specified software to the target monitoring program.

[0080] For example, in this embodiment, the watchdog manager is used to monitor the heartbeat information of the security-related software functions and inject software execution abnormality faults, that is, simulate software execution abnormality faults:

[0081] Establish a watchdog manager to monitor the software heartbeat information, such as Figure 4 .

[0082] The original criterion for judging whether the software heartbeat message is normal is that the watchdog manager receives 1-2 heartbeat message information within the 40ms supervision reference period.

[0083] After the software fault injection is activated by manual manipulation, the original judgment statement is changed: if the software receives 1-2 heartbeat messages within Xms time, it is running normally; otherwise, it is judged to be running abnormally. The supervision reference period of the watchdog manager is shortened to a value less than the period of the heartbeat message. For example, the value X can be 1ms-5ms; then 1-2 message information will definitely not be received within such a reference period, that is, the heartbeat message can maintain normal operation, but the judgment criteria will enter the judgment that the heartbeat message of the software fault has not been received. At this time, the watchdog manager will stop feeding the dog, and when the watchdog cycle reaches the end, the fault will be revealed (detected), and the software fault will be successfully injected. Specific examples are as follows Figure 5 .

[0084] At this time, the time from fault injection time 1 to fault detection time 2 is FDTI, that is, the detection time of the fault; the fault handling time is from fault detection time 2 to the achievement of the safe state at the system level, and the FHTI time is completely retained. In summary, it is possible to effectively simulate the occurrence of software faults, retain part of the FDTI (the time when the software fault takes effect is missing, but it can be effectively estimated) and all of the FHTI, so as to verify the achievement of FTTI more realistically.

[0085] Through this embodiment, by changing the original judgment statement of software execution exception, a software fault of software execution exception is indirectly created, which can achieve functional safety testing of execution exception faults while avoiding interference with software function codes.

[0086] In an exemplary embodiment, the designated safety mechanism includes a first safety mechanism corresponding to an execution abnormality failure;

[0087] When it is determined that the specified software has a specified software failure based on the changed specified determination condition, the effectiveness of the specified safety mechanism is verified based on whether the target system successfully starts the specified safety mechanism, including:

[0088] S21, in a case where it is determined based on the changed designated determination condition that the designated software has an abnormal execution failure, when the target system successfully starts the first safety mechanism, determining that the first safety mechanism is effective;

[0089] S22: When the target system fails to successfully start the first safety mechanism, determine that the first safety mechanism is invalid.

[0090] In the case of successful injection of execution software fault, that is, in the case of determining that the specified software has a specified software fault based on the changed specified determination condition, the effectiveness of the specified security mechanism can be verified based on whether the target system successfully starts the specified security mechanism. Here, the specified software is software related to the application layer security of the target system.

[0091] In the case where it is determined based on the changed specified judgment condition that the specified software has an execution abnormality failure, when the target system successfully starts the first safety mechanism, the first safety mechanism is determined to be effective; when the target system fails to successfully start the first safety mechanism, the first safety mechanism is determined to be invalid. Optionally, considering that it generally takes a certain amount of time from injecting the execution abnormality failure to detecting the execution abnormality failure, and it takes a certain amount of time from detecting the execution abnormality failure to responding to the execution abnormality failure and starting the first safety mechanism corresponding to the execution abnormality failure, in order to improve the accuracy of system security detection, in the case where it is determined based on the changed specified judgment condition that the specified software has an execution abnormality failure, when the target system successfully starts the first safety mechanism within the first target time period, the first safety mechanism is determined to be effective; when the target system fails to successfully start the first safety mechanism within the first target time period, the first safety mechanism is determined to be invalid.

[0092] Through this embodiment, whether the system security mechanism is effective is verified based on whether the corresponding security mechanism is successfully started after the system is injected with a specified software fault, thereby improving the functional safety of the system.

[0093] In an exemplary embodiment, the specified software fault includes a program flow disorder fault, which refers to a fault in which the running order of a group of programs of the specified software is disordered; the specified judgment condition includes that a group of programs does not run according to the specified running order;

[0094] In response to the acquired change indication information, the specified determination condition of the target monitoring program is changed, including:

[0095] S31, in response to the acquired change indication information, adjusting the specified running order of a group of programs in the specified determination condition from a first running order to a second running order, wherein the first running order is at least partially different from the second running order.

[0096] When the program of the specified software runs normally, the target monitoring program can set multiple checkpoints in the security-related software and define program running flows corresponding to the multiple checkpoints. When the obtained change indication message is used to indicate that the simulated specified software failure is a program flow disorder failure, in response to the obtained change indication information, the specified running order of a group of programs in the specified judgment condition is adjusted from the first running order to the second running order, wherein the first running order is at least partially different from the second running order.

[0097] Here, the program flow disorder fault refers to a fault in which the running order of a group of programs of the specified software is disordered; the specified judgment condition includes that a group of programs does not run according to the specified running order.

[0098] For example, in this embodiment, the watchdog manager is used to monitor the program flow of safety-related software functions (for example, intelligent driving steering request EPS response control) and inject program flow / timing disorder faults:

[0099] Set up multiple checkpoints in safety-related software and define Figure 6 The program running flow: after the checkpoint EPS_read_SteeringAngle, it reaches the checkpoint SteeringAngle_needs_correction. However, if it reaches the checkpoint SteeringAngle_adjust_successfully after EPS_read_SteeringAngle, the watchdog manager will determine that the program flow is abnormal, so that the system starts the safety mechanism and enters the safe state.

[0100] Then, after the software fault injection is activated by human manipulation, the program flow monitoring based on the watchdog manager is designed to inject software faults, and the original program flow rules can be Figure 6 Switch to adjust Figure 7 . In this way, even if the program flow is in a normal state, Figure 6 (i.e., after checking EPS_read_SteeringAngle, the checkpoint SteeringAngle_needs_correction is reached), the program flow is judged to be inconsistent. Figure 7 The criterion (i.e., reaching the checkpoint SteeringAngle_adjust_successfully after EPS_read_SteeringAngle) causes the watchdog manager to report a program flow / timing fault and successfully inject a software fault.

[0101] Through this embodiment, by changing the original judgment statement of software program flow disorder, a software fault of software program flow disorder is indirectly created, which can achieve functional safety testing of program flow disorder faults while avoiding interference with software functional codes.

[0102] In one exemplary embodiment, the designated safety mechanism includes a second safety mechanism corresponding to a program flow disorder fault;

[0103] When it is determined that the specified software has a specified software failure based on the changed specified determination condition, the effectiveness of the specified safety mechanism is verified based on whether the target system successfully starts the specified safety mechanism, including:

[0104] S41, in the case where it is determined based on the changed designated determination condition that a program flow disorder fault occurs in the designated software, when the target system successfully starts the second safety mechanism, determining that the second safety mechanism is effective;

[0105] S42: When the target system fails to successfully start the second safety mechanism, determine that the second safety mechanism is invalid.

[0106] Similar to the aforementioned embodiment, in the case of a successful injection of an execution software fault, that is, in the case of determining that a specified software fault occurs in the specified software based on the changed specified determination condition, the effectiveness of the specified security mechanism can be verified based on whether the target system successfully starts the specified security mechanism.

[0107] When it is determined based on the changed designated determination condition that the designated software has a program flow disorder failure, when the target system successfully starts the second safety mechanism, the second safety mechanism is determined to be effective; when the target system fails to successfully start the second safety mechanism, the second safety mechanism is determined to be invalid.

[0108] Optionally, considering that it generally takes a certain amount of time from injecting a program flow disorder fault to detecting the program flow disorder fault, and it also takes a certain amount of time from detecting the program flow disorder fault to responding to the program flow disorder fault and starting the second safety mechanism corresponding to the program flow disorder fault, in order to improve the accuracy of system safety detection, when it is determined based on the changed specified judgment conditions that a program flow disorder fault has occurred in the specified software, when the target system successfully starts the second safety mechanism within the second target time period, the second safety mechanism is determined to be effective; when the target system fails to successfully start the second safety mechanism within the second target time period, the second safety mechanism is determined to be invalid.

[0109] Through this embodiment, whether the system security mechanism is effective is verified based on whether the corresponding security mechanism is successfully started after the system is injected with a specified software fault, thereby improving the functional safety of the system.

[0110] In an exemplary embodiment, in response to the acquired change indication information, changing the specified determination condition of the target monitoring program includes:

[0111] S51, in response to the acquired change indication information, changing the designated determination condition of the target monitoring program at a target time, wherein the target time is the time when the target monitoring program receives a heartbeat message of the designated software.

[0112] In order to improve the accuracy of the effectiveness verification of the system security mechanism, the specified judgment conditions of the target monitoring program can be changed at the target time. Here, the target time is the time when the target monitoring program receives a heartbeat message from the specified software, that is, the specified software fault is injected at the target time.

[0113] For example, combined with Figure 5 , the fault injection time 1 can be consistent with the time when the watchdog receives a heartbeat message from the specified software.

[0114] Through this embodiment, by injecting a specified software fault at a specified time, the detection time after the software fault occurs can be retained, and the achievement of FTTI performance can be well verified at the functional safety system integration test level.

[0115] In an exemplary embodiment, when no software failure occurs in the target system, the target monitoring program is periodically reset according to a third time period;

[0116] After changing the specified determination condition of the target monitoring program in response to the acquired change indication information, the method further includes:

[0117] S61, stop periodically resetting the target monitoring program according to the third time period, so as to detect a specified software fault at the start time of the third time period next to the target time.

[0118] In this embodiment, the target monitoring program is used to detect and recover errors in system operation, and its main function is to trigger a reset when a problem occurs in the system to prevent the system from completely crashing.

[0119] In the case where there is no software failure in the target system, the target monitoring program is periodically reset according to the third time period to ensure stable operation of the system and avoid unnecessary resets. For example, in this embodiment, taking the target monitoring program as a watchdog as an example, the target monitoring program is periodically reset according to the third time period to reset the timer of the watchdog, that is, to reset the watchdog feeding cycle.

[0120] Combination Figure 5In response to the acquired change indication information, after changing the specified judgment condition of the target monitoring program, stop periodically resetting the target monitoring program according to the third time period, so as to detect the specified software fault at the beginning of the next third time period of the target time (i.e., fault detection time 2).

[0121] Through this embodiment, the detection time after the software fault occurs can be determined, and the achievement of FTTI performance can be well verified at the functional safety system integration test level.

[0122] As an optional exemplary embodiment of the present application, the system safety testing method of the embodiment of the present application is explained by taking the functional safety real vehicle test or system-level integration test of the automotive E / E system as an example.

[0123] This solution is based on the system-level integration test of the functional safety of automotive E / E products, and proposes a system-level software fault injection strategy. It avoids directly implanting fault codes in software function codes; it will not interfere with the function operation of the software application layer; it can effectively cover various types of software faults; and it can manually and accurately control the timing of fault injection.

[0124] Based on software functional failures, a technical solution is designed to prevent the failure of external monitoring equipment (watchdog manager) from being affected / interfered with software function operation by implanting fault codes in software function codes. This solution can cover most of the application layer software failures and perform efficient fault simulation of software functions. The fault simulation injection in this solution can retain the software fault detection time FDTI and the total software fault processing time FHTI.

[0125] Through this embodiment, compared with directly setting the microprocessor fault or watchdog failure, the original FDTI time is well preserved, and the normal operation of the software function is maintained. Only the criteria for determining functional abnormality are adjusted to indirectly create software faults, which well simulates the FDTI time when the software fault is actually detected.

[0126] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0127] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware server, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM (Read-Only Memory) / RAM (Random Access Memory), a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a car, a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0128] According to another aspect of an embodiment of the present application, a system safety testing device for implementing the above-mentioned system safety testing method is also provided. Figure 8 is a structural block diagram of an optional system safety testing device according to an embodiment of the present application, such as Figure 8 As shown, the device may include:

[0129] The acquisition unit 802 is used to acquire change indication information, wherein the change indication information is used to indicate the change of the specified determination condition of the target monitoring program, the specified determination condition is a condition satisfied for determining that the specified software of the target system has a specified software fault, and the target monitoring program is used to monitor the specified software based on the specified determination condition, and trigger the target system to start the specified safety mechanism when the specified software is monitored to have a specified software fault;

[0130] The changing unit 804 is used to change the specified judgment condition of the target monitoring program in response to the acquired change indication information, wherein the changed specified judgment condition is used to judge the normally running specified software as having a specified software fault, so as to simulate the specified software fault;

[0131] The verification unit 806 is used to verify the effectiveness of the specified security mechanism based on whether the target system successfully starts the specified security mechanism when it is determined that the specified software has a specified software failure based on the changed specified determination condition.

[0132] Through the embodiments of the present application, change indication information is obtained, wherein the change indication information is used to indicate the change of the specified judgment condition of the target monitoring program, the specified judgment condition is the condition satisfied for determining that the specified software of the target system has a specified software fault, the target monitoring program is used to monitor the specified software based on the specified judgment condition, and trigger the target system to start the specified safety mechanism when the specified software is monitored to have a specified software fault; in response to the obtained change indication information, the specified judgment condition of the target monitoring program is changed, wherein the changed specified judgment condition is used to determine that the normally running specified software has a specified software fault, so as to simulate the specified software fault; when it is determined that the specified software has a specified software fault based on the changed specified judgment condition, the effectiveness of the specified safety mechanism is verified based on whether the target system successfully starts the specified safety mechanism, thereby solving the problem that the system safety testing method in the related art has a large interference and strong destructiveness to the software function, and avoiding the implantation of fault code in the software function code to interfere with the operation of the software function.

[0133] In an exemplary embodiment, the specified software fault includes an execution abnormality fault, which refers to a fault in which the specified software is in an abnormal execution state; the specified judgment condition includes failure to monitor a target number of heartbeat messages within a specified time period, and the heartbeat message is sent by the specified software to the target monitoring program;

[0134] The change units include:

[0135] The first changing module is used to change the specified time period in the specified determination condition from the first time period to the second time period in response to the acquired change indication information, so as to obtain the changed specified determination condition, wherein the second time period is shorter than the first time period.

[0136] In an exemplary embodiment, the designated safety mechanism includes a first safety mechanism corresponding to an execution abnormality failure;

[0137] The verification unit includes:

[0138] A first determination module is used to determine that the first safety mechanism is effective when the target system successfully starts the first safety mechanism in the case that the specified software is determined to have an abnormal execution failure based on the changed specified determination condition;

[0139] The second determination module is used to determine that the first security mechanism is invalid when the target system fails to successfully start the first security mechanism.

[0140] In an exemplary embodiment, the specified software fault includes a program flow disorder fault, which refers to a fault in which the running order of a group of programs of the specified software is disordered; the specified judgment condition includes that a group of programs does not run according to the specified running order;

[0141] The change units include:

[0142] The second changing module is used to change the specified running order of a group of programs in the specified judgment condition from a first running order to a second running order in response to the acquired change indication information, wherein the first running order is at least partially different from the second running order.

[0143] In one exemplary embodiment, the designated safety mechanism includes a second safety mechanism corresponding to a program flow disorder fault;

[0144] The verification unit includes:

[0145] A third determination module is used to determine that the second safety mechanism is effective when the target system successfully starts the second safety mechanism in the case that the specified software is determined to have a program flow disorder failure based on the changed specified determination condition;

[0146] The fourth determination module is used to determine that the second security mechanism is invalid when the target system fails to successfully start the second security mechanism.

[0147] In an exemplary embodiment, the changing unit includes:

[0148] The third changing module is used to change the designated judgment condition of the target monitoring program at a target time in response to the acquired change indication information, wherein the target time is the time when the target monitoring program receives a heartbeat message of the designated software.

[0149] In an exemplary embodiment, when no software failure occurs in the target system, the target monitoring program is periodically reset according to a third time period;

[0150] The above device also includes:

[0151] A stop unit is used to stop periodically resetting the target monitoring program according to the third time period after changing the specified judgment condition of the target monitoring program in response to the acquired change indication information, so as to detect the specified software fault at the beginning of the third time period next to the target time. It should be noted here that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be operated in Figure 1 In the hardware environment shown, it can be implemented by software or by hardware, wherein the hardware environment includes a network environment.

[0152] According to another aspect of the embodiments of the present application, a storage medium is further provided. Optionally, in this embodiment, the storage medium can be used to execute the program code of any of the system safety testing methods in the embodiments of the present application.

[0153] Optionally, in this embodiment, the storage medium may be located on at least one network device among a plurality of network devices in the network shown in the above embodiment.

[0154] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps:

[0155] S1, obtaining change indication information, wherein the change indication information is used to indicate a specified determination condition of a change target monitoring program, the specified determination condition being a condition satisfied for determining that a specified software failure occurs in specified software of a target system, the target monitoring program being used to monitor the specified software based on the specified determination condition, and triggering the target system to start a specified safety mechanism when the specified software failure is detected;

[0156] S2, in response to the acquired change indication information, changing the designated judgment condition of the target monitoring program, wherein the changed designated judgment condition is used to judge the normally running designated software as having a designated software fault, so as to simulate the designated software fault;

[0157] S3, when it is determined based on the changed designated determination condition that the designated software has a designated software failure, verify the effectiveness of the designated safety mechanism based on whether the target system successfully starts the designated safety mechanism.

[0158] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, which will not be described in detail in this embodiment.

[0159] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.

[0160] According to another aspect of an embodiment of the present application, an electronic device for implementing the above-mentioned system security testing method is also provided. The electronic device may be a smart device, a server, a terminal, or a combination thereof.

[0161] Fig. 9 is a structural block diagram of an optional electronic device according to an embodiment of the present application, such as Fig. 9 As shown, it includes a processor 902, a communication interface 904, a memory 906 and a communication bus 908, wherein the processor 902, the communication interface 904 and the memory 906 communicate with each other through the communication bus 908, wherein,

[0162] Memory 906, used to store computer programs;

[0163] The processor 902 is used to implement the following steps when executing the computer program stored in the memory 906:

[0164] S1, obtaining change indication information, wherein the change indication information is used to indicate a specified determination condition of a change target monitoring program, the specified determination condition being a condition satisfied for determining that a specified software failure occurs in specified software of a target system, the target monitoring program being used to monitor the specified software based on the specified determination condition, and triggering the target system to start a specified safety mechanism when the specified software failure is detected;

[0165] S2, in response to the acquired change indication information, changing the designated judgment condition of the target monitoring program, wherein the changed designated judgment condition is used to judge the normally running designated software as having a designated software fault, so as to simulate the designated software fault;

[0166] S3, when it is determined based on the changed designated determination condition that the designated software has a designated software failure, verify the effectiveness of the designated safety mechanism based on whether the target system successfully starts the designated safety mechanism.

[0167] Optionally, the communication bus may be a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 The communication interface is used for communication between the above electronic device and other devices.

[0168] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0169] As an example, the memory 906 may include but is not limited to the acquisition unit 802, the change unit 804 and the verification unit 806 in the system safety test device. In addition, it may also include but is not limited to other module units in the system safety test device, which will not be repeated in this example.

[0170] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0171] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0172] It can be understood by those skilled in the art that Fig. 9 The structure shown is for illustration only. The device for implementing the above-mentioned system security testing method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Fig. 9 The structure of the electronic device is not limited. Fig. 9 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig. 9 Different configurations shown.

[0173] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0174] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0175] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in any one of the above method embodiments.

[0176] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0177] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0178] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the above methods in each embodiment of the present application.

[0179] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0180] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0181] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.

[0182] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist physically separately, or at least two units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0183] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A system safety testing method, characterized in that: include: Acquire change indication information, wherein the change indication information is used to indicate a specified determination condition of a change target monitoring program, wherein the specified determination condition is a condition satisfied for determining that a specified software failure occurs in specified software of a target system, and the target monitoring program is used to monitor the specified software based on the specified determination condition, and trigger the target system to start a specified safety mechanism when the specified software failure is detected in the specified software; In response to the acquired change indication information, the specified determination condition of the target monitoring program is changed, wherein the changed specified determination condition is used to determine that the specified software that is running normally has the specified software failure, so as to simulate the specified software failure; When it is determined that the designated software has the designated software failure based on the changed designated determination condition, the effectiveness of the designated safety mechanism is verified based on whether the target system successfully starts the designated safety mechanism.

2. The method according to claim 1, characterized in that The specified software fault includes an execution abnormality fault, which refers to a fault in which the specified software is in an abnormal execution state; the specified judgment condition includes failure to monitor a target number of heartbeat messages within a specified time period, and the heartbeat message is sent by the specified software to the target monitoring program; The step of changing the specified determination condition of the target monitoring program in response to the acquired change indication information includes: In response to the acquired change indication information, the specified time period in the specified determination condition is changed from a first time period to a second time period to obtain the changed specified determination condition, wherein the second time period is shorter than the first time period.

3. The method according to claim 2, characterized in that The designated safety mechanism includes a first safety mechanism corresponding to the execution abnormality failure; The step of verifying the effectiveness of the designated safety mechanism based on whether the target system successfully starts the designated safety mechanism when it is determined that the designated software has the designated software failure based on the changed designated determination condition includes: In the case where it is determined that the specified software has the execution exception failure based on the changed specified determination condition, when the target system successfully starts the first security mechanism, it is determined that the first security mechanism is valid; when the target system fails to successfully start the first security mechanism, it is determined that the first security mechanism is invalid.

4. The method according to claim 1, characterized in that: The specified software fault includes a program flow disorder fault, and the program flow disorder fault refers to a fault in which the running order of a group of programs of the specified software is disordered; the specified judgment condition includes that the group of programs does not run according to the specified running order; The step of changing the specified determination condition of the target monitoring program in response to the acquired change indication information includes: In response to the acquired change indication information, the specified running order of the group of programs in the specified determination condition is changed from a first running order to a second running order, wherein the first running order is at least partially different from the second running order.

5. The method according to claim 4, characterized in that The designated safety mechanism includes a second safety mechanism corresponding to the program flow disorder fault; The step of verifying the effectiveness of the designated safety mechanism based on whether the target system successfully starts the designated safety mechanism when it is determined that the designated software has the designated software failure based on the changed designated determination condition includes: In the case where it is determined that the specified software has the program flow disorder failure based on the changed specified judgment condition, when the target system successfully starts the second safety mechanism, it is determined that the second safety mechanism is valid; when the target system fails to successfully start the second safety mechanism, it is determined that the second safety mechanism is invalid.

6. The method according to any one of claims 1 to 5, characterized in that The step of changing the specified determination condition of the target monitoring program in response to the acquired change indication information includes: In response to the acquired change indication information, the designated determination condition of the target monitoring program is changed at a target time, wherein the target time is a time when the target monitoring program receives a heartbeat message of the designated software.

7. The method according to claim 6, characterized in that In the case that no software failure occurs in the target system, the target monitoring program is periodically reset according to a third time period; After changing the specified determination condition of the target monitoring program in response to the acquired change indication information, the method further includes: The periodic resetting of the target monitoring program according to the third time period is stopped, so as to detect the designated software fault at a start time of the third time period next to the target time.

8. A system safety testing device, characterized in that: include: an acquisition unit, configured to acquire change indication information, wherein the change indication information is used to indicate a specified determination condition of a change target monitoring program, wherein the specified determination condition is a condition satisfied for determining that a specified software failure occurs in specified software of a target system, and the target monitoring program is configured to monitor the specified software based on the specified determination condition, and trigger the target system to start a specified safety mechanism when the specified software failure is detected in the specified software; a changing unit, configured to change the specified determination condition of the target monitoring program in response to the acquired change indication information, wherein the changed specified determination condition is used to determine that the specified software that is running normally has the specified software failure, so as to simulate the specified software failure; The verification unit is used to verify the validity of the specified security mechanism based on whether the target system successfully starts the specified security mechanism when it is determined that the specified software has the specified software failure based on the changed specified determination condition.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of any one of the methods of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.