CN117193932A - Hypervisor-based virtual core monitoring method and device and electronic equipment - Google Patents

Hypervisor-based virtual core monitoring method and device and electronic equipment Download PDF

Info

Publication number
CN117193932A
CN117193932A CN202310955988.6A CN202310955988A CN117193932A CN 117193932 A CN117193932 A CN 117193932A CN 202310955988 A CN202310955988 A CN 202310955988A CN 117193932 A CN117193932 A CN 117193932A
Authority
CN
China
Prior art keywords
virtual core
virtual
timer
core
abnormal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310955988.6A
Other languages
Chinese (zh)
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongling Zhixing Chengdu Technology Co ltd
Original Assignee
Zhongling Zhixing Chengdu Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongling Zhixing Chengdu Technology Co ltd filed Critical Zhongling Zhixing Chengdu Technology Co ltd
Priority to CN202310955988.6A priority Critical patent/CN117193932A/en
Publication of CN117193932A publication Critical patent/CN117193932A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application relates to a method and a device for monitoring virtual cores based on hypervisors and electronic equipment, wherein the method comprises the steps of maintaining a corresponding timer for each virtual core on embedded equipment after a Hypervisor of a virtual machine is started; each virtual core updates the value of the timer to be the current time according to a fixed time interval; periodically checking whether the value of the timer of each virtual core changes; wherein the periodic inspection time interval is greater than the fixed time interval; and if the value of the timer of the virtual core is unchanged, determining that the virtual core is abnormal. In the scheme, the abnormal condition can be more accurately positioned and processed by monitoring the state of each virtual core, and the stability and reliability of the system are improved.

Description

Hypervisor-based virtual core monitoring method and device and electronic equipment
Technical Field
The present application relates to the field of computers, and in particular, to a Hypervisor-based virtual core monitoring method and apparatus, and an electronic device.
Background
With the widespread use of virtualization technology, multiple virtual machines may be simultaneously running on a single embedded device, and each virtual machine may have multiple virtual cores. To ensure proper operation of the virtual machine, it becomes critical to monitor the state of the virtual cores. Currently, most existing monitoring systems are based on monitoring the overall state of a virtual machine, and lack fine-grained monitoring of virtual cores. Thus, a solution is needed that is capable of monitoring the state of each virtual core.
Disclosure of Invention
The application aims to provide a method and a device for monitoring virtual cores based on hypervisors and electronic equipment, which are used for providing a solution capable of monitoring the state of each virtual core.
In order to achieve the above object, a first aspect of the present application provides a Hypervisor-based virtual core monitoring method, including:
after the Hypervisor of the virtual machine is started, maintaining a corresponding timer for each virtual core on the embedded device;
each virtual core updates the value of the timer to be the current time according to a fixed time interval;
periodically checking whether the value of the timer of each virtual core changes; wherein the periodic inspection time interval is greater than the fixed time interval;
and if the value of the timer of the virtual core is unchanged, determining that the virtual core is abnormal.
Optionally, the method further comprises:
and when the virtual core is determined to be abnormal, sending an interrupt request to a physical core where the abnormal virtual core is located, and recording stack information of the physical core.
Optionally, the method further comprises:
and injecting a virtual interrupt request into the abnormal virtual core, and recording stack information of the abnormal virtual core.
Optionally, the method further comprises:
and restarting the virtual machine where the abnormal virtual core is located when the number of times that the virtual core continuously does not respond reaches a set number of times threshold.
Optionally, for the abnormal virtual core, if the abnormal virtual core responds again, the number of continuous non-response times corresponding to the virtual core is re-counted as 0.
A second aspect of the present application provides a virtual core monitoring apparatus, including:
the timer module is used for maintaining a corresponding timer for each virtual core on the embedded equipment after the Hypervisor of the virtual machine is started;
the timer updating module is used for updating the value of the timer to be the current time according to the fixed time interval;
a periodic checking module, configured to periodically check whether a value of a timer of each virtual core changes; wherein the periodic inspection time interval is greater than the fixed time interval;
and the abnormality monitoring module is used for determining that the virtual core is abnormal when the value of the timer of the virtual core is unchanged.
A third aspect of the application provides a non-transitory computer readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of the method of the first aspect.
A fourth aspect of the present application provides an electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of the first aspect.
In the embodiment of the application, the CPU core of each virtual machine is monitored through the simulation watchdog so as to ensure the normal operation of the virtual cores. The system maintains a timer TICK_TIME for each virtual core after Hypervisor is started, and checks the response of each virtual core through the timer. When the virtual core does not respond, determining that the virtual core is abnormal. By monitoring the state of each virtual core, abnormal conditions can be more accurately positioned and handled, and the stability and reliability of the system are improved.
Additional features and advantages of the application will be set forth in the detailed description which follows.
Drawings
The accompanying drawings are included to provide a further understanding of the application, and are incorporated in and constitute a part of this specification, illustrate the application and together with the description serve to explain, without limitation, the application. In the drawings:
FIG. 1 is a flow diagram illustrating a virtual core monitoring method according to an example embodiment;
FIG. 2 is another flow diagram illustrating a virtual core monitoring method according to an example embodiment;
fig. 3 is a block diagram of a virtual core monitoring apparatus according to an example embodiment.
Detailed Description
The following describes specific embodiments of the present application in detail with reference to the drawings. It should be understood that the detailed description and specific examples, while indicating and illustrating the application, are not intended to limit the application.
Referring to fig. 1, an embodiment of the present application provides a Hypervisor-based virtual core monitoring method, which is used for determining a response state of each virtual core when the Hypervisor (virtual machine monitor, english: virtual machine monitor, abbreviated as VMM) runs on the Hypervisor, so as to monitor a state of each virtual core. The method comprises the following steps.
Step 101, after the Hypervisor is started, maintaining a corresponding timer for each virtual core on the embedded device. In the embodiment of the present application, the timer is also called a time_time variable, and is used for recording the last TIME the corresponding virtual core has been written into the analog register.
Step 102, each virtual core updates the value of the timer to be the current time according to fixed time intervals. In step 102, each virtual core writes the current TIME to the analog register, i.e., updates the value of the time_time, such that the tick_time=current_time.
Step 103, periodically checking whether the value of the timer of each virtual core changes; wherein the periodic inspection time interval is greater than the fixed time interval. Assuming that the periodic inspection time interval is M seconds and the fixed time interval is N seconds, M > N.
And 104, if the value of the timer of the virtual core is unchanged, determining that the virtual core is abnormal.
In the embodiment of the application, the CPU core of each virtual machine is monitored through the simulation watchdog so as to ensure the normal operation of the virtual cores. The system maintains a device TICK_TIME for each virtual core after Hypervisor is started, and checks the response of each virtual core through a timer. When the virtual core does not respond, determining that the virtual core is abnormal. By monitoring the state of each virtual core, abnormal conditions can be more accurately positioned and handled, and the stability and reliability of the system are improved.
In the embodiment of the application, when the virtual core is found abnormal, the system sends an interrupt request (IPI) to the physical core where the virtual core is located, and records the relevant stack information so as to analyze and check faults.
In addition, the system may inject a virtual interrupt request (virtual IPI) to the virtual core and record stack information of the virtual core. By recording stack information of the virtual core and the physical core, the cause of the abnormal situation can be more accurately located and analyzed.
When the number X of continuous unresponsiveness of the virtual core is found to reach the set number threshold, the system will take measures to restart the virtual machine to resume the normal operation of the virtual core. The restart operation may be implemented by communicating with a virtual machine manager. Meanwhile, at any time, if the virtual core is found to respond again, x=0 is updated.
According to the embodiment of the application, through the virtual core monitoring system and the method, the abnormal condition of the virtual core can be found and processed in time, and the stability and the reliability of the virtual machine are ensured. In addition, the system can monitor the state of each virtual core in fine granularity, and take corresponding measures to perform fault treatment, so that the manageability and maintainability of the system are improved.
Next, a virtual core monitoring method in an embodiment of the present application will be described with reference to fig. 2. After the Hypervisor is started, the method includes the following steps.
Step 201, setting a TICK_TIME variable for each virtual core;
step 202, writing the current time into an analog register periodically;
step 203, starting a timer, wherein the interval of the timer is M seconds;
step 204, circularly detecting whether the time_time of each virtual core changes;
step 205, if the time_time is changed, returning to step 204; if TICK_TIME has not changed, step 206 is performed.
In step 206, the number of unresponsiveness times X of the virtual core is increased.
Step 207, judging whether X reaches a threshold; if so, go to step 208;
in step 208, the virtual machine is restarted, resetting X to 0.
And, if the time_time is unchanged in step 205, steps 209-212 may be performed.
Step 209, sending an IPI interrupt request to the physical core where the virtual core is located;
step 210, recording stack information of a physical core;
step 211, sending a virtual IPI interrupt to the virtual core;
in step 212, stack information of the virtual core is recorded.
In summary, the solution in the embodiment of the present application has at least the following technical effects.
Fine grain monitoring: by monitoring the state of each virtual core, abnormal conditions can be more accurately positioned and handled, and the stability and reliability of the system are improved.
Fast response: the system checks the response condition of the virtual core at regular time, and immediately takes measures when abnormality is found, so that the response time of fault processing is shortened.
And (3) fault analysis: the system records stack information of the virtual core and the physical core, is favorable for carrying out deep analysis and investigation on abnormal conditions, and improves the efficiency of fault processing.
Automatic restarting: when the number of times that the virtual core is not responded reaches the threshold value, the system automatically restarts the virtual machine, so that the requirement of manual intervention is reduced.
Therefore, by the virtual core monitoring method and the system in the embodiment of the application, the reliability and the stability of the system in the virtualized environment can be improved, and better support is provided for the application of the virtualized technology.
Based on the same inventive concept, an embodiment of the present application further provides a virtual core monitoring apparatus 300, as shown in fig. 3, where the apparatus 300 includes a timer module 301, configured to maintain a corresponding timer for each virtual core on the embedded device after the Hypervisor of the virtual machine is started; a timer updating module 302, configured to update the value of the timer to the current time at a fixed time interval; a periodic checking module 303, configured to periodically check whether a value of a timer of each virtual core changes; wherein the periodic inspection time interval is greater than the fixed time interval; the anomaly monitoring module 304 is configured to determine that the virtual core is anomalous when the value of the timer of the virtual core is unchanged.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
In another exemplary embodiment, a computer readable storage medium is also provided, comprising program instructions which, when executed by a processor, implement the steps of the virtual core monitoring method described above. For example, the computer readable storage medium may be the memory described above that includes program instructions executable by a processor of an electronic device to perform the virtual core monitoring method described above.
In another exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program executable by a programmable apparatus, the computer program having code portions for performing the virtual core monitoring method described above when executed by the programmable apparatus.
In another exemplary embodiment, the present application also provides an electronic device, including: a storage medium having a computer program stored thereon; and a processor for executing the computer program in the storage medium to implement the steps of the virtual core monitoring method.
The preferred embodiments of the present application have been described in detail above with reference to the accompanying drawings, but the present application is not limited to the specific details of the above embodiments, and various simple modifications can be made to the technical solution of the present application within the scope of the technical concept of the present application, and all the simple modifications belong to the protection scope of the present application.
In addition, the specific features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various possible combinations are not described further.
Moreover, any combination of the various embodiments of the present application can be made, as long as it does not depart from the gist of the present application, which is also regarded as the content of the present application.

Claims (8)

1. The virtual core monitoring method based on the Hypervisor is characterized by comprising the following steps of:
after the Hypervisor of the virtual machine is started, maintaining a corresponding timer for each virtual core on the embedded device;
each virtual core updates the value of the timer to be the current time according to a fixed time interval;
periodically checking whether the value of the timer of each virtual core changes; wherein the periodic inspection time interval is greater than the fixed time interval;
and if the value of the timer of the virtual core is unchanged, determining that the virtual core is abnormal.
2. The method of claim 1, wherein the method further comprises:
and when the virtual core is determined to be abnormal, sending an interrupt request to a physical core where the abnormal virtual core is located, and recording stack information of the physical core.
3. The method of claim 1, wherein the method further comprises:
and injecting a virtual interrupt request into the abnormal virtual core, and recording stack information of the abnormal virtual core.
4. The method of claim 1, wherein the method further comprises:
and restarting the virtual machine where the abnormal virtual core is located when the number of times that the virtual core continuously does not respond reaches a set number of times threshold.
5. The method of claim 1, wherein for an abnormal virtual core, if the abnormal virtual core responds again, the number of consecutive unresponsiveness times corresponding to the virtual core is recalculated to 0.
6. A virtual core monitoring apparatus, comprising:
the timer module is used for maintaining a corresponding timer for each virtual core on the embedded equipment after the Hypervisor of the virtual machine is started;
the timer updating module is used for updating the value of the timer to be the current time according to the fixed time interval;
a periodic checking module, configured to periodically check whether a value of a timer of each virtual core changes; wherein the periodic inspection time interval is greater than the fixed time interval;
and the abnormality monitoring module is used for determining that the virtual core is abnormal when the value of the timer of the virtual core is unchanged.
7. A non-transitory computer readable storage medium having stored thereon a computer program, characterized in that the program when executed by a processor realizes the steps of the method according to any of claims 1-5.
8. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any one of claims 1-5.
CN202310955988.6A 2023-07-31 2023-07-31 Hypervisor-based virtual core monitoring method and device and electronic equipment Pending CN117193932A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310955988.6A CN117193932A (en) 2023-07-31 2023-07-31 Hypervisor-based virtual core monitoring method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310955988.6A CN117193932A (en) 2023-07-31 2023-07-31 Hypervisor-based virtual core monitoring method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN117193932A true CN117193932A (en) 2023-12-08

Family

ID=88989549

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310955988.6A Pending CN117193932A (en) 2023-07-31 2023-07-31 Hypervisor-based virtual core monitoring method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN117193932A (en)

Similar Documents

Publication Publication Date Title
CN109032822B (en) Method and device for storing crash information
CN104636221B (en) Computer system fault processing method and device
US11853150B2 (en) Method and device for detecting memory downgrade error
CN114816022B (en) Method, system and storage medium for monitoring server power supply abnormality
CN115543740A (en) Method, system, equipment and storage medium for monitoring abnormal operation of service
US20050033952A1 (en) Dynamic scheduling of diagnostic tests to be performed during a system boot process
CN114385418A (en) Protection method, device, equipment and storage medium for communication equipment
US9411666B2 (en) Anticipatory protection of critical jobs in a computing system
CN107818034B (en) Method and device for monitoring running space of process in computer equipment
CN117193932A (en) Hypervisor-based virtual core monitoring method and device and electronic equipment
CN115576734B (en) Multi-core heterogeneous log storage method and system
JP2010039987A (en) Computer system, method for processing failure of hardware, and program
CN113868001B (en) Method, system and computer storage medium for checking memory repair result
US20130055017A1 (en) Device and method for restoring information in a main storage unit
US9176806B2 (en) Computer and memory inspection method
CN112231170B (en) Data interaction card supervision method, system, terminal and storage medium
CN116266150A (en) Service recovery method, data processing unit and related equipment
CN113703823A (en) BMC (baseboard management controller) firmware upgrading method and device, electronic equipment and storage medium
JP2012181737A (en) Computer system
CN111475335A (en) Method, system, terminal and storage medium for fast recovery of database
CN116483612B (en) Memory fault processing method, device, computer equipment and storage medium
JP2014203181A (en) Fault diagnosis device and program
CN113836035B (en) Battery management system testing method and device and electronic equipment
CN108415788B (en) Data processing apparatus and method for responding to non-responsive processing circuitry
JP5832408B2 (en) Virtual computer system and control method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination