Virtualization platform life cycle monitoring method and equipment
Through the virtualization platform life cycle monitoring method, fault injection test and online testing are used to monitor the life cycle state transition of virtual machines, solving the problem of insufficient monitoring in the existing technology, and improving the robustness and diagnostic capabilities of life cycle management. Reduced dependence on hardware security.
Patent Information
- Application Number
- CN202411108883.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-13
AI Technical Summary
The existing virtualization platform lacks an effective monitoring mechanism in life cycle management, making it difficult to solve the problems of state transition abnormalities, state transition failures and initial configuration errors, and has a high dependence on hardware security.
Provide a virtualization platform life cycle monitoring method, which can realize comprehensive monitoring of the life cycle of the virtual machine by obtaining the life cycle state and state conversion process of the virtual machine, combining fault injection test and online testing, and identifying hardware failures and unexpected conversions. , improve robustness and diagnostic rate.
It effectively solves the problems of abnormal and failure in the life cycle, improves the hardware failure diagnosis rate and state migration robustness, reduces the dependence on hardware security, and enhances functional security.
Smart Images

Figure CN118965341A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of virtualization technology, and in particular to a method and device for monitoring the lifecycle of a virtualization platform. Background Art
[0002] In order to meet the increasingly centralized scenario integration needs of the automotive E / E architecture computing platform, the computing platform is designed with safe, reliable, high-performance, and low-loss virtualization capabilities, and the software and hardware (CPU, memory, storage devices, etc.) resources are isolated and elastically orchestrated and shared for scenario applications. While improving resource utilization and operational efficiency, it is also necessary to support the coexistence of multi-scenario application ecosystems.
[0003] In view of this, Hypervisor (virtualization) adopts a high reliability and security framework design, providing functional safety capability support for virtualization ecosystem software, which can ensure the functional safety of vehicles.
[0004] Virtual Machine (VM) lifecycle management is the most basic function of virtualization, and its function itself runs through the entire virtualization lifecycle. Therefore, on the basis of meeting the basic functions, it is very necessary to develop a highly secure and robust configuration and monitoring function. Summary of the invention
[0005] The present application provides a virtualization platform lifecycle monitoring method and device to perform lifecycle monitoring on the functional status of a virtual machine.
[0006] In a first aspect, the present application provides a method for monitoring a lifecycle of a virtualization platform, wherein the virtualization platform includes a virtual machine, and the method includes:
[0007] Acquire the life cycle state of the virtual machine, wherein the life cycle state includes the startup state of the virtual machine, the running state of the virtual machine, the exit state of the virtual machine, the sleep state of the virtual machine, and the fault state of the virtual machine;
[0008] Acquire a state transition process between the life cycle states, the state transition process comprising one of the transition from the startup state to the running state, the transition from the running state to the exit state, the transition from the exit state to the startup state, the transition between the running state and the sleep state, and the transition from the fault state to the exit state;
[0009] The life cycle of the virtual machine is monitored according to the state transition process and the test library, and the test library includes a fault injection test and an online test.
[0010] In a possible design, if the state transition process is transitioning from the startup state to the running state, the life cycle monitoring of the virtual machine according to the state transition process and the test library includes:
[0011] In response to the configuration instruction, the virtual machine is configured, and a first timing is obtained, where the first timing is a configuration start time;
[0012] Performing a power-on self-test on the virtual machine that has completed configuration, and obtaining post-self-test status data according to the power-on self-test items of the virtual machine;
[0013] If it is determined according to the state data that the virtual machine has passed the power-on self-test, respond to the start instruction to make the virtual machine enter the start state, and obtain a second timing and a third timing, where the second timing and the third timing are respectively the end time of the power-on self-test and the start time of the start state;
[0014] Performing the fault injection test and the online test on the virtual machine that has entered the startup state, and entering the fault state when the virtual machine detects an abnormality;
[0015] If it is determined that the transition of the virtual machine that has entered the fault state from the startup state to the running state satisfies a first transition condition, responding to a first transition instruction causes the virtual machine to enter the running state, and obtaining a fourth timing, where the fourth timing is the end time of the startup state;
[0016] The life cycle of the virtual machine is monitored according to the first timing, the second timing, the third timing, and the fourth timing.
[0017] In a possible design, the third timing and the fourth timing perform life cycle monitoring on the virtual machine, including:
[0018] If it is determined that the time difference between the fourth timing and the third timing is less than or equal to the second preset duration, the life cycle monitoring of the virtual machine transitioning from the startup state to the running state is terminated.
[0019] In one possible design, if it is determined that the time difference between the fourth timing and the third timing is greater than a second preset duration, the virtual machine is controlled to enter the fault state.
[0020] In one possible design, it also includes:
[0021] If it is determined that the time difference between the second timing and the first timing is less than or equal to the first preset duration, end the life cycle monitoring of the virtual machine configuration phase;
[0022] If it is determined that the time difference between the second timing and the first timing is greater than the first preset time length, the virtual machine is controlled to enter a safe state.
[0023] In a possible design, if the state transition process is transitioning from the running state to the exiting state, the life cycle monitoring of the virtual machine according to the state transition process and the test library includes:
[0024] Obtaining the start time when the virtual machine enters the running state;
[0025] Performing the fault injection test and the online test on the virtual machine that has entered the running state, and entering the fault state when the virtual machine detects an abnormality;
[0026] If it is determined that the transition of the virtual machine that has entered the fault state from the running state to the exited state satisfies a second transition condition, responding to a second transition instruction causes the virtual machine to enter the exited state, and obtaining an end time of the running state;
[0027] If it is determined that the time difference between the end time of the running state and the start time of the running state is less than or equal to the third preset duration, the life cycle monitoring of the virtual machine transitioning from the running state to the exit state is terminated.
[0028] In one possible design, if it is determined that the time difference between the end time of the running state and the start time of the running state is greater than a third preset duration, the virtual machine is controlled to enter the fault state.
[0029] In a possible design, if the state transition process is transitioning from the exit state to the startup state, the life cycle monitoring of the virtual machine according to the state transition process and the test library includes:
[0030] Obtaining the start time when the virtual machine enters the exit state;
[0031] Performing the fault injection test and the online test on the virtual machine that has entered the exit state, and entering the fault state when the virtual machine detects an abnormality;
[0032] If it is determined that the transition of the virtual machine that has entered the fault state from the exit state to the start state satisfies a third transition condition, responding to a third transition instruction causes the virtual machine to enter the start state, and obtaining an end time of the exit state;
[0033] If it is determined that the time difference between the end time of the exit state and the start time of the exit state is less than or equal to a fourth preset duration, the life cycle monitoring of the virtual machine transitioning from the exit state to the startup state is terminated.
[0034] In one possible design, if it is determined that the time difference between the end time of the exit state and the start time of the exit state is greater than a fourth preset duration, the virtual machine is controlled to enter the fault state.
[0035] In a possible design, if the state transition process is transitioning from the running state to the sleeping state, the life cycle monitoring of the virtual machine according to the state transition process and the test library includes:
[0036] Obtaining the start time when the virtual machine enters the running state;
[0037] Performing the fault injection test and the online test on the virtual machine that has entered the running state, and entering the fault state when the virtual machine detects an abnormality;
[0038] If it is determined that the transition of the virtual machine that has entered the fault state from the running state to the sleep state satisfies a fourth transition condition, responding to a fourth transition instruction causes the virtual machine to enter the sleep state, and obtaining an end time of the running state;
[0039] If it is determined that the time difference between the end time of the running state and the start time of the running state is less than or equal to the fifth preset duration, the life cycle monitoring of the virtual machine transitioning from the running state to the sleep state is terminated.
[0040] In one possible design, if it is determined that the time difference between the end time of the running state and the start time of the running state is greater than a fifth preset time duration, the virtual machine is controlled to enter the fault state.
[0041] In a possible design, if the state transition process is transitioning from the dormant state to the running state, the life cycle monitoring of the virtual machine according to the state transition process and the test library includes:
[0042] Obtaining the start time when the virtual machine enters the sleep state;
[0043] Performing the fault injection test and the online test on the virtual machine that has entered the dormant state, and entering the fault state when the virtual machine detects an abnormality;
[0044] If it is determined that the transition of the virtual machine that has entered the fault state from the sleep state to the running state satisfies a fifth transition condition, responding to a fifth transition instruction causes the virtual machine to enter the running state, and obtaining an end time of the sleep state;
[0045] If it is determined that the time difference between the end time of the sleep state and the start time of the sleep state is less than or equal to the sixth preset duration, the life cycle monitoring of the virtual machine transitioning from the sleep state to the running state is terminated.
[0046] In one possible design, if it is determined that the time difference between the end time of the sleep state and the start time of the sleep state is greater than a sixth preset duration, the virtual machine is controlled to enter the fault state.
[0047] In a possible design, if the state transition process is transitioning from the fault state to the exit state, the life cycle monitoring of the virtual machine according to the state transition process and the test library includes:
[0048] Obtaining the start time when the virtual machine enters the fault state;
[0049] Performing the fault injection test and the online test on the virtual machine that has entered the fault state to trigger the virtual machine to reset external hardware;
[0050] If it is determined that the virtual machine that has reset the external hardware switches from the fault state to the exit state satisfies a sixth switching condition, respond to a sixth switching instruction to make the virtual machine enter the exit state, and obtain an end time of the fault state;
[0051] If it is determined that the time difference between the end time of the fault state and the start time of the fault state is less than or equal to the seventh preset time duration, the life cycle monitoring of the virtual machine transitioning from the fault state to the exit state is terminated.
[0052] In one possible design, if it is determined that the time difference between the end time of the fault state and the start time of the fault state is greater than a seventh preset time duration, the virtual machine is controlled to enter the fault state.
[0053] In a possible design, the method further includes: monitoring the life cycle of the virtual machine through arbitration judgment.
[0054] In a possible design, the monitoring of the life cycle of the virtual machine through arbitration judgment includes:
[0055] Obtaining a previous life cycle state and a subsequent life cycle state of the current life cycle state of the virtual machine and a historical conversion condition, wherein the historical conversion condition is a conversion condition when the previous life cycle state is converted to the subsequent life cycle state;
[0056] If it is determined that the historical conversion condition is correct and it is determined that the program does not have an infinite loop, then it is determined whether the program has a program running fault, wherein the program running fault includes an abnormal interruption phenomenon or an abnormal exit phenomenon;
[0057] If not, and it is determined that the previous life cycle state is a normal end and the subsequent life cycle state is a normal start, then the life cycle monitoring of the virtual machine when the program fails to run is terminated.
[0058] In one possible design, if it is determined that the historical conversion condition is erroneous, the program is in an infinite loop, the program has a program running failure, the previous life cycle state ends abnormally, or the next life cycle state starts abnormally, a fault instruction is generated, and the virtual machine enters the fault state in response to the fault instruction.
[0059] In one possible design, the method further includes:
[0060] Obtaining a fault source in which the virtual machine enters the fault state after detecting an abnormality;
[0061] The external hardware is restarted according to the fault source, so that the virtual machine enters a safe working state according to the application scenario.
[0062] In a second aspect, the present application provides a virtualization platform lifecycle monitoring device, wherein the virtualization platform includes a virtual machine, and the device includes:
[0063] A first acquisition module is used to acquire the life cycle state of the virtual machine, wherein the life cycle state includes the startup state of the virtual machine, the running state of the virtual machine, the exit state of the virtual machine, the sleep state of the virtual machine and the fault state of the virtual machine;
[0064] A second acquisition module is used to acquire a state transition process between the life cycle states, wherein the state transition process includes one of the transition from the startup state to the running state, the transition from the running state to the exit state, the transition from the exit state to the startup state, the transition between the running state and the sleep state, and the transition from the fault state to the exit state;
[0065] A monitoring module is used to monitor the life cycle of the virtual machine according to the state transition process and the test library, wherein the test library includes a fault injection test and an online test.
[0066] In a possible design, if the state transition process is transitioning from the startup state to the running state, the monitoring module is specifically used to:
[0067] In response to the configuration instruction, the virtual machine is configured, and a first timing is obtained, where the first timing is a configuration start time;
[0068] Performing a power-on self-test on the virtual machine that has completed configuration, and obtaining post-self-test status data according to the power-on self-test items of the virtual machine;
[0069] If it is determined according to the state data that the virtual machine has passed the power-on self-test, respond to the start instruction to make the virtual machine enter the start state, and obtain a second timing and a third timing, where the second timing and the third timing are respectively the end time of the power-on self-test and the start time of the start state;
[0070] Performing the fault injection test and the online test on the virtual machine that has entered the startup state, and entering the fault state when the virtual machine detects an abnormality;
[0071] If it is determined that the transition of the virtual machine that has entered the fault state from the startup state to the running state satisfies a first transition condition, responding to a first transition instruction causes the virtual machine to enter the running state, and obtaining a fourth timing, where the fourth timing is the end time of the startup state;
[0072] The life cycle of the virtual machine is monitored according to the first timing, the second timing, the third timing, and the fourth timing.
[0073] In a possible design, the monitoring module is further used to:
[0074] If it is determined that the time difference between the fourth timing and the third timing is less than or equal to the second preset duration, the life cycle monitoring of the virtual machine transitioning from the startup state to the running state is terminated.
[0075] In a possible design, if it is determined that the time difference between the fourth timing and the third timing is greater than a second preset duration, the monitoring module is further used to: control the virtual machine to enter the fault state.
[0076] In a possible design, the monitoring module is further used to:
[0077] If it is determined that the time difference between the second timing and the first timing is less than or equal to the first preset duration, end the life cycle monitoring of the virtual machine configuration phase;
[0078] If it is determined that the time difference between the second timing and the first timing is greater than the first preset time length, the virtual machine is controlled to enter a safe state.
[0079] In a possible design, if the state transition process is transitioning from the running state to the exit state, the monitoring module is specifically configured to:
[0080] Obtaining the start time when the virtual machine enters the running state;
[0081] Performing the fault injection test and the online test on the virtual machine that has entered the running state, and entering the fault state when the virtual machine detects an abnormality;
[0082] If it is determined that the transition of the virtual machine that has entered the fault state from the running state to the exited state satisfies a second transition condition, responding to a second transition instruction causes the virtual machine to enter the exited state, and obtaining an end time of the running state;
[0083] If it is determined that the time difference between the end time of the running state and the start time of the running state is less than or equal to the third preset duration, the life cycle monitoring of the virtual machine transitioning from the running state to the exit state is terminated.
[0084] In a possible design, if it is determined that the time difference between the end time of the running state and the start time of the running state is greater than a third preset duration, the monitoring module is also used to: control the virtual machine to enter the fault state.
[0085] In a possible design, if the state transition process is transitioning from the exit state to the start state, the monitoring module is specifically configured to:
[0086] Obtaining the start time when the virtual machine enters the exit state;
[0087] Performing the fault injection test and the online test on the virtual machine that has entered the exit state, and entering the fault state when the virtual machine detects an abnormality;
[0088] If it is determined that the transition of the virtual machine that has entered the fault state from the exit state to the start state satisfies a third transition condition, responding to a third transition instruction causes the virtual machine to enter the start state, and obtaining an end time of the exit state;
[0089] If it is determined that the time difference between the end time of the exit state and the start time of the exit state is less than or equal to a fourth preset duration, the life cycle monitoring of the virtual machine transitioning from the exit state to the startup state is terminated.
[0090] In a possible design, if it is determined that the time difference between the end time of the exit state and the start time of the exit state is greater than a fourth preset duration, the monitoring module is further used to: control the virtual machine to enter the fault state.
[0091] In a possible design, if the state transition process is transitioning from the running state to the sleeping state, the monitoring module is specifically configured to:
[0092] Obtaining the start time when the virtual machine enters the running state;
[0093] Performing the fault injection test and the online test on the virtual machine that has entered the running state, and entering the fault state when the virtual machine detects an abnormality;
[0094] If it is determined that the transition of the virtual machine that has entered the fault state from the running state to the sleep state satisfies a fourth transition condition, responding to a fourth transition instruction causes the virtual machine to enter the sleep state, and obtaining an end time of the running state;
[0095] If it is determined that the time difference between the end time of the running state and the start time of the running state is less than or equal to the fifth preset duration, the life cycle monitoring of the virtual machine transitioning from the running state to the sleep state is terminated.
[0096] In a possible design, if it is determined that the time difference between the end time of the running state and the start time of the running state is greater than a fifth preset time length, the monitoring device is also used to: control the virtual machine to enter the fault state.
[0097] In a possible design, if the state conversion process is the conversion from the sleep state to the running state, the monitoring device is further used to:
[0098] Obtaining the start time when the virtual machine enters the sleep state;
[0099] Performing the fault injection test and the online test on the virtual machine that has entered the dormant state, and entering the fault state when the virtual machine detects an abnormality;
[0100] If it is determined that the transition of the virtual machine that has entered the fault state from the sleep state to the running state satisfies a fifth transition condition, responding to a fifth transition instruction causes the virtual machine to enter the running state, and obtaining an end time of the sleep state;
[0101] If it is determined that the time difference between the end time of the sleep state and the start time of the sleep state is less than or equal to the sixth preset duration, the life cycle monitoring of the virtual machine transitioning from the sleep state to the running state is terminated.
[0102] In a possible design, if it is determined that the time difference between the end time of the sleep state and the start time of the sleep state is greater than a sixth preset duration, the monitoring device is further used to: control the virtual machine to enter the fault state.
[0103] In a possible design, if the state conversion process is the conversion from the fault state to the exit state, the monitoring module is further used to:
[0104] Obtaining the start time when the virtual machine enters the fault state;
[0105] Performing the fault injection test and the online test on the virtual machine that has entered the fault state, so as to trigger the virtual machine to reset the external hardware;
[0106] If it is determined that the virtual machine that has reset the external hardware switches from the fault state to the exit state satisfies a sixth switching condition, respond to a sixth switching instruction to make the virtual machine enter the exit state, and obtain an end time of the fault state;
[0107] If it is determined that the time difference between the end time of the fault state and the start time of the fault state is less than or equal to the seventh preset time duration, the life cycle monitoring of the virtual machine transitioning from the fault state to the exit state is terminated.
[0108] In a possible design, if it is determined that the time difference between the end time of the fault state and the start time of the fault state is greater than a seventh preset time length, the monitoring module is also used to: control the virtual machine to enter the fault state.
[0109] In a possible design, if the virtual machine program fails to run, the device further includes:
[0110] The arbitration module is used to monitor the life cycle of the virtual machine through arbitration judgment.
[0111] In a possible design, the arbitration module is specifically used to:
[0112] Obtaining a previous life cycle state and a subsequent life cycle state of the current life cycle state of the virtual machine and a historical conversion condition, wherein the historical conversion condition is a conversion condition when the previous life cycle state is converted to the subsequent life cycle state;
[0113] If it is determined that the historical conversion condition is correct and it is determined that the program does not have an infinite loop, then it is determined whether the program has a program running fault, wherein the program running fault includes an abnormal interruption phenomenon or an abnormal exit phenomenon;
[0114] If not, and it is determined that the previous life cycle state is a normal end and the subsequent life cycle state is a normal start, then the life cycle monitoring of the virtual machine when the program fails to run is terminated.
[0115] In a possible design, if it is determined that one of the historical conversion condition is wrong, the program is in an infinite loop, the program has a program operation failure, the previous life cycle state ends abnormally, or the next life cycle state starts abnormally, the arbitration module is further used to:
[0116] A fault instruction is generated, and in response to the fault instruction, the virtual machine enters the fault state.
[0117] In a possible design, the apparatus further includes: a restart module; the restart module is used to:
[0118] Obtaining a fault source that causes the virtual machine to enter the fault state after detecting an abnormality;
[0119] The external hardware is restarted according to the fault source, so that the virtual machine enters a safe working state according to the application scenario.
[0120] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0121] The memory stores computer-executable instructions;
[0122] The processor executes the computer-executable instructions stored in the memory to implement any possible virtualization platform lifecycle monitoring method provided in the first aspect.
[0123] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement any possible virtualization platform lifecycle monitoring method provided in the first aspect.
[0124] In a fifth aspect, the present application provides a computer program product, comprising computer execution instructions, which, when executed by a processor, are used to implement any possible virtualization platform lifecycle monitoring method provided in the first aspect.
[0125] The present application provides a method and device for monitoring the life cycle of a virtualization platform. The virtualization platform includes a virtual machine. First, the life cycle state of the virtual machine is obtained. The life cycle state includes the startup state of the virtual machine, the running state of the virtual machine, the exit state of the virtual machine, the sleep state of the virtual machine and the fault state of the virtual machine. Then, the state conversion process between the life cycle states is obtained, wherein the state conversion process includes the startup state conversion to the running state, the running state conversion to the exit state, the exit state conversion to the startup state, the conversion between the running state and the sleep state, and the fault state conversion to the exit state. Then, the life cycle of the virtual machine is monitored according to the state conversion process and the test library, and the test library includes fault injection testing and online testing. The functional state management in the life cycle of the virtual machine can be monitored, which can not only solve the state conversion anomalies, state conversion failures and initial configuration errors that may be caused in the whole life cycle, but also make up for the lack of effective monitoring of the unexpected conversion of the life cycle state of the hypervisor that meets the ASILD level of functional safety. In addition, it can also improve the diagnosis rate of random hardware failures in the life cycle state conversion and the robustness of state migration, which can greatly reduce the dependence on hardware security compared with related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0126] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0127] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0128] Figure 2 A flowchart of a virtualization platform lifecycle monitoring method provided in an embodiment of the present application;
[0129] Figure 3 A schematic diagram of a state transition process of a life cycle state provided in an embodiment of the present application;
[0130] Figure 4 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application;
[0131] Figure 5 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application;
[0132] Figure 6A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application;
[0133] Figure 7 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application;
[0134] Figure 8 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application;
[0135] Fig. 9 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application;
[0136] Fig.10 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application;
[0137] Fig.11 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application;
[0138] Fig.12 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application;
[0139] Fig.13 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application;
[0140] Fig.14 A schematic diagram of the structure of a virtualization platform lifecycle monitoring device provided in an embodiment of the present application;
[0141] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0142] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of methods and devices consistent with some aspects of the present application as detailed in the appended claims.
[0143] The terms "first", "second", "third", "fourth", etc. (if any) 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, for example. 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 that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0144] At present, Hypervisor can adopt high reliability and security framework design to provide functional safety support for virtualization ecosystem software, thereby ensuring the functional safety of vehicles. As the most basic function of virtualization, virtual machine (VM) lifecycle management runs through the entire virtualization lifecycle. Therefore, on the basis of meeting basic functions, it is very necessary to develop a highly secure and robust configuration and monitoring function.
[0145] In view of the above problems existing in the prior art, the present application provides a virtualization platform lifecycle monitoring method and device. The inventive concept of the virtualization platform lifecycle monitoring method provided by the present application is to monitor the state transition of the virtualization platform lifecycle state and the program running failure and timeout, and at the same time use the test library to perform power-on self-test, online self-test and fault injection, so as to achieve effective coverage of random hardware failures, thereby providing an effective monitoring solution for virtualization platform lifecycle management as a whole.
[0146] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application, such as Figure 1 As shown, a virtualization platform is configured in the vehicle 100 to provide functional safety capability support for the virtualization ecosystem software, which can ensure the functional safety of the vehicle 100, and the virtualization platform includes a virtual machine. The electronic device 200 is configured to execute the virtualization platform life cycle monitoring method provided in the embodiment of the present application, which can monitor the functional state management in the life cycle of the virtual machine, which can not only solve the state transition anomalies, state transition failures and initial configuration errors that may be caused in the entire life cycle, but also make up for the lack of effective monitoring of unexpected life cycle state transitions in the hypervisor that meets the ASILD level of functional safety. In addition, it can also improve the diagnosis rate of random hardware failures in the life cycle state transition and the robustness of state migration, which can greatly reduce the dependence on hardware safety.
[0147] The electronic device 200 may be, for example, an electronic control unit (ECU) or a microcontroller (MCU) configured in the vehicle 100. The embodiment of the present application does not limit the type of the electronic device 200. Figure 1 ECU is taken as an example.
[0148] It should be noted that the above application scenario diagram is only for illustrative purposes, and the virtualization platform lifecycle monitoring method and device provided in the embodiments of the present application include but are not limited to the above application scenarios.
[0149] Figure 2 A flow chart of a virtualization platform lifecycle monitoring method provided in an embodiment of the present application is as follows: Figure 2 As shown, the virtualization platform lifecycle monitoring method provided in the embodiment of the present application includes:
[0150] S101: Obtain the life cycle status of a virtual machine.
[0151] Obtaining the life cycle status of a virtual machine is to obtain the current state of the virtual machine. Figure 3 As shown, the entire life cycle state of the virtual machine may include the startup state of the virtual machine (such as Figure 3 The running status of the virtual machine (as shown in S0) Figure 3 ), the exit status of the virtual machine (as shown in S1 in Figure 3 ) and the sleep state of the virtual machine (as shown in S2 Figure 3 ) and the virtual machine's fault status (as shown in S3 in Figure 3 S0-S3 are the basic states for realizing the life cycle of a virtual machine. By converting between these states, the basic conversion of the life cycle of a virtual machine can be realized. The S4 state can realize the closed loop of security monitoring of the entire life cycle, and can eventually enter a safe working state with the help of external independent security equipment.
[0152] S102: Acquire the state transition process between life cycle states.
[0153] Continue to refer to Figure 3 As shown, the state transition process between life cycle states may include the transition from the startup state of the virtual machine to the running state of the virtual machine (S0→S1), the transition from the running state of the virtual machine to the exit state of the virtual machine (S1→S2), the transition from the exit state of the virtual machine to the startup state of the virtual machine (S2→S0), the transition between the running state of the virtual machine and the sleep state of the virtual machine The fault state is converted to one of the exit states (S4→S2). The process of obtaining the state conversion between the life cycle states is to obtain the state conversion process of the virtual machine.
[0154] Among them, for each state from S0 to S3, the monitoring of each state of the virtual machine and the conversion conditions during the state conversion process can be realized respectively. Further, arbitration judgment can be used to make corresponding processing strategy decisions from various dimensions of software systematic failure, time timeout, sleep and wake-up exceptions, etc.
[0155] It should be noted that the state transition process between life cycle states includes but is not limited to the above, and may also include Figure 3 The running state shown in the figure is converted to the fault state (S1→S4), the fault state is converted to the exit state (S4→S2), the sleep state is converted to the fault state (S3→S4), and the self-conversion of each life cycle state, etc., wherein the life cycle state conversion process is determined by the actual working conditions, which is not limited to the embodiments of the present application. The life cycle monitoring process of the life cycle state conversion process is similar to the life cycle state conversion process already listed, and will not be repeated here.
[0156] S103: Monitor the life cycle of the virtual machine according to the state transition process and the test library.
[0157] Among them, the test library may include fault injection tests and online tests. In some embodiments, the fault injection test may be a single test in a specific stage, such as error correction code (ErrorCorrectingCode, ECC) gizmos injection, clock frequency fault injection, memory fault injection, interrupt fault injection, etc. The online test may be an online cycle test, such as dual-core lockstep test, memory built-in self-test (Memory Build-In-Self Test, MBIST), online register mirror test, etc. In actual working conditions, specific test strategies can be configured according to actual application scenarios. Configuration methods include but are not limited to adding specific fault injection tests, performing power-on and power-off or initialization tests when the system is powered on and off, and performing periodic tests during system operation. Various different combinations can be used to achieve effective coverage of random hardware failures while ensuring system resources.
[0158] Based on the life cycle transition path of the virtual machine, the entire life cycle of the virtual machine is monitored in combination with the corresponding test strategies designed in the test library.
[0159] Among them, the unexpected state transition or transition failure of the life cycle state caused by the failure of program operation can be effectively monitored by monitoring the state transition process to realize the transition condition judgment, program dead loop judgment, abnormal interruption and abnormal exit judgment, previous state end abnormal judgment, next state start abnormal judgment, sleep abnormal judgment, wake-up abnormal judgment, etc. In addition, through the effective collection of the previous and next states, the post-check of the transition conditions, the comprehensive coverage of the software systematic failure mode, and the layout and reasonable design throughout the life cycle, the diagnostic coverage of program operation failure can be maximized to avoid program operation failure due to systematic failure.
[0160] In addition, the failure of lifecycle state transition caused by state transition timeout can be effectively avoided by the start and end time of the entire lifecycle state transition process. And combined with the configured preset timeout, it can support static configuration of different applications and different lifecycle state transition stages. Furthermore, the introduction of the test library can identify single point failures and latent faults in the hardware, effectively improving the overall security of the virtualization platform.
[0161] The embodiment of the present application provides a method for monitoring the life cycle of a virtualization platform, wherein the virtualization platform includes a virtual machine, first obtaining the life cycle state of the virtual machine, the life cycle state includes the startup state of the virtual machine, the running state of the virtual machine, the exit state of the virtual machine, the sleep state of the virtual machine and the fault state of the virtual machine, and then obtaining the state conversion process between the life cycle states, wherein the state conversion process includes the startup state conversion to the running state, the running state conversion to the exit state, the exit state conversion to the startup state, the conversion between the running state and the sleep state, and the fault state conversion to the exit state. Then, the life cycle of the virtual machine is monitored according to the state conversion process and the test library, and the test library includes a fault injection test and an online test. The functional state management in the life cycle of the virtual machine can be monitored, which can not only solve the state conversion anomalies, state conversion failures and initial configuration errors that may be caused in the whole life cycle, but also make up for the lack of effective monitoring of the unexpected conversion of the life cycle state of the hypervisor that meets the ASILD level of functional safety. In addition, it can also improve the diagnosis rate of random hardware failures in the life cycle state conversion and the robustness of state migration, which can greatly reduce the dependence on hardware security compared with related technologies.
[0162] In a possible design, if the state transition process is transitioning from the startup state to the running state (S0→S1), a possible implementation of step S103 is as follows: Figure 4 shown. Figure 4 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application. Figure 4 As shown, the embodiment of the present application includes:
[0163] S201: Configure a virtual machine in response to a configuration instruction and obtain a first timing.
[0164] The first timing is the configuration start time.
[0165] The virtual machine is configured in response to the configuration instruction, and a timing T11 is set at the start time of the configuration as the first timing.
[0166] S202: Perform a power-on self-test on the configured virtual machine, and obtain post-self-test status data according to the power-on self-test items of the virtual machine.
[0167] Perform a power-on self-test on the configured virtual machine, and obtain the status of each item after the power-on self-test, and represent it with the status data after the self-test. In some embodiments, different self-test items can be selected according to different requirements for system startup time, for example, including but not limited to: the validity of the virtual machine ID, the validity of the parameter type in the virtual machine configuration data structure, the validity of the parameter range, etc. It can also include hardware self-test, such as various fault injection tests, memory tests, lockstep tests, register tests, etc.
[0168] S203: Determine whether the power-on self-test passes according to the status data.
[0169] According to the status data corresponding to the power-on self-test items, it is determined whether the power-on self-test has passed. If it has passed, the process proceeds to the next step S204. If it has not passed, that is, the self-test has failed, the process reconfigures, that is, proceeds to step S201. In some embodiments, it is determined whether the power-on self-test has passed specifically based on the content of the self-test items of the power-on self-test, which is not limited in the embodiments of the present application.
[0170] S204: Respond to the startup instruction to enable the virtual machine to enter a startup state, and obtain a second timing and a third timing.
[0171] After the power-on self-test passes, the virtual machine is controlled to enter the startup state in response to the startup instruction, and the end time of the power-on self-test, ie, the second timer T12, and the start time of the startup state, ie, the third timer T13, are recorded.
[0172] S205: Perform a fault injection test and an online test on the virtual machine that has entered the startup state. When the virtual machine detects an abnormality, it enters a fault state.
[0173] A fault injection test is performed on a virtual machine in a startup state, which can be specifically configured according to the requirements of the fault injection test, and then the virtual machine enters a fault state when an abnormality is detected (S4).
[0174] The online test of the virtual machine in the startup state can be specifically configured according to the online test requirements, and then the virtual machine enters the fault state (S4) when an abnormality is detected.
[0175] S206: Determine whether the transition of the virtual machine that has entered the fault state from the startup state to the running state satisfies a first transition condition.
[0176] Determine whether the transition condition of the virtual machine from the startup state to the running state meets the corresponding first transition condition. If so, execute step S207a; if not, execute step S207b to maintain the current state.
[0177] In some embodiments, the first conversion condition includes but is not limited to: whether the virtual machine ID number is correct, whether the physical CPU bitmap used by the virtual machine is used by the current virtual machine, the validity of the virtual machine configuration information type, and the validity of the virtual machine configuration information range.
[0178] S207a: Respond to the first conversion instruction to enable the virtual machine to enter a running state, and obtain a fourth timing.
[0179] If the first conversion condition is met, the virtual machine is controlled to enter the running state in response to the generated first conversion instruction, and the end time of the startup state, ie, the fourth timer T14, is recorded at the same time.
[0180] In some embodiments, after the fourth timing is obtained, an online test is performed on the virtual machine, and an abnormality is detected and the virtual machine enters a fault state (S4).
[0181] S207b: Keep the virtual machine started.
[0182] S208: Monitor the life cycle of the virtual machine according to the third timing and the fourth timing.
[0183] After step S207a, the life cycle of the virtual machine from the startup state to the running state is further monitored according to the acquired third timer T13 and fourth timer T14.
[0184] In a possible design, a possible implementation of step S208 is as follows: Figure 5 shown. Figure 5 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application. Figure 5 As shown, the embodiment of the present application includes:
[0185] S2081: Determine whether the time difference between the fourth timing and the third timing is less than or equal to a second preset duration.
[0186] Determine whether T14-T13 is less than or equal to the second preset time length. If it is determined that T14-T13 is less than or equal to the second preset time length, end the timeout monitoring of the state transition phase S0→S1, and execute step S2082; if it is determined that T14-T13 is greater than the second preset time length, indicating that the state transition from the startup state to the running state has timed out, the virtual machine is controlled to enter a fault state, and step S2083 is executed.
[0187] S2082: End the lifecycle monitoring of the transition of the virtual machine from the startup state to the running state.
[0188] S2083: Control the virtual machine to enter a fault state.
[0189] In addition, after obtaining the first timing T11 and the second timing T12, the life cycle monitoring of the virtual machine configuration phase is also included through the first timing and the second timing, and the implementation method is as follows: Figure 6 shown. Figure 6 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application is shown as follows: Figure 6 As shown, the embodiment of the present application includes:
[0190] S301: Determine whether the time difference between the second timing and the first timing is less than or equal to a first preset duration;
[0191] S302: End the lifecycle monitoring of the virtual machine configuration phase.
[0192] S303: Control the virtual machine to enter a safe state.
[0193] Determine whether T12-T11 is less than or equal to the first preset time length. If it is determined that T12-T11 is less than or equal to the first preset time length, then end the timeout monitoring of the configuration phase, that is, execute step S302, and then continue to execute Figure 4 The embodiment monitors the life cycle of the virtual machine from the startup state to the running state; if it is determined that T12-T11 is greater than the first preset time, it means that the virtual machine configuration phase has timed out, and the virtual machine is controlled to enter the safe state, that is, step S303 is executed. At this time, the safe state is in the virtual machine preparation state, and the virtual machine cannot enter the startup state. Among them, the configuration phase is used to complete the power-on self-test.
[0194] It should be noted that the first preset duration and the second preset duration can be customized and can be configured based on the principle of meeting the requirements of the maximum allowable time for system fault processing and leaving a certain margin. The maximum allowable time for system fault processing is not a fixed value. It is necessary to consider the possible hazards, fault triggering conditions, fault detection, safety status, etc. as a whole according to the upper-level application scenarios and business needs, and determine the diagnostic test time interval, fault response time, etc. on this basis. The specific values of the first preset duration and the second preset duration are not limited in this embodiment of the application.
[0195] The virtualization platform life cycle monitoring method provided by the embodiment of the present application can achieve the unexpected conversion or conversion failure from the startup state to the running state caused by the configuration error of the virtualization platform through power-on self-test, designing a test library for test injection and timeout monitoring from the startup state to the running state, which can be effectively avoided through the start time, end time and test library in the conversion process of this stage, and can be effectively avoided through the configuration validity check of the power-on self-test and the configurable fault injection test. Self-test and fault injection tests can identify single point failures and latent faults in the hardware, and effectively improve the overall security of the virtualization platform. And combined with the setting of configurable timeouts such as the first preset duration and the second preset duration, static configuration of different applications and different life cycle conversion stages can be supported.
[0196] In a possible design, if the state transition process is transitioning from the running state to the exit state (S1→S2), a possible implementation of step S103 is as follows: Figure 7 shown. Figure 7 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application. Figure 7 As shown, the embodiment of the present application includes:
[0197] S401: Obtain the start time when the virtual machine enters the running state.
[0198] The virtual machine enters the running state and records the start time T21 of the running state.
[0199] S402: Perform a fault injection test and an online test on the virtual machine that has entered the running state. When the virtual machine detects an abnormality, it enters a fault state.
[0200] A fault injection test is performed on a virtual machine in a running state, which can be specifically configured according to the requirements of the fault injection test, and then an abnormality is detected, which means that the virtual machine enters a fault state (S4).
[0201] The online test of the running virtual machine can be specifically configured according to the online test requirements, and then the virtual machine enters the fault state (S4) when an abnormality is detected.
[0202] S403: Determine whether the transition of the virtual machine that has entered the fault state from the running state to the exited state satisfies a second transition condition.
[0203] Determine whether the transition condition of the virtual machine from the running state to the exiting state satisfies the corresponding second transition condition. If so, execute step S404a; if not, execute step S404b to maintain the previous state.
[0204] In some embodiments, the second conversion condition includes but is not limited to virtual machine data structure pointer type validity or virtual machine data structure pointer range validity.
[0205] S404a: Respond to the second conversion instruction to make the virtual machine enter the exit state, and obtain the end time of the running state.
[0206] If the second conversion condition is met, the virtual machine is controlled to enter the exit state in response to the generated second conversion instruction, and the end time of the running state, ie, T22, is recorded at the same time.
[0207] In some embodiments, after the end time of the running state is obtained, ie, T22, the virtual machine is further tested online, and an abnormality is detected and the virtual machine enters a fault state (S4).
[0208] S404b: Keep the virtual machine running.
[0209] S405: Determine whether the time difference between the end time of the running state and the start time of the running state is less than or equal to a third preset time length.
[0210] Determine whether T22-T21 is less than or equal to the third preset time. If it is determined that T22-T21 is less than or equal to the third preset time, end the timeout monitoring of the state transition phase from S1 to S2, and execute step S306; if it is determined that T22-T21 is greater than the third preset time, indicating that the state transition from the running state to the exit state has timed out, control the virtual machine to enter the fault state, and execute step S407.
[0211] S406: End the lifecycle monitoring of the transition of the virtual machine from the running state to the exiting state.
[0212] S407: Control the virtual machine to enter a fault state.
[0213] The virtualization platform lifecycle monitoring method provided in the embodiment of the present application can effectively avoid unexpected conversion or conversion failure from the running state to the exit state caused by the virtualization platform configuration error through the start time, end time and test library in the conversion process of this stage. And combined with the configurable timeout time, such as the third preset time, it can support static configuration of different applications and different lifecycle conversion stages.
[0214] In a possible design, if the state transition process is transitioning from the exit state to the start state (S2→S0), a possible implementation of step S103 is as follows: Figure 8 shown. Figure 8 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application. Figure 8 As shown, the embodiment of the present application includes:
[0215] S501: Obtain the start time when the virtual machine enters the exit state.
[0216] The virtual machine enters the exit state and records the start time T31 of the exit state.
[0217] S502: Perform a fault injection test and an online test on the virtual machine that has entered the exit state. When the virtual machine detects an abnormality, it enters the fault state.
[0218] A fault injection test is performed on the virtual machine in the exit state, which can be specifically configured according to the requirements of the fault injection test, and then an abnormality is detected, which is the fault state of entering the virtual machine (S4).
[0219] The online test of the virtual machine in the exit state can be specifically configured according to the online test requirements, and then the virtual machine enters the fault state when an abnormality is detected (S4).
[0220] S503: Determine whether the transition of the virtual machine that has entered the fault state from the exit state to the start state satisfies a third transition condition.
[0221] It is determined whether the transition condition of the virtual machine from the exit state to the start state satisfies the corresponding third transition condition. If so, step S504a is executed; if not, step S504b is executed to maintain the previous state.
[0222] In some embodiments, the third conversion condition includes but is not limited to whether the virtual machine ID number is correct, the type validity of the virtual machine configuration information, or the range validity of the virtual machine configuration information.
[0223] S504a: Respond to the third conversion instruction to enable the virtual machine to enter the startup state, and obtain the end time of the exit state.
[0224] If the third conversion condition is met, the virtual machine is controlled to enter the startup state in response to the generated third conversion instruction, and the end time of the exit state, ie, T32, is recorded at the same time.
[0225] In some embodiments, after the end time of the exit state, ie, T32, is obtained, the virtual machine is further tested online, and an abnormality is detected to enter the virtual machine failure state (S4).
[0226] S504b: Maintain the exit status of the virtual machine.
[0227] S505: Determine whether the time difference between the end time of the exit state and the start time of the exit state is less than or equal to a fourth preset time length.
[0228] Determine whether T32-T31 is less than or equal to the fourth preset time. If it is determined that T32-T31 is less than or equal to the fourth preset time, end the timeout monitoring of the state transition phase from S2 to S0, and execute step S406; if it is determined that T32-T31 is greater than the fourth preset time, it indicates that the state transition from the exit state to the start state has timed out, and the control virtual machine enters the fault state, and executes step S407.
[0229] S506: End the lifecycle monitoring of the transition of the virtual machine from the exit state to the start state.
[0230] S507: Control the virtual machine to enter a fault state.
[0231] The virtualization platform lifecycle monitoring method provided in the embodiment of the present application can effectively avoid unexpected conversion or conversion failure from the exit state to the startup state caused by virtualization platform configuration errors through the start time, end time and test library in the conversion process of this stage. In addition, combined with a configurable timeout time such as the fourth preset duration, static configuration of different applications and different lifecycle conversion stages can be supported.
[0232] In a possible design, if the state transition process is from the running state to the sleeping state (S1→S3), a possible implementation of step S103 is as follows: Fig. 9 shown. Fig. 9 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application. Fig. 9 As shown, the embodiment of the present application includes:
[0233] S601: Obtain the start time when the virtual machine enters the running state.
[0234] The virtual machine enters the running state and records the start time T41 of the running state.
[0235] S602: Perform a fault injection test and an online test on the virtual machine that has entered the running state. When the virtual machine detects an abnormality, it enters a fault state.
[0236] A fault injection test is performed on a virtual machine in a running state, which can be specifically configured according to the requirements of the fault injection test, and then an abnormality is detected, which means that the virtual machine enters a fault state (S4).
[0237] The online test of the running virtual machine can be specifically configured according to the online test requirements, and then the virtual machine enters the fault state (S4) when an abnormality is detected.
[0238] S603: Determine whether the transition of the virtual machine that has entered the fault state from the running state to the sleeping state satisfies a fourth transition condition.
[0239] Determine whether the transition condition of the virtual machine from the running state to the sleeping state satisfies the corresponding fourth transition condition. If so, execute step S604a; if not, execute step S604b to maintain the previous state.
[0240] In some embodiments, the fourth conversion condition includes but is not limited to virtual machine data structure pointer type validity or virtual machine data structure pointer range validity.
[0241] S604a: Respond to the fourth conversion instruction to make the virtual machine enter a dormant state, and obtain an end time of the running state.
[0242] If the fourth conversion condition is met, the virtual machine is controlled to enter a dormant state in response to the generated fourth conversion instruction, and the end time of the running state, ie, T42, is recorded at the same time.
[0243] In some embodiments, after the end time of the running state, ie, T42, is obtained, the virtual machine is further tested online, and an abnormality is detected and the virtual machine enters a fault state (S4).
[0244] S604b: Keep the virtual machine running.
[0245] S605: Determine whether the time difference between the end time of the running state and the start time of the running state is less than or equal to a fifth preset time length.
[0246] Determine whether T42-T41 is less than or equal to the fifth preset time. If it is determined that T42-T41 is less than or equal to the fifth preset time, end the timeout monitoring of the state transition phase from S1 to S3, and execute step S606; if it is determined that T42-T41 is greater than the fifth preset time, indicating that the state transition from the running state to the sleeping state has timed out, control the virtual machine to enter the fault state, and execute step S607.
[0247] S606: End the lifecycle monitoring of the transition of the virtual machine from the running state to the sleeping state.
[0248] S607: Control the virtual machine to enter a fault state.
[0249] The virtualization platform lifecycle monitoring method provided in the embodiment of the present application can effectively avoid unexpected conversion or conversion failure from the running state to the dormant state caused by virtualization platform configuration errors through the start time, end time and test library in the conversion process of this stage. In addition, combined with a configurable timeout time such as the fifth preset duration, static configuration of different applications and different lifecycle conversion stages can be supported.
[0250] In a possible design, if the state transition process is from the sleep state to the running state (S3→S1), a possible implementation of step S103 is as follows: Fig.10 shown. Fig.10 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application. Fig.10 As shown, the embodiment of the present application includes:
[0251] S701: Obtain the start time when the virtual machine enters the sleep state.
[0252] The virtual machine enters the sleep state and records the start time T51 of the sleep state.
[0253] S702: Perform a fault injection test and an online test on the virtual machine that has entered the dormant state. When the virtual machine detects an abnormality, it enters a fault state.
[0254] A fault injection test is performed on a dormant virtual machine, which can be specifically configured according to the requirements of the fault injection test, and then an abnormality is detected, which means that the virtual machine enters a fault state (S4).
[0255] The online test of the virtual machine in the dormant state can be specifically configured according to the online test requirements, and then the virtual machine enters the fault state (S4) when an abnormality is detected.
[0256] S703: Determine whether the transition of the virtual machine that has entered the fault state from the sleep state to the running state satisfies a fifth transition condition.
[0257] Determine whether the transition condition of the virtual machine from the sleep state to the running state meets the corresponding fifth transition condition. If so, execute step S704a; if not, execute step S704b to maintain the previous state.
[0258] In some embodiments, the fifth conversion condition includes but is not limited to virtual machine data structure pointer type validity or virtual machine data structure pointer range validity.
[0259] S704a: Respond to the fifth conversion instruction to enable the virtual machine to enter the running state, and obtain the end time of the sleep state.
[0260] If the fifth conversion condition is met, the virtual machine is controlled to enter the running state in response to the generated fifth conversion instruction, and the end time of the sleep state, ie, T52, is recorded at the same time.
[0261] In some embodiments, after the end time of the sleep state, ie, T52, is obtained, the virtual machine is further tested online, and an abnormality is detected to enter the virtual machine failure state (S4).
[0262] S704b: Keep the virtual machine in a dormant state.
[0263] S705: Determine whether the time difference between the end time of the sleep state and the start time of the sleep state is less than or equal to a sixth preset time length.
[0264] Determine whether T52-T51 is less than or equal to the sixth preset time. If it is determined that T52-T51 is less than or equal to the sixth preset time, end the timeout monitoring of the state transition phase from S3 to S1, and execute step S706; if it is determined that T52-T51 is greater than the sixth preset time, indicating that the state transition from the sleep state to the running state has timed out, control the virtual machine to enter the fault state, and execute step S707.
[0265] S706: End the lifecycle monitoring of the transition of the virtual machine from the sleep state to the running state.
[0266] S707: Control the virtual machine to enter a fault state.
[0267] The virtualization platform lifecycle monitoring method provided in the embodiment of the present application can effectively avoid unexpected conversion or conversion failure from the dormant state to the running state caused by virtualization platform configuration errors through the start time, end time and test library in the conversion process of this stage. In addition, combined with a configurable timeout time such as the fifth preset duration, it can support static configuration of different applications and different lifecycle conversion stages.
[0268] In a possible design, if the state transition process is transitioning from the fault state to the exit state (S4→S2), a possible implementation of step S103 is as follows: Fig.11 shown. Fig.11 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application. Fig.11 As shown, the embodiment of the present application includes:
[0269] S801: Obtain the start time when the virtual machine enters a fault state.
[0270] The virtual machine enters a fault state and records the start time T61 of the fault state.
[0271] S802: Perform a fault injection test and an online test on the virtual machine that has entered a fault state to trigger the virtual machine to reset external hardware.
[0272] A fault injection test is performed on a virtual machine in a fault state, which can be specifically configured according to the requirements of the fault injection test, and then an abnormality is detected to trigger an external hardware reset.
[0273] The online test of the running virtual machine can be configured according to the online test requirements, and then an abnormality is detected to trigger an external hardware reset.
[0274] S803: Determine whether the transition of the virtual machine whose external hardware has been reset from the failure state to the exit state satisfies a sixth transition condition.
[0275] Determine whether the transition condition of the virtual machine from the fault state to the exit state satisfies the corresponding sixth transition condition. If so, execute step S804a; if not, execute step S804b to maintain the previous state.
[0276] In some embodiments, the sixth conversion condition includes but is not limited to the validity of the virtual machine data structure pointer type or the validity of the virtual machine data structure pointer range or the fault type is the first time that the program running fault is determined and the virtual machine needs to be restarted.
[0277] S804a: Respond to the sixth conversion instruction to make the virtual machine enter the exit state, and obtain the end time of the fault state.
[0278] If the sixth conversion condition is met, the virtual machine is controlled to enter the exit state in response to the generated sixth conversion instruction, and the end time of the fault state, ie, T62, is recorded at the same time.
[0279] In some embodiments, after the end time of the fault state is obtained, ie, T62, the virtual machine is further tested online, and an abnormality is detected to enter the virtual machine fault state (S4).
[0280] S784b: Maintain the fault state of the virtual machine.
[0281] S805: Determine whether the time difference between the end time of the fault state and the start time of the fault state is less than or equal to a seventh preset time length.
[0282] Determine whether T62-T61 is less than or equal to the seventh preset time. If it is determined that T62-T61 is less than or equal to the seventh preset time, end the timeout monitoring of the state transition phase from S4 to S2, and execute step S806; if it is determined that T62-T61 is greater than the seventh preset time, indicating that the state transition from the fault state to the exit state has timed out, control the virtual machine to enter the fault state, and execute step S807.
[0283] S806: End the lifecycle monitoring of the transition of the virtual machine from the failure state to the exit state.
[0284] S807: Control the virtual machine to enter a fault state.
[0285] The virtualization platform lifecycle monitoring method provided in the embodiment of the present application can effectively avoid unexpected conversion or conversion failure from the fault state to the exit state caused by the virtualization platform configuration error through the start time, end time and test library in the conversion process of this stage. And combined with the configurable timeout time, such as the fifth preset time, it can support static configuration of different applications and different lifecycle conversion stages.
[0286] In some embodiments, arbitration judgment can also be used to monitor the life cycle of the virtual machine, and specifically to monitor the scenarios in which the program fails to run, so that arbitration judgment can be used to make final processing strategy decisions from various dimensions of software systemic failure, as well as time timeouts, sleep and wake-up exceptions, etc.
[0287] In a possible design, a possible implementation method of monitoring the life cycle of a virtual machine through arbitration is as follows: Fig.12 shown. Fig.12 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application. Fig.12 As shown, the embodiment of the present application includes:
[0288] S901: Obtain the previous life cycle state and the next life cycle state of the current life cycle state of the virtual machine and the historical conversion conditions.
[0289] The historical transition condition is a transition condition when a previous life cycle state is transitioned to a next life cycle state.
[0290] Get the previous life cycle state, the next life cycle state, and the transition conditions between the previous and next life cycle states of the current life cycle state of the virtual machine.
[0291] S902: Determine whether the history conversion condition is correct.
[0292] It is determined whether the historical conversion condition is correct. If it is correct, step S803 is further executed to perform the next level of judgment. Otherwise, if the historical conversion condition is wrong, the fault state is directly output, and the virtual machine fault state is entered according to the fault state determined by arbitration, that is, step S808 is executed. Step S802 is a post-judgment based on the previous and next states and the conversion condition, which can effectively avoid unexpected state conversion.
[0293] S903: Determine whether the program is running in an infinite loop.
[0294] Determine whether the program is running in an infinite loop. If so, directly output the fault state, enter the virtual machine fault state according to the fault state determined by arbitration, and execute step S908. If not, enter the next level of judgment, and execute step S904. The infinite loop detection in step S903 can effectively avoid state transition failure and transition timeout.
[0295] S904: Determine whether there is a program running failure.
[0296] Among them, program operation failures include abnormal interruption or abnormal exit.
[0297] Determine whether the program has an abnormal interruption or abnormal exit. If so, directly output the fault state, enter the fault state of the virtual machine according to the fault state determined by arbitration, and execute step S908. If not, enter the next level of judgment, and execute step S905. Among them, abnormal interruption or abnormal exit may cause program execution abnormality and hinder the real-time execution of normal programs. Through abnormal interruption and abnormal exit detection, unexpected program execution and program timeout can be effectively avoided.
[0298] S905: Determine whether the previous life cycle state ends normally.
[0299] Determine whether the previous life cycle state is a normal end. If it is an abnormal end, directly output the fault state, and enter the fault state of the virtual machine according to the fault state determined by arbitration, that is, execute step S808. If it is a normal end, enter the next level of judgment, that is, execute step S806. The normal end detection of the previous life cycle state can effectively avoid the abnormal state of multiple states existing at the same time.
[0300] S906: Determine whether the next life cycle state starts normally.
[0301] It is determined whether the next life cycle state is started normally. If it cannot be started normally, the fault state is directly outputted. According to the fault state determined by arbitration, the virtual machine fault state is entered, and step S908 is executed. If it is started normally, step S907 is executed to end the life cycle monitoring of the virtual machine when the program fails to run. The detection of whether the next life cycle state is started normally in step S906 can effectively avoid the abnormal state where neither the previous state nor the next state exists.
[0302] S907: End the life cycle monitoring of the virtual machine when the program fails to run.
[0303] S908: Generate a fault instruction, and respond to the fault instruction to make the virtual machine enter a fault state.
[0304] As described in the above steps, if it is determined that the historical conversion condition is incorrect, the program is running in an infinite loop, the program has a program running failure, the previous life cycle state ends abnormally, or the next life cycle state starts abnormally, a fault instruction is generated, and the virtual machine enters a fault state in response to the fault instruction.
[0305] The virtualization platform lifecycle monitoring method provided in the embodiment of the present application monitors the lifecycle of the virtual machine through arbitration judgment, and can specifically monitor the scenario of program failure, so that the arbitration judgment can be used to make the final processing strategy decision from various dimensions of software system failure, time timeout, sleep and wake-up exceptions, etc.
[0306] In some embodiments, the safe working state is not a unique fixed state, and the most appropriate state needs to be considered as a whole based on the upper-level application scenarios and business needs. As the underlying basic platform, the final safe working state of the Hypervisor can usually be achieved by notifying the external independent MCU, watchdog, etc. through effective means to inform that the system is currently in a serious abnormal state or to notify the external hardware to restart. Therefore, the virtualization platform lifecycle monitoring method provided in the embodiment of the present application may also include possible implementation methods for making the virtual machine enter a safe working state from a fault state, such as Fig.13 shown. Fig.13 A flowchart of another virtualization platform lifecycle monitoring method provided in an embodiment of the present application is shown as follows: Fig.13 As shown, the embodiment of the present application includes:
[0307] S1001: Obtain the fault source of the virtual machine entering a fault state after detecting an abnormality.
[0308] S1002: Restart the external hardware according to the fault source, so that the virtual machine enters a safe working state according to the application scenario.
[0309] As can be seen from the description of the aforementioned embodiments, the fault sources for the virtual machine to enter the fault state (S4) after detecting an abnormality may include the following: 1. Arbitration determines that the virtual machine state changes unexpectedly, the virtual machine state changes fail, the sleep or wake-up exception occurs, etc., and the program running fault state is output to trigger the life cycle state to enter S4; 2. According to the start and end time of the state transition, it is judged that the set time is exceeded, and the timeout fault state is output to trigger the life cycle state to enter S4; 3. According to the fault injection test results, if there are interrupt exceptions, memory exceptions, clock exceptions, etc., the fault injection test fails to trigger the life cycle state to enter S4; 4. According to the online test results, if there are lockstep exceptions, memory self-test exceptions, register test exceptions, etc., the online test fails to trigger the life cycle state to enter S4.
[0310] Determine the source of the fault that caused the virtual machine to enter a faulty state, and then restart the external hardware according to the source of the fault, so that the virtual machine enters a safe working state according to the application scenario.
[0311] For example, if the source of the fault is that the maximum allowable time for system fault processing is exceeded, the external hardware such as the security MCU or the watchdog is directly notified that it is in a fault state, and the external hardware can choose to restart the whole system or other effective means according to the overall requirements of the system, wherein the maximum allowable time for system fault processing includes a first preset time, a second preset time, a third preset time, a fourth preset time, a fifth preset time, a sixth preset time and a seventh preset time; if the source of the fault is that a single fault injection test fails, the external hardware such as the security MCU or the watchdog is directly notified that it is in a fault state, and the external hardware can choose to restart the whole system or other effective means according to the overall requirements of the system; if the source of the fault is that the online test fails, the external hardware such as the security MCU or the watchdog is notified that it is in a fault state, and the subsequent processing is selected by the system level according to the overall business function and scenario; if the source of the fault is a program running fault identified by arbitration, the virtual machine can be restarted first, and it can be determined whether the fault can be recovered. If it can be recovered, the fault state (S4) is converted to the exit state (S2), and then the normal life cycle state conversion of the virtual machine startup state and the virtual machine running state is entered. Furthermore, if the virtual machine still cannot be restored after restarting after the above-mentioned fault source is determined, the external hardware such as the security MCU or watchdog is directly notified that it is in a fault state. The external hardware can choose to restart the whole system or other effective means according to the overall needs of the system.
[0312] The virtualization platform lifecycle monitoring method provided in the embodiment of the present application can, after realizing security monitoring of the entire lifecycle of the virtual machine, also make the virtual machine enter a safe working state with the help of external hardware (an independent security device) according to specific application scenarios and system requirements, thereby improving the practicality of the virtualization platform lifecycle monitoring method.
[0313] Fig.14 The present invention provides a schematic diagram of a virtualization platform lifecycle monitoring device structure, wherein the virtualization platform includes a virtual machine. Fig.14 As shown, the virtualization platform lifecycle monitoring device 1000 provided in the embodiment of the present application includes:
[0314] The first acquisition module 1001 is used to acquire the life cycle state of the virtual machine, where the life cycle state includes the startup state of the virtual machine, the running state of the virtual machine, the exit state of the virtual machine, the sleep state of the virtual machine, and the fault state of the virtual machine;
[0315] The second acquisition module 1002 is used to acquire the state transition process between life cycle states, where the state transition process includes one of the following: transition from the startup state to the running state, transition from the running state to the exit state, transition from the exit state to the startup state, transition between the running state and the sleep state, and transition from the fault state to the exit state;
[0316] The monitoring module 1003 is used to monitor the life cycle of the virtual machine according to the state transition process and the test library, and the test library includes fault injection testing and online testing.
[0317] In a possible design, if the state transition process is transitioning from the startup state to the running state, the monitoring module 1003 is specifically used to:
[0318] Responding to the configuration instruction, configuring the virtual machine, and obtaining a first timing, where the first timing is the configuration start time;
[0319] Perform a power-on self-test on the configured virtual machine, and obtain post-self-test status data according to the power-on self-test items of the virtual machine;
[0320] If it is determined according to the status data that the virtual machine power-on self-test has passed, respond to the startup instruction to make the virtual machine enter the startup state, and obtain a second timing and a third timing, where the second timing and the third timing are respectively the end time of the power-on self-test and the start time of the startup state;
[0321] Perform fault injection testing and online testing on virtual machines that have entered the startup state. When the virtual machine detects an abnormality, it enters the fault state.
[0322] If it is determined that the transition of the virtual machine that has entered the fault state from the startup state to the running state satisfies the first transition condition, respond to the first transition instruction to make the virtual machine enter the running state, and obtain a fourth timing, where the fourth timing is the end time of the startup state;
[0323] The life cycle of the virtual machine is monitored according to the third timing and the fourth timing.
[0324] In a possible design, the monitoring module 1003 is further used for:
[0325] If it is determined that the time difference between the fourth timing and the third timing is less than or equal to the second preset duration, the life cycle monitoring of the virtual machine transitioning from the startup state to the running state is terminated.
[0326] In a possible design, if it is determined that the time difference between the fourth timing and the third timing is greater than the second preset duration, the monitoring module 1003 is also used to: control the virtual machine to enter a fault state.
[0327] In a possible design, the monitoring module 1003 is further used for:
[0328] If it is determined that the time difference between the second timing and the first timing is less than or equal to the first preset duration, life cycle monitoring of the virtual machine ends the configuration phase;
[0329] If it is determined that the time difference between the second timing and the first timing is greater than the first preset time length, the virtual machine is controlled to enter a safe state.
[0330] In a possible design, if the state transition process is transitioning from the running state to the exit state, the monitoring module 1003 is specifically configured to:
[0331] Get the start time when the virtual machine enters the running state;
[0332] Perform fault injection testing and online testing on virtual machines that have entered the running state. When the virtual machine detects an abnormality, it enters the fault state;
[0333] If it is determined that the transition of the virtual machine that has entered the fault state from the running state to the exited state satisfies the second transition condition, respond to the second transition instruction to make the virtual machine enter the exited state, and obtain the end time of the running state;
[0334] If it is determined that the time difference between the end time of the running state and the start time of the running state is less than or equal to the third preset time length, the life cycle monitoring of the virtual machine transitioning from the running state to the exited state is terminated.
[0335] In a possible design, if it is determined that the time difference between the end time of the running state and the start time of the running state is greater than a third preset time length, the monitoring module is also used for 1003: controlling the virtual machine to enter a fault state.
[0336] In a possible design, if the state transition process is transitioning from the exit state to the start state, the monitoring module 1003 is specifically configured to:
[0337] Get the start time when the virtual machine enters the exit state;
[0338] Perform fault injection testing and online testing on virtual machines that enter the exit state. When a virtual machine detects an anomaly, it enters the fault state.
[0339] If it is determined that the transition of the virtual machine that has entered the fault state from the exit state to the start state satisfies the third transition condition, respond to the third transition instruction to make the virtual machine enter the start state, and obtain the end time of the exit state;
[0340] If it is determined that the time difference between the end time of the exit state and the start time of the exit state is less than or equal to the fourth preset time length, the life cycle monitoring of the virtual machine transitioning from the exit state to the start state is terminated.
[0341] In a possible design, if it is determined that the time difference between the end time of the exit state and the start time of the exit state is greater than a fourth preset time length, the monitoring module 1003 is further used to: control the virtual machine to enter a fault state.
[0342] In a possible design, if the state transition process is transitioning from the running state to the sleeping state, the monitoring module 1003 is specifically used to:
[0343] Get the start time when the virtual machine enters the running state;
[0344] Perform fault injection testing and online testing on virtual machines that have entered the running state. When the virtual machine detects an abnormality, it enters the fault state;
[0345] If it is determined that the transition of the virtual machine that has entered the fault state from the running state to the sleeping state satisfies the fourth transition condition, respond to the fourth transition instruction to make the virtual machine enter the sleeping state, and obtain the end time of the running state;
[0346] If it is determined that the time difference between the end time of the running state and the start time of the running state is less than or equal to the fifth preset time, the life cycle monitoring of the virtual machine switching from the running state to the sleep state is terminated.
[0347] In a possible design, if it is determined that the time difference between the end time of the running state and the start time of the running state is greater than the fifth preset time length, the monitoring device 1003 is also used to: control the virtual machine to enter a fault state.
[0348] In a possible design, if the state conversion process is from the sleep state to the running state, the monitoring device 1003 is further used to:
[0349] Get the start time when the virtual machine enters the sleep state;
[0350] Perform fault injection testing and online testing on the virtual machines that have entered the dormant state. When the virtual machine detects an abnormality, it enters the fault state;
[0351] If it is determined that the transition of the virtual machine that has entered the fault state from the sleep state to the running state satisfies the fifth transition condition, respond to the fifth transition instruction to make the virtual machine enter the running state, and obtain the end time of the sleep state;
[0352] If it is determined that the time difference between the end time of the sleep state and the start time of the sleep state is less than or equal to the sixth preset duration, the life cycle monitoring of the virtual machine transitioning from the sleep state to the running state is terminated.
[0353] In a possible design, if it is determined that the time difference between the end time of the sleep state and the start time of the sleep state is greater than a sixth preset duration, the monitoring device 1003 is further used to: control the virtual machine to enter a fault state.
[0354] In a possible design, if the state transition process is transitioning from a fault state to an exit state, the monitoring module 1003 is further configured to:
[0355] Get the start time when the virtual machine enters the fault state;
[0356] Perform fault injection testing and online testing on virtual machines that have entered a faulty state to trigger the virtual machines to reset external hardware;
[0357] If it is determined that the virtual machine whose external hardware has been reset switches from the fault state to the exit state, which satisfies the sixth switching condition, responding to the sixth switching instruction causes the virtual machine to enter the exit state, and obtaining the end time of the fault state;
[0358] If it is determined that the time difference between the end time of the fault state and the start time of the fault state is less than or equal to the seventh preset time length, the life cycle monitoring of the virtual machine transitioning from the fault state to the exit state is terminated.
[0359] In a possible design, if it is determined that the time difference between the end time of the fault state and the start time of the fault state is greater than a seventh preset time length, the monitoring module 1003 is further used to: control the virtual machine to enter a fault state.
[0360] In a possible design, if the virtual machine program fails to run, the virtualization platform lifecycle monitoring device 1000 further includes:
[0361] The arbitration module is used to monitor the life cycle of the virtual machine through arbitration judgment.
[0362] In a possible design, the arbitration module is specifically used for:
[0363] Obtain the previous life cycle state and the next life cycle state of the current life cycle state of the virtual machine and the historical conversion condition, the historical conversion condition being the conversion condition when the previous life cycle state is converted to the next life cycle state;
[0364] If it is determined that the historical conversion conditions are correct and that the program does not have an infinite loop, it is determined whether the program has a program operation failure, which includes an abnormal interruption or abnormal exit.
[0365] If not, and it is determined that the previous life cycle state is ended normally and the next life cycle state is started normally, the life cycle monitoring of the virtual machine when the program fails to run is terminated.
[0366] In a possible design, if it is determined that one of the historical conversion conditions is wrong, the program is in an infinite loop, the program has a program operation failure, the previous life cycle state ends abnormally, or the next life cycle state starts abnormally, the arbitration module is further used to:
[0367] A fault instruction is generated, and the fault instruction is responded to so that the virtual machine enters a fault state.
[0368] In a possible design, the virtualization platform lifecycle monitoring device 1000 further includes: a restart module, the restart module is used to:
[0369] Obtain the fault source of the virtual machine detecting an abnormality and entering a fault state;
[0370] Restart external hardware according to the fault source, so that the virtual machine enters a safe working state according to the application scenario.
[0371] The virtualization platform lifecycle monitoring device provided in the embodiment of the present application can execute the corresponding steps of the virtualization platform lifecycle monitoring method in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here.
[0372] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig.15 As shown, the electronic device 2000 may include: a processor 2001 , and a memory 2002 communicatively connected to the processor 2001 .
[0373] The memory 2002 is used to store programs. Specifically, the programs may include program codes, and the program codes include computer-executable instructions.
[0374] The memory 2002 may include a high-speed RAM memory, and may also include a non-volatile memory (NoN-volatile memory), such as at least one disk memory.
[0375] The processor 2001 is used to execute the computer execution instructions stored in the memory 2002 to implement the virtualization platform lifecycle monitoring method provided in the above embodiments.
[0376] The processor 2001 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0377] Optionally, the memory 2002 may be independent or integrated with the processor 2001. When the memory 2002 is a device independent of the processor 2001, the electronic device 2000 may further include:
[0378] The bus 2003 is used to connect the processor 2001 and the memory 2002. The bus can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.
[0379] Optionally, in a specific implementation, if the memory 2002 and the processor 2001 are integrated on a chip, the memory 2002 and the processor 2001 can communicate through an internal interface.
[0380] The present application also provides a computer-readable storage medium, which may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes. Specifically, the computer-readable storage medium stores computer execution instructions, and the computer execution instructions are used for each step of the method in the above embodiment.
[0381] The present application also provides a computer program product, including computer execution instructions, which implement the steps of the method in the above embodiment when executed by a processor.
[0382] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the claims.
[0383] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A virtualization platform life cycle monitoring method, characterized in that: The virtualization platform includes a virtual machine, and the method includes: Acquire the life cycle state of the virtual machine, wherein the life cycle state includes the startup state of the virtual machine, the running state of the virtual machine, the exit state of the virtual machine, the sleep state of the virtual machine, and the fault state of the virtual machine; Acquire a state transition process between the life cycle states, the state transition process comprising one of the transition from the startup state to the running state, the transition from the running state to the exit state, the transition from the exit state to the startup state, the transition between the running state and the sleep state, and the transition from the fault state to the exit state; The life cycle of the virtual machine is monitored according to the state transition process and the test library, and the test library includes a fault injection test and an online test.
2. The virtualization platform lifecycle monitoring method according to claim 1, characterized in that: If the state transition process is transitioning from the startup state to the running state, the life cycle monitoring of the virtual machine according to the state transition process and the test library includes: In response to the configuration instruction, the virtual machine is configured, and a first timing is obtained, where the first timing is a configuration start time; Performing a power-on self-test on the virtual machine that has completed configuration, and obtaining post-self-test status data according to the power-on self-test items of the virtual machine; If it is determined according to the state data that the virtual machine has passed the power-on self-test, respond to the start instruction to make the virtual machine enter the start state, and obtain a second timing and a third timing, where the second timing and the third timing are respectively the end time of the power-on self-test and the start time of the start state; Performing the fault injection test and the online test on the virtual machine that has entered the startup state, and entering the fault state when the virtual machine detects an abnormality; If it is determined that the transition of the virtual machine that has entered the fault state from the startup state to the running state satisfies a first transition condition, responding to a first transition instruction causes the virtual machine to enter the running state, and obtaining a fourth timing, where the fourth timing is the end time of the startup state; The life cycle of the virtual machine is monitored according to the third timing and the fourth timing.
3. The method for monitoring the life cycle of a virtualization platform according to claim 2, characterized in that: The performing life cycle monitoring on the virtual machine according to the third timing and the fourth timing includes: If it is determined that the time difference between the fourth timing and the third timing is less than or equal to the second preset duration, the life cycle monitoring of the virtual machine transitioning from the startup state to the running state is terminated.
4. The method for monitoring the life cycle of a virtualization platform according to claim 2, characterized in that: If it is determined that the time difference between the fourth timing and the third timing is greater than a second preset duration, the virtual machine is controlled to enter the fault state.
5. The method for monitoring the life cycle of a virtualization platform according to claim 2, characterized in that: Also includes: If it is determined that the time difference between the second timing and the first timing is less than or equal to the first preset duration, end the life cycle monitoring of the virtual machine configuration phase; If it is determined that the time difference between the second timing and the first timing is greater than the first preset time length, the virtual machine is controlled to enter a safe state.
6. The method for monitoring the life cycle of a virtualization platform according to claim 1, characterized in that: If the state transition process is the transition from the running state to the exiting state, the life cycle monitoring of the virtual machine according to the state transition process and the test library includes: Obtaining the start time when the virtual machine enters the running state; Performing the fault injection test and the online test on the virtual machine that has entered the running state, and entering the fault state when the virtual machine detects an abnormality; If it is determined that the transition of the virtual machine that has entered the fault state from the running state to the exited state satisfies a second transition condition, responding to a second transition instruction causes the virtual machine to enter the exited state, and obtaining an end time of the running state; If it is determined that the time difference between the end time of the running state and the start time of the running state is less than or equal to the third preset duration, the life cycle monitoring of the virtual machine transitioning from the running state to the exit state is terminated.
7. The method for monitoring the life cycle of a virtualization platform according to claim 6, characterized in that: If it is determined that the time difference between the end time of the running state and the start time of the running state is greater than a third preset time length, the virtual machine is controlled to enter the fault state.
8. The method for monitoring the life cycle of a virtualization platform according to claim 1, characterized in that: If the state transition process is transition from the exit state to the start state, the life cycle monitoring of the virtual machine according to the state transition process and the test library includes: Obtaining the start time when the virtual machine enters the exit state; Performing the fault injection test and the online test on the virtual machine that has entered the exit state, and entering the fault state when the virtual machine detects an abnormality; If it is determined that the transition of the virtual machine that has entered the fault state from the exit state to the start state satisfies a third transition condition, responding to a third transition instruction causes the virtual machine to enter the start state, and obtaining an end time of the exit state; If it is determined that the time difference between the end time of the exit state and the start time of the exit state is less than or equal to a fourth preset duration, the life cycle monitoring of the virtual machine transitioning from the exit state to the startup state is terminated.
9. The method for monitoring the life cycle of a virtualization platform according to claim 8, characterized in that: If it is determined that the time difference between the end time of the exit state and the start time of the exit state is greater than a fourth preset time length, the virtual machine is controlled to enter the fault state.
10. The method for monitoring the life cycle of a virtualization platform according to claim 1, characterized in that: If the state transition process is transitioning from the running state to the sleeping state, the life cycle monitoring of the virtual machine according to the state transition process and the test library includes: Obtaining the start time when the virtual machine enters the running state; Performing the fault injection test and the online test on the virtual machine that has entered the running state, and entering the fault state when the virtual machine detects an abnormality; If it is determined that the transition of the virtual machine that has entered the fault state from the running state to the sleep state satisfies a fourth transition condition, responding to a fourth transition instruction causes the virtual machine to enter the sleep state, and obtaining an end time of the running state; If it is determined that the time difference between the end time of the running state and the start time of the running state is less than or equal to the fifth preset duration, the life cycle monitoring of the virtual machine transitioning from the running state to the sleep state is terminated.
11. The method for monitoring the life cycle of a virtualization platform according to claim 10, characterized in that: If it is determined that the time difference between the end time of the running state and the start time of the running state is greater than a fifth preset time length, the virtual machine is controlled to enter the fault state.
12. The method for monitoring the life cycle of a virtualization platform according to claim 1, characterized in that: If the state transition process is transitioning from the dormant state to the running state, the life cycle monitoring of the virtual machine according to the state transition process and the test library includes: Obtaining the start time when the virtual machine enters the sleep state; Performing the fault injection test and the online test on the virtual machine that has entered the dormant state, and entering the fault state when the virtual machine detects an abnormality; If it is determined that the transition of the virtual machine that has entered the fault state from the sleep state to the running state satisfies a fifth transition condition, responding to a fifth transition instruction causes the virtual machine to enter the running state, and obtaining an end time of the sleep state; If it is determined that the time difference between the end time of the sleep state and the start time of the sleep state is less than or equal to the sixth preset duration, the life cycle monitoring of the virtual machine transitioning from the sleep state to the running state is terminated.
13. The method for monitoring the life cycle of a virtualization platform according to claim 12, characterized in that: If it is determined that the time difference between the end time of the sleep state and the start time of the sleep state is greater than a sixth preset time length, the virtual machine is controlled to enter the fault state.
14. The method for monitoring the life cycle of a virtualization platform according to claim 1, characterized in that: If the state transition process is transition from the fault state to the exit state, the life cycle monitoring of the virtual machine according to the state transition process and the test library includes: Obtaining the start time when the virtual machine enters the fault state; Performing the fault injection test and the online test on the virtual machine that has entered the fault state to trigger the virtual machine to reset external hardware; If it is determined that the virtual machine that has reset the external hardware switches from the fault state to the exit state satisfies a sixth switching condition, respond to a sixth switching instruction to make the virtual machine enter the exit state, and obtain an end time of the fault state; If it is determined that the time difference between the end time of the fault state and the start time of the fault state is less than or equal to the seventh preset time duration, the life cycle monitoring of the virtual machine transitioning from the fault state to the exit state is terminated.
15. The method for monitoring the life cycle of a virtualization platform according to claim 14, characterized in that: If it is determined that the time difference between the end time of the fault state and the start time of the fault state is greater than a seventh preset time length, the virtual machine is controlled to enter the fault state.
16. The method for monitoring the life cycle of a virtualization platform according to claim 1, characterized in that: Also includes: The life cycle of the virtual machine is monitored through arbitration judgment.
17. The method for monitoring the life cycle of a virtualization platform according to claim 16, characterized in that: The monitoring of the life cycle of the virtual machine through arbitration judgment includes: Obtaining a previous life cycle state and a subsequent life cycle state of the current life cycle state of the virtual machine and a historical conversion condition, wherein the historical conversion condition is a conversion condition when the previous life cycle state is converted to the subsequent life cycle state; If it is determined that the historical conversion condition is correct and it is determined that the program does not have an infinite loop, then it is determined whether the program has a program running fault, wherein the program running fault includes an abnormal interruption phenomenon or an abnormal exit phenomenon; If not, and it is determined that the previous life cycle state is a normal end and the subsequent life cycle state is a normal start, then the life cycle monitoring of the virtual machine when the program fails to run is terminated.
18. The method for monitoring the life cycle of a virtualization platform according to claim 17, characterized in that: If it is determined that the historical conversion condition is wrong, the program is in an infinite loop, the program has a program running failure, the previous life cycle state ends abnormally, or the next life cycle state starts abnormally, a fault instruction is generated, and the virtual machine enters the fault state in response to the fault instruction.
19. The method for monitoring the lifecycle of a virtualization platform according to any one of claims 1 to 18, characterized in that: Also includes: Obtaining a fault source in which the virtual machine enters the fault state after detecting an abnormality; The external hardware is restarted according to the fault source, so that the virtual machine enters a safe working state according to the application scenario.
20. A virtualization platform life cycle monitoring device, characterized in that: The virtualization platform includes a virtual machine, and the device includes: A first acquisition module is used to acquire the life cycle state of the virtual machine, wherein the life cycle state includes the startup state of the virtual machine, the running state of the virtual machine, the exit state of the virtual machine, the sleep state of the virtual machine and the fault state of the virtual machine; A second acquisition module is used to acquire a state transition process between the life cycle states, wherein the state transition process includes one of the transition from the startup state to the running state, the transition from the running state to the exit state, the transition from the exit state to the startup state, the transition between the running state and the sleep state, and the transition from the fault state to the exit state; A monitoring module is used to monitor the life cycle of the virtual machine according to the state transition process and the test library, wherein the test library includes a fault injection test and an online test.
21. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the virtualization platform lifecycle monitoring method according to any one of claims 1 to 19.
22. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the virtualization platform lifecycle monitoring method according to any one of claims 1 to 19.
23. A computer program product, comprising computer executable instructions, which are used to implement the virtualization platform lifecycle monitoring method according to any one of claims 1 to 19 when executed by a processor.
Citation Information
Patent Citations
Method and device for managing state of virtual machine and intelligent terminal
CN107810488A
Method based on distributed fault monitoring and virtual machine high-availability system
CN111953566A
Virtualization platform reliability test method and system, terminal and storage medium
CN111966599A
Operation rate management method, operation rate management program, and operation rate management device for virtualization system
JP2015215857A
Failure recovery testing framework for microservice-based applications
US20170242784A1
