CN109710378B - Virtual machine fault detection method - Google Patents
Virtual machine fault detection method Download PDFInfo
- Publication number
- CN109710378B CN109710378B CN201811547664.4A CN201811547664A CN109710378B CN 109710378 B CN109710378 B CN 109710378B CN 201811547664 A CN201811547664 A CN 201811547664A CN 109710378 B CN109710378 B CN 109710378B
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- picture
- desktop
- server
- normal
- 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.)
- Active
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Debugging And Monitoring (AREA)
- Image Analysis (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a fault detection method of a virtual machine, wherein a server creates a virtual machine template according to a parameter configuration file and a preset normal desktop picture, a terminal loads the virtual machine according to the virtual machine template, a client loads the configuration file, compares a current desktop screen capture picture of the virtual machine with the preset normal picture to obtain contrast difference data, and transmits the contrast difference data and the desktop screen capture picture to the server, and the server judges whether the virtual machine is normal or not according to the contrast difference data and the desktop screen capture picture. The invention compares the desktop screen capturing picture of the virtual machine with the normal desktop picture through the image histogram, the image equalization technology, the process detection and the socket data transmission, and judges whether the desktop of the virtual machine is normal or not according to the difference value and the screen capturing picture.
Description
Technical Field
The invention belongs to the technical field of cloud computing, and particularly relates to a fault detection method of a virtual machine.
Background
When the cloud desktops of the virtual machines are tested in batches, when the number of the virtual machines reaches hundreds or thousands of times, it is difficult to check whether the cloud desktop virtual machines are normally started one by manpower. The traditional method for ping the IP address of the virtual machine can only detect that the network of the virtual machine is normal, and can not detect when the desktop of the virtual machine has white screen, screen pattern or abnormal and wrong flick frame.
Disclosure of Invention
Accordingly, a primary object of the present invention is to provide a fault detection method for a virtual machine.
In order to achieve the above purpose, the technical scheme of the invention is realized as follows:
the embodiment of the invention provides a fault detection method of a virtual machine, which comprises the following steps: the method comprises the steps that a virtual machine template is created by a server according to a parameter configuration file and a preset normal desktop picture, a virtual machine is loaded by a terminal according to the virtual machine template, the configuration file is loaded by a client, a current desktop screen capturing picture of the virtual machine is compared with the preset normal picture to obtain comparison difference data, the comparison difference data and the desktop screen capturing picture are transmitted to the server, and whether the virtual machine is normal or not is judged by the server according to the comparison difference data and the desktop screen capturing picture.
In the above scheme, the terminal loads the virtual machine according to the virtual machine template, and the client loads the configuration file, and then the method further comprises: after the client detects that the virtual machine has started a specific program and has acquired an IP address, the virtual machine name, cpu, memory information are acquired and sent to the server.
In the above scheme, the comparison difference data is obtained by comparing the current desktop screen capturing picture of the virtual machine with the preset normal picture, specifically, the client captures the current desktop image through an imagegrab () method of the PIL library, and compares the current desktop screen capturing picture with the preset normal desktop picture through a histogram method to obtain the picture difference value a.
In the above scheme, the transmitting the contrast difference data and the desktop screenshot to the server is specifically: and sending the cloud desktop name, the current desktop screen capture picture and the difference value a of the virtual machine to a server through socket.
In the above scheme, the server judges whether the virtual machine is normal according to the contrast difference data and the desktop screenshot picture, specifically: and the server receives the desktop screen capturing picture, and the picture difference value a is larger than 0, so that the network of the virtual machine is confirmed to be normal but the desktop is abnormal.
In the above scheme, the server judges whether the virtual machine is normal according to the contrast difference data and the desktop screenshot picture, specifically: and the server receives the desktop screen capturing picture, and the picture difference value a is equal to 0, but cpu and memory information indicate that occupation is too large, and confirm that the load of the virtual machine is abnormal.
In the above scheme, the server judges whether the virtual machine is normal according to the contrast difference data and the desktop screenshot picture, specifically: and the server receives the desktop screen capturing picture, the picture difference value a is equal to 0, and the cpu and the memory information indicate normal, so that the virtual machine is confirmed to be normal.
In the above scheme, the method further comprises: and if the server does not receive the contrast difference data and the desktop screen capturing picture, confirming that the virtual machine is not started or the network is abnormal.
Compared with the prior art, the method and the device have the advantages that the desktop screen capturing picture of the virtual machine is compared with the normal desktop picture through the image histogram, the image equalization technology, the process detection and the socket data transmission, and whether the desktop of the virtual machine is normal or not is judged according to the difference value and the screen capturing picture.
Drawings
Fig. 1 is a flowchart of a fault detection method of a virtual machine according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the invention provides a fault detection method of a virtual machine, as shown in fig. 1, which is realized by the following steps:
step 101: the server creates a virtual machine template according to the parameter configuration file and a preset normal desktop picture;
specifically, a virtual machine template is created, a client program, a parameter configuration file and a preset normal desktop picture are placed in a specified directory, the client program is automatically operated after the starting-up is set, and virtual machines are created in batches through the virtual machine template.
The parameter configuration file comprises a server address, a port, a detection process name and waiting time.
Step 102: the terminal loads a virtual machine according to the virtual machine template, and the client loads a configuration file;
specifically, the client automatically runs and loads a parameter configuration file and a preset normal desktop picture; detecting whether a specific process of the virtual machine is started or not, and if the specific process is not started, waiting for a period of time and detecting again; and detecting whether the virtual machine network card is normal or not, acquiring the IP address, and waiting for a period of time to detect if the IP address is not acquired.
The specific process refers to reporting information to a server by means of the program.
After the client detects that the virtual machine has started a specific program and has acquired an IP address, the virtual machine name, cpu, memory information are acquired and sent to the server.
Step 103: the client compares the current desktop screen capturing picture of the virtual machine with a preset normal picture to obtain contrast difference data, and transmits the contrast difference data and the desktop screen capturing picture to a server;
specifically, the client intercepts a current desktop image through an imagegrab () method of a PIL library, and compares the current desktop screenshot picture with a preset normal desktop picture through a histogram method to obtain a picture difference value a.
And sending the cloud desktop name, the current desktop screen capture picture and the difference value a of the virtual machine to a server through socket.
Step 104: and the server judges whether the virtual machine is normal or not according to the contrast difference data and the desktop screen capturing picture.
Specifically, the server receives the desktop screenshot picture, and the picture difference value a is greater than 0, so as to confirm that the network of the virtual machine is normal but the desktop is abnormal.
And the server receives the desktop screen capturing picture, and the picture difference value a is equal to 0, but cpu and memory information indicate that occupation is too large, and confirm that the load of the virtual machine is abnormal.
And the server receives the desktop screen capturing picture, the picture difference value a is equal to 0, and the cpu and the memory information indicate normal, so that the virtual machine is confirmed to be normal.
And if the server does not receive the contrast difference data and the desktop screen capturing picture, confirming that the virtual machine is not started or the network is abnormal.
The above description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention.
Claims (5)
1. The fault detection method of the virtual machine is characterized by comprising the following steps: the method comprises the steps that a virtual machine template is created by a server according to a parameter configuration file and a preset normal desktop picture, a virtual machine is loaded by a terminal according to the virtual machine template, a configuration file is loaded by a client, a current desktop screen capturing picture of the virtual machine is compared with the preset normal picture to obtain contrast difference data, the contrast difference data and the desktop screen capturing picture are transmitted to the server, and whether the virtual machine is normal or not is judged by the server according to the contrast difference data and the desktop screen capturing picture; the terminal loads a virtual machine according to the virtual machine template, and the client loads a configuration file, and then the method further comprises the steps of: the client detects that the virtual machine has started a specific program and acquires the IP address, acquires the name of the virtual machine, CPU and memory information and sends the name, CPU and memory information to the server; the method comprises the steps that a current desktop screen capturing picture of a virtual machine is compared with a preset normal picture to obtain comparison difference data, specifically, the client captures a current desktop image through an imageGrab () method of a PIL library, and the current desktop screen capturing picture is compared with the preset normal desktop picture through a histogram method to obtain a picture difference value a; the step of transmitting the contrast difference data and the desktop screen capturing picture to a server comprises the following specific steps: and sending the cloud desktop name, the current desktop screen capture picture and the difference value a of the virtual machine to a server through socket.
2. The method for detecting a fault of a virtual machine according to claim 1, wherein the server judges whether the virtual machine is normal according to the contrast difference data and the desktop screenshot picture, specifically: and the server receives the desktop screen capturing picture, and the picture difference value a is larger than 0, so that the network of the virtual machine is confirmed to be normal but the desktop is abnormal.
3. The method for detecting a fault of a virtual machine according to claim 2, wherein the server judges whether the virtual machine is normal according to the contrast difference data and the desktop screenshot picture, specifically: and the server receives the desktop screen capturing picture, and the picture difference value a is equal to 0, but the CPU or the memory information indicates that the occupation is overlarge, and the load abnormality of the virtual machine is confirmed.
4. The method for detecting a failure of a virtual machine according to claim 3, wherein the server determines whether the virtual machine is normal according to the contrast difference data and the desktop screenshot, specifically: and the server receives the desktop screen capturing picture, the picture difference value a is equal to 0, and the cpu or the memory information indicates normal, so that the virtual machine is confirmed to be normal.
5. The method for detecting a failure of a virtual machine according to claim 4, further comprising: and if the server does not receive the contrast difference data and the desktop screen capturing picture, confirming that the virtual machine is not started or the network is abnormal.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811547664.4A CN109710378B (en) | 2018-12-18 | 2018-12-18 | Virtual machine fault detection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811547664.4A CN109710378B (en) | 2018-12-18 | 2018-12-18 | Virtual machine fault detection method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109710378A CN109710378A (en) | 2019-05-03 |
CN109710378B true CN109710378B (en) | 2023-06-02 |
Family
ID=66256729
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811547664.4A Active CN109710378B (en) | 2018-12-18 | 2018-12-18 | Virtual machine fault detection method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109710378B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113496477B (en) * | 2020-04-07 | 2024-07-23 | 华为技术有限公司 | Screen detection method and electronic equipment |
CN111880984A (en) * | 2020-06-09 | 2020-11-03 | 上海容易网电子商务股份有限公司 | Monitoring system for android interactive screen application running state |
CN111831373A (en) * | 2020-06-09 | 2020-10-27 | 上海容易网电子商务股份有限公司 | Detection processing method for application starting state of android interactive screen |
CN113849251B (en) * | 2020-06-28 | 2024-10-18 | 中兴通讯股份有限公司 | Virtual cloud desktop monitoring method, client, server and storage medium |
CN112463907A (en) * | 2020-12-07 | 2021-03-09 | 深圳市易售科技有限公司 | Method, device and system for positioning fault advertising machine and storage medium |
CN112991321A (en) * | 2021-04-08 | 2021-06-18 | 读书郎教育科技有限公司 | Detection method and system for flat screen-patterned test |
CN113419915B (en) * | 2021-07-21 | 2024-09-24 | 北京百度网讯科技有限公司 | Cloud terminal desktop static determination method and device |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017016212A1 (en) * | 2015-07-30 | 2017-02-02 | 中兴通讯股份有限公司 | Testing method and device for desktop cloud system |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8850429B2 (en) * | 2010-10-05 | 2014-09-30 | Citrix Systems, Inc. | Load balancing in multi-server virtual workplace environments |
US8700888B2 (en) * | 2011-01-27 | 2014-04-15 | Wyse Technology L.L.C. | Specific-purpose client with configuration history for self-provisioning of configuration and obviating reinstallation of embedded image |
US9183093B2 (en) * | 2013-12-05 | 2015-11-10 | Vmware, Inc. | Virtual machine crash management |
WO2015108283A1 (en) * | 2014-01-14 | 2015-07-23 | 에스케이플래닛 주식회사 | Application error detection method for cloud streaming service, and apparatus and system therefor |
JP6220079B2 (en) * | 2014-09-08 | 2017-10-25 | 日本電信電話株式会社 | Display control apparatus, display control method, and display control program |
CN105335214A (en) * | 2015-11-12 | 2016-02-17 | 国云科技股份有限公司 | Virtual machine failure detection and recovery method |
CN105872016B (en) * | 2016-03-17 | 2019-03-29 | 广东微云科技股份有限公司 | The operation method of virtual machine in a kind of desktop cloud |
US10025671B2 (en) * | 2016-08-08 | 2018-07-17 | International Business Machines Corporation | Smart virtual machine snapshotting |
-
2018
- 2018-12-18 CN CN201811547664.4A patent/CN109710378B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017016212A1 (en) * | 2015-07-30 | 2017-02-02 | 中兴通讯股份有限公司 | Testing method and device for desktop cloud system |
Also Published As
Publication number | Publication date |
---|---|
CN109710378A (en) | 2019-05-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109710378B (en) | Virtual machine fault detection method | |
CN106484611B (en) | Fuzzy test method and device based on automatic protocol adaptation | |
CN109684155B (en) | Monitoring configuration method, device, equipment and readable storage medium | |
WO2019129022A1 (en) | Error processing method, apparatus and system for device | |
CN107888446B (en) | Protocol robustness testing method and device | |
CN111190755B (en) | Application program function exception handling method and device | |
CN111367753B (en) | Cloud desktop screen recording method and device based on network communication engine ICE architecture | |
CN111554219A (en) | Display equipment testing method and device, electronic product and storage medium | |
CN111711533B (en) | Fault diagnosis method, fault diagnosis device, electronic device and storage medium | |
CN111399732B (en) | Webpage screenshot method and device, computer equipment and storage medium | |
CN114528350B (en) | Cluster brain fracture processing method, device, equipment and readable storage medium | |
CN109656791B (en) | gPC performance test method and device based on Jmeter | |
CN109474540A (en) | A kind of method and device identifying OPC flow | |
CN113271337B (en) | Method and device for subscribing computer message | |
CN112910706B (en) | Automatic configuration method, system, device and readable storage medium | |
CN115174245A (en) | Test method and system based on DoIP protocol detection | |
CN114721968A (en) | Test method, test device and storage medium | |
CN114374627A (en) | Method, device and system for restarting baseboard management controller and server | |
CN109104322B (en) | Method, device, readable storage medium and system for solving FL-NET communication fault | |
CN113032255A (en) | Response noise recognition method, model, electronic device, and computer storage medium | |
CN107864057B (en) | Online automatic checking and alarming method based on networking state | |
CN112948195A (en) | Interface testing method and device, electronic equipment and storage medium | |
US20230028497A1 (en) | Method for optimizing the image processing of web videos, image processing apparatus applying the method | |
CN113691601B (en) | Interaction method between external device and service terminal and related device | |
CN114636852B (en) | Overcurrent test method and device for server, server and readable storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |