Container testing method and apparatus, fault injection method and apparatus

By simulating CPU failures by adjusting the CPU clock frequency in kernel mode, the container testing process is simplified, testing efficiency and versatility are improved, and the problems of complexity and low testing efficiency in simulating CPU failures in existing technologies are solved.

CN115756987BActive Publication Date: 2026-11-10INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211465885.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-22
Publication Date
2026-11-10
Estimated Expiration
2042-11-22

AI Technical Summary

Technical Problem

Existing technologies for simulating CPU fault types are complex, resulting in cumbersome container testing processes, low testing efficiency, and difficulty in applying them across various physical machines.

Method used

By obtaining the fault type and corresponding frequency of the target CPU, the frequency update function in kernel mode is called to inject the fault. After the fault injection is successful, the container operation is monitored, and the CPU clock frequency is adjusted using the target function registered in kernel mode to simulate various CPU faults.

Benefits of technology

It simplifies the container testing process, improves testing efficiency, and makes the testing methods applicable to a variety of physical machines, thus improving versatility and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115756987B_ABST
    Figure CN115756987B_ABST
Patent Text Reader

Abstract

This application relates to a container testing method and apparatus, and a fault injection method and apparatus, belonging to the field of cloud computing technology. The method includes: obtaining the target fault type corresponding to a target processor (CPU); determining the target frequency corresponding to the target CPU based on the target fault type; calling a target function registered in the kernel state; sending a first frequency update signal for the target CPU to a frequency update function in the kernel state, the first frequency update signal including the target frequency, so that the frequency update function updates the clock frequency of the target CPU from the initial frequency to the target frequency, thereby completing fault injection for the target CPU; after successful fault injection into the target CPU, starting the container under test; monitoring the operation of the container under test when the target CPU fails; and obtaining the test results corresponding to the container under test. This method simplifies the testing steps and improves the versatility of the testing method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and in particular to a container testing method and apparatus, and a fault injection method and apparatus. Background Technology

[0002] In the current technology field, most production environment containers run on virtual machines, with only a small portion running on physical machines. Among them, the CPU (central processing unit) of the physical machine (host machine) where the container runs may experience various failures. For example, when the CPU response is slow, it may cause the performance of the container running on the host machine to degrade or become unavailable, thereby affecting business transactions.

[0003] To test the performance of containers under different CPU failures, a container testing method that can simulate various types of CPU failures is needed. However, in traditional testing methods, different simulation methods are required to simulate different types of CPU failures, which leads to a complex testing process and reduced testing efficiency. Summary of the Invention

[0004] Based on this, it is necessary to provide a container testing method and apparatus capable of simulating CPU faults, a fault injection method and apparatus, a computer device, a computer-readable storage medium, and a computer program product to address the aforementioned technical problems.

[0005] Firstly, this application provides a container testing method. The method includes:

[0006] Obtain test information of the target processor CPU, the test information including the target fault type corresponding to the target CPU;

[0007] Determine the target frequency corresponding to the target CPU based on the target fault type;

[0008] The target function registered in the kernel mode is invoked, and a first frequency update signal for the target CPU is sent to the frequency update function in the kernel mode. The first frequency update signal includes the target frequency, so that the frequency update function updates the clock frequency of the target CPU from the initial frequency to the target frequency, thereby completing the fault injection for the target CPU.

[0009] After the fault injection of the target CPU is successful, the container under test is started, and the operation of the container under test when the target CPU fails is monitored to obtain the test results corresponding to the container under test.

[0010] In one embodiment, the test information further includes the test duration, and the method further includes:

[0011] After the monitoring period for the operation of the container under test reaches the test duration, the monitoring of the operation of the container under test shall be stopped.

[0012] The target function registered in the kernel mode is invoked, and a second frequency update signal for the target CPU is sent to the frequency update function in the kernel mode. The second frequency update signal includes the initial frequency, so that the frequency update function updates the clock frequency of the target CPU from the target frequency to the initial frequency.

[0013] In one embodiment, after the frequency update function updates the clock frequency of the target CPU to the target frequency, the method further includes:

[0014] The fault injection status of the target CPU is determined based on the response time of the target CPU to the probe command and / or the fault injection error information of the target CPU.

[0015] If the fault injection state indicates that the fault injection has failed, the process of repeatedly calling the target function registered in the kernel mode and sending a frequency update signal for the target CPU to the frequency update function in the kernel mode, so that the frequency update function updates the clock frequency of the target CPU to the target frequency, continues until the fault injection state indicates that the fault injection has succeeded.

[0016] In one embodiment, determining the fault injection status for the target CPU based on the response time of the target faulty CPU to the probe instruction and / or the fault injection error information for the target CPU includes:

[0017] Upon receiving a fault injection error message for the target CPU, the fault injection status for the target CPU is determined to be a first status indicating fault injection failure.

[0018] Alternatively, if no fault injection error message is received for the target CPU, a probe command is sent to the target CPU, and the response time of the target CPU to the probe command is obtained;

[0019] Determine the expected response time range of the target CPU;

[0020] If the response time is within the expected response time range, the fault injection state is determined to be a second state characterizing successful fault injection.

[0021] If the response time is outside the expected response time range, the fault injection state is determined to be the first state characterizing fault injection failure.

[0022] In one embodiment, the test information further includes the expected operating state of the container under test, and the monitoring of the operating status of the container under test when the target CPU fails, to obtain the test results corresponding to the container under test, includes:

[0023] The operation of the container under test is monitored when the target CPU fails, so as to obtain the actual operating status of the container under test;

[0024] Based on the expected operating state and the actual operating state, the test result corresponding to the container to be tested is determined.

[0025] Secondly, this application also provides a fault simulation method. The method includes:

[0026] Obtain the target processor CPU and the target fault type corresponding to the target CPU;

[0027] Determine the target frequency corresponding to the target fault type;

[0028] The target function registered in kernel mode is invoked, and a frequency update signal for the target CPU is sent to the frequency update function in kernel mode. The frequency update signal includes the target frequency, so that the frequency update function updates the clock frequency of the target CPU to the target frequency.

[0029] Thirdly, this application also provides a container testing apparatus. The apparatus includes:

[0030] The acquisition module is used to acquire test information of the target processor CPU, the test information including the target fault type corresponding to the target CPU;

[0031] The first determining module is used to determine the target frequency corresponding to the target CPU based on the target fault type;

[0032] The first fault injection module is used to call a target function registered in the kernel mode and send a first frequency update signal for the target CPU to the frequency update function in the kernel mode. The first frequency update signal includes the target frequency, so that the frequency update function updates the clock frequency of the target CPU from the initial frequency to the target frequency, thereby completing the fault injection for the target CPU.

[0033] The monitoring module is used to start the container under test after the fault injection of the target CPU is successful, monitor the operation of the container under test when the target CPU fails, and obtain the test results corresponding to the container under test.

[0034] In one embodiment, the test information further includes the test duration, and the device further includes:

[0035] The termination module is used to stop monitoring the operation of the container under test after the monitoring time for the operation of the container under test has reached the test time.

[0036] The calling module is used to call the target function registered in the kernel mode and send a second frequency update signal for the target CPU to the frequency update function in the kernel mode. The second frequency update signal includes the initial frequency, so that the frequency update function updates the clock frequency of the target CPU from the target frequency to the initial frequency.

[0037] In one embodiment, after the frequency update function updates the clock frequency of the target CPU to the target frequency, the apparatus further includes:

[0038] The second determining module is used to determine the fault injection status of the target CPU based on the response time of the target CPU to the probe command and / or the fault injection error information of the target CPU.

[0039] The second fault injection module is used to repeatedly call the target function registered in the kernel mode when the fault injection state indicates that the fault injection has failed, and send a frequency update signal for the target CPU to the frequency update function in the kernel mode so that the frequency update function updates the clock frequency of the target CPU to the target frequency, until the fault injection state indicates that the fault injection has been successful.

[0040] In one embodiment, the second determining module is further configured to:

[0041] Upon receiving a fault injection error message for the target CPU, the fault injection status for the target CPU is determined to be a first status indicating fault injection failure.

[0042] Alternatively, if no fault injection error message is received for the target CPU, a probe command is sent to the target CPU, and the response time of the target CPU to the probe command is obtained;

[0043] Determine the expected response time range of the target CPU;

[0044] If the response time is within the expected response time range, the fault injection state is determined to be a second state characterizing successful fault injection.

[0045] If the response time is outside the expected response time range, the fault injection state is determined to be the first state characterizing fault injection failure.

[0046] In one embodiment, the test information further includes the expected operating state of the container under test, and the monitoring module is further configured to:

[0047] The operation of the container under test is monitored when the target CPU fails, so as to obtain the actual operating status of the container under test;

[0048] Based on the expected operating state and the actual operating state, the test result corresponding to the container to be tested is determined.

[0049] Fourthly, this application also provides a fault simulation device. The device includes:

[0050] The acquisition module is used to acquire the target processor CPU and the target fault type corresponding to the target CPU;

[0051] The determination module is used to determine the target frequency corresponding to the target fault type;

[0052] The calling module is used to call the target function registered in the kernel mode and send a frequency update signal for the target CPU to the frequency update function in the kernel mode. The frequency update signal includes the target frequency, so that the frequency update function updates the clock frequency of the target CPU to the target frequency.

[0053] Fifthly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0054] Obtain test information of the target processor CPU, the test information including the target fault type corresponding to the target CPU;

[0055] Determine the target frequency corresponding to the target CPU based on the target fault type;

[0056] The target function registered in the kernel mode is invoked, and a first frequency update signal for the target CPU is sent to the frequency update function in the kernel mode. The first frequency update signal includes the target frequency, so that the frequency update function updates the clock frequency of the target CPU from the initial frequency to the target frequency, thereby completing the fault injection for the target CPU.

[0057] After the fault injection of the target CPU is successful, the container under test is started, and the operation of the container under test when the target CPU fails is monitored to obtain the test results corresponding to the container under test.

[0058] Sixthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0059] Obtain test information of the target processor CPU, the test information including the target fault type corresponding to the target CPU;

[0060] Determine the target frequency corresponding to the target CPU based on the target fault type;

[0061] The target function registered in the kernel mode is invoked, and a first frequency update signal for the target CPU is sent to the frequency update function in the kernel mode. The first frequency update signal includes the target frequency, so that the frequency update function updates the clock frequency of the target CPU from the initial frequency to the target frequency, thereby completing the fault injection for the target CPU.

[0062] After the fault injection of the target CPU is successful, the container under test is started, and the operation of the container under test when the target CPU fails is monitored to obtain the test results corresponding to the container under test.

[0063] Seventhly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0064] Obtain test information of the target processor CPU, the test information including the target fault type corresponding to the target CPU;

[0065] Determine the target frequency corresponding to the target CPU based on the target fault type;

[0066] The target function registered in the kernel mode is invoked, and a first frequency update signal for the target CPU is sent to the frequency update function in the kernel mode. The first frequency update signal includes the target frequency, so that the frequency update function updates the clock frequency of the target CPU from the initial frequency to the target frequency, thereby completing the fault injection for the target CPU.

[0067] After the fault injection of the target CPU is successful, the container under test is started, and the operation of the container under test when the target CPU fails is monitored to obtain the test results corresponding to the container under test.

[0068] The aforementioned container testing method, apparatus, computer equipment, storage medium, and computer program product acquire test information of the target processor CPU, including the target fault type corresponding to the target CPU. Based on the target fault type, the target frequency corresponding to the target CPU is determined. Then, a target function registered in the kernel mode is called to send a first frequency update signal for the target CPU to the frequency update function in the kernel mode. The first frequency update signal includes the target frequency, so that the frequency update function updates the clock frequency of the target CPU from the initial frequency to the target frequency, thereby completing the fault injection for the target CPU. After the fault injection of the target CPU is successful, the container under test is started, and the operation of the container under test when the target CPU fails is monitored to obtain the test results corresponding to the container under test. Based on the aforementioned container testing methods, devices, computer equipment, storage media, and computer program products, by registering a target function in the kernel space and then calling the target function to pass the target frequency corresponding to the target fault type to the frequency update function in the kernel space, the frequency update function updates the clock frequency of the target CPU to the target frequency, thereby completing fault injection. In other words, by adjusting the CPU clock frequency, various CPU faults can be simulated, thus simplifying the testing process, improving testing efficiency, and requiring no restrictions on other conditions during the simulation of CPU faults. This testing method can be applied to various physical machines, improving the versatility of container testing methods. Attached Figure Description

[0069] Figure 1 This is a flowchart illustrating a container testing method in one embodiment;

[0070] Figure 2 This is a flowchart illustrating the container testing method in another embodiment;

[0071] Figure 3 This is a flowchart illustrating the container testing method in another embodiment;

[0072] Figure 4 This is a flowchart illustrating the container testing method in another embodiment;

[0073] Figure 5 This is a flowchart illustrating the container testing method in another embodiment;

[0074] Figure 6 This is a flowchart illustrating a fault simulation method in one embodiment;

[0075] Figure 7 This is a structural block diagram of a container testing apparatus in one embodiment;

[0076] Figure 8 This is a structural block diagram of a fault simulation device in one embodiment;

[0077] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0078] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0079] In one embodiment, such as Figure 1 As shown, a container testing method is provided. This embodiment illustrates the method applied to a terminal, but it is understood that the method can also be applied to a server, and to a system including both a terminal and a server, and implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0080] Step 102: Obtain the test information of the target processor CPU, including the target fault type corresponding to the target CPU.

[0081] Different containers, when running on a host machine, need to use all or part of the host machine's CPU. Therefore, when the CPU on the host machine fails, it will affect the running status of the container. In this embodiment of the application, in order to detect the running status of the container on the host machine under different types of CPU failures, a container testing method is proposed.

[0082] In this embodiment of the application, the target processor CPU is the CPU to be injected with a fault, and the target fault type is the type of fault injected into the target CPU. The target fault types include CPU stopping operation, CPU lag, and CPU overclocking. During the application process, there are two test modes: specified fault and random fault. In the specified fault mode, the target CPU and the test information of the target CPU (i.e., the target fault type) can be set by the tester. At this time, the test information of the target CPU can be obtained directly. The tester can use all CPUs in the host machine as target CPUs, or some CPUs in the host machine as target CPUs.

[0083] For example, if the host machine has CPU1, CPU2, and CPU3, and container 1 uses CPU1 and CPU2 when running on the host machine, to simulate all CPUs lag, the tester can set CPU1, CPU2, and CPU3 as the target CPUs and lag as the target fault type; to simulate some CPUs overclocking, the tester can set CPU3 as the target CPU and overclocking as the target fault type, or set CPU1 and CPU2 as the target CPUs and overclocking as the target fault type.

[0084] When the tester selects the random fault mode, the target CPU and target fault type are no longer set by the tester, but are randomly generated by the test equipment. Specifically, the target CPU can be determined while the target fault type is randomly generated by the test equipment; alternatively, the target fault type can be determined while the target CPU is randomly generated by the test equipment; or both the target CPU and target fault type can be randomly generated by the test equipment.

[0085] In the above process, the target fault types corresponding to different target CPUs can be different, or the target fault types corresponding to different target CPUs can be the same.

[0086] Step 104: Determine the target frequency corresponding to the target CPU based on the target fault type.

[0087] In this embodiment of the application, the target frequency corresponding to the target CPU is determined according to the target fault type. The tester can pre-set the correspondence between the target fault type and the target frequency, and determine the target frequency corresponding to the target CPU according to the target fault type and the above correspondence.

[0088] For example, the correspondence between target fault type and target frequency can be referred to Table 1 below. Taking the target fault type 1 of target CPU1 as stuttering and the target fault type 2 of target CPU2 as overclocking as an example, the target frequency 1 corresponding to target CPU1 can be determined to be 30 (30 ticks per second) and the target frequency 2 corresponding to target CPU2 is 1000 (1000 ticks per second). Here, tick (relative time unit) is the relative time unit of the system.

[0089] Table 1

[0090] Target Fault Type CPU clock frequency (number of ticks per second) Stop running 10 Stuck and stopped 30-50 Overclocking 1000

[0091] Step 106: Call the target function registered in kernel mode and send a first frequency update signal for the target CPU to the frequency update function in kernel mode. The first frequency update signal includes the target frequency, so that the frequency update function updates the clock frequency of the target CPU from the initial frequency to the target frequency, thereby completing the fault injection for the target CPU.

[0092] In this embodiment, after determining the target frequency corresponding to the target CPU, the clock frequency of the target CPU can be updated according to the target frequency, thereby completing the fault injection targeting the target CPU. In the host machine, the frequency update function used to adjust the CPU clock frequency runs in kernel mode and cannot be directly called through user-mode frequency update operations. Therefore, a target function (which can be a piece of code) that can be called by user mode can be created and registered in kernel mode so that the target function and the frequency update function can exchange information. The specific steps of fault injection are as follows:

[0093] The target function is called and a first frequency update signal for the target CPU is sent to the frequency update function through the target function. The first frequency update signal includes the target frequency. Then the frequency update function updates the clock frequency of the target CPU from the initial frequency to the target frequency.

[0094] For example, taking the above example again, if container 1 uses CPU1 and CPU2 when running on the host machine, and a fault is injected into CPU1 and CPU2, with the target fault type of both CPU1 and CPU2 being stuttering, and the initial frequency 1 corresponding to CPU1 being 300 and the initial frequency 2 corresponding to CPU2 being 350, in Table 1 above, the CPU clock frequency corresponding to stuttering is a frequency range: 30-50. Therefore, the target frequency 1 corresponding to CPU1 and the target frequency 2 corresponding to CPU2 can be different. According to the target fault type, the target frequency 1 corresponding to CPU1 is 30 and the target frequency 2 corresponding to CPU2 is 35. The target function is called and a first frequency update signal is sent to the frequency update function through the target function. The first frequency update signal includes: the target frequency 1 corresponding to CPU1 is 30 and the target frequency 2 corresponding to CPU2 is 35. Then the frequency update function will update the clock frequency of CPU1 from 300 to 30 and the clock frequency of CPU2 from 350 to 35.

[0095] Step 108: After the fault injection of the target CPU is successful, start the container under test, monitor the operation of the container under test when the target CPU fails, and obtain the test results corresponding to the container under test.

[0096] In this embodiment of the application, the container to be tested is the container to be tested. After the fault injection of the target CPU is successful, a start signal can be sent to the container to be tested. The container to be tested responds to the start signal and starts working. Within a preset time period, the operation of the container to be tested when the target CPU fails is monitored, and the test results corresponding to the container to be tested are obtained.

[0097] For example, taking the above example again, after injecting faults into CPU1 and CPU2, container 1 is started, and the running status of container 1 is detected when both CPU1 and CPU2 are stuck, and the test results corresponding to container 1 are obtained.

[0098] In the above container testing method, the target frequency is determined according to the type of target fault to be injected. The target function is registered in the kernel space, and then the target frequency corresponding to the target fault type is passed to the frequency update function in the kernel space by calling the target function. This allows the frequency update function to update the clock frequency of the target CPU to the target frequency, thus completing the fault injection. In other words, by adjusting the CPU clock frequency, various CPU faults can be simulated, thereby simplifying the testing process, improving testing efficiency, and not requiring other restrictions during the simulation of CPU faults. This testing method can be applied to various physical machines, improving the versatility of container testing methods.

[0099] In one embodiment, such as Figure 2 As shown, the test information also includes the test duration, and the method further includes:

[0100] Step 202: After the monitoring period for the operation of the container under test has reached the test duration, stop monitoring the operation of the container under test.

[0101] In this embodiment of the application, the test duration refers to the time from the start of monitoring the container under test to the end of monitoring. During one test duration, the fault type of the CPU in the host machine remains unchanged.

[0102] When monitoring of the container under test begins, a timer starts. Once the monitoring duration reaches the test duration, the monitoring of the container under test stops, and one monitoring cycle of the container under test is completed.

[0103] Step 204: Call the target function registered in kernel mode and send a second frequency update signal for the target CPU to the frequency update function in kernel mode. The second frequency update signal includes the initial frequency so that the frequency update function updates the clock frequency of the target CPU from the target frequency to the initial frequency.

[0104] In this embodiment of the application, after each monitoring of the container under test is completed, the target CPU injected with the fault will be adjusted to the normal operating state. At this time, the target function in the kernel mode is called, and the target function sends a second frequency update signal for the target CPU to the frequency update function in the kernel mode. The second frequency update signal includes the initial frequency corresponding to the target CPU. The frequency update function updates the clock frequency of the target CPU from the target frequency to the initial frequency according to the second frequency update signal.

[0105] For example, continuing with the above example, taking a test duration of 30 minutes, after injecting faults into CPU1 and CPU2, container 1 is started, its operational status is monitored, and a timer begins. When the monitoring duration reaches 30 minutes, monitoring of container 1 is stopped. Then, the target function is called, and a second frequency update signal is sent to the frequency update function. The second frequency update signal includes the initial frequency of CPU1 being 300 MHz and the initial frequency of CPU2 being 350 MHz. The frequency update function then updates the clock frequency of CPU1 from 30 MHz to 300 MHz and the clock frequency of CPU2 from 35 MHz to 350 MHz.

[0106] In this embodiment, after the fault injection into the target CPU is successful, monitoring of the container under test begins until the testing duration is reached, at which point monitoring stops. After completing the above monitoring, the clock frequency of the target CPU is updated back to the initial frequency to promptly adjust the target CPU to a normal operating state. This avoids damage to the container caused by prolonged operation under CPU failure conditions and improves the safety of the testing process.

[0107] In one embodiment, such as Figure 3 As shown, after the frequency update function updates the clock frequency of the target CPU from the initial frequency to the target frequency, the method further includes:

[0108] Step 302: Determine the fault injection status of the target CPU based on the response time of the target CPU to the probe command and / or the fault injection error information of the target CPU.

[0109] In this embodiment of the application, the target CPU is injected with faults by adjusting the clock frequency of the target CPU. However, during the fault injection process, due to the influence of some accidental factors in the system, the clock frequency update process of the target CPU may be incorrect, or the working state of the target CPU after the clock frequency update may not achieve the expected effect corresponding to the target fault type. In this case, it is necessary to re-inject faults into the target CPU.

[0110] Specifically, when an error occurs during the clock frequency update of the target CPU, the system generates a fault injection error message for that target CPU. Alternatively, if the response time of the target CPU to the probe command after being injected with the target fault type does not match the expected response time, it indicates that the target CPU has not achieved the expected effect. Therefore, the fault injection status of the target CPU can be determined based on the fault injection error message and / or the response time of the target CPU to the probe command. The fault injection status is used to characterize whether the fault injection was successful or failed.

[0111] Step 304: If the fault injection state indicates that the fault injection has failed, repeatedly call the target function registered in the kernel mode to send a frequency update signal for the target CPU to the frequency update function in the kernel mode, so that the frequency update function updates the clock frequency of the target CPU to the target frequency, until the fault injection state indicates that the fault injection has succeeded.

[0112] In this embodiment of the application, when the fault injection status indicates that the fault injection has failed, the fault injection is re-performed on the target CPU. That is, the target function registered in the kernel mode is called again to send a frequency update signal for the target CPU to the frequency update function in the kernel mode, so that the frequency update function updates the clock frequency of the target CPU to the target frequency. Then, the fault injection status for the target CPU is determined according to the above steps. If the fault injection status indicates that the fault injection has failed, the above operation is repeated until the fault injection status indicates that the fault injection has succeeded.

[0113] In this embodiment, after fault injection is completed, the success of fault injection for the target CPU is determined based on the response time of the target CPU to the probe command and / or the fault injection error information for the target CPU. If it is unsuccessful, the previous fault injection steps are repeated until the fault injection for the target CPU is successful. Through the above process, the success of fault injection for the target CPU can be guaranteed, avoiding monitoring the container under test when fault injection fails and obtaining incorrect test results, thus improving the accuracy of container testing.

[0114] In one embodiment, such as Figure 4 As shown, step 302 includes:

[0115] Step 402: Upon receiving a fault injection error message for the target CPU, determine the fault injection status for the target CPU as the first status indicating fault injection failure. Alternatively,

[0116] In this embodiment of the application, when an error occurs during fault injection of the target CPU, causing the fault injection to be interrupted, the system will generate fault injection error information. Therefore, when the fault injection error information for the target CPU is received, the fault injection status for the target CPU can be determined to be the first state (indicating that the fault injection has failed).

[0117] Step 404: If no fault injection error message is received for the target CPU, send a probe command to the target CPU and obtain the response time of the target CPU to the probe command.

[0118] If no fault injection error message is received for the target CPU, it indicates that the fault injection is complete. At this point, it is necessary to further determine whether the working state of the target CPU after the fault injection meets the expected effect. In this embodiment, a probe command can be sent to the target CPU, and the response time of the target CPU to the probe command can be obtained.

[0119] Step 406: Determine the expected response time range of the target CPU.

[0120] In this embodiment of the application, different target fault types correspond to different expected response time ranges of target CPUs. Therefore, the expected response time range of the target CPU can be determined based on the target fault type corresponding to the target CPU and the above correspondence. The correspondence between different target fault types and different expected response time ranges of target CPUs can be set by the tester.

[0121] Step 408: If the response time is within the expected response time range, determine the fault injection state as the second state characterizing successful fault injection. Alternatively,

[0122] Step 410: If the response time is outside the expected response time range, determine the fault injection state as the first state characterizing fault injection failure.

[0123] In this embodiment, the response time of the target CPU to the probe instruction can be compared with the expected response time range of the target CPU. If the response time of the target CPU to the probe instruction is within the expected response time range, it means that the target CPU has achieved the expected effect, and the fault injection state is the second state representing the success of fault injection. If the response time of the target CPU to the probe instruction is outside the expected response time range, it means that the target CPU has not achieved the expected effect, and the fault injection state is the first state representing the failure of fault injection.

[0124] For example, taking the above example again, with the target CPU as CPU1 and the target fault type as lag, the clock frequency of the target CPU after successful fault injection is 30. When CPU1 lags, the expected response time of CPU1 to the probe command is in the range of 0.8s to 1.1s. The obtained response time of CPU1 to the probe command is 0.95s. At this time, the response time of 0.95s is within the range of 0.8s to 1.1s, so the fault injection state of CPU1 is the second state; or, the obtained response time of CPU1 to the probe command is 0.5s. At this time, the response time of 0.95s is not within the range of 0.8s to 1.1s, so the fault injection state of CPU1 is the first state.

[0125] This embodiment provides specific steps for determining the fault injection status of the target CPU. If the fault injection status is the first state, the previous fault injection steps are repeated until the fault injection of the target CPU is successful. Through the above process, the fault injection of the target CPU can be guaranteed to be successful, avoiding monitoring the container under test when the fault injection fails and finally obtaining incorrect test results, which can improve the accuracy of container testing.

[0126] In one embodiment, such as Figure 5 As shown, the test information also includes the expected operating state of the container under test, and step 108 includes:

[0127] Step 502: Monitor the operation of the container under test when the target CPU fails to obtain the actual operating status of the container under test.

[0128] In this embodiment of the application, the test information also includes the expected operating state of the container to be tested. The expected operating state can be set by the tester according to the target CPU and the target fault type corresponding to the target CPU. The expected operating state also includes container error stack information and business information. The container error stack information refers to the error information generated by the container during operation, and the business information refers to the duration, response speed, etc. of the container when running various services.

[0129] Among them, it can monitor the operation of the container under test when the target CPU fails, and obtain the actual operating status composed of the actual container error stack information and the actual business information.

[0130] Step 504: Determine the test results for the container to be tested based on the expected and actual operating states.

[0131] In this embodiment, the expected running state and the actual running state are compared to determine whether the actual running state matches the expected running state, thereby determining the test result corresponding to the container under test. The test result includes whether the container under test is running normally or abnormally. When the actual running state is the same as the expected running state, the test result of the container under test is that the container under test is running normally; otherwise, the test result of the container under test is that the container under test is running abnormally.

[0132] Secondly, the above content can be integrated to obtain a test file, which includes the expected running state of the container under test, the actual running state of the container under test, the comparison results between the expected running state and the actual running state, and the test results corresponding to the container under test.

[0133] For example, taking the above example again, with container 1 as the container to be tested, CPU1 and CPU2 as the target CPUs, and the target fault type as lag, the expected operating state of container 1 should be: the expected container error stack information is slow CPU response, and the expected business information is a runtime of 10s to 15s for business A. Monitoring container 1, the actual operating state of container 1 is: the actual container error stack information is slow CPU response, and the actual business information is a runtime of 12.4s for business A. Therefore, the actual operating state of container 1 matches the expected operating state, and the corresponding test result for container 1 is that the container is running normally; if the monitored actual operating state of container 1 is... If the actual operating status of container 1 is as follows: the actual container error stack information is "network not found" and the actual service information is "runtime for service A: 12.4s". Since the actual container error stack information is different from the expected container error stack information, the actual operating status of container 1 does not meet the expected operating status, and the corresponding test result for container 1 is "container operation abnormal". If the actual operating status of container 1 is as follows: the actual container error stack information is "slow CPU response" and the actual service information is "runtime for service A: 17s". Since the actual service information is different from the expected service information, the actual operating status of container 1 does not meet the expected operating status, and the corresponding test result for container 1 is "container operation abnormal".

[0134] In this embodiment, the test result corresponding to the test container is determined based on the preset expected operating state and actual operating state of the test container. That is, it is determined whether the test container is operating normally or abnormally. In this way, testers can troubleshoot abnormal test containers based on the test results, which is beneficial for the correction and adjustment of the container.

[0135] In one embodiment, such as Figure 6 As shown, a fault simulation method is provided, the method comprising:

[0136] Step 602: Obtain the target processor CPU and the target fault type corresponding to the target CPU.

[0137] In this embodiment of the application, the target processor CPU and the target fault type corresponding to the target CPU are obtained. The target CPU is the CPU to be injected with a fault, and the target fault type includes lag, stop running, and overclocking.

[0138] Step 604: Determine the target frequency corresponding to the target fault type.

[0139] In this embodiment of the application, different fault types are simulated by adjusting the CPU clock frequency. During the application process, the staff can pre-set the correspondence between the target fault type and the target frequency, and then determine the target frequency corresponding to the target fault type in the correspondence.

[0140] Step 606: Call the target function registered in kernel mode and send a frequency update signal for the target CPU to the frequency update function in kernel mode. The frequency update signal includes the target frequency so that the frequency update function updates the clock frequency of the target CPU to the target frequency.

[0141] In this embodiment, the frequency update function includes the CPU clock frequency parameter. Therefore, as long as the frequency update function updates the clock frequency of the target CPU to the target frequency corresponding to the target fault type, the fault injection of the target CPU can be completed. However, in the host machine, the frequency update function runs in kernel mode and cannot be called directly through the frequency update operation in user mode.

[0142] To solve the above problems, a custom target function (which can be a piece of code) can be set and registered in kernel mode. At this time, the target function can call the frequency update function to enable information transmission between the target function and the frequency update function. A signal event is set as the entry point to trigger the target function. After the target function is registered in kernel mode, the target function starts to wait for the aforementioned signal event. The steps of obtaining the target processor CPU, the target fault type corresponding to the target CPU, and determining the target frequency corresponding to the target fault type are located in user mode and can be used as signal events. Then, when a signal event occurs in user mode, the system will send the signal event to the target function to trigger the target function and complete the call to the target function.

[0143] After setting and registering the target function, you can send a frequency update signal for the target CPU to the frequency update function by calling the target function registered in kernel mode. The frequency update signal includes the target frequency. The frequency update function will update the target CPU clock frequency parameter to the target frequency, thus completing a fault injection into the target CPU.

[0144] In this embodiment, a custom target function is registered in the kernel mode. This target function is used to realize information transmission with the frequency update function in the kernel mode, thereby realizing the real-time change of the system CPU clock frequency in user mode and solving the problem of not being able to directly change the CPU clock frequency.

[0145] In a specific embodiment, taking container 1 running on the host machine as an example, the CPU used by container 1 is CPU1, the target CPU to be injected with fault is CPU1, the target fault type is lag, and the target frequency corresponding to lag is determined to be 30. Then, the target function can be called and a first frequency update signal can be sent to the frequency update function through the target function. The first frequency update signal includes the target frequency of CPU1 being 30. The frequency update function will update the clock frequency of CPU1 from 300 to 30, where 300 is the initial frequency of CPU1.

[0146] After completing the above fault injection process, the fault injection status of CPU1 can be determined based on the response time of CPU1 to the probe instruction and / or the fault injection error information of CPU1. The steps for determining the fault injection status are the same as those described in the above embodiments and will not be repeated here. If the fault injection status of CPU1 is the first status (fault injection failed), the above steps of calling the target function and sending the first frequency update signal to the frequency update function through the target function are repeated. The first frequency update signal includes the target frequency of CPU1 being 30, and the frequency update function updating the clock frequency of CPU1 from 300 to 30, until the fault injection status of CPU1 is the second status (fault injection successful).

[0147] Taking a test duration of 30 minutes as an example, after the fault injection is successful, the system can send a start signal to container 1. Container 1 responds to the start signal and starts working. When the system starts monitoring the operating status of container 1, it starts timing the monitoring time. When the monitoring time reaches 30 minutes, the monitoring of container 1 can be stopped to obtain the actual operating status of container 1.

[0148] Finally, the expected operating state of container 1 when CPU1 lags, preset by the tester, can be obtained. This expected operating state is then compared with the actual operating state of container 1. If the actual operating state matches the expected state, the test result for container 1 is that the container is running normally; otherwise, the test result for container 1 is that the container is running abnormally. Furthermore, the expected operating state of container 1, the actual operating state of container 1, the comparison result between the expected and actual operating states, and the corresponding test result for container 1 can be integrated to obtain the test file for container 1, which can then be viewed by the tester.

[0149] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0150] Based on the same inventive concept, this application also provides a container testing apparatus for implementing the container testing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more container testing apparatus embodiments provided below can be found in the limitations of the container testing method described above, and will not be repeated here.

[0151] In one embodiment, such as Figure 7 As shown, a container testing apparatus is provided, comprising: an acquisition module 702, a first determination module 704, a first fault injection module 706, and a monitoring module 708, wherein:

[0152] The acquisition module 702 is used to acquire test information of the target processor CPU, including the target fault type corresponding to the target CPU;

[0153] The first determining module 704 is used to determine the target frequency corresponding to the target CPU based on the target fault type.

[0154] The first fault injection module 706 is used to call the target function registered in the kernel mode and send a first frequency update signal for the target CPU to the frequency update function in the kernel mode. The first frequency update signal includes the target frequency, so that the frequency update function updates the clock frequency of the target CPU from the initial frequency to the target frequency, thereby completing the fault injection for the target CPU.

[0155] The monitoring module 708 is used to start the container under test after the target CPU fault injection is successful, monitor the operation of the container under test when the target CPU fails, and obtain the test results corresponding to the container under test.

[0156] This embodiment registers a target function in kernel mode, and then calls the target function to pass the target frequency corresponding to the target fault type to the frequency update function in kernel mode. This causes the frequency update function to update the target CPU's clock frequency to the target frequency, thus completing fault injection. In other words, by adjusting the CPU clock frequency, various CPU faults can be simulated, thereby simplifying the testing process, improving testing efficiency, and eliminating the need for other restrictions during CPU fault simulation. This testing method is applicable to various physical machines, improving the versatility of container testing methods. In one embodiment, the test information also includes the test duration, and the device further includes:

[0157] The termination module is used to stop monitoring the runtime of the container under test after the monitoring duration for the container under test has reached the test duration.

[0158] The calling module is used to call the target function registered in kernel mode and send a second frequency update signal for the target CPU to the frequency update function in kernel mode. The second frequency update signal includes the initial frequency, so that the frequency update function updates the clock frequency of the target CPU from the target frequency to the initial frequency.

[0159] In one embodiment, after the frequency update function updates the clock frequency of the target CPU to the target frequency, the apparatus further includes:

[0160] The second determining module is used to determine the fault injection status of the target CPU based on the response time of the target CPU to the probe instruction and / or the fault injection error information of the target CPU.

[0161] The second fault injection module is used to repeatedly call the target function registered in the kernel mode when the fault injection state indicates that the fault injection has failed, and send a frequency update signal for the target CPU to the frequency update function in the kernel mode so that the frequency update function updates the clock frequency of the target CPU to the target frequency, until the fault injection state indicates that the fault injection has been successful.

[0162] In one embodiment, the second determining module is further configured to:

[0163] Upon receiving a fault injection error message for the target CPU, the fault injection status for the target CPU is determined to be the first status indicating fault injection failure.

[0164] Alternatively, if no fault injection error message is received for the target CPU, a probe command is sent to the target CPU, and the response time of the target CPU to the probe command is obtained.

[0165] Determine the expected response time range of the target CPU;

[0166] If the response time is within the expected response time range, the fault injection state is determined as the second state characterizing the success of fault injection.

[0167] Alternatively, if the response time is outside the expected response time range, the fault injection state is determined as the first state characterizing fault injection failure.

[0168] In one embodiment, the test information also includes the expected operating state of the container under test, and the monitoring module 708 is further configured to:

[0169] Monitor the operation of the container under test when the target CPU fails to obtain the actual operating status of the container under test;

[0170] Based on the expected and actual operating states, determine the test results for the container to be tested.

[0171] In one embodiment, such as Figure 8 As shown, a fault simulation device is provided, including: an acquisition module 802, a determination module 804, and a calling module 806, wherein:

[0172] The acquisition module 802 is used to acquire the target processor CPU and the target fault type corresponding to the target CPU;

[0173] The determination module 804 is used to determine the target frequency corresponding to the target fault type;

[0174] Module 806 is used to call the target function registered in kernel mode and send a frequency update signal for the target CPU to the frequency update function in kernel mode. The frequency update signal includes the target frequency so that the frequency update function updates the clock frequency of the target CPU to the target frequency.

[0175] In this embodiment, a custom target function is registered in the kernel mode. This target function is used to realize information transmission with the frequency update function in the kernel mode, thereby realizing the real-time change of the system CPU clock frequency in user mode and solving the problem of not being able to directly change the CPU clock frequency.

[0176] Each module in the aforementioned container testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0177] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9As shown, the computer device includes a processor, memory, communication interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a container testing method.

[0178] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0179] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0180] Obtain test information for the target processor CPU, including the target fault type corresponding to the target CPU;

[0181] Determine the target frequency corresponding to the target CPU based on the target fault type;

[0182] The target function registered in the kernel mode is called, and a first frequency update signal for the target CPU is sent to the frequency update function in the kernel mode. The first frequency update signal includes the target frequency, so that the frequency update function updates the clock frequency of the target CPU from the initial frequency to the target frequency, thereby completing the fault injection for the target CPU.

[0183] After the fault injection into the target CPU is successful, the container under test is started, and the operation of the container under test is monitored when the target CPU fails, so as to obtain the test results corresponding to the container under test.

[0184] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0185] Obtain test information for the target processor CPU, including the target fault type corresponding to the target CPU;

[0186] Determine the target frequency corresponding to the target CPU based on the target fault type;

[0187] The target function registered in the kernel mode is called, and a first frequency update signal for the target CPU is sent to the frequency update function in the kernel mode. The first frequency update signal includes the target frequency, so that the frequency update function updates the clock frequency of the target CPU from the initial frequency to the target frequency, thereby completing the fault injection for the target CPU.

[0188] After the fault injection into the target CPU is successful, the container under test is started, and the operation of the container under test is monitored when the target CPU fails, so as to obtain the test results corresponding to the container under test.

[0189] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0190] Obtain test information for the target processor CPU, including the target fault type corresponding to the target CPU;

[0191] Determine the target frequency corresponding to the target CPU based on the target fault type;

[0192] The target function registered in the kernel mode is called, and a first frequency update signal for the target CPU is sent to the frequency update function in the kernel mode. The first frequency update signal includes the target frequency, so that the frequency update function updates the clock frequency of the target CPU from the initial frequency to the target frequency, thereby completing the fault injection for the target CPU.

[0193] After the fault injection into the target CPU is successful, the container under test is started, and the operation of the container under test is monitored when the target CPU fails, so as to obtain the test results corresponding to the container under test.

[0194] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0195] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0196] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0197] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method of testing a container, characterized by, The method comprises: obtaining test information of a target processor CPU, the test information comprising a target fault type corresponding to the target CPU; determining a target frequency corresponding to the target CPU according to the target fault type; calling a target function registered in a kernel state, and sending a first frequency update signal for the target CPU to a frequency update function in the kernel state, the first frequency update signal comprising the target frequency, so that the frequency update function updates the clock frequency of the target CPU from an initial frequency to the target frequency, to complete fault injection for the target CPU; after the fault injection for the target CPU succeeds, starting a to-be-tested container, monitoring the running condition of the to-be-tested container when the target CPU is faulty, and obtaining test results corresponding to the to-be-tested container.

2. The method of claim 1, wherein, The test information further comprises a test duration, and the method further comprises: stopping monitoring the running condition of the to-be-tested container when the monitoring duration of the running condition of the to-be-tested container reaches the test duration; calling a target function registered in a kernel state, and sending a second frequency update signal for the target CPU to a frequency update function in the kernel state, the second frequency update signal comprising the initial frequency, so that the frequency update function updates the clock frequency of the target CPU from the target frequency to the initial frequency.

3. The method of claim 1, wherein, After the frequency update function updates the clock frequency of the target CPU from the initial frequency to the target frequency, the method further comprises: determining a fault injection state for the target CPU according to the response duration of the target CPU to a probe instruction and / or fault injection error information for the target CPU; in the case where the fault injection state represents a fault injection failure, repeatedly calling a target function registered in a kernel state, and sending a frequency update signal for the target CPU to a frequency update function in the kernel state, so that the frequency update function updates the clock frequency of the target CPU to the target frequency, until the fault injection state represents a fault injection success.

4. The method of claim 3, wherein, The determination of the fault injection state for the target CPU according to the response duration of the target CPU to a probe instruction and / or fault injection error information for the target CPU comprises: in the case where fault injection error information for the target CPU is received, determining that the fault injection state for the target CPU is a first state representing a fault injection failure; or, in the case where the fault injection error information for the target CPU is not received, sending a probe instruction to the target CPU, and obtaining the response duration of the target CPU to the probe instruction; determining an expected response duration range of the target CPU; in the case where the response duration is within the expected response duration range, determining that the fault injection state is a second state representing a fault injection success; Or, in the case where the response duration is outside the expected response duration range, determining that the fault injection state is the first state representing a fault injection failure.

5. The method of claim 1, wherein, The test information further includes an expected running state of the to-be-tested container, and the running condition of the to-be-tested container when the target CPU fails is monitored to obtain a test result corresponding to the to-be-tested container, including: The running condition of the to-be-tested container when the target CPU fails is monitored to obtain an actual running state of the to-be-tested container; According to the expected running state and the actual running state, a test result corresponding to the to-be-tested container is determined.

6. A fault simulation method characterized by, The method comprises: Obtaining a target processor CPU and a target fault type corresponding to the target CPU; Determining a target frequency corresponding to the target fault type; When a signal event occurs, a target function registered in a kernel state is called to send a frequency update signal for the target CPU to a frequency update function in the kernel state, and the target frequency is included in the frequency update signal, so that the frequency update function updates the clock frequency of the target CPU to the target frequency; the target function is used to call the frequency update function to enable information transmission between the target function and the frequency update function; the signal event serves as an entry for triggering the target function.

7. A container testing device characterized by The device comprises: An acquisition module is configured to acquire test information of a target processor CPU, and the test information includes a target fault type corresponding to the target CPU; A first determination module is configured to determine a target frequency corresponding to the target CPU according to the target fault type; A first fault injection module is configured to call a target function registered in a kernel state, send a first frequency update signal for the target CPU to a frequency update function in the kernel state, and include the target frequency in the first frequency update signal, so that the frequency update function updates the clock frequency of the target CPU from an initial frequency to the target frequency, thereby completing fault injection for the target CPU; A monitoring module is configured to start a to-be-tested container after the fault injection for the target CPU is successful, monitor the running condition of the to-be-tested container when the target CPU fails, and obtain a test result corresponding to the to-be-tested container.

8. A fault simulation apparatus characterized by comprising: The device comprises: An acquisition module is configured to acquire a target processor CPU and a target fault type corresponding to the target CPU; A determination module is configured to determine a target frequency corresponding to the target fault type; A calling module is configured to call a target function registered in a kernel state when a signal event occurs, send a frequency update signal for the target CPU to a frequency update function in the kernel state, and include the target frequency in the frequency update signal, so that the frequency update function updates the clock frequency of the target CPU to the target frequency; the target function is used to call the frequency update function to enable information transmission between the target function and the frequency update function; and the signal event serves as an entry for triggering the target function. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.

11. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • CPU fault injection method, CPU fault injection device and fault management system

    CN106776178A

  • CPU test method, system and device and storage medium

    CN115098315A