CN113821286A - Method and device for distributing virtual machine files in cloud desktop environment and storage medium - Google Patents

Method and device for distributing virtual machine files in cloud desktop environment and storage medium Download PDF

Info

Publication number
CN113821286A
CN113821286A CN202111016020.4A CN202111016020A CN113821286A CN 113821286 A CN113821286 A CN 113821286A CN 202111016020 A CN202111016020 A CN 202111016020A CN 113821286 A CN113821286 A CN 113821286A
Authority
CN
China
Prior art keywords
task
file distribution
token
concurrency
tokens
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
CN202111016020.4A
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.)
New H3C Big Data Technologies Co Ltd
Original Assignee
New H3C Big Data 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 Big Data Technologies Co Ltd filed Critical New H3C Big Data Technologies Co Ltd
Priority to CN202111016020.4A priority Critical patent/CN113821286A/en
Publication of CN113821286A publication Critical patent/CN113821286A/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/451Execution arrangements for user interfaces
    • G06F9/452Remote windowing, e.g. X-Window System, desktop virtualisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method, a device and a storage medium for distributing files of a virtual machine in a cloud desktop environment, which are used for solving the technical problem that the concurrency number of batch file distribution in a virtual desktop infrastructure cannot be adjusted in a self-adaptive and dynamic mode. In the invention, a control service component in a cloud desktop environment realizes the control of the concurrent execution of a file distribution task through three variable parameters of a token blocking queue, the used token number and the available token total number, can receive a concurrent number modification task in real time, and realizes the dynamic modification of the file distribution concurrent number in a virtual desktop infrastructure through dynamically modifying the three variable parameters according to a preset rule algorithm.

Description

Method and device for distributing virtual machine files in cloud desktop environment and storage medium
Technical Field
The invention relates to the technical field of cloud computing, in particular to a method and a device for distributing files of a virtual machine in a cloud desktop environment and a storage medium.
Background
A Virtual Desktop Infrastructure (VDI, also called cloud Desktop Infrastructure) can host a 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 the cloud desktop of the user through various terminal devices such as a PC (personal computer), a thin client and the like to complete tasks such as daily office work, and an administrator can realize visual management of all cloud desktop resources and batch deployment of the cloud desktops to meet the requirements of a large number of users. The Virtual desktop infrastructure mainly comprises a terminal device client, a desktop connection protocol, a cloud desktop management platform, a virtualization management platform, infrastructure components, a desktop resource pool and the like, wherein the desktop resource pool is composed of a plurality of Virtual Machines (VMs) capable of providing Virtual desktops.
With the development of information technology and computers, the iterative update of the cloud computing technology is greatly promoted, the use scenes of the cloud computing become more and more diversified, and the requirements under different application scenes are continuously enriched.
Based on the requirements of current teleeducation and teleworking, the solution for fusing teleworking and teleeducation can realize the purposes of uniformly distributing computer resources, visualizing computer management and enriching working and teaching scenes.
In the office and education integration solution, the operation of distributing the files in batches to the virtual machines through the cloud desktop management platform is a basic requirement scene, namely after the files are uploaded by the cloud desktop management platform, the virtual machines needing to be issued are selected to execute distribution operation, and the files are distributed to the virtual machines of all the clients.
Because the file distribution involves the occupation of network bandwidth, when the target file is small and the distributed virtual machines are few, the influence on other tasks in the network is little. However, when the file size is large and there are many distributed virtual machines, it will have a large impact on other tasks in the network, especially on real-time operations such as the operation of the virtual machine by the client. Therefore, the concurrency amount of the distribution tasks is generally controlled in the file distribution so as to reduce the great influence on other tasks in the existing network.
In the current cloud desktop system, two common schemes for limiting file distribution concurrency are provided, one scheme is that the number of concurrent access is fixed, and file distribution concurrency is executed according to the fixed number; the second is to set a limit on the number of concurrent accesses before each file distribution transaction.
In the first scheme, since the concurrent access number of file distribution is fixed, no matter whether the current network bandwidth occupation is high or low, tasks are always executed in a certain concurrent number, and the concurrent number cannot be adjusted according to the current network bandwidth condition.
In the second scheme, although the number of concurrent accesses is set when the distribution task is executed, the problem of the fixed number of concurrent accesses in the first scheme is solved to a certain extent, in the task execution, the number of concurrent accesses in the task cannot be modified, and only reference can be made according to the network occupation condition before the task execution. The use of the network condition by the use scene of the cloud computing may change at any time, for example, the traffic volume in the current network is large, and the network bandwidth occupies a large amount in a period of time, so the concurrency amount set before the distribution task is set is small. However, after the peak time has elapsed, the network may be idle for a subsequent period of time, and the task in execution cannot adjust the amount of concurrency to fully utilize the idle network bandwidth.
Disclosure of Invention
In view of this, the present invention provides a method, an apparatus, and a storage medium for distributing a file of a virtual machine in a cloud desktop environment, which are used to solve the technical problem that the concurrency number of batch file distribution in a virtual desktop infrastructure cannot be dynamically adjusted in a self-adaptive manner.
On the basis of one aspect of the embodiment of the invention, the invention provides a method for distributing files of a virtual machine in a cloud desktop environment, which comprises the following steps:
applying for a token to a token blocking queue tokenQueue when executing a file distribution task for a single virtual machine; the number of initialization tokens of the tokenQueue is equal to the total number of available tokens totalToken;
when the token is successfully applied to the token queue, adding 1 to the used token number consumeToken and executing the file distribution task; when the token is failed to be applied to the tokenQueue, the execution of the file distribution task is blocked;
when the file distribution task is completed, returning the token applied by the task to tokenQueue and subtracting 1 from consumeToken;
and when receiving the concurrent number modification task, executing the concurrent number modification task, wherein the concurrent number modification task realizes the dynamic modification of the file distribution concurrent number by dynamically modifying the totalToken, the tokenQueue and the consumeToken.
Further, when the concurrency number modification task is to increase the file distribution concurrency number, the method for executing the concurrency number modification task is as follows:
acquiring an increased file distribution concurrency increment n from the concurrency modification task attribute, and adding n tokens to a token queue;
and modifying the total number totalttoken of the available tokens into totalttoken + n.
Further, when the concurrency number modification task is to reduce the number of file distribution concurrency and the number of tokens consumeToken currently used is smaller than the number n of file distribution concurrency to be reduced, the method for executing the concurrency number modification task is as follows:
modifying the total number totaltToken of the available tokens into totaltToken-n;
setting the number of tokens consumeToken used currently as 0 to prevent the currently executed file distribution task from returning the tokens to the token queue;
the token blocking queue tokenQueue is decremented by the difference of n and the number of file distribution tasks currently being executed, i.e., n minus consumeToken before reset.
Further, when the concurrency number modification task is to reduce the number of file distribution concurrency and the currently used token number consumeToken is greater than or equal to the number n of file distribution concurrency to be reduced, the method for executing the concurrency number modification task is as follows:
modifying the total number totaltToken of the available tokens into totaltToken-n;
judging whether the number of tokens consumeToken + n used currently is more than or equal to the total number totalToken of the modified available tokens;
when the consumeToken + n is larger than or equal to totalToken, setting the token number consumeToken used currently as totalToken-n, and emptying the rest tokens in the tokenQueue;
when consumeToken + n is less than totalToken, n tokens are subtracted from tokenQueue.
Further, the file distribution task and the concurrency number modification task are sent to a control Service component Controller Service in the cloud desktop environment by a cloud desktop management platform Service component Workspace Service, and are executed by the Controller Service.
Based on another aspect of the embodiments of the present invention, the present invention further provides a device for distributing a file of a virtual machine in a cloud desktop environment, where the device includes:
the cloud desktop management platform Service component Workspace Service is used for issuing one or more file distribution tasks aiming at a single virtual machine and issuing concurrency number modification tasks to the cloud desktop management platform control Service component;
the cloud desktop management platform control Service component is used for executing the file distribution task and the concurrency number modification task, and comprises:
the token queue processing module is used for applying for a token from the token blocking queue token queue when executing a file distribution task aiming at a single virtual machine; when the file distribution task is completed, returning the token applied by the task to tokenQueue and subtracting 1 from consumeToken; the number of initialization tokens of the tokenQueue is equal to the total number of available tokens totalToken;
the file distribution task execution module is used for adding 1 to the used token number consumeToken and executing the file distribution task when the token is successfully applied to the token queue; when the token is failed to be applied to the tokenQueue, the execution of the file distribution task is blocked;
and the concurrent number modification module is used for executing the concurrent number modification task when the concurrent number modification task is received, and the concurrent number modification task realizes the dynamic modification of the file distribution concurrent number by dynamically modifying the totalToken, the tokenQueue and the consumeToken.
Further, the concurrency number modification module comprises:
the concurrency number increasing submodule is used for acquiring an increased file distribution concurrency number increment n from the attribute of the concurrent number modification task and increasing n tokens to the token queue when the concurrent number modification task is to increase the file distribution concurrency number; and modifying the total number totalttoken of the available tokens to totalttoken + n.
Further, the concurrency number modification module further includes:
the first concurrent number reducing submodule is used for modifying the total number totaltotken of the available tokens into totaltotken-n when the concurrent number modifying task is used for reducing the file distribution concurrent number and the number consumeToken used currently is less than the number n of the file distribution concurrent number to be reduced; setting the number of tokens consumeToken used currently as 0 to prevent the currently executed file distribution task from returning the tokens to the token queue; and subtracting the difference between n and the number of file distribution tasks currently being executed from the token blocking queue tokenQueue.
Further, the concurrency number modification module further includes:
the concurrency number second reducing submodule is used for modifying the total number totaltotken of the available tokens into totaltotken-n when the concurrency number modifying task is to reduce the file distribution concurrency number and the number consumeToken used currently is greater than or equal to the number n of the file distribution concurrency to be reduced; judging whether the number of tokens consumeToken + n used currently is more than or equal to the total number totalToken of the modified available tokens;
when the consumeToken + n is larger than or equal to totalToken, setting the token number consumeToken used currently as totalToken-n, and emptying the rest tokens in the tokenQueue;
when consumeToken + n is less than totalToken, n tokens are subtracted from tokenQueue.
In the invention, a control service component in a cloud desktop environment realizes the control of the concurrent execution of a file distribution task through three variable parameters of a token blocking queue, the used token number and the available token total number, can receive a concurrent number modification task in real time, and realizes the dynamic modification of the file distribution concurrent number in a virtual desktop infrastructure through dynamically modifying the three variable parameters according to a preset rule algorithm.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments of the present invention or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present invention, and for those skilled in the art, other drawings may be obtained according to the drawings of the embodiments of the present invention.
Fig. 1 is a schematic diagram illustrating an implementation process and a component structure of a file distribution method for a virtual machine in a cloud desktop environment according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating a step of dynamically increasing the concurrent number of file distribution tasks in the virtual machine file distribution method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a step of dynamically reducing the concurrency number of file distribution tasks (scene one) in the file distribution method of the virtual machine according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a step of dynamically reducing the concurrency number (scenario two) of file distribution tasks in the file distribution method of the virtual machine according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a virtual machine file distribution apparatus in a cloud desktop environment according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the embodiments of the invention. As used in this embodiment of the invention, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The term "and/or" as used herein is meant to encompass any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used to describe various information in embodiments of the present invention, the information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of embodiments of the present invention. Depending on the context, moreover, the word "if" as used may be interpreted as "at … …" or "when … …" or "in response to a determination".
The invention aims to provide a virtual machine file distribution method which is used for dynamically adjusting the concurrency of file distribution services in real time according to different network occupation conditions.
For clear and complete description of the technical scheme of the invention, the following detailed description takes the cloud desktop management platform workbench architecture as an example and combines with the accompanying drawings.
In the cloud desktop infrastructure, a client is client software connected with a Workspace cloud desktop virtual machine. The security gateway provides network security protection for the client to access the Workspace cloud desktop virtual machine. The user can log in the management platform through the WEB to manage and configure.
The control Service component Controller Service is used for providing services for the client, such as user login, virtual machine application and the like; performing service interaction with the virtual machine, such as command issuing, file issuing, virtual machine startup and shutdown and the like; performing service interaction with a Workspace Server, for example, returning login information to a Workspace Server client; and interacting with the underlying virtual machine through an interface, such as inquiring the state of the virtual machine.
The cloud desktop management platform Service component Workspace Service is used for providing services for a Web end, such as Web end login and interface data display function control; performing Service interaction with the Controller Server, for example, querying the client login information and the like from the Controller Server; and interacting with the underlying virtual machine through an interface, such as executing the creation of the virtual machine, the deletion of the virtual machine and the like.
Fig. 1 is a schematic diagram of an implementation process and a component structure of a file distribution method for a cloud desktop environment virtual machine according to an embodiment of the present invention. The embodiment is realized based on a cloud desktop infrastructure, a Remote Procedure Call (RPC) protocol which can be adopted between a cloud desktop management platform Service component Workspace Service and a control Service component Conroller Service is a GRPC protocol, and data transmission can be carried out by using a structural data serialization method (such as protobuf).
In this embodiment, the execution of the file distribution task is implemented based on tokens, involving several token-related variables:
total number of available tokens totalttoken: the variable is used for storing the total concurrency number of the file distribution tasks set by the user;
number of tokens consumed consumeToken: the variable is used for storing the number of tokens consumed by the file distribution task which is currently executed concurrently, namely the number of tokens used by the file distribution task which is currently executed;
token blocking queue token queue: for maintaining tokens that have not been used. The token blocking queue has totalToken tokens when being initialized, when a file distribution task starts to be executed, a token is taken out from the tokenQueue queue for the file distribution task and distributed to the file distribution task, and when the file distribution task ends, the token distributed to the file distribution task is returned to the totalToken queue. And if the token in the token queue is already allocated and the file distribution task cannot take the token, setting the file distribution task in a waiting state until the token is available in the token queue.
The following describes the distribution and execution process of the file distribution task with reference to fig. 1:
step 101, selecting a virtual machine of a file to be issued on a management interface of a cloud desktop management platform, customizing a file distribution task, and issuing the file distribution task to a cloud desktop management platform Service component Workspace Service;
the cloud desktop management platform can provide a management page (equivalent to a management terminal) based on a browser through WEB service, an administrator can customize a file distribution task through the management page, can select a virtual machine of a file to be issued on a management interface, and customizes the file distribution task aiming at the selected virtual machine.
And step 102, after receiving the file distribution task issuing request, the Workspace Service issues the task to the Controller Service through the GRPC message. The file distribution task issuing request carries file distribution task information, including a task identifier, a file identifier to be issued, a target virtual machine address and the like.
And step 103, after receiving the file distribution task issuing request, the Controller Service starts to execute the file distribution task, and simultaneously replies the successful distribution of the work space Service task through the GRPC message.
And step 104, after receiving the successful task distribution message, the Workspace Service responds to the management interface of the cloud desktop management platform, and the management interface displays that the distribution task is started to be executed.
In this embodiment, the method for the Controller Service to execute the file distribution task includes:
step 1031, when the Controller Service executes a file distribution task of a certain virtual machine, trying to acquire a token from the token queue, if the token cannot be acquired, blocking the execution of the file distribution task, setting the file distribution task in a blocking waiting state, after the token is acquired, starting to execute the file distribution task, and simultaneously adding 1 to the consumeToken number.
And 1032, after the file distribution task of a certain virtual machine is executed, judging whether consumeToken is larger than 0, if so, returning the token to the token queue, and simultaneously reducing the number of consumeToken by 1.
For example, assuming totalToken is set to 1, tokenQueue contains only 1 token at initialization. If the Workspace Service issues 2 file distribution tasks of the virtual machines to the Controller Service, the Controller Service sequentially executes the 2 file distribution tasks, after a first file distribution task is started, 1 token is firstly obtained from a token queue, and after the token is obtained, the first file distribution task starts to be executed. After the first file distribution task is executed, the second file distribution task is started, and when the second file distribution task acquires the token from the token queue, if the token queue is unavailable, the second file distribution task is set to be in a blocking waiting state by the Controller Service. After the first file distribution task is executed and the token is returned to the token queue, the second file distribution task can acquire the token and start to execute.
Fig. 2 is a schematic flow chart of a step of dynamically increasing the concurrent number of file distribution tasks in the virtual machine file distribution method provided in an embodiment of the present invention, where the step includes:
step 201, the cloud desktop management platform modifies the concurrent access number, the modification number is increased by n, and the cloud management platform issues a concurrent number modification request for modifying the concurrent access number to the Workspace Service through the management interface.
And step 202, after receiving the concurrency number modification request, Workspace Service transmits the concurrency number modification task to Controller Service through GRPC message.
And 203, after receiving the concurrent number modification task, the Controller Service starts to execute the concurrent number modification task, and after the task is successfully executed, the Controller Service replies a message that the execution of the Workspace Service concurrent number modification task is successful through the GRPC message.
The step process of executing the concurrent number modification task by the Controller Service is as follows:
step 2031, when acquiring that the modification instruction increases n for the file distribution concurrency number (the increment of the file distribution concurrency number is n) from the attributes of the concurrent number modification task, increasing n tokens to the token queue. Wherein n is an integer greater than 0.
Step 2032, modify total token number totalToken to totalToken + n.
Step 2033, if there is a task waiting (blocking) because there is no available token in the token queue in the currently issued file distribution tasks being executed, the waiting file distribution task can obtain the token from the token queue after n tokens are added, and start the file distribution tasks of n virtual machines, so as to achieve the purpose of dynamically increasing the concurrence number as totalToken + n.
And step 204, after receiving the feedback message that the concurrency number modification task is successfully executed, the Workspace Service informs a management interface of the cloud desktop management platform that the concurrency number modification task is successfully executed.
Fig. 3 is a schematic flow chart of a step of dynamically reducing the concurrency number (scenario one) of file distribution tasks in the file distribution method of the virtual machine according to an embodiment of the present invention. In a scenario one, the number of used tokens consumeToken is smaller than the number n of file distribution concurrency to be reduced, that is, totaltken after modification- (totaltken before modification-consumeToken before modification) <0, which indicates that the number of modified tokens that are not currently consumed is more than the number of modified totaltken, and in this scenario, the modification process is as follows:
step 301, distributing the concurrent number through a management interface modification file of the cloud desktop management platform, reducing the total number totalttoken of the available tokens by n, and issuing a concurrent number modification request for modifying the concurrent access number to the Workspace Service.
Step 302, after receiving the concurrent number modification request, the Workspace Service issues the concurrent number modification task to the Controller Service through the GRPC message.
And step 303, after receiving the task, the Controller Service starts to execute the concurrent number modification task, and after the task is successfully executed, the Controller Service replies a message that the execution of the Workspace Service modification task is successful through the GRPC message.
The step process of executing the concurrent number modification task by the Controller Service is as follows:
step 3031, when the modification instruction is acquired from the concurrent number modification task attribute and the number of the distributed concurrent numbers of the file is reduced by n, modifying the total number totaltotken of the current available tokens into totaltotken-n.
Step 3032, under the condition that the condition of the scenario one is met, namely consumeToken < n, resetting consumeToken 0, so as to prevent the currently executed file distribution task from returning the token to the tokenQueue.
Step 3033. deduct n tokens from the token queue by the difference between the number of file distribution tasks currently being executed and n (i.e. the consumeToken value before n-top value).
After the above operation, only totalToken-n tokens remain in the token blocking queue tokenQueue. Meanwhile, because consumeToken is set to be 0, the token used by the file distribution task cannot return to the token queue after the task is completed, the concurrency quantity of the subsequent file distribution task is modified to totalToken-n, and the purpose of dynamically reducing the concurrency quantity to totalToken-n is achieved.
And step 304, after receiving the message that the modification task is successfully executed, the Workspace Service responds to the cloud desktop management platform, and the modification task is successfully executed.
Fig. 4 is a schematic flow chart of a step of dynamically reducing the concurrency number (scenario two) of file distribution tasks in the file distribution method of the virtual machine according to the embodiment of the present invention. In this scenario, the number of tokens consumeToken currently used is greater than or equal to the number n of file distribution concurrency to be reduced, that is, totaltken after modification- (totaltken before modification-consumeToken before modification) > (0), which indicates that the number of tokens currently not consumed after modification is less than the number of tokens after modification, and the modification process in this scenario is:
step 401, distributing the concurrent number through a management interface modification file of the cloud desktop management platform, reducing the total number totalToken of the available tokens by n, and issuing a concurrent number modification request for modifying the concurrent access number to the Workspace Service.
And step 402, after receiving the concurrent number modification request, Workspace Service issues the task to Controller Service through GRPC message.
And step 403, after the Controller Service receives the task, executing the concurrent number modification task, and after the task is successfully executed, replying a message that the Workspace Service modification task is successfully executed through the GRPC message.
The step process of executing the concurrent number modification task by the Controller Service is as follows:
step 4031, when the modification instruction is acquired from the attribute of the concurrent number modification task and the number of the distributed concurrent numbers of the file is reduced by n, modifying the total number totaltotken of the current available tokens to totaltotken-n.
Step 4031, under the condition that consumeToken is equal to or greater than n, which is the condition that scenario two is met, determine whether consumeToken + n > -totalToken? If yes, resetting consumeToken-n (i.e. step b in the figure). The token queue is then emptied of the remaining tokens (i.e., step c in the figure). Through the operation, the number of tokens which can be returned to the tokenQueue by the currently executed file distribution task is totalToken-n, the number of the subsequent file distribution tasks which can be continuously and concurrently executed is modified to totalToken-n, and the aim of dynamically reducing the concurrency amount to totalToken-n is fulfilled.
Step 4032. if consumeToken + n < totalToken, i.e., consumeToken is smaller than totalToken after modification. N tokens are subtracted from the tokenQueue, i.e. n tokens are deleted from the tokens that have not yet been used. Through the operation, the number of tokens that the currently executed file distribution task can return to the tokenQueue is consumeToken, and the number of tokens that still remain in the tokenQueue is totalteon-consumeToken-n, so that the number of subsequent file distribution tasks that can continue to be executed concurrently is modified to be consumeToken + (totalteon-consumeToken-n), and the goal of dynamically reducing the concurrency amount to totalteon-n is achieved
And step 404, after receiving the message that the modification task is successfully executed, the Workspace Service responds to the cloud desktop management platform to successfully execute the modification task.
Through the file distribution concurrency number modification process, the file distribution concurrency number can be dynamically modified according to the network occupation condition, so that the control of the file distribution concurrency number of the virtual machine of the cloud desktop product is more intelligent, and a new implementation mode is provided.
Fig. 5 is a schematic structural diagram of a virtual machine file distribution apparatus in a cloud desktop environment according to an embodiment of the present invention, and each functional module in the apparatus 500 may be implemented by software, hardware, or a combination of software and hardware. The apparatus 500 comprises:
the cloud desktop management platform Service component Workspace Service 510 is used for issuing one or more file distribution tasks aiming at a single virtual machine and issuing a concurrency number modification task to the cloud desktop management platform control Service component Controller Service 520;
a cloud desktop management platform control Service component Controller Service 520, configured to execute the file distribution task and the concurrency number modification task, where the component 520 further includes:
the token queue processing module 521 is configured to apply for a token from a token blocking queue token queue when executing a file distribution task for a single virtual machine; when the file distribution task is completed, returning the token applied by the task to tokenQueue and subtracting 1 from consumeToken; the number of initialization tokens of the tokenQueue is equal to the total number of available tokens totalToken;
the file distribution task execution module 522 is configured to, when a token is successfully applied to the tokenQueue, add 1 to the used token number consumeToken and execute the file distribution task; when the token is failed to be applied to the tokenQueue, the execution of the file distribution task is blocked;
a concurrency number modification module 523, configured to execute the concurrency number modification task when the concurrency number modification task is received, where the concurrency number modification task implements dynamic modification of the file distribution concurrency number by dynamically modifying the totalToken, the tokenQueue, and the consumeToken.
Further, the concurrency number modification module 523 includes:
the concurrency number increasing submodule is used for acquiring an increased file distribution concurrency number increment n from the attribute of the concurrent number modification task and increasing n tokens to the token queue when the concurrent number modification task is to increase the file distribution concurrency number; and modifying the total number totalttoken of the available tokens to totalttoken + n.
Further, the concurrency number modification module 523 further includes:
the first concurrent number reducing submodule is used for modifying the total number totaltotken of the available tokens into totaltotken-n when the concurrent number modifying task is used for reducing the file distribution concurrent number and the number consumeToken used currently is less than the number n of the file distribution concurrent number to be reduced; setting the number of tokens consumeToken used currently as 0 to prevent the currently executed file distribution task from returning the tokens to the token queue; and subtracting the difference between n and the number of file distribution tasks currently being executed from the token blocking queue tokenQueue.
Further, the concurrent number modification module further includes:
the concurrency number second reducing submodule is used for modifying the total number totaltotken of the available tokens into totaltotken-n when the concurrency number modifying task is to reduce the file distribution concurrency number and the number consumeToken used currently is greater than or equal to the number n of the file distribution concurrency to be reduced; judging whether the number of tokens consumeToken + n used currently is more than or equal to the total number totalToken of the modified available tokens;
when the consumeToken + n is larger than or equal to totalToken, setting the token number consumeToken used currently as totalToken-n, and emptying the rest tokens in the tokenQueue;
when consumeToken + n is less than totalToken, n tokens are subtracted from tokenQueue.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device 600 includes: a processor 610 such as a Central Processing Unit (CPU), a communication bus 620, a communication interface 640, and a storage medium 630. Wherein the processor 610 and the storage medium 630 may communicate with each other through a communication bus 620. The storage medium 630 stores therein a computer program, for example, a computer program instance of the aforementioned works Service component and/or Controller Service component, which is stored in the storage medium 630, and when being executed by the processor 610, the computer program can implement the functions of the steps of the method provided by the present invention.
The storage medium may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. In addition, the storage medium may be at least one memory device located remotely from the processor. The Processor may be a general-purpose Processor including a Central Processing Unit (CPU), a Network Processor (NP), etc.; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
It should be recognized that embodiments of the present invention can be realized and implemented by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory memory. The method may be implemented in a computer program using standard programming techniques, including a non-transitory storage medium configured with the computer program, where the storage medium so configured causes a computer to operate in a specific and predefined manner. Each program may be implemented in a high level procedural or object oriented programming language to communicate with a computer system. However, the program(s) can be implemented in assembly or machine language, if desired. In any case, the language may be a compiled or interpreted language. Furthermore, the program can be run on a programmed application specific integrated circuit for this purpose. Further, operations of processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and/or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) collectively executed on one or more processors, by hardware, or combinations thereof. The computer program includes a plurality of instructions executable by one or more processors.
Further, the method may be implemented in any type of computing platform operatively connected to a suitable interface, including but not limited to a personal computer, mini computer, mainframe, workstation, networked or distributed computing environment, separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, and the like. Aspects of the invention may be embodied in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optically read and/or write storage medium, RAM, ROM, or the like, such that it may be read by a programmable computer, which when read by the storage medium or device, is operative to configure and operate the computer to perform the procedures described herein. Further, the machine-readable code, or portions thereof, may be transmitted over a wired or wireless network. The present invention includes these and other different types of non-transitory computer-readable storage media when such media include instructions or programs that implement the above-described steps in conjunction with a microprocessor or other data processor. The invention also includes the computer itself when programmed according to the methods and techniques described herein.
The above description is only an example of the present invention, and is not intended to limit the present invention. Various modifications and alterations to this invention will become apparent to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for distributing files of a virtual machine in a cloud desktop environment is characterized by comprising the following steps:
applying for a token to a token blocking queue tokenQueue when executing a file distribution task for a single virtual machine; the number of initialization tokens of the tokenQueue is equal to the total number of available tokens totalToken;
when the token is successfully applied to the token queue, adding 1 to the used token number consumeToken and executing the file distribution task; when the token is failed to be applied to the tokenQueue, the execution of the file distribution task is blocked;
when the file distribution task is completed, returning the token applied by the task to tokenQueue and subtracting 1 from consumeToken;
and when receiving the concurrent number modification task, executing the concurrent number modification task, wherein the concurrent number modification task realizes the dynamic modification of the file distribution concurrent number by dynamically modifying the totalToken, the tokenQueue and the consumeToken.
2. The method according to claim 1, wherein when the concurrency number modification task is to increase the file distribution concurrency number, the method for executing the concurrency number modification task is to:
acquiring an increased file distribution concurrency increment n from the concurrency modification task attribute, and adding n tokens to a token queue;
and modifying the total number totalttoken of the available tokens into totalttoken + n.
3. The method according to claim 2, wherein when the concurrency number modification task is to reduce the number of file distribution concurrency and the number of tokens consumeToken currently used is less than the number n of file distribution concurrency to be reduced, the method for executing the concurrency number modification task is:
modifying the total number totaltToken of the available tokens into totaltToken-n;
setting the number of tokens consumeToken used currently as 0 to prevent the currently executed file distribution task from returning the tokens to the token queue;
the token blocking queue tokenQueue is decremented by the difference of n and the number of file distribution tasks currently being executed, i.e., n minus consumeToken before reset.
4. The method according to claim 3, wherein when the concurrency number modification task is to reduce the number of file distribution concurrency and the number of tokens consumeToken currently used is greater than or equal to the number n of file distribution concurrency to be reduced, the method for executing the concurrency number modification task is:
modifying the total number totaltToken of the available tokens into totaltToken-n;
judging whether the number of tokens consumeToken + n used currently is more than or equal to the total number totalToken of the modified available tokens;
when the consumeToken + n is larger than or equal to totalToken, setting the token number consumeToken used currently as totalToken-n, and emptying the rest tokens in the tokenQueue;
when consumeToken + n is less than totalToken, n tokens are subtracted from tokenQueue.
5. The method of claim 1,
the file distribution task and the concurrency number modification task are sent to a control Service component Controller Service in the cloud desktop environment by a cloud desktop management platform Service component Workspace Service and executed by the Controller Service.
6. An apparatus for distributing a file of a virtual machine in a cloud desktop environment, the apparatus comprising:
the cloud desktop management platform Service component Workspace Service is used for issuing one or more file distribution tasks aiming at a single virtual machine and issuing concurrency number modification tasks to the cloud desktop management platform control Service component;
the cloud desktop management platform control Service component is used for executing the file distribution task and the concurrency number modification task, and comprises:
the token queue processing module is used for applying for a token from the token blocking queue token queue when executing a file distribution task aiming at a single virtual machine; when the file distribution task is completed, returning the token applied by the task to tokenQueue and subtracting 1 from consumeToken; the number of initialization tokens of the tokenQueue is equal to the total number of available tokens totalToken;
the file distribution task execution module is used for adding 1 to the used token number consumeToken and executing the file distribution task when the token is successfully applied to the token queue; when the token is failed to be applied to the tokenQueue, the execution of the file distribution task is blocked;
and the concurrent number modification module is used for executing the concurrent number modification task when the concurrent number modification task is received, and the concurrent number modification task realizes the dynamic modification of the file distribution concurrent number by dynamically modifying the totalToken, the tokenQueue and the consumeToken.
7. The apparatus of claim 6, wherein the concurrency number modification module comprises:
the concurrency number increasing submodule is used for acquiring an increased file distribution concurrency number increment n from the attribute of the concurrent number modification task and increasing n tokens to the token queue when the concurrent number modification task is to increase the file distribution concurrency number; and modifying the total number totalttoken of the available tokens to totalttoken + n.
8. The apparatus of claim 7, wherein the concurrency number modification module further comprises:
the first concurrent number reducing submodule is used for modifying the total number totaltotken of the available tokens into totaltotken-n when the concurrent number modifying task is used for reducing the file distribution concurrent number and the number consumeToken used currently is less than the number n of the file distribution concurrent number to be reduced; setting the number of tokens consumeToken used currently as 0 to prevent the currently executed file distribution task from returning the tokens to the token queue; and subtracting the difference between n and the number of file distribution tasks currently being executed from the token blocking queue tokenQueue.
9. The apparatus of claim 8, wherein the concurrency number modification module further comprises:
the concurrency number second reducing submodule is used for modifying the total number totaltotken of the available tokens into totaltotken-n when the concurrency number modifying task is to reduce the file distribution concurrency number and the number consumeToken used currently is greater than or equal to the number n of the file distribution concurrency to be reduced; judging whether the number of tokens consumeToken + n used currently is more than or equal to the total number totalToken of the modified available tokens;
when the consumeToken + n is larger than or equal to totalToken, setting the token number consumeToken used currently as totalToken-n, and emptying the rest tokens in the tokenQueue;
when consumeToken + n is less than totalToken, n tokens are subtracted from tokenQueue.
10. A storage medium on which a computer program is stored which, when being executed by a processor, carries out the method steps of any one of claims 1 to 5.
CN202111016020.4A 2021-08-31 2021-08-31 Method and device for distributing virtual machine files in cloud desktop environment and storage medium Pending CN113821286A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111016020.4A CN113821286A (en) 2021-08-31 2021-08-31 Method and device for distributing virtual machine files in cloud desktop environment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111016020.4A CN113821286A (en) 2021-08-31 2021-08-31 Method and device for distributing virtual machine files in cloud desktop environment and storage medium

Publications (1)

Publication Number Publication Date
CN113821286A true CN113821286A (en) 2021-12-21

Family

ID=78923599

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111016020.4A Pending CN113821286A (en) 2021-08-31 2021-08-31 Method and device for distributing virtual machine files in cloud desktop environment and storage medium

Country Status (1)

Country Link
CN (1) CN113821286A (en)

Similar Documents

Publication Publication Date Title
US10540351B2 (en) Query dispatch and execution architecture
EP3073374B1 (en) Thread creation method, service request processing method and related device
US10908950B1 (en) Robotic process automation system with queue orchestration and task prioritization
US4949254A (en) Method to manage concurrent execution of a distributed application program by a host computer and a large plurality of intelligent work stations on an SNA network
US6209032B1 (en) Enabling target servers to control determination of full user synchronization
US10261811B2 (en) Systems and methods for contextually allocating emulation resources
US20070255798A1 (en) Brokered virtualized application execution
JPH08502841A (en) Distributed application processing network
CN102402462A (en) Techniques for load balancing GPU enabled virtual machines
CN102946409A (en) Method, system of sending single terminal user experience from a plurality of servers to clients
CN113296950A (en) Processing method, processing device, electronic equipment and readable storage medium
CN111083166A (en) Method and device for setting white list in cloud database and computer storage medium
CN112596757A (en) Method and device for upgrading agent component of cloud desktop virtual machine and storage medium
CN114721818A (en) Kubernetes cluster-based GPU time-sharing method and system
US7197712B2 (en) Server visualization and control
CN110750349B (en) Distributed task scheduling method and system
EP1611523B1 (en) Controlling usage of system resources by a network manager
CN113821286A (en) Method and device for distributing virtual machine files in cloud desktop environment and storage medium
CN111699473B (en) System, method and apparatus for suspending and resuming a virtual assistant
US20160266915A1 (en) Systems and Methods for Providing an Emulation of a Computer Product
US20130185448A1 (en) Systems and Methods for Managing Emulation Sessions
CN114462388A (en) Handle management or communication method, electronic device, storage medium, and program product
CN114281442A (en) Cloud desktop client and method thereof
CN108614732B (en) Method for quickly mapping hardware equipment of operating system under dynamic foreground of Loongson platform
CN114281443B (en) Cloud desktop system and method

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