CN108804147B - Linkage shutdown method and device and client - Google Patents

Linkage shutdown method and device and client Download PDF

Info

Publication number
CN108804147B
CN108804147B CN201810524131.8A CN201810524131A CN108804147B CN 108804147 B CN108804147 B CN 108804147B CN 201810524131 A CN201810524131 A CN 201810524131A CN 108804147 B CN108804147 B CN 108804147B
Authority
CN
China
Prior art keywords
client
shutdown
virtual
virtual desktop
event
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
Application number
CN201810524131.8A
Other languages
Chinese (zh)
Other versions
CN108804147A (en
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.)
New H3C Cloud Technologies Co Ltd
Original Assignee
New H3C Cloud Technologies 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 New H3C Cloud Technologies Co Ltd filed Critical New H3C Cloud Technologies Co Ltd
Priority to CN201810524131.8A priority Critical patent/CN108804147B/en
Publication of CN108804147A publication Critical patent/CN108804147A/en
Application granted granted Critical
Publication of CN108804147B publication Critical patent/CN108804147B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/4401Bootstrapping
    • G06F9/442Shutdown
    • 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/451Execution arrangements for user interfaces
    • G06F9/452Remote windowing, e.g. X-Window System, desktop virtualisation

Abstract

The application provides a linkage shutdown method, a linkage shutdown device and a client, relates to the technical field of cloud computing, and is used for monitoring shutdown events of a virtual desktop currently used by the client; and when a shutdown event of the virtual desktop is monitored, sending the shutdown event to the client through an agent service program of a virtual machine providing the virtual desktop, so that the client determines whether to perform linkage shutdown with the virtual desktop according to the received shutdown event. According to the method, the client determines whether linkage shutdown is performed or not according to the shutdown event fed back by the server, when the client needs shutdown, the client can shut down according to the shutdown event, independent shutdown operation is not required to be performed on the client independently, the operation chain that the virtual desktop and the client need shutdown simultaneously is simplified, and the convenience of management of a linkage shutdown system is improved.

Description

Linkage shutdown method and device and client
Technical Field
The application relates to the technical field of cloud computing, in particular to a linkage shutdown method and device for a virtual desktop and a client and the client.
Background
Nowadays, cloud computing technology is changing day by day, and the application scene of virtual desktop is more and more extensive, and for example daily official working, school teaching etc. can all be applied to virtual desktop solution, and virtual desktop solution has simplified computer management, has reduced the power consumption to improve office efficiency through rationally distributing computer resource.
The Virtual Desktop scheme platform is realized based on a Virtual Desktop Infrastructure (VDI), can host the Desktop environment of a user to a high-performance server in the form of a Virtual machine, and provides the user with almost the same user experience as a physical PC. An ordinary user can use own virtual desktops through various client devices such as a PC (personal computer), a thin client and the like to complete tasks such as daily office work, school teaching and the like, and an administrator can realize visual management of all virtual desktop resources and batch deployment of the virtual desktops so as to meet the requirements of a large number of users.
In an application scene of a virtual desktop, if the virtual desktop and a client are to be powered off, a user is required to first power off the virtual desktop, return to an operating environment of the client after the virtual desktop is powered off, and then power off the virtual desktop in the operating environment of the client, so that the client is powered off finally. The operation chain of the virtual desktop and the client for shutdown is long in the shutdown process, and the shutdown system management is not convenient to link. How to simplify the operation chain of the virtual desktop and the shutdown of the client and improve the convenience of the linked shutdown system becomes a technical problem which needs to be solved by technical personnel in the field.
Disclosure of Invention
The embodiment of the application describes a linkage shutdown method, a linkage shutdown device and a client.
In a first aspect, an embodiment of the present application provides a linkage shutdown method, which is applied to a linkage shutdown system, where the linkage shutdown system includes a client and a server, and the server provides a virtual desktop service for the client through a virtual machine, and the method includes:
the server monitors a shutdown event of the virtual desktop currently used by the client;
when monitoring a shutdown event of the virtual desktop, the server sends the shutdown event to the client through an agent service program of a virtual machine providing the virtual desktop;
and the client determines whether to carry out linkage shutdown with the virtual desktop according to the received shutdown event.
Optionally, in this embodiment, the step of the server monitoring a shutdown event of the virtual desktop currently used by the client includes:
intercepting a shutdown instruction function of the virtual desktop through a virtual machine process with a hook program;
and judging whether a shutdown event of the virtual desktop is monitored or not according to the incoming parameters intercepted from the shutdown instruction function.
Optionally, in this embodiment, before the step of intercepting, by the server, a shutdown instruction function of the virtual desktop through a virtual machine process deployed with a hook routine, the method further includes:
the server detects whether the agent service program of the virtual machine is started for the first time after being upgraded;
and when the hook program is started for the first time after upgrading, deploying the hook program into the process of the virtual machine.
Optionally, in this embodiment, when monitoring a shutdown event of the virtual desktop, the step of sending the shutdown event to the client through an agent service program of a virtual machine providing the virtual desktop by the server includes:
and starting a named pipeline through the proxy service program of the virtual machine to receive the shutdown event intercepted by the virtual machine process, and sending the shutdown event to the client after receiving the shutdown event.
Optionally, in this embodiment, the step of determining, by the client, whether to perform linked shutdown with the virtual desktop according to the received shutdown event includes:
receiving a shutdown event of the virtual desktop currently used by the client;
detecting whether a linkage shutdown strategy between the client and the virtual machine is started or not;
when the linkage shutdown strategy between the client and the virtual machine is started, detecting whether the client is a thin client or not;
when the client is a thin client, detecting whether the client runs with other virtual desktops;
and when the client does not run other virtual desktops currently, closing the client.
In a second aspect, an embodiment of the present application further provides a linkage shutdown method, which is applied to a server, where the server is used to provide a virtual desktop service, and the method includes:
monitoring a shutdown event of the virtual desktop currently used by the client;
and when a shutdown event of the virtual desktop is monitored, sending the shutdown event to the client through an agent service program of a virtual machine providing the virtual desktop, so that the client determines whether to perform linkage shutdown with the virtual desktop according to the received shutdown event.
Optionally, in this embodiment, the step of monitoring a shutdown event of the virtual desktop includes:
intercepting a shutdown instruction function of the virtual desktop through a virtual machine process with a hook program;
and judging whether a shutdown event of the virtual desktop is monitored or not according to the incoming parameters intercepted from the shutdown instruction function.
Optionally, in this embodiment, before intercepting, by a virtual machine process deployed with a hook program, a shutdown instruction function of the virtual desktop, the method further includes:
detecting whether the agent service program of the virtual machine is started for the first time after being upgraded;
and when the hook program is started for the first time after upgrading, deploying the hook program into the process of the virtual machine.
Optionally, in this embodiment, when monitoring a shutdown event of the virtual desktop, the step of sending the shutdown event to the client through an agent service program of a virtual machine providing the virtual desktop includes:
and starting a named pipeline through the proxy service program of the virtual machine to receive the shutdown event intercepted by the virtual machine process, and sending the shutdown event to the client after receiving the shutdown event.
In a third aspect, an embodiment of the present application further provides a linkage shutdown method, which is applied to a client, where the method includes:
receiving a virtual desktop shutdown event sent by the server when the server monitors the shutdown event of the virtual desktop currently used by the client;
detecting whether a linkage shutdown strategy between the client and the virtual machine is started or not;
when the linkage shutdown strategy between the client and the virtual machine is started, detecting whether the client is a thin client or not;
when the client is a thin client, detecting whether the client runs with other virtual desktops;
and when the client does not run other virtual desktops currently, closing the client.
In a fourth aspect, an embodiment of the present application further provides a linked shutdown system, where the system includes a client and a server that provides a virtual desktop service for the client through a virtual machine, and the method includes:
the server is used for monitoring a shutdown event of the virtual desktop currently used by the client, and sending the shutdown event to the client through an agent service program of a virtual machine providing the virtual desktop when the shutdown event of the virtual desktop is monitored;
and the client is used for determining whether to carry out linkage shutdown with the virtual desktop according to the received shutdown event.
Optionally, in this embodiment of the application, when monitoring a shutdown event of the virtual desktop currently used by the client, the server is specifically configured to:
intercepting a shutdown instruction function of the virtual desktop through a virtual machine process with a hook program;
and judging whether a shutdown event of the virtual desktop is monitored or not according to the incoming parameters intercepted from the shutdown instruction function.
Optionally, in this embodiment, the server is further configured to:
detecting whether an agent service program of the virtual machine is started for the first time;
and when the hook program is started for the first time after upgrading, deploying the hook program into the process of the virtual machine.
Optionally, in this embodiment, when monitoring the shutdown event of the virtual desktop, the server is further configured to, in a process of sending the shutdown event to the client through a proxy server of a virtual machine providing the virtual desktop, send the shutdown event to the client:
and starting a named pipeline through the proxy service program of the virtual machine to receive the shutdown event intercepted by the virtual machine process, and sending the shutdown event to the client after receiving the shutdown event.
Optionally, in this embodiment, the client is specifically configured to:
receiving a shutdown event of the virtual desktop currently used by the client;
detecting whether a linkage shutdown strategy between the client and the virtual machine is started or not;
when the linkage shutdown strategy between the client and the virtual machine is started, detecting whether the client is a thin client or not;
when the client is a thin client, detecting whether the client runs with other virtual desktops;
and when the client does not run other virtual desktops currently, closing the client.
In a fifth aspect, an embodiment of the present application further provides a linkage relation apparatus, which is applied to a server, where the server provides a virtual desktop service for a client through a virtual machine, and the apparatus includes:
the monitoring module is used for monitoring a shutdown event of the virtual desktop currently used by the client;
and the sending module is used for sending the shutdown event to the client through an agent service program of the virtual machine providing the virtual desktop when the shutdown event of the virtual desktop is monitored, so that the client determines whether to perform linkage shutdown with the virtual desktop according to the received shutdown event.
Optionally, in this embodiment, the monitoring module is specifically configured to:
intercepting a shutdown instruction function through a virtual machine process with a hook program;
and judging whether a shutdown event is monitored or not according to the incoming parameters intercepted from the shutdown instruction function.
Optionally, in this embodiment, the linkage shutdown device further includes a first detection module and a deployment module;
the first detection module is used for detecting whether the agent service program of the virtual machine is started for the first time after being upgraded;
the deployment module is used for deploying the hook program to the process of the virtual machine when the upgraded hook program is started for the first time.
Optionally, in this embodiment, the sending module is specifically configured to:
and starting a named pipeline through the proxy service program of the virtual machine to receive the shutdown event intercepted by the virtual machine process, and sending the shutdown event to the client after receiving the shutdown event.
In a sixth aspect, an embodiment of the present application further provides a client, where the client is communicatively connected to a server to use a virtual desktop service provided by the server through a virtual machine, and the client includes:
the receiving module is used for receiving a virtual desktop shutdown event sent by the server when the server monitors the shutdown event of the virtual desktop currently used by the client;
the second detection module is used for detecting whether the linkage shutdown strategy between the client and the virtual machine is started or not;
the third detection module is used for detecting whether the client is a thin client or not when the linkage shutdown strategy between the client and the virtual machine is started;
the fourth detection module is used for detecting whether other virtual desktops are operated at the client side when the client side is the thin client side;
and the closing module is used for closing the client when the client does not run other virtual desktops currently.
In a seventh aspect, an embodiment of the present application further provides a server, including a processor and a nonvolatile memory storing computer instructions, where the computer instructions, when executed by the switch, implement the linked shutdown method provided in the second aspect.
Compared with the prior art, the method has the following beneficial effects:
the linkage shutdown method, the linkage shutdown device and the client provided by the embodiment of the application monitor the shutdown event of the virtual desktop currently used by the client; and when a shutdown event of the virtual desktop is monitored, sending the shutdown event to the client through an agent service program of a virtual machine providing the virtual desktop, so that the client determines whether to perform linkage shutdown with the virtual desktop according to the received shutdown event. According to the method, the client determines whether linkage shutdown is performed or not according to the shutdown event fed back by the server, when the client needs shutdown, the client can shut down according to the shutdown event, independent shutdown operation is not required to be performed on the client independently, the operation chain of the virtual desktop and the client when shutdown is required is simplified, and the convenience of management of a linkage shutdown system is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a block diagram illustrating a linked shutdown system according to an embodiment of the present disclosure;
FIG. 2 is a block diagram of the server of FIG. 1;
fig. 3 is a schematic flowchart of a linked shutdown method according to an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating the sub-steps of step S410 in FIG. 3;
FIG. 5 is a flowchart illustrating the sub-steps of step S430 in FIG. 3;
FIG. 6 is a block diagram of functional blocks of a linked shutdown device according to an embodiment of the present disclosure;
FIG. 7 is a block diagram of another functional module of the linked shutdown device according to the embodiment of the present application;
fig. 8 is a functional block diagram of a client according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the description of the present application, it is also noted that the terms "first," "second," and the like are used merely to distinguish one description from another, and are not intended to indicate or imply relative importance, unless otherwise explicitly stated or limited. To those of ordinary skill in the art, the specific meaning of terms in this application can be understood as appropriate.
In the prior art, when a virtual desktop (e.g., a cloud desktop) and a client are required to be powered off, taking the client as a thin client as an example, the thin client refers to a terminal device which removes most of irrelevant functions of a PC, such as a CD-ROM, a floppy drive, an expansion slot, and the like, and communicates with a server through network connection to deliver the virtual desktop to a user. After the thin client is started, the task bar is hidden, the system hot key is shielded, and a user can only operate in the application environment of the thin client. After the user completes the configuration of the IP address of the server, the user can log in the virtual desktop provided by the server for the thin client by inputting a user name and a password. In the scene, the virtual desktop and the client are powered off, after the user logs in the virtual desktop to be powered off, the user can quit the application environment of the thin client, and the thin client still needs to be powered off continuously, so that the power off of the thin client can be completed, the whole power off operation chain is prolonged, and the management of a management platform is inconvenient.
In order to solve the above problem, the prior art provides the following two schemes to implement linked shutdown of the virtual desktop and the client.
In the first scheme, the client is controlled to be closed in a mode that a window program in a virtual desktop receives a VM _ ENDSESSION message and then informs the client.
The second scheme is to read the system shutdown log, analyze the keywords (such as "power off", "restart") in the shutdown log, and notify the client to shut down when analyzing the corresponding keywords.
However, the applicant has studied that, in the first solution, on the one hand, the VM _ endsission message cannot distinguish between a shutdown event and a restart event, i.e. cannot obtain certain shutdown information from the VM _ endsission message. On the other hand, the VM _ endisseon message is received by the window program, and the window receiving program must be generated after the user logs in the system, that is, the first scheme must realize linkage shutdown only in the case that the user logs in the system.
In the second scheme, on one hand, the shutdown or restart keywords corresponding to different operating system types may not be compatible, and the determined shutdown information cannot be obtained according to the analysis of the shutdown log. On the other hand, because the time for writing the shutdown log by the operating system of the server is uncertain, the time for writing the shutdown log by the operating system may be later than the time for exiting the virtual desktop agent service program, which may cause failure in monitoring the shutdown event and failure in implementing linked shutdown.
In order to overcome the drawbacks of the prior art described above, the applicant has studied to provide a solution by means of the following embodiments.
Referring to fig. 1, fig. 1 is a block diagram illustrating a linked shutdown system according to an embodiment of the present disclosure. The coordinated shutdown system 1 comprises a client 10 and a server 30, the client 10 communicating with the server 30 via a network 20. The server 30 may include at least one virtual machine 31, and the virtual machine 31 may provide a virtual desktop service for the client 10. It is understood that, in the present embodiment, the linked shutdown system 1 may further include a virtual desktop management platform (not shown in the figure) for authorizing and allocating the virtual machine 31 to the user logged in to the client 10.
The client 10 may be, but is not limited to, a smart phone, a Personal Computer (PC), a tablet PC, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), and the like. The client 10 performs the service processing through the virtual desktop provided by the server 30, and the service processing process is completed by the server 30, so in this embodiment, the hardware configuration of the client 10 may be less than that of an ordinary client.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a server 30 according to an embodiment of the present disclosure. The server 30 includes the coordinated shutdown device 100, a memory 310 and a processor 320.
The memory 310 and the processor 320 may be directly or indirectly electrically connected to each other to enable data transmission or interaction. The coordinated shutdown device 100 comprises at least one computer program or software functional module, which may be stored in the memory 310 in the form of software (software) or firmware (firmware), and the processor 320 is configured to execute executable modules stored in the memory 310, such as the coordinated shutdown device 100 stored in the memory 310.
It should be understood that the server 30 may also include more or fewer components than those shown in fig. 2, and may have a completely different configuration than that shown in fig. 2, and the present embodiment is not limited thereto. The components shown in fig. 2 may be implemented by software, hardware, or a combination thereof. Correspondingly, the server 30 may also be implemented by hardware and/or software.
Referring to fig. 3, fig. 3 is a schematic diagram illustrating a linked shutdown method applied to the linked shutdown system 1 in fig. 1 according to an embodiment of the present disclosure. The following describes each step of the linked shutdown method provided in this embodiment in detail.
In step S410, the server 30 monitors the shutdown time of the virtual desktop currently used by the client.
Referring to fig. 4, in the present embodiment, the step S410 may include a sub-step S411 and a sub-step S412.
And a substep S411, intercepting a shutdown instruction function of the virtual desktop through a virtual machine process with a hook subprogram.
In this embodiment, the hook program is injected into the process of the virtual machine when the operating system is started, and when a shutdown event or a restart event occurs on the virtual desktop, the process of the virtual machine injected with the hook program may intercept the shutdown event or the restart event.
Before substep S411, the method further includes a step of deploying a hook program in the virtual machine process, where the step specifically includes:
firstly, the server 30 detects whether the proxy service program of the virtual machine 31 is started for the first time;
then, when the hook program is started for the first time after the upgrade, the hook program is deployed into the process of the virtual machine 31.
The specific process of deploying the hook program is as follows:
after the virtual desktop is started, the agent service program in the virtual machine 31 is started as a service program, and the server 30 determines whether the start is the first start of the agent service program, where the first start includes the first start after upgrade and the first start after initial installation. Taking the first start after upgrading as an example, the server 30 determines whether the start is the first start of the proxy service program according to the upgrade tag of the proxy service program in the registry.
If the proxy service program is started for the first time, hook programs (hook. dll and hook64.dll) under the installation directory are copied to a System path (for example, a 32-bit operating System can be C: \ Windows \ System 32; and a 64-bit operating System can be C: \ System32 and C \ Windows SysWOW 64). And writes the path of the hook dynamic link library to the registry (e.g., the 32-bit operating system may be HKEY _ LOCAL _ MACHINE \ SOFTWARE \ Microsoft
\\ Windows NT \ CurrentVersion \ Windows; the 64-bit operating system may be HKEY _ LOCAL _ MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersi on \ Windows and HKEY _ LOCAL _ MACHINE \ SOFTWARE \ Wow6432Node
Microsoft Windows NT CurrentVersion Windows). The hook program is copied to the system path, and the hook program dynamic link library path is written into the registry, so that the hook program can be deployed. After the operating system is started next time, the operating system program injects the hook program into the virtual machine process according to the hook program path in the registry, so that the virtual machine process injected with the hook program intercepts shutdown events and restart events of the virtual desktop. Specifically, in this embodiment, the virtual machine process deployed with the hook program acquires a shutdown event and a restart event by intercepting a shutdown instruction function.
When the agent service program is not started for the first time, the agent service program starts the named pipe and monitors a shutdown event as the named pipe Server.
Named Pipes, also known as "Named Pipes," are a simple inter-process communication mechanism. Named pipes enable reliable, one-way or two-way data communication between different processes on the same computer or between different processes on different computers across a network.
And a substep 412 of determining whether a shutdown event of the virtual desktop is monitored according to the incoming parameters intercepted from the shutdown instruction function.
The shutdown instruction function may include an ExitWindowsEx () function and an initiashutdown () function, where the ExitWindowsEx () function is used to exit, restart, or logoff the system. The InitiateShutdown () function is used to specify the computer that is started up to do shutdown and restart. In this embodiment, the incoming parameter may be obtained by intercepting one of an ExitWindowsEx () function and an InitiateShutdown () function. Taking the ExitWindowsEx () function as an example, in the operating system with WIN 732 bits, the incoming argument 29 represents shutdown and the incoming argument 2 represents restart. The current corresponding event type of the virtual desktop can be judged by intercepting the transmitted parameters in the shutdown instruction function.
After the server 30 monitors the shutdown event of the virtual desktop, the process proceeds to step S420.
Step S420, sending a shutdown event to the client 10 through the proxy server of the virtual machine 31 providing the virtual desktop.
And if the event of the virtual desktop is monitored to be a restarting event, returning to the operating system for restarting. And if the monitored event of the virtual desktop is a shutdown event, the virtual machine process creates a named pipeline and takes the named pipeline as a named pipeline Client. The virtual machine process sends a shutdown event notification to the proxy server of the virtual machine 31 through the named pipe.
After the agent service program of the virtual machine 31 receives the shutdown event, the shutdown event is sent to the client 10.
In step S430, the client 10 determines whether to perform linked shutdown with the virtual desktop according to the received shutdown event.
In this embodiment, taking the client 10 as a thin client as an example, referring to fig. 5, step S430 includes the following sub-steps:
and a substep S431, receiving a shutdown event of the virtual desktop currently used by the client.
And a substep S432 of detecting whether the client 10 starts a linked shutdown policy with the virtual machine.
After receiving the virtual desktop shutdown event, the client 10 first checks whether a linked shutdown policy between the client 10 and the virtual machine 31, which is issued by the virtual desktop management platform, is started. In this embodiment, the virtual desktop management platform may pre-configure the linked shutdown policy between the client 10 and the virtual machine 31, and after the agent service program of the virtual machine 31 sends the shutdown event to the client 10, the virtual desktop management platform sends the linked shutdown policy between the virtual machine 31 that sends the shutdown event and the client 10 to the client 10.
When the client 10 detects that the client 10 has started the linked shutdown policy with the virtual machine 31 according to the linked shutdown policy, the substep S433 is entered, otherwise, the flow is ended.
And a substep S433 of detecting whether the client 10 is a thin client.
When detecting that the client 10 is a thin client, the flow proceeds to step S434, otherwise, the flow ends.
And a sub-step S434, detecting whether the client 10 currently runs other virtual desktops.
And when detecting that the background of the client 10 does not run other virtual desktops currently, entering the substep S435, otherwise, ending the process.
Substep S435, the client 10 is turned off.
The step S430 above gives an embodiment of performing linked shutdown when the client 10 is a thin client by way of example, and it can be understood that in other embodiments of this embodiment, the client 10 may also perform linked shutdown by adopting other manners, for example, the client 10 performs shutdown directly after receiving a shutdown event; or the client 10 shuts down after receiving the shutdown event and detecting that no other virtual desktop is running on the client 10; alternatively, the client 10 may shut down the virtual machine 31 when receiving the shutdown event and detecting that the client 10 has started the linked shutdown policy with the virtual machine.
In the method provided by this embodiment, the virtual machine process deployed with the hook monitors the shutdown event of the virtual desktop, and when the shutdown event is monitored, the shutdown event is fed back to the client 10, and the client 10 determines whether to perform linked shutdown with the virtual desktop. The method has the advantages that the event type of the virtual desktop can be accurately determined by intercepting the incoming parameters of the shutdown instruction function in the process of monitoring the shutdown event of the virtual desktop by the virtual machine process with the hook, and the error in event type identification is prevented. Meanwhile, the method does not depend on a window program, and linkage shutdown can be realized without user login. According to the method, the shutdown event of the virtual desktop currently used by the client can be accurately monitored through the virtual machine process with the hook, and the shutdown event is fed back to the client 10, so that linkage shutdown of the client 10 and the virtual desktop is realized, an operation chain when the virtual desktop and the client 10 need shutdown is simplified, and convenience in management of a linkage shutdown system is improved.
Referring to fig. 1, the present linkage shutdown system 1 is different from the above embodiment in that the linkage shutdown system introduces functions of the client 10 and the server 30 in the linkage shutdown process in the system from the perspective of the system formed by the client 10 and the server 30. It is to be understood that the functions of the client 10 and the server 30 in the coordinated shutdown system 1 to be described next have been described in the specific steps of the above embodiment, and only the coordinated shutdown system 1 will be briefly described below.
The server 30 is configured to monitor a shutdown event of a virtual desktop currently used by the client 10, and send the shutdown event to the client 10 through an agent service program of a virtual machine providing the virtual desktop when the shutdown event of the virtual desktop is monitored.
In this embodiment, optionally, when monitoring a shutdown event of the virtual desktop currently used by the client 10, the server 30 is specifically configured to:
intercepting a shutdown instruction function of the virtual desktop through a virtual machine process with a hook program;
and judging whether a shutdown event of the virtual desktop is monitored or not according to the incoming parameters intercepted from the shutdown instruction function.
In the process of sending the shutdown event to the client through the proxy server of the virtual machine providing the virtual desktop when the shutdown event of the virtual desktop is monitored, the server 30 is further configured to:
and starting a named pipeline through the proxy service program of the virtual machine to receive the shutdown event intercepted by the virtual machine process, and sending the shutdown event to the client 10 after receiving the shutdown event.
In this embodiment, the server 30 is further configured to:
detecting whether an agent service program of the virtual machine is started for the first time;
and when the hook program is started for the first time after upgrading, deploying the hook program into the process of the virtual machine.
And the client 10 is used for determining whether to perform linkage shutdown with the virtual desktop according to the received shutdown event.
In this embodiment, the client 10 is specifically configured to:
a shutdown event of the virtual desktop currently used by the client 10 is received.
And detecting whether the client 10 starts a linkage shutdown strategy with the virtual machine.
When the client 10 opens the linkage shutdown strategy with the virtual machine, detecting whether the client 10 is a thin client.
When the client 10 is a thin client, whether the client 10 runs other virtual desktops currently is detected.
The client 10 is switched off when the client 10 is not currently running another virtual desktop.
The embodiment of the present application further provides a linkage shutdown device 100, which is different from the above embodiments in that the linkage shutdown device 100 uses the server 300 as an execution main body, and describes a linkage shutdown process from the perspective of a virtual device. It is to be understood that the specific functions performed by the functional modules involved in the linkage shutdown device 100 to be described next have been described in the specific steps of the above embodiment, and the detailed contents of the specific functional modules can be described with reference to the above embodiment, and only the linkage shutdown device 100 will be briefly described below. Referring to fig. 6, the linked shutdown device 100 includes the following functional modules.
A monitoring module 110, configured to monitor a shutdown event of the virtual desktop currently used by the client.
In this embodiment, the monitoring module 110 is specifically configured to:
intercepting a shutdown instruction function through a virtual machine process with a hook program;
and judging whether a shutdown event is monitored or not according to the incoming parameters intercepted from the shutdown instruction function.
A sending module 120, configured to send a shutdown event to the client 10 through an agent service program of a virtual machine providing the virtual desktop when the shutdown event of the virtual desktop is monitored, so that the client 10 determines whether to perform linked shutdown with the virtual desktop according to the received shutdown event.
In this embodiment, the sending module 120 is specifically configured to:
a named pipeline is started through a proxy service program of the virtual machine 31 to receive a shutdown event intercepted by a virtual machine process, and the shutdown event is sent to the client 10 after the shutdown event is received.
Referring to fig. 7, in the present embodiment, the linked shutdown device 100 may further include: a first detection module 130 and a deployment module 140.
A first detecting module 130, configured to detect whether the proxy service program of the virtual machine 31 is started for the first time after being upgraded;
the deployment module 140 is configured to deploy the hook program to the process of the virtual machine 31 when the upgraded hook program is started for the first time.
The embodiment of the present application further provides a client 10, which is different from the above embodiment, in that the client 10 serves as an execution main body, and the linked shutdown process is described from the perspective of a virtual device. It is to be understood that the specific functions performed by the functional modules involved in the client terminal 10 to be described next have been described in the specific steps of the above embodiment, and the detailed contents of the specific functional modules can be described with reference to the above embodiment, and only the client terminal 10 is briefly described below. Referring to fig. 8, the client 10 includes the following functional modules.
The receiving module 101 is configured to receive a virtual desktop shutdown event sent by a server when monitoring the shutdown event of a virtual desktop currently used by the client.
The second detecting module 102 is configured to detect whether the client 10 starts a linked shutdown policy with the virtual machine 31.
The third detection module 103 is configured to detect whether the client 10 is a thin client when the client 10 has started the linked shutdown policy with the virtual machine 31.
The fourth detection module 104 is configured to detect whether another virtual desktop is currently running on the client 10 when the client 10 is a thin client.
A shutdown module 105, configured to shutdown the client 10 when the client 10 is not currently running any other virtual desktop.
If the above functions are implemented in the form of software functional modules and sold or used as a separate product, they may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for executing all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
To sum up, according to the linked shutdown method, the linked shutdown device and the client provided by the embodiment of the application, firstly, a server monitors a shutdown event of a virtual desktop currently used by the client; then, when a shutdown event of the virtual desktop is monitored, the shutdown event is sent to the client; and finally, the client determines whether to carry out linkage shutdown with the virtual desktop according to the received shutdown event. The method has the advantages that the event type of the virtual desktop can be accurately determined by intercepting the incoming parameters of the shutdown instruction function in the process of monitoring the shutdown event of the virtual desktop by the virtual machine process with the hook, and the error in event type identification is prevented. Meanwhile, the method does not depend on a window program, and linkage shutdown can be realized without user login. According to the method, the shutdown event of the virtual desktop currently used by the client can be accurately monitored through the virtual machine process with the hook, and the shutdown event is fed back to the client, so that linkage shutdown of the client and the virtual desktop is realized, an operation chain when the virtual desktop and the client need shutdown is simplified, and convenience in management of a linkage shutdown system is improved.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (8)

1. A linkage shutdown method is applied to a server, wherein the server is used for providing a virtual desktop service, and the method comprises the following steps:
monitoring shutdown events of a virtual desktop currently used by a client, wherein the shutdown events comprise: intercepting a shutdown instruction function of the virtual desktop through a virtual machine process with a hook program; judging whether a shutdown event of the virtual desktop is monitored or not according to the incoming parameters intercepted from the shutdown instruction function;
when a shutdown event of the virtual desktop is monitored, sending the shutdown event to the client through an agent service program of a virtual machine providing the virtual desktop, so that the client determines whether to perform linkage shutdown with the virtual desktop according to the received shutdown event, including: enabling the client to receive the shutdown event and shutdown when detecting that the client does not operate other virtual desktops; or the client receives the shutdown event and shuts down the client when detecting that the client starts a linked shutdown strategy with the virtual machine, wherein the linked shutdown strategy is configured in advance through a virtual management platform, and the virtual desktop management platform is used for sending the linked shutdown strategy to the client after the shutdown event is sent to the client.
2. The method of claim 1, wherein prior to intercepting a shutdown instruction function of the virtual desktop by a virtual machine process deploying a hook routine, the method further comprises:
detecting whether the agent service program of the virtual machine is started for the first time after being upgraded;
and when the hook program is started for the first time after upgrading, deploying the hook program into the process of the virtual machine.
3. The method of claim 1, wherein the step of sending a shutdown event to the client through a proxy server of a virtual machine providing the virtual desktop when the shutdown event of the virtual desktop is monitored comprises:
and starting a named pipeline through the proxy service program of the virtual machine to receive the shutdown event intercepted by the virtual machine process, and sending the shutdown event to the client after receiving the shutdown event.
4. A linkage shutdown method is applied to a client side, and comprises the following steps:
receiving a virtual desktop shutdown event sent by a server when monitoring the shutdown event of a virtual desktop currently used by the client;
detecting whether a linkage shutdown strategy between the client and the virtual machine is started or not; the linkage shutdown strategy is configured in advance through a virtual management platform, and the virtual desktop management platform is used for sending the linkage shutdown strategy to the client after the shutdown event is sent to the client;
when the linkage shutdown strategy between the client and the virtual machine is started, detecting whether the client is a thin client or not;
when the client is a thin client, detecting whether the client runs with other virtual desktops;
and when the client does not run other virtual desktops currently, closing the client.
5. A linkage relation device is applied to a server, the server provides virtual desktop service for a client through a virtual machine, and the linkage relation device comprises:
the monitoring module is used for monitoring a shutdown event of the virtual desktop currently used by the client; the monitoring module is specifically configured to: intercepting a shutdown instruction function through a virtual machine process with a hook program; judging whether a shutdown event is monitored or not according to the incoming parameters intercepted from the shutdown instruction function;
a sending module, configured to send a shutdown event to the client through an agent service program of a virtual machine providing the virtual desktop when monitoring the shutdown event of the virtual desktop, so that the client determines whether to perform linked shutdown with the virtual desktop according to the received shutdown event, where the sending module includes: enabling the client to receive the shutdown event and shutdown when detecting that the client does not operate other virtual desktops; or the client receives the shutdown event and shuts down the client when detecting that the client starts a linkage shutdown strategy with the virtual machine; the linkage shutdown strategy is configured in advance through a virtual management platform, and the virtual desktop management platform is used for sending the linkage shutdown strategy to the client after the shutdown event is sent to the client.
6. The apparatus of claim 5, wherein the linked shutdown apparatus further comprises a first detection module and a deployment module;
the first detection module is used for detecting whether the agent service program of the virtual machine is started for the first time after being upgraded;
the deployment module is used for deploying the hook program to the process of the virtual machine when the upgraded hook program is started for the first time.
7. The apparatus of claim 5, wherein the sending module is specifically configured to:
and starting a named pipeline through the proxy service program of the virtual machine to receive a shutdown event intercepted by the virtual machine process, and sending the shutdown event to the client after receiving the shutdown event.
8. A client communicatively coupled to a server for using virtual desktop services provided by the server via a virtual machine, the client comprising:
the receiving module is used for receiving a virtual desktop shutdown event sent by the server when the server monitors the shutdown event of the virtual desktop currently used by the client;
the second detection module is used for detecting whether the linkage shutdown strategy between the client and the virtual machine is started or not; the linkage shutdown strategy is configured in advance through a virtual management platform, and the virtual desktop management platform is used for sending the linkage shutdown strategy to the client after the shutdown event is sent to the client;
the third detection module is used for detecting whether the client is a thin client or not when the linkage shutdown strategy between the client and the virtual machine is started;
the fourth detection module is used for detecting whether other virtual desktops are operated at the client side when the client side is the thin client side; and the closing module is used for closing the client when the client does not run other virtual desktops currently.
CN201810524131.8A 2018-05-28 2018-05-28 Linkage shutdown method and device and client Active CN108804147B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810524131.8A CN108804147B (en) 2018-05-28 2018-05-28 Linkage shutdown method and device and client

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810524131.8A CN108804147B (en) 2018-05-28 2018-05-28 Linkage shutdown method and device and client

Publications (2)

Publication Number Publication Date
CN108804147A CN108804147A (en) 2018-11-13
CN108804147B true CN108804147B (en) 2022-05-10

Family

ID=64090587

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810524131.8A Active CN108804147B (en) 2018-05-28 2018-05-28 Linkage shutdown method and device and client

Country Status (1)

Country Link
CN (1) CN108804147B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112286627B (en) * 2020-09-25 2023-06-30 福建升腾资讯有限公司 Virtual machine management method and system based on Ovirt and event driving
CN114327010A (en) * 2021-12-28 2022-04-12 杭州雾联科技有限公司 System control method, device and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101877713A (en) * 2009-11-30 2010-11-03 英业达股份有限公司 System for remotely operating virtual machine
CN106657358A (en) * 2016-12-29 2017-05-10 北京奇虎科技有限公司 Service proxy method and device for Android applications
CN107689873A (en) * 2016-08-05 2018-02-13 深圳市深信服电子科技有限公司 A kind of method and device of switching on and shutting down
CN107888430A (en) * 2017-12-15 2018-04-06 新华三云计算技术有限公司 Virtual Machine Manager operates synchronous method and device

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150006730A1 (en) * 2013-06-27 2015-01-01 Sap Ag Enabling multi-tenant virtual servers in a cloud system
CN103618752B (en) * 2013-12-18 2017-10-10 广东中科遥感技术有限公司 A kind of virtual machine remote desktop safety accesses system and method
CN105094896B (en) * 2015-07-01 2019-07-26 北京奇安信科技有限公司 Client terminal start-up method, apparatus and system on virtual platform
US9977894B2 (en) * 2015-11-18 2018-05-22 Red Hat, Inc. Virtual machine malware scanning
CN105844148A (en) * 2016-03-16 2016-08-10 北京金山安全软件有限公司 Method and device for protecting operating system and electronic equipment
CN106019957A (en) * 2016-05-31 2016-10-12 Tcl集团股份有限公司 Intelligent terminal control method and intelligent terminal control system
CN106203092B (en) * 2016-06-30 2019-12-10 珠海豹趣科技有限公司 Method and device for intercepting shutdown of malicious program and electronic equipment
CN106648937B (en) * 2016-12-29 2020-02-28 北京奇虎科技有限公司 Broadcast agent method and device for android application
CN106650410B (en) * 2016-12-29 2020-01-31 北京奇虎科技有限公司 Permission control method and device for android applications
CN107483552A (en) * 2017-07-24 2017-12-15 河南智业科技发展有限公司 A kind of cloud desktop intelligent start/stop method based on cloud computing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101877713A (en) * 2009-11-30 2010-11-03 英业达股份有限公司 System for remotely operating virtual machine
CN107689873A (en) * 2016-08-05 2018-02-13 深圳市深信服电子科技有限公司 A kind of method and device of switching on and shutting down
CN106657358A (en) * 2016-12-29 2017-05-10 北京奇虎科技有限公司 Service proxy method and device for Android applications
CN107888430A (en) * 2017-12-15 2018-04-06 新华三云计算技术有限公司 Virtual Machine Manager operates synchronous method and device

Also Published As

Publication number Publication date
CN108804147A (en) 2018-11-13

Similar Documents

Publication Publication Date Title
US8683459B2 (en) Automated virtual appliance sizing
US9516060B2 (en) Malware analysis methods and systems
CN107408180B (en) Detection of malicious invocation of application program interface calls
US8069362B2 (en) Automated electrical power savings in virtualization environments
US9635138B2 (en) Client-server input method editor architecture
US8875296B2 (en) Methods and systems for providing a framework to test the security of computing system over a network
US9065725B1 (en) Techniques for virtual environment-based web client management
US20150332043A1 (en) Application analysis system for electronic devices
US9870303B2 (en) Monitoring and correlating a binary process in a distributed business transaction
CN113296798B (en) Service deployment method, device and readable storage medium
EP2883135A1 (en) Background application page architecture for web applications
US20200210214A1 (en) Auditing clipboard operations in virtual desktop environments
US10084637B2 (en) Automatic task tracking
US10404568B2 (en) Agent manager for distributed transaction monitoring system
US20170147462A1 (en) Agent dynamic service
WO2015199878A1 (en) System and method for the tracing and detection of malware
EP3611643A1 (en) Malware detection based on user interactions
Karne et al. DOSC: dispersed operating system computing
CN108804147B (en) Linkage shutdown method and device and client
CN109831351B (en) Link tracking method, device, terminal and storage medium
CN113626133B (en) Virtual machine control method, device, equipment and computer readable storage medium
US20170147483A1 (en) Tracking asynchronous entry points for an application
US10025646B2 (en) Naming of nodes in NET framework
US10223092B2 (en) Capturing and deploying applications using maximal and minimal sets
CN108255547B (en) Application program control method and device

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