CN112416518A - Method and system for intelligently preventing virtual resource waste - Google Patents

Method and system for intelligently preventing virtual resource waste Download PDF

Info

Publication number
CN112416518A
CN112416518A CN202011314219.0A CN202011314219A CN112416518A CN 112416518 A CN112416518 A CN 112416518A CN 202011314219 A CN202011314219 A CN 202011314219A CN 112416518 A CN112416518 A CN 112416518A
Authority
CN
China
Prior art keywords
virtual machine
client
operated
server
heartbeat
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
CN202011314219.0A
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.)
Vcmy Guangzhou Technology Shares Co ltd
Original Assignee
Vcmy Guangzhou Technology Shares 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 Vcmy Guangzhou Technology Shares Co ltd filed Critical Vcmy Guangzhou Technology Shares Co ltd
Priority to CN202011314219.0A priority Critical patent/CN112416518A/en
Publication of CN112416518A publication Critical patent/CN112416518A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3438Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment monitoring of user actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention provides a method and a system for intelligently preventing virtual resource waste, wherein the method comprises the following steps: after a client starts a virtual machine, the client detects whether the virtual machine is operated or not, and if the client operates the virtual machine, operation heartbeats are sent to a server; the server receives the operation heartbeat, detects whether the virtual machine is not operated for a long time, and immediately closes the virtual machine and releases virtual resources if the operation heartbeat is not operated for a long time; an intelligent virtual resource waste prevention system comprises a client monitoring module for detecting whether a virtual machine is operated or not, a client heartbeat sending module for sending operation heartbeats to a server, and a server control module for controlling the virtual machine to be closed; the method comprises the steps that a mouse and keyboard event of a client side is monitored, an operation heartbeat is sent to a server, and whether the virtual machine is not operated for a long time or not is detected according to the operation heartbeat, so that the virtual machine is controlled to be closed; the problem of resource waste is solved.

Description

Method and system for intelligently preventing virtual resource waste
Technical Field
The invention particularly relates to a method and a system for intelligently preventing virtual resource waste.
Background
Under the large background of online learning of the network, a plurality of real operation learning platforms appear on the network, namely, a user can start a real operation virtual machine corresponding to courses on the platform to further carry out real operation learning; the virtual machine becomes a necessary virtualization technology of the real operation learning platform, but the problem of virtual resource waste exists, and when the virtual machine is not used for a long time and is not closed in time, the virtual resource waste is caused;
the current market solves the problem by limiting the real operation time to deal with the waste of virtual machine resources; however, the controllability of this method is not high, because the usage duration of each user is not completely consistent, there still exists a waste situation, for example, the user completes the experiment in advance within the specified time without closing the virtual machine, which may cause a waste of resources.
Disclosure of Invention
The invention provides a method and a system for intelligently preventing virtual resource waste, which mainly help a server end to know whether a client end is not operated for a long time by monitoring the operation of a virtual machine through the client end and intelligently close the client end, thereby releasing resources occupied by a user for opening real operations and preventing waste, and the specific technical contents are as follows:
a method for intelligently preventing virtual resource waste comprises the steps that after a client starts a virtual machine, the client detects whether the virtual machine is operated, and if the client operates the virtual machine, operation heartbeats are sent to a server;
and the server receives the operation heartbeat, detects whether the virtual machine is not operated for a long time according to the time for receiving the operation heartbeat, and immediately closes the virtual machine and releases virtual resources if the virtual machine is not operated for a long time.
In one or more embodiments of the present invention, the client determines whether the virtual machine is operating according to a mouse and keyboard monitoring event.
In one or more embodiments of the present invention, the mouse and keyboard monitor events include: any one of a mouse click, a mouse movement, and a pressing of a keyboard button.
In one or more embodiments of the present invention, the sending the operation heartbeat to the server includes the steps of: firstly, a timing period is set, in the timing period, if the client side monitors that the virtual machine is operated, the client side sends the operation heartbeat to the server side, and if the client side does not monitor that the virtual machine is operated, the client side does not send the operation heartbeat.
In one or more embodiments of the present invention, the detecting whether the virtual machine is not operated for a long time includes: and the server checks an interval value between the time of receiving the last operation heartbeat of the client and the current time of the system every other detection period, and if the interval value exceeds set standard time, the server judges that the virtual machine is not operated for a long time.
An intelligent virtual resource waste prevention system, comprising: the system comprises a client monitoring module, a client heartbeat sending module and a server control module;
the client monitoring module is used for the client to detect whether the virtual machine is operated or not;
the client heartbeat sending module is used for sending an operation heartbeat to the server side if the client side operates the virtual machine;
and the server side control module is used for receiving the operation heartbeat by the server, detecting whether the virtual machine is not operated for a long time according to the time for receiving the operation heartbeat, and immediately closing the virtual machine and releasing virtual resources if the virtual machine is not operated for a long time.
In one or more embodiments of the present invention, the client determines whether the virtual machine is operating according to a mouse and keyboard monitoring event.
In one or more embodiments of the present invention, the mouse and keyboard monitor events include: any one of a mouse click, a mouse movement, and a pressing of a keyboard button.
In one or more embodiments of the present invention, the sending the operation heartbeat to the server includes the steps of: firstly, a timing period is set, in the timing period, if the client side monitors that the virtual machine is operated, the client side sends the operation heartbeat to the server side, and if the client side does not monitor that the virtual machine is operated, the client side does not send the operation heartbeat.
In one or more embodiments of the present invention, the detecting whether the virtual machine is not operated for a long time includes: and the server checks an interval value between the time of receiving the last operation heartbeat of the client and the current time of the system every other detection period, and if the interval value exceeds set standard time, the server judges that the virtual machine is not operated for a long time.
The invention has the beneficial effects that: the client monitoring module determines whether the virtual machine is operated or not by monitoring clicking and moving events of a mouse and a keyboard of the virtual machine, the client heartbeat sending module sends operation heartbeats of the client to the server control module, and the server control module sends a command of closing or not to the client real operation virtual machine according to whether the time of receiving the operation heartbeats reaches the standard time of long-time non-operation or not.
Drawings
Fig. 1 is a schematic flow chart of the method for intelligently preventing virtual resource waste according to the present invention.
Fig. 2 is a block diagram illustrating a structure of an intelligent virtual resource waste prevention system according to the present invention.
Detailed Description
The scheme of the application is further described as follows:
referring to fig. 1, in a method for intelligently preventing virtual resource waste, after a client starts a virtual machine, the client detects whether the virtual machine is operating, and if the client operates the virtual machine, an operation heartbeat is sent to a server; the server receives the operation heartbeat, detects whether the virtual machine is not operated for a long time according to the time for receiving the operation heartbeat, immediately closes the virtual machine and releases virtual resources if the operation heartbeat is not operated for a long time, and informs the client of closing; the real-time monitoring of the client operation realizes the intelligent shutdown of the inactive virtual machine and prevents the resource waste.
The client side judges whether the virtual machine is operated or not according to the mouse and keyboard monitoring event; the mouse and keyboard monitoring event comprises the following steps: any one of mouse clicking, mouse moving and keyboard button pressing; setting mouse click, mouse movement and pressing keyboard buttons, and realizing any action, namely any operation if any equipment is operated.
The method for sending the operation heartbeat to the server side comprises the following steps: firstly, setting a timing period, wherein in the timing period, if the client side monitors that the virtual machine is operated, the client side sends the operation heartbeat to the server side, and if the client side does not monitor that the virtual machine is operated, the client side does not send the operation heartbeat; in this embodiment, the timing period is set to 30 seconds, if the setting time is too short, the virtual machine is frequently operated to occupy resources, and if the setting time is too long, the effective monitoring effect cannot be achieved.
The method for detecting whether the virtual machine is not operated for a long time comprises the following steps: every time a detection period is set, the server checks an interval value between the time of receiving the last operation heartbeat of the client and the current time of the system, and if the interval value exceeds set standard time, the server judges that the virtual machine is not operated for a long time; in this embodiment, the detection period is set to be one detection period every 1 minute, and the standard time is set to be 10 minutes; if the setting time is too short, the use feeling of the user is influenced, and if the setting time is too long, resources are wasted.
Referring to fig. 2, an intelligent virtual resource waste prevention system includes: the system comprises a client monitoring module, a client heartbeat sending module and a server control module; the client monitoring module is used for the client to detect whether the virtual machine is operated or not; the client heartbeat sending module is used for sending an operation heartbeat to the server side if the client side operates the virtual machine; the server side control module is used for receiving the operation heartbeat by the server, detecting whether the virtual machine is not operated for a long time according to the time for receiving the operation heartbeat, immediately closing the virtual machine and releasing virtual resources if the operation heartbeat is not operated for a long time, and informing the client side that the virtual machine is closed; the real-time monitoring of the client operation realizes the intelligent shutdown of the inactive virtual machine and prevents the resource waste.
The client side judges whether the virtual machine is operated or not according to the mouse and keyboard monitoring event; the mouse and keyboard monitoring event comprises the following steps: any one of mouse clicking, mouse moving and keyboard button pressing; setting mouse click, mouse movement and pressing keyboard buttons, and realizing any action, namely any operation if any equipment is operated.
The method for sending the operation heartbeat to the server side comprises the following steps: firstly, setting a timing period, wherein in the timing period, if the client side monitors that the virtual machine is operated, the client side sends the operation heartbeat to the server side, and if the client side does not monitor that the virtual machine is operated, the client side does not send the operation heartbeat; in this embodiment, the timing period is set to 30 seconds, if the setting time is too short, the virtual machine is frequently operated to occupy resources, and if the setting time is too long, the effective monitoring effect cannot be achieved.
The method for detecting whether the virtual machine is not operated for a long time comprises the following steps: every time a detection period is set, the server checks an interval value between the time of receiving the last operation heartbeat of the client and the current time of the system, and if the interval value exceeds set standard time, the server judges that the virtual machine is not operated for a long time; in this embodiment, the detection period is set to be one detection period every 1 minute, and the standard time is set to be 10 minutes; if the setting time is too short, the use feeling of the user is influenced, and if the setting time is too long, resources are wasted.
The above preferred embodiments should be considered as examples of the embodiments of the present application, and technical deductions, substitutions, improvements and the like similar to, similar to or based on the embodiments of the present application should be considered as the protection scope of the present patent.

Claims (10)

1. A method for intelligently preventing virtual resource waste is characterized in that after a client starts a virtual machine, the client detects whether the virtual machine is operated, and if the client operates the virtual machine, operation heartbeats are sent to a server;
and the server receives the operation heartbeat, detects whether the virtual machine is not operated for a long time according to the time for receiving the operation heartbeat, and immediately closes the virtual machine and releases virtual resources if the virtual machine is not operated for a long time.
2. The method for intelligently preventing virtual resource waste according to claim 1, wherein: and the client judges whether the virtual machine is operated or not according to the mouse and keyboard monitoring event.
3. The method for intelligently preventing virtual resource waste according to claim 2, wherein: the mouse and keyboard monitoring event comprises the following steps: any one of a mouse click, a mouse movement, and a pressing of a keyboard button.
4. The method for intelligently preventing virtual resource waste according to claim 1, wherein: the method for sending the operation heartbeat to the server side comprises the following steps: firstly, a timing period is set, in the timing period, if the client side monitors that the virtual machine is operated, the client side sends the operation heartbeat to the server side, and if the client side does not monitor that the virtual machine is operated, the client side does not send the operation heartbeat.
5. The method for intelligently preventing virtual resource waste according to claim 1, wherein: the method for detecting whether the virtual machine is not operated for a long time comprises the following steps: and the server checks an interval value between the time of receiving the last operation heartbeat of the client and the current time of the system every other detection period, and if the interval value exceeds set standard time, the server judges that the virtual machine is not operated for a long time.
6. The utility model provides an intelligence prevents virtual resource waste system which characterized in that includes: the system comprises a client monitoring module, a client heartbeat sending module and a server control module;
the client monitoring module is used for the client to detect whether the virtual machine is operated or not;
the client heartbeat sending module is used for sending an operation heartbeat to the server side if the client side operates the virtual machine;
and the server side control module is used for receiving the operation heartbeat by the server, detecting whether the virtual machine is not operated for a long time according to the time for receiving the operation heartbeat, and immediately closing the virtual machine and releasing virtual resources if the virtual machine is not operated for a long time.
7. The intelligent virtual resource waste prevention system according to claim 6, wherein: and the client judges whether the virtual machine is operated or not according to the mouse and keyboard monitoring event.
8. The intelligent virtual resource waste prevention system according to claim 7, wherein: the mouse and keyboard monitoring event comprises the following steps: any one of a mouse click, a mouse movement, and a pressing of a keyboard button.
9. The intelligent virtual resource waste prevention system according to claim 6, wherein: the method for sending the operation heartbeat to the server side comprises the following steps: firstly, a timing period is set, in the timing period, if the client side monitors that the virtual machine is operated, the client side sends the operation heartbeat to the server side, and if the client side does not monitor that the virtual machine is operated, the client side does not send the operation heartbeat.
10. The intelligent virtual resource waste prevention system according to claim 6, wherein: the method for detecting whether the virtual machine is not operated for a long time comprises the following steps: and the server checks an interval value between the time of receiving the last operation heartbeat of the client and the current time of the system every other detection period, and if the interval value exceeds set standard time, the server judges that the virtual machine is not operated for a long time.
CN202011314219.0A 2020-11-21 2020-11-21 Method and system for intelligently preventing virtual resource waste Pending CN112416518A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011314219.0A CN112416518A (en) 2020-11-21 2020-11-21 Method and system for intelligently preventing virtual resource waste

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011314219.0A CN112416518A (en) 2020-11-21 2020-11-21 Method and system for intelligently preventing virtual resource waste

Publications (1)

Publication Number Publication Date
CN112416518A true CN112416518A (en) 2021-02-26

Family

ID=74778037

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011314219.0A Pending CN112416518A (en) 2020-11-21 2020-11-21 Method and system for intelligently preventing virtual resource waste

Country Status (1)

Country Link
CN (1) CN112416518A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103491102A (en) * 2013-09-30 2014-01-01 天脉聚源(北京)传媒科技有限公司 Method, system and device for monitoring stability of internet audio and video
WO2015158161A1 (en) * 2014-04-15 2015-10-22 华为技术有限公司 Sleep control method, apparatus and system for virtual desktop
CN108600284A (en) * 2017-12-28 2018-09-28 武汉噢易云计算股份有限公司 A kind of virtual machine high availability implementation method and system based on Ceph
CN109189523A (en) * 2018-08-08 2019-01-11 广东微云科技股份有限公司 A kind of method, system and the method for closing virtual machine of judgement idle virtual machine

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103491102A (en) * 2013-09-30 2014-01-01 天脉聚源(北京)传媒科技有限公司 Method, system and device for monitoring stability of internet audio and video
WO2015158161A1 (en) * 2014-04-15 2015-10-22 华为技术有限公司 Sleep control method, apparatus and system for virtual desktop
CN108600284A (en) * 2017-12-28 2018-09-28 武汉噢易云计算股份有限公司 A kind of virtual machine high availability implementation method and system based on Ceph
CN109189523A (en) * 2018-08-08 2019-01-11 广东微云科技股份有限公司 A kind of method, system and the method for closing virtual machine of judgement idle virtual machine

Similar Documents

Publication Publication Date Title
CN106201844B (en) A kind of log collecting method and device
TW200518013A (en) Monitor capable of controlling the power of host computer and the controlling method therefor
CN106412237B (en) A kind of control method and device of the suspension button of intelligent terminal
WO2001039461A3 (en) Network event correlation system using protocol models
CN102685034A (en) Method and client for giving prompt for instant messaging message
CN107045766A (en) Terminal user safety monitoring method and device
CN106814838B (en) Method and device for terminal automatic dormancy
WO2008156730A3 (en) System and method for providing multi-protocol access to remote computers
CN102833120B (en) The abnormal method and system of NM server are processed in a kind of rapid automatized test
CN108132735A (en) Terminal and application control method
CA2219886A1 (en) Method and system for interfacing applications software with electronic writeboard
CN108053610A (en) A kind of method for building up of monitored person's abnormal behaviour analysis model
CN106930039B (en) Method for adding detergent in midway of washing machine and washing machine
CN112416518A (en) Method and system for intelligently preventing virtual resource waste
CN110056281A (en) A kind of finger dish-washing machine and its control method
CN101673194B (en) Device and method for processing user notification message by using same
CN107861391A (en) Control method, device, home appliance and the readable storage medium storing program for executing of home appliance
CN106598767B (en) Intelligent substation monitoring service console implementation method based on watchdog technique
CN105100125B (en) A kind of dormancy control method of virtual desktop, apparatus and system
CN101272480A (en) Method and circuit for restarting DVR video monitoring system in case of system halt
DE19718911A1 (en) Screen saver for computer monitor screen
CN109227540A (en) A kind of robot control method, robot and computer readable storage medium
CN108882039B (en) Switching control method for video playing owner
CN104970947A (en) Safety control method and apparatus for upper limb rehabilitation robot
CN112671622A (en) Safety monitoring method and device based on intelligent mobile equipment and intelligent mobile equipment

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