A cluster resource scheduling method and device and a computer readable storage medium
By scheduling resources during off-peak hours in the cloud gaming cluster and determining which virtual devices match the task priority to execute offline tasks, the problem of low cluster resource utilization is solved, achieving efficient resource utilization and cost reduction.
Patent Information
- Application Number
- CN202210666464.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-14
- Publication Date
- 2026-07-24
- Estimated Expiration
- 2042-06-14
AI Technical Summary
Cloud gaming cluster resources are underutilized during off-peak hours, leading to resource waste and impacting operating costs.
In target clusters where cluster resource utilization on cloud servers is below a preset threshold, target virtual devices are identified and matched with target task priorities to execute offline tasks in order to improve resource utilization.
It improves the utilization rate of cluster resources, reduces the cost for business users to operate offline tasks, and meets the processing needs of tasks with different priorities.
Smart Images

Figure CN117278598B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a cluster resource scheduling method, apparatus and computer-readable storage medium. Background Technology
[0002] Cloud gaming, also known as gaming on demand, is an online gaming technology based on cloud computing. In cloud gaming, the game doesn't run on the player's terminal; instead, it runs on a cloud server. The cloud server renders the game scene as a video and audio stream, which is then transmitted to the player's terminal via the network. Therefore, cloud gaming eliminates the need to consider terminal configuration, completely solving the technical problem of insufficient terminal performance for running demanding games.
[0003] Typically, cloud gaming experiences distinct peak and off-peak periods in real-time player counts; for example, the number of players online during peak hours far exceeds the number during off-peak hours. However, to ensure a smooth gaming experience, the cluster resources supporting cloud gaming are always allocated according to peak hours. This results in significant resource waste during off-peak periods, leading to low cluster resource utilization. Summary of the Invention
[0004] This application provides a cluster resource scheduling method, apparatus, and computer-readable storage medium, which can improve the resource utilization of the cluster.
[0005] In a first aspect, embodiments of this application provide a cluster resource scheduling method, the method comprising:
[0006] Obtain a target offline task request from the business party, wherein the target offline task request includes a target task identifier and a target task priority;
[0007] Identify a target cluster in at least one cluster of cloud servers whose cluster resource utilization is less than a preset threshold.
[0008] A target virtual device is determined from at least one virtual device corresponding to the target cluster. The at least one virtual device refers to a virtual device in the cloud server used to schedule the cluster resources of the target cluster. The priority of the target virtual device matches the priority of the target task.
[0009] A correspondence is established between the device identifier of the target virtual device and the target task identifier. The device identifier of the target virtual device and the corresponding target task identifier are sent to the business party, so that the business party sends the target task parameters of the target offline task corresponding to the target task identifier to the cloud server. The cloud server sends the target task parameters to the target virtual device, and the target virtual device executes the target offline task based on the target task parameters.
[0010] Secondly, embodiments of this application provide a cluster resource scheduling device, the device comprising:
[0011] The acquisition module is used to acquire target offline task requests from business parties, wherein the target offline task request includes a target task identifier and a target task priority;
[0012] The processing module is used to identify a target cluster in at least one cluster of cloud servers whose cluster resource utilization is less than a preset threshold.
[0013] The processing module is further configured to determine a target virtual device among at least one virtual device corresponding to the target cluster, wherein the at least one virtual device refers to a virtual device in the cloud server used to schedule cluster resources of the target cluster, and the priority of the target virtual device matches the priority of the target task;
[0014] The processing module is further configured to establish a correspondence between the device identifier of the target virtual device and the target task identifier, and send the device identifier of the target virtual device and the corresponding target task identifier to the business party, so that the business party sends the target task parameters of the target offline task corresponding to the target task identifier to the cloud server, the cloud server sends the target task parameters to the target virtual device, and the target virtual device executes the target offline task based on the target task parameters.
[0015] Thirdly, embodiments of this application provide a computer device including a processor, a memory, and a network interface, wherein the processor is connected to the memory and the network interface; the network interface is used to provide network communication functions, the memory is used to store program code, and the processor is used to call the program code to implement the methods as described in the first aspect and possible implementations of the first aspect.
[0016] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, implement the cluster resource scheduling method provided in embodiments of this application.
[0017] Fifthly, embodiments of this application also provide a computer program product, which includes a computer program or computer instructions, and when the computer program or computer instructions are executed by a processor, they implement the cluster resource scheduling method provided in embodiments of this application.
[0018] This application embodiment can, after identifying a target cluster with low cluster resource utilization (e.g., a cloud gaming cluster idle during off-peak hours), schedule resources from the target cluster to determine a target virtual device, enabling that target virtual device to execute target offline tasks from the business party. This method can improve cluster resource utilization and reduce the cost for the business party to operate offline tasks. Furthermore, in this application embodiment, the priority of the target virtual device matches the priority of the aforementioned target offline task. Therefore, this application can use virtual devices of different priorities to process offline tasks of different priorities, thereby meeting the task requirements of offline tasks of different priorities. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram illustrating the real-time online player count for cloud gaming, provided in an embodiment of this application.
[0021] Figure 2 This is a schematic diagram of the architecture of a communication system provided in an embodiment of this application;
[0022] Figure 3 This is a flowchart illustrating a cluster resource scheduling method provided in an embodiment of this application;
[0023] Figure 4a This is a schematic diagram of a display page of a cloud management platform provided in an embodiment of this application;
[0024] Figure 4b This is a schematic diagram of the display page of another cloud management platform provided in the embodiments of this application;
[0025] Figure 5 This is a schematic diagram of the architecture of another communication system provided in the embodiments of this application;
[0026] Figure 6 This is a flowchart illustrating another cluster resource scheduling method provided in an embodiment of this application;
[0027] Figure 7This is a flowchart illustrating another cluster resource scheduling method provided in an embodiment of this application;
[0028] Figure 8 This is a schematic diagram of the structure of a cluster resource scheduling device provided in an embodiment of this application;
[0029] Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0031] The terms "first" and "second," etc., used in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0032] When this application is applied to specific products and technologies, data such as target task identifiers, target task parameters, and target task priorities in the embodiments of this application need to be obtained with the permission or consent of the object before they can be acquired, and the collection, use and processing of this data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0033] This application provides a cluster resource scheduling method that improves cluster resource utilization by utilizing resources of clusters with low resource utilization to execute offline tasks. For example, in... Figure 1In the cloud gaming scenario shown, the number of online players during off-peak hours is far lower than during peak hours. Therefore, cluster resources during off-peak hours can be scheduled to execute various offline tasks, reducing the waste of cluster resources. The cluster resource scheduling method proposed in this application involves cloud technology. Cloud technology refers to a hosting technology that unifies hardware, software, network, and other resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Cloud technology is a general term encompassing network technology, information technology, integration technology, management platform technology, and application technology based on cloud computing business models. Depending on the application area, it includes cloud computing, cloud storage, cloud applications, and cloud services. For example, in a specific implementation of this application, at least one server cluster in the cloud server can be used to execute offline tasks in this application, in addition to executing online tasks for various cloud applications (such as audio and video rendering tasks during gameplay in cloud games). Furthermore, the device identifier and task identifier data of the virtual devices in this application can be stored in a cloud database using cloud storage.
[0034] The architecture of the communication system according to embodiments of this application is described below. Figure 2 This is a schematic diagram of the architecture of a communication system provided in an embodiment of this application, such as... Figure 2 As shown, the communication system includes a cloud service cluster side, a cloud management platform side, and a service provider side. The cloud service cluster side includes a cloud server and multiple server clusters. For example, the multiple server clusters include cluster 1, cluster 2, cluster 3, etc. The cloud server can schedule resources from each server cluster to create virtual devices such as virtual device 1, virtual device 2, and virtual device 3. The devices on the cloud management platform side receive offline task requests from devices on the service provider side and communicate with the cloud server based on these requests to determine the virtual device to execute the offline task. The determined virtual device can execute the offline task after receiving the task parameters corresponding to the offline task request.
[0035] Specifically, firstly, the device on the business side triggers the generation of a target offline task request and sends the request to the cloud management platform. This request includes a target task identifier and the target task's priority. Next, the device on the cloud management platform determines a target cluster (e.g., cluster 1) from multiple clusters on the cloud server, whose resource utilization is less than a preset threshold. Then, based on the target task's priority, it determines the target virtual device (e.g., virtual device 1 in cluster 1) from multiple virtual devices corresponding to the target cluster. After determining the target virtual device, the device on the cloud management platform stores the correspondence between the device identifier of the target virtual device and the target task identifier of the target offline task (this data can be stored on the device on the cloud management platform or in a database in the cloud) and informs the business side. Finally, the business side can send the target task parameters corresponding to the target offline task to the cloud server, which then sends the target task parameters to the target virtual device (e.g., virtual device 1 in cluster 1). The target virtual device (e.g., virtual device 1 in cluster 1) executes the target offline task according to the target task parameters.
[0036] In some embodiments, target offline tasks for different service versions need to be executed by target virtual devices running the corresponding version of the image file. Therefore, in the process of determining the target virtual device from multiple virtual devices corresponding to the target cluster based on the priority of the target task, it is also necessary to consider which virtual devices among the multiple virtual devices are running the corresponding version of the image file. The final determined target virtual device needs to match not only the priority of the target task, but also the version of the image file.
[0037] It should be noted that the devices on the cloud management platform side can also be integrated into the cloud server on the cloud business cluster side, or the cloud server can perform the functions of the cloud management platform side. This application does not impose any restrictions on this.
[0038] It should be noted that the equipment on the business side and the cloud management platform side mentioned above can be terminal devices. These terminal devices can be referred to as terminals, user equipment (UE), access terminals, user units, mobile devices, user terminals, wireless communication devices, user agents, or user devices. Terminals include, but are not limited to, handheld devices with wireless communication capabilities (e.g., smartphones, tablets), computing devices (e.g., personal computers, PCs), intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The cloud servers and clusters mentioned above are cloud servers or cloud server clusters that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The business side and the cloud management platform side, the cloud management platform side and the cloud servers, and the cloud servers and clusters can be directly or indirectly connected via wired or wireless communication methods; this application does not impose any restrictions on this.
[0039] This application can be applied to the field of cloud applications (such as cloud gaming), scheduling server cluster resources allocated to online tasks of cloud applications to execute offline tasks when cluster resource utilization is low (such as during periods when the number of online players in cloud games is low), thereby improving the resource utilization of the server cluster and reducing the cost of operating offline tasks.
[0040] The following will combine Figures 3 to 9 The cluster resource scheduling method, apparatus, and computer-readable storage medium provided in the embodiments of this application will be described in detail.
[0041] See Figure 3 This is a flowchart illustrating a cluster resource scheduling method provided in an embodiment of this application. The method includes steps S301 to S304, which can be achieved by the above... Figure 2 The device execution is shown on the cloud management platform side.
[0042] in:
[0043] S301. Obtain the target offline task request from the business party. The target offline task request includes the target task identifier and the target task priority.
[0044] In contrast to online tasks in cloud applications that are latency-sensitive, require high stability, and exhibit distinct peak and trough periods, the offline tasks (including target offline tasks) mentioned in this application refer to tasks that are not latency-sensitive, can be executed multiple times, and have variable execution times. For example, in a cloud gaming scenario, an online task might be a task that renders audio and video in real-time in response to player actions during a game, while an offline task might be a task that renders audio and video of a highlight moment in response to a player's request to review that highlight moment after the game ends. This application sets different priorities for different offline tasks (including target offline tasks) based on the different real-time requirements of the business. Specifically, offline tasks with high real-time requirements are set to high priority, while offline tasks with low real-time requirements are set to low priority.
[0045] Therefore, when a business initiates a target offline task request to the cloud management platform, the request must carry the target task priority and target task identifier. The target task priority can be either high or low, and the target task identifier includes at least one character. For example, the target offline task request can be "high priority, 1", where "1" represents the target task identifier.
[0046] S302. In at least one cluster of cloud servers, identify the target cluster whose cluster resource utilization is less than a preset threshold.
[0047] The cloud server can manage at least one cluster and communicate with the cloud management platform. Managing at least one cluster includes, but is not limited to, obtaining the cluster resource utilization rate of each cluster and scheduling cluster resources to create virtual devices.
[0048] In one possible implementation, the cloud management platform can obtain the cluster resource utilization rate of each cluster in at least one cluster through the cloud server, and select clusters with cluster resource utilization rates lower than a preset threshold as target clusters based on the cluster resource utilization rate of each cluster. The preset threshold can prevent excessive consumption of cluster resources used for executing offline tasks, which would affect online tasks in cloud applications. This preset threshold can be configured in advance on the cloud management platform side.
[0049] It should be noted that the specific process by which the cloud management platform obtains the cluster resource utilization rate of each cluster in at least one cluster through the cloud server can be as follows: the cloud server reports to the cloud management platform at predetermined time intervals, or the cloud management platform initiates a cluster resource utilization rate acquisition request to the cloud server after receiving an offline task request, and the cloud server reports to the cloud management platform when responding to the request. This application does not impose any restrictions on this.
[0050] S303. Determine the target virtual device in at least one virtual device corresponding to the target cluster. The at least one virtual device refers to the virtual device in the cloud server used to schedule the cluster resources of the target cluster. The priority of the target virtual device matches the priority of the target task.
[0051] In one possible implementation, the at least one virtual device corresponding to the target cluster includes at least one pre-created first virtual device; determining the target virtual device among the at least one virtual devices corresponding to the target cluster includes: if the target task priority is high, then determining the first virtual device in an idle state among the at least one first virtual device as the target virtual device; if the target task priority is low, then sending a first virtual device creation request to the cloud server, the first virtual device creation request carrying the cluster identifier of the target cluster, so that the cloud server creates a second virtual device corresponding to the target cluster, the priority of the second virtual device being lower than the priority of the first virtual device; receiving the device identifier of the second virtual device sent by the cloud server; and determining the second virtual device corresponding to the device identifier as the target virtual device.
[0052] Since high-priority offline tasks have higher real-time requirements, this application adopts a pre-creation (or pre-launch) approach for these tasks, pre-creating a batch of first virtual devices. This method allows the cloud management platform to directly select an idle first virtual device from the pre-created batch of first virtual devices as the target virtual device when it receives a high-priority target offline task, without waiting for device allocation, thus improving the efficiency of target virtual device determination. It should be noted that the cloud management platform stores the device identifier of each pre-created first virtual device. When any first virtual device is selected as the target virtual device, its device identifier can be directly queried and used as the device identifier of the target virtual device.
[0053] Since low-priority offline tasks have lower real-time requirements, this application adopts a real-time device creation method for low-priority offline tasks, creating a second virtual device in real time. In this method, when the cloud management platform receives the low-priority target offline task, it first sends a first virtual device creation request to the cloud server. The cloud server then creates a second virtual device based on the first virtual device creation request and sends the device identifier of the second virtual device to the cloud management platform so that the cloud management platform can recognize it as the target virtual device.
[0054] It should be noted that the first virtual device, the second virtual device, and the target virtual device mentioned above are cluster resources of the target cluster. They are container groups generated through virtualization technology that can be used to support different services, such as Android containers, audio and video streaming containers, etc. This method allows multiple service-isolated virtual devices to be created on a single target cluster. These virtual devices can schedule the cluster's processor, memory, and other resources to process offline tasks, thereby improving the processing efficiency of offline tasks and the utilization rate of cluster resources.
[0055] To pre-create the first virtual device and create the second virtual device in real time, it is necessary to first determine the number of new virtual devices to be created for each type. This allows the cloud server to allocate cluster resources from the target cluster to pre-create the required number of first and second virtual devices. The processes for pre-creating the first virtual device and creating the second virtual device in real time are explained in detail below.
[0056] ① Pre-select and create the first virtual device
[0057] In one possible implementation, the specific method for pre-creating the first virtual device includes: obtaining a preset number of idle first virtual devices and a preset maximum utilization rate of the first virtual devices; determining the number of new virtual devices to be created based on the preset number of idle first virtual devices and the preset maximum utilization rate; and sending a second virtual device creation request to the cloud server, the second virtual device creation request carrying the number of new virtual devices to be created and the cluster identifier of the target cluster, so that the cloud server creates the first virtual devices corresponding to the target cluster that meet the number of new virtual devices to be created.
[0058] The preset number of idle devices and the preset maximum utilization rate of the first virtual device can ensure that the first virtual device maintains a fixed number of idle devices and a certain proportion of idle devices, so as to quickly allocate the first virtual device to high-priority target offline task requests.
[0059] In one possible implementation, the method of determining the number of newly created first virtual devices based on a preset idle quantity and a preset maximum utilization rate specifically includes: determining a first difference by subtracting the number of idle first virtual devices corresponding to the target cluster from the preset idle quantity; determining a first new quantity by subtracting the first difference from the number of first virtual devices to be created corresponding to the target cluster from the first difference; counting the number of first virtual devices that are associated with the task identifier of offline tasks among at least one virtual device corresponding to the target cluster, and the total number of first virtual devices; determining a preset total quantity by the ratio of the number of used devices to the preset maximum utilization rate; determining a second new quantity by the difference between the preset total quantity and the total number of first virtual devices; and determining the maximum value between the first new quantity and the second new quantity as the number of newly created first virtual devices.
[0060] Wherein, the first virtual device to be created corresponding to the target cluster refers to the first virtual device that is being created by scheduling the target cluster resources. The number of first virtual devices in use refers to the number of first virtual devices that have been allocated to execute offline tasks (the device identifier of this type of first virtual device is stored in correspondence with the task identifier of the offline task). The total number of first virtual devices is equal to the sum of the number of first virtual devices in an idle state, the number of first virtual devices to be created, and the number of first virtual devices in use. Based on this, the number of newly created first virtual devices can be obtained by the following formulas (1) to (3):
[0061] The number of new virtual devices to be created = MAX{first number of new devices, second number of new devices}(1)
[0062] First new quantity = Preset idle quantity - Number of first virtual devices in idle state corresponding to the target cluster - Number of first virtual devices to be created corresponding to the target cluster (2)
[0063] Second new quantity = Number of used / Preset maximum utilization rate - Total number of first virtual devices (3)
[0064] It should be noted that the aforementioned preset idle quantity and preset maximum utilization rate can be configured in advance on the cloud management platform side. If the value of the first or second new quantity is negative, it means that no new first virtual device needs to be created. For example, if at the current moment, there are 10 idle first virtual devices in the target cluster, 50 in use, and 5 being created, and the preset idle quantity is 30 and the preset maximum utilization rate is 80%, then the first new quantity = 30 - 10 - 5 = 15, the second new quantity = 50 / 0.8 - (10 + 5 + 50) = -2.5, and the number of new first virtual devices to be created is 15.
[0065] After the cloud management platform determines the number of new virtual devices to be created through the above possible implementation methods, the cloud management platform can send a second virtual device creation request to the cloud server. For example, the second virtual device creation request can be "cluster 1, 15", where cluster 1 is the cluster identifier of the target cluster and 15 is the number of new virtual devices to be created. After receiving the second virtual device creation request, the cloud server can schedule the cluster resources of cluster 1 to create 15 first virtual devices.
[0066] ② Create a second virtual device in real time
[0067] In one possible implementation, the specific method for creating a second virtual device in real time includes: if the target task priority is low, storing the target offline task request in a request queue; counting the first number of offline task requests in the request queue; determining the fourth number of newly added second virtual devices to be created for the target cluster based on the first number, the second number of idle second virtual devices corresponding to the target cluster, and the third number of second virtual devices to be created for the target cluster; and sending a first virtual device creation request to the cloud server, including: sending the first virtual device creation request to the cloud server, the first virtual device creation request carrying the fourth number and the cluster identifier of the target cluster, so that the cloud server creates second virtual devices corresponding to the target cluster that meet the fourth number.
[0068] Specifically, when the cloud management platform receives a low-priority target offline task request, it stores the request in a request queue (all offline task requests in the request queue have low priority) according to the order of receipt, waiting for the creation of a second virtual device. Before creating the second virtual device, the cloud management platform first counts the first number of all offline task requests in the request queue. This first number is equal to the total number of second virtual devices required by all offline task requests in the request queue (one virtual device executes one offline task request). Then, it determines the fourth number of newly added second virtual devices to be created for the target cluster based on the first, second, and third numbers. The second number refers to the number of second virtual devices in an idle state corresponding to the target cluster, and the third number refers to the number of second virtual devices being created by scheduling resources in the target cluster.
[0069] In one possible implementation, the specific method for determining the fourth number of newly added second virtual devices to be created corresponding to the target cluster based on the first number, the second number, and the third number includes: determining the second difference by subtracting the second number of idle second virtual devices corresponding to the target cluster from the first number; and determining the fourth number of newly added second virtual devices to be created corresponding to the target cluster by subtracting the second difference from the third number of second virtual devices to be created corresponding to the target cluster. That is to say, the fourth number (the number of newly added second virtual devices to be created) can be calculated by the following formula (4):
[0070] Fourth quantity = First quantity - Second quantity of second virtual devices in idle state corresponding to the target cluster - Third quantity of second virtual devices to be created corresponding to the target cluster (4)
[0071] It should be noted that if the fourth quantity is negative, it means that the total number of second virtual devices currently in an idle state and the number of second virtual devices to be created can meet the total number of second virtual devices required by all offline task requests in the request queue, and there is no need to add any new second virtual devices to be created.
[0072] After the cloud management platform determines the number of new virtual devices to be created through the above possible implementation methods, the cloud management platform can send a first virtual device creation request to the cloud server. For example, the first virtual device creation request can be "cluster 2, 10", where cluster 2 is the cluster identifier of the target cluster and 10 is the number of new virtual devices to be created. After receiving the first virtual device creation request, the cloud server can schedule the cluster resources of cluster 2 to create 10 second virtual devices.
[0073] Optionally, after step S303, the cloud management platform can determine the corresponding target virtual device for the target offline task. However, in some optional methods, the target offline task is an offline task under a certain service version, in which case the target virtual device used to execute the target offline task must be a target virtual device running the image file of the corresponding version.
[0074] In one possible implementation, before step S301, the method further includes: obtaining an image file corresponding to any version identifier of the application used to perform offline tasks; sending the image file to a cloud server so that the cloud server determines the virtual device associated with any version identifier in at least one virtual device in each cluster; and sending the image file to the virtual device associated with any version identifier so that the virtual device associated with any version identifier runs the image file.
[0075] Specifically, offline tasks for each business version can be executed by running the corresponding version of the application. This application version is packaged into an image file and stored by the cloud management platform. When the cloud management platform receives an application for a specific business version in advance, it can first create an image based on that version. Then, the cloud management platform sends the created image to the cloud server. When the cloud server uses cluster resources to create a virtual device, it sends the image file to the created virtual device. This method ensures that if the cloud management platform requests to allocate a virtual device for an offline task with a corresponding version identifier, the allocated virtual device can be a virtual device running the image file of that version. The specific business version of the application is indicated by a version identifier.
[0076] For example, if a cloud gaming service has applications in versions A, B, and C, the service provider first sends these applications to the cloud management platform. The cloud management platform then packages each application into image file A, image file B, and image file C, respectively. If a virtual device needs to be created to run image file A, image file A can be included when sending a virtual device creation request to the cloud server. This allows the cloud server to create a virtual device that can run image file A.
[0077] For example, Figure 4a This is a schematic diagram of a cloud management platform's display page, such as... Figure 4a As shown, this cloud management platform is designed for cloud gaming and includes multiple functional modules such as access provider information, package list types, game management, device management, user management, access provider parameters, game update list, and channel game management. Specifically, in the access provider information module, users can view real-time information about the access provider (i.e., the business party), including the access provider's name, ID, the number of instances occupied by the created virtual device, creation time, and the games accessed by the access provider. Figure 4b This is a schematic diagram of the display page of another cloud management platform. Figure 4b The page displayed is Figure 4a The specific content displayed in the game management module is as follows: Figure 4b The information includes details indicating that the cloud management platform has generated an image for the "Highlights" service of XX game from other access providers, and that the generated image has been uploaded to the cloud server. Furthermore, when the cloud server sends the image to the created virtual device, the image status is displayed as... Figure 4b The cloudification in China has been successful.
[0078] Based on this, in one possible implementation, the target offline task request further includes a target version identifier of the application used to execute the target offline task; determining the target virtual device in at least one virtual device corresponding to the target cluster includes: determining at least one virtual device running the target image file in at least one virtual device; determining the target virtual device in at least one virtual device running the target image file.
[0079] For example, if the target version identifier carried in the target offline task request is version A as described above, and the target task priority is high, then the cloud management platform will select one virtual device as the target virtual device from the multiple pre-created first virtual devices running image file A. The method for creating the multiple pre-created first virtual devices running image file A can be referred to the method for pre-selecting and creating first virtual devices described above. In this case, the value of each device in the formula for calculating the number of newly created first virtual devices refers to the value of the number of devices running image file A (for example, the number of first virtual devices in an idle state corresponding to the target cluster refers to the number of first virtual devices in an idle state corresponding to the target cluster that are running image file A).
[0080] For example, if the target version identifier carried in the target offline task request is version A as mentioned above, and the target task priority is low, the cloud management platform will first determine the number of new virtual devices to be created (the fourth number) of running image file A based on the above method of creating the second virtual device in real time. The value of each device in the formula for calculating the fourth number refers to the value of the number of devices running image file A (for example, the first number is the total number of offline task requests carrying version A in the request queue). Then, when sending the first virtual device creation request to the cloud server, the fourth number and image file A are sent. After the cloud server creates the second virtual device running image file A, the second virtual device can be used as the target virtual device.
[0081] S304. Establish the correspondence between the device identifier of the target virtual device and the target task identifier, and send the device identifier of the target virtual device and the corresponding target task identifier to the business party, so that the business party sends the target task parameters of the target offline task corresponding to the target task identifier to the cloud server. The cloud server sends the target task parameters to the target virtual device, and the target virtual device executes the target offline task based on the target task parameters.
[0082] The target task parameters are the task parameters required by the target virtual device when running the image file. For example, for the audio and video rendering task of highlight moments of the player in game A in a cloud gaming scenario, the target task parameters should be data such as the start time, end time, and target player's character information of the highlight moments in game A.
[0083] Optionally, the correspondence between the device identifier of the target virtual device and the target task identifier can be stored on the device on the cloud management platform side or on the cloud device (such as a cloud server).
[0084] Optionally, the mapping between the device identifier of the target virtual device and the target task identifier can be sent from the cloud management platform to the cloud server, or the business party can include this mapping when sending the target task parameters to the cloud server. Based on this, the cloud server can forward the target task parameters to the corresponding target virtual device according to this mapping.
[0085] Optionally, if the target virtual device obtains a corresponding generated file while executing the target offline task, the target virtual device can upload the generated file to a public cloud service system (such as a cloud drive) and return the address where the generated file is stored in the public cloud service system to the business party. When the business party triggers the operation to retrieve the generated file, it can download the generated file from the public cloud service system according to this address.
[0086] Optionally, after the target virtual device completes the target offline task, it can notify the cloud management platform to terminate the mapping between the device identifier of the target virtual device and the target task identifier. This method allows the target virtual device to be reused to execute other offline tasks with the same priority and version identifier as the target offline task.
[0087] In the specific implementation of this application, steps S301 to S304 described above can also be handled by... Figure 5 The cloud management platform in the illustrated communication system architecture includes a task distributor and an offline scheduler. When the cloud management platform receives an offline task request from the business side, the task distributor on the cloud management platform allocates virtual devices to the offline task according to the task priority carried in the offline task request (the specific method can be seen in step S303 above). This includes determining the number of newly created virtual devices, the number of newly created virtual devices, how to instruct the cloud server to create virtual devices on the cluster based on the number of newly created virtual devices (for cases with multiple version identifiers), and how to reclaim the cluster resources occupied by the virtual devices (the specific implementation methods for these two parts can be found in the following sections). Figure 6 , Figure 7 In the corresponding implementation, the offline scheduler calculates and notifies the cloud service cluster side to execute the task. After the cloud service cluster side creates the virtual device, it can notify the task distributor, which will store the device identifier of the created virtual device and the task identifier of the offline task, and notify the service side that the task parameters can be passed to the corresponding virtual device.
[0088] based on Figure 3In the described embodiments, after identifying a target cluster with low cluster resource utilization (e.g., a cloud gaming cluster idle during off-peak hours), this application schedules the resources of the target cluster to determine a target virtual device, enabling the target virtual device to execute target offline tasks from the business party. This method can improve the cluster's resource utilization and reduce the cost for the business party to operate offline tasks. Furthermore, in the embodiments of this application, the priority of the target virtual device matches the priority of the aforementioned target offline task. Therefore, this application can use virtual devices of different priorities to process offline tasks of different priorities, thereby meeting the task requirements of offline tasks of different priorities.
[0089] The above Figure 3 The corresponding embodiment describes a scheme for scheduling cluster resources to execute offline tasks. For the newly added number of devices to be created obtained in step S303, how to instruct the cloud server to schedule cluster resources to create virtual devices based on this newly added number of devices to be created can be found below. Figure 6 Corresponding implementation examples.
[0090] See Figure 6 This is a flowchart illustrating another cluster resource scheduling method provided in this application embodiment. The method includes steps S601 to S604, which can be derived from the above... Figure 2 or Figure 5 The execution is carried out on the device side of the cloud management platform. Among them:
[0091] S601. Determine the first probability distribution based on at least one newly created quantity corresponding to the first virtual device running different image files.
[0092] Specifically, when determining the first probability distribution, this application uses the sum of the number of newly created virtual devices of the same image file (referring to the image file generated by the application based on the same business version) as each probability value in the probability distribution, and the ratio of the probability values corresponding to different image files as the first probability distribution.
[0093] For example, if the cloud management platform receives three high-priority offline tasks with version A (corresponding to image file A) (i.e., the task priority of the offline tasks is high), and the number of new tasks to be created for each task is "10, 20, 10"; two high-priority offline tasks with version B (corresponding to image file B), and the number of new tasks to be created for each task is "40, 10"; and one high-priority offline task with version C (corresponding to image file C), and the number of new tasks to be created for each task is "10", then the first probability distribution can be represented by (10+20+10):(40+10):(10), which is 40:50:10. It should be noted that the method for calculating the number of new tasks to be created here can be referred to the above. Figure 3 The formula for calculating the number of new virtual devices to be created during implementation will not be elaborated here.
[0094] S602. Send the first probability distribution to the cloud server so that the cloud server can create the first virtual device on the cluster where the resource utilization rate is less than a preset threshold.
[0095] After determining the first probability distribution based on step S601 above, the cloud management platform can include the first probability distribution when sending the request to create the second virtual device corresponding to the newly added number to be created to the cloud server. Further, the cloud server creates the first virtual device based on the number of virtual devices that the cluster with resource utilization less than a preset threshold can still support, the number of virtual devices that can be supported, and the first probability distribution.
[0096] Optionally, if the number of virtual devices that can be supported is greater than or equal to the total number of devices in the first probability distribution, then a first virtual device equal to the total number of devices in the first probability distribution can be created on the cluster; if the number of virtual devices that can be supported is less than the total number of devices in the first probability distribution, then the first virtual devices are created on the cluster proportionally according to the first probability distribution. This method can ensure fairness in the creation of first virtual devices associated with different versions when cluster resources are insufficient.
[0097] For example, if the number of virtual devices that can be supported is 50, and the first probability distribution is 40:50:10 as in the example above, then according to the first probability distribution, the first virtual devices associated with version identifiers A, B, and C that can be created on this cluster are 20, 25, and 5, respectively. It should be noted that in this case, for the first virtual devices that have not been fully created, a new cluster with a resource utilization rate less than a preset threshold can be identified, and the resources of the newly identified cluster can be scheduled to create the first virtual devices.
[0098] S603. If the cluster's resource utilization rate is still less than the preset threshold, then determine the second probability distribution based on at least one newly created virtual device corresponding to the second virtual device running different image files.
[0099] If the cluster's resource utilization is still less than a preset threshold after scheduling the above cluster resources to create the first virtual device, a second virtual device with a lower priority can be created according to the second probability distribution.
[0100] Similarly, when determining the second probability distribution, this application uses the sum of the number of newly created virtual devices of the same image file as each probability value in the probability distribution, and the ratio of the probability values corresponding to different image files as the second probability distribution.
[0101] S604. Send a second probability distribution to the cloud server so that the cloud server can create a second virtual device on a cluster where the resource utilization rate is less than a preset threshold.
[0102] Specifically, when the cloud server creates the first virtual device according to the first probability distribution, the first virtual device can consume all the remaining resources in the cluster; while for the creation of the second virtual device, this application takes into account the impact on online tasks in the cloud application, so that after the second virtual device is created, the resources occupied by the cluster must be less than a preset threshold.
[0103] For example, if a cluster's total cluster resources can support 500 virtual devices, and the preset threshold is 80%, and the cluster can currently support a maximum of 160 virtual devices, then when the cluster is used to create a second virtual device, it can support a maximum of 160 - (500 - 500 * 80%) = 60 second virtual devices (the cluster resources of the remaining 100 virtual devices out of the 160 that can be supported can only be used to create the first virtual device, and cannot be used to create the second virtual device).
[0104] Based on this, the cloud server can create second virtual devices according to the number of second virtual devices that the cluster can support and the second probability distribution. The method of creating second virtual devices according to the second probability distribution is the same as the specific implementation of step S602 above, and will not be repeated here.
[0105] It should be noted that if the cloud management platform receives offline task requests associated with the same version identifier, when creating virtual devices in the scheduling cluster, it does not need to create them based on the first probability distribution or the second probability distribution. Instead, it directly creates the first virtual device for the high-priority offline task first, and then directly creates the second virtual device for the low-priority offline task (when creating the second virtual device, it is necessary to consider that the resources occupied by the cluster must be less than the preset threshold).
[0106] based on Figure 6 In the described embodiments, this application can create a first virtual device (or a second virtual device) according to the proportion of the number of newly created first virtual devices (or second virtual devices) associated with different version identifiers. This method can ensure the fairness of the creation of virtual devices associated with each version identifier when cluster resources are insufficient.
[0107] See Figure 7 This is a flowchart illustrating another cluster resource scheduling method provided in this application embodiment. The method involves a cluster resource reclamation process, including steps S701 to S703, which can be derived from the above... Figure 2 or Figure 5 Executed on the cloud management platform side. Among them:
[0108] S701. If the cluster resource utilization rate of any cluster in at least one cluster is greater than or equal to a preset threshold, then determine the virtual device that meets the preset condition from at least one virtual device corresponding to any cluster.
[0109] Specifically, when the cluster resource utilization rate of any cluster in at least one cluster is greater than or equal to a preset threshold, the online tasks of cloud applications running on any cluster may be affected, so it is necessary to reclaim the cluster resources used to create virtual devices from any cluster.
[0110] Specifically, the virtual devices with preset conditions include the following four types of virtual devices: a second virtual device among at least one virtual device corresponding to any cluster whose offline task has not been executed for a duration longer than a preset duration; a first virtual device among at least one virtual device corresponding to any cluster whose offline task has not been executed for a duration longer than a preset duration; a virtual device among the found virtual devices whose offline task has been executed for a duration longer than a preset duration (here, the found devices are those virtual devices that have established a correspondence with any task identifier among at least one virtual device corresponding to any cluster); and a second virtual device among the found virtual devices that has been executed for an offline task within a preset time period. For ease of description, these four types of virtual devices will be referred to as the first type of virtual device, the second type of virtual device, the third type of virtual device, and the fourth type of virtual device, respectively.
[0111] S702: Notify the cloud server to release cluster resources occupied by virtual devices that meet preset conditions.
[0112] Specifically, the importance of the four types of virtual devices increases sequentially from the first to the fourth type. Therefore, when this application notifies the cloud server to release virtual devices that meet the preset conditions, it will release (or delete) the cluster resources occupied by the first, second, third, and fourth types of virtual devices in order of their importance from lowest to highest. Simultaneously, after releasing each type of virtual device, the cluster resource utilization rate of any cluster will be updated, and it will be re-evaluated whether the cluster resource utilization rate is still greater than or equal to a preset threshold. If the cluster resource utilization rate is still greater than or equal to the preset threshold, then the next type of virtual device will be released.
[0113] Optionally, when releasing cluster resources occupied by the first type of virtual devices, this application specifically includes: identifying a second virtual device from at least one virtual device corresponding to any cluster whose offline task has not been executed for a duration longer than a preset duration; notifying the cloud server to release the cluster resources occupied by the identified second virtual device; and updating the cluster resource utilization rate of any cluster. This optional method can release low-priority second virtual devices that have been idle for a long time.
[0114] Optionally, when releasing cluster resources occupied by the second type of virtual devices, this application specifically includes: identifying a first virtual device from at least one virtual device corresponding to any cluster whose offline task has not been executed for a duration longer than a preset duration; notifying the cloud server to release the cluster resources occupied by the identified first virtual device; and updating the cluster resource utilization rate of any cluster. This optional method can release high-priority first virtual devices that have been idle for a long time. The preset duration here may be the same as or different from the preset duration in the first type of virtual devices, and this application does not impose any restrictions on this.
[0115] Optionally, when releasing cluster resources occupied by the third type of virtual devices, this application specifically includes: searching for virtual devices that correspond to any task identifier from at least one virtual device corresponding to any cluster; identifying virtual devices among the found virtual devices whose offline task execution duration is longer than a preset duration; decoupling the identified virtual devices from their corresponding task identifiers and notifying the cloud server to release the cluster resources occupied by the identified virtual devices; and updating the cluster resource utilization rate of any cluster. This optional method can release virtual devices that have been bound to offline tasks for a long time, avoiding situations where virtual devices get stuck while executing offline tasks. The preset duration here can be the same as or different from the preset durations for the first and second types of virtual devices; this application does not impose any restrictions on this.
[0116] Optionally, when releasing cluster resources occupied by the fourth type of virtual devices, this application specifically includes: identifying a second virtual device executing an offline task within a preset time period from the found virtual devices; decoupling the identified second virtual device from its corresponding task identifier and notifying the cloud server to release the identified virtual device; and updating the cluster resource utilization rate of any cluster. This optional method can further release low-priority second virtual devices bound to offline tasks. The second virtual device executing an offline task within the preset time period can include a second virtual device that is not currently executing but executed an offline task at a time prior to the current time, and a second virtual device that is still executing an offline task at the current time. Therefore, when releasing these two types of second virtual devices, the cluster resources occupied by the second virtual device that is not currently executing but executed an offline task at a time prior to the current time can be released first. If the cluster resource utilization rate is still greater than or equal to a preset threshold, then the cluster resources occupied by the second virtual device that is still executing an offline task at the current time can be released.
[0117] S703. Update the cluster resource utilization of any cluster and trigger the execution of the step of determining the target cluster whose cluster resource utilization is less than a preset threshold in at least one cluster of the cloud server.
[0118] Specifically, if, after releasing a certain type of virtual device, the resource utilization rate of any cluster is updated and determined to no longer exceed a preset threshold, then the step of determining the target cluster whose cluster resource utilization rate is less than the preset threshold in at least one cluster of the cloud server can be triggered. This method can promptly release the cluster resources occupied by virtual devices, ensuring the normal operation of online tasks in cloud applications.
[0119] based on Figure 7 In the described embodiments, after scheduling cluster resources to create virtual devices to execute offline tasks, the cluster resources occupied by the virtual devices are released and reclaimed according to the reclamation policy. This method can avoid affecting the normal operation of online tasks of cloud applications.
[0120] See Figure 8 This is a schematic diagram of a cluster resource scheduling device provided in an embodiment of this application. The cluster resource scheduling device includes an acquisition module 801 and a processing module 802. Wherein:
[0121] The acquisition module 801 is used to acquire a target offline task request from the business party, wherein the target offline task request includes a target task identifier and a target task priority;
[0122] Processing module 802 is used to identify a target cluster in at least one cluster of cloud servers whose cluster resource utilization is less than a preset threshold.
[0123] The processing module 802 is further configured to determine a target virtual device among at least one virtual device corresponding to the target cluster, wherein the at least one virtual device refers to a virtual device in the cloud server used to schedule the cluster resources of the target cluster, and the priority of the target virtual device matches the priority of the target task;
[0124] The processing module 802 is further configured to establish a correspondence between the device identifier of the target virtual device and the target task identifier, and send the device identifier of the target virtual device and the corresponding target task identifier to the business party, so that the business party sends the target task parameters of the target offline task corresponding to the target task identifier to the cloud server, the cloud server sends the target task parameters to the target virtual device, and the target virtual device executes the target offline task based on the target task parameters.
[0125] In one possible implementation, the at least one virtual device corresponding to the target cluster includes at least one pre-created first virtual device;
[0126] The processing module 802, when determining the target virtual device among at least one virtual device corresponding to the target cluster, specifically includes:
[0127] If the target task has a high priority, then the first virtual device that is in an idle state among the at least one first virtual devices is determined as the target virtual device;
[0128] If the target task has a low priority, a first virtual device creation request is sent to the cloud server. The first virtual device creation request carries the cluster identifier of the target cluster, so that the cloud server creates a second virtual device corresponding to the target cluster. The priority of the second virtual device is lower than that of the first virtual device.
[0129] Receive the device identifier of the second virtual device sent by the cloud server;
[0130] The second virtual device corresponding to the device identifier is identified as the target virtual device.
[0131] In one possible implementation, before the acquisition module 801 acquires the target offline task request from the business party, it further includes:
[0132] The acquisition module 801 is used to acquire the preset number of idle devices and the preset maximum utilization rate of the first virtual device.
[0133] The processing module 802 is used to determine the number of new virtual devices to be created for the first virtual device based on the preset number of idle devices and the preset maximum utilization rate.
[0134] The processing module 802 is further configured to send a second virtual device creation request to the cloud server. The second virtual device creation request carries the number of new virtual devices to be created and the cluster identifier of the target cluster, so that the cloud server creates the first virtual devices corresponding to the target cluster that meet the number of new virtual devices to be created.
[0135] In one possible implementation, the processing module 802, when determining the number of new virtual devices to be created based on the preset idle quantity and the preset maximum utilization rate, specifically includes:
[0136] The difference between the preset number of idle devices and the number of first virtual devices in an idle state corresponding to the target cluster is determined as the first difference.
[0137] The difference between the first difference and the number of first virtual devices to be created corresponding to the target cluster is determined as the first new quantity;
[0138] The number of first virtual devices that establish a correspondence with the task identifier of the offline task in at least one virtual device corresponding to the target cluster, and the total number of first virtual devices are counted.
[0139] The ratio of the number of uses to the preset maximum usage rate is determined as the preset total number;
[0140] The difference between the preset total quantity and the total quantity of the first virtual devices is determined as the second new quantity;
[0141] The maximum value between the first newly added quantity and the second newly added quantity is determined as the newly added quantity to be created for the first virtual device.
[0142] In one possible implementation, the processing module 802 is further configured to:
[0143] If the target task has a low priority, then the target offline task request will be stored in the request queue.
[0144] Count the first number of offline task requests in the request queue;
[0145] Based on the first quantity, the second quantity of second virtual devices in an idle state corresponding to the target cluster, and the third quantity of second virtual devices to be created corresponding to the target cluster, a fourth quantity of newly added second virtual devices to be created corresponding to the target cluster is determined.
[0146] The processing module 802, when sending a first virtual device creation request to the cloud server, specifically includes:
[0147] A first virtual device creation request is sent to the cloud server. The first virtual device creation request carries the fourth quantity and the cluster identifier of the target cluster, so that the cloud server creates a second virtual device corresponding to the target cluster that meets the fourth quantity.
[0148] In one possible implementation, the processing module 802, when determining the fourth number of newly added second virtual devices to be created corresponding to the target cluster based on the first number, the second number of second virtual devices in an idle state corresponding to the target cluster, and the third number of second virtual devices to be created corresponding to the target cluster, specifically includes:
[0149] The difference between the first quantity and the second quantity of the second virtual devices in the idle state corresponding to the target cluster is determined as the second difference;
[0150] The difference between the second difference and the third number of second virtual devices to be created corresponding to the target cluster is determined as the fourth number of newly added second virtual devices to be created corresponding to the target cluster.
[0151] In one possible implementation, the processing module 802 is further configured to:
[0152] If the cluster resource utilization rate of any cluster in the at least one cluster is greater than or equal to the preset threshold, then a virtual device that meets the preset condition is determined from at least one virtual device corresponding to any cluster.
[0153] The cloud server is notified to release the cluster resources occupied by the virtual devices that meet the preset conditions;
[0154] Update the cluster resource utilization of any of the clusters, triggering the execution of the step of determining the target cluster whose cluster resource utilization is less than a preset threshold in at least one cluster of the cloud server.
[0155] In one possible implementation, the processing module 802, when determining a virtual device that meets a preset condition from at least one virtual device corresponding to any cluster, specifically includes:
[0156] From at least one virtual device corresponding to any cluster, determine a second virtual device whose offline task has not been executed for a duration longer than a preset duration;
[0157] The determined second virtual device is used as the virtual device that meets the preset conditions.
[0158] In one possible implementation, after configuring the determined second virtual device as the virtual device that meets the preset conditions, the processing module 802 is further configured to:
[0159] The cloud server is notified to release the cluster resources occupied by the identified second virtual device;
[0160] Update the cluster resource utilization of any of the aforementioned clusters;
[0161] If the updated cluster resource utilization rate of any cluster is greater than or equal to the preset threshold, then a first virtual device with a duration of non-offline task execution greater than the preset duration is determined from at least one virtual device corresponding to any cluster.
[0162] The first virtual device is selected as the virtual device that meets the preset conditions.
[0163] In one possible implementation, after configuring the determined first virtual device as the virtual device that meets the preset conditions, the processing module 802 is further configured to:
[0164] The cloud server is notified to release the cluster resources occupied by the identified first virtual device;
[0165] Update the cluster resource utilization of any of the aforementioned clusters;
[0166] If the updated cluster resource utilization rate of any cluster is greater than or equal to the preset threshold, then search for a virtual device that corresponds to any task identifier from at least one virtual device corresponding to any cluster.
[0167] Identify the virtual devices found that perform offline tasks for a duration longer than the preset duration;
[0168] The identified virtual devices are designated as virtual devices that meet the preset conditions.
[0169] In one possible implementation, after configuring the determined virtual device as the virtual device that meets the preset conditions, the processing module 802 is further configured to:
[0170] Release the association between the identified virtual device and its corresponding task identifier, and notify the cloud server to release the cluster resources occupied by the identified virtual device;
[0171] Update the cluster resource utilization of any of the aforementioned clusters;
[0172] If the updated cluster resource utilization rate of any cluster is greater than or equal to the preset threshold, then a second virtual device that performs offline tasks within the preset time period is determined from the found virtual devices.
[0173] The second virtual device that performs offline tasks within a preset time period is designated as the virtual device that meets the preset conditions;
[0174] Remove the mapping relationship between the virtual devices that meet the preset conditions and their corresponding task identifiers.
[0175] In one possible implementation, the acquisition module 801 is further configured to acquire an image file corresponding to any version identifier of an application used to perform offline tasks; the processing module is further configured to send the image file to the cloud server, so that the cloud server determines the virtual device associated with the any version identifier in at least one virtual device corresponding to each cluster, and the cloud server sends the image file to the virtual device associated with the any version identifier, so that the virtual device associated with the any version identifier runs the image file.
[0176] In one possible implementation, the target offline task request further includes a target version identifier of the application used to perform the target offline task;
[0177] The processing module 802, when determining the target virtual device among at least one virtual device corresponding to the target cluster, specifically includes:
[0178] Among the at least one virtual device, at least one virtual device is identified that runs the target image file;
[0179] The target virtual device is determined in the at least one virtual device running the target image file.
[0180] It should be noted that the functions of each functional module of the cluster scheduling device in this application embodiment can be specifically implemented according to the methods in the above method embodiments. The specific implementation process and beneficial effects can be referred to the relevant descriptions in the above method embodiments, and will not be repeated here.
[0181] See Figure 9This is a schematic diagram of a computer device provided in an embodiment of this application. The computer device includes a processor 901, a storage device 902, and a network interface 903. Data interaction is possible between the processor 901, the storage device 902, and the network interface 903. The storage device 902 may include volatile memory, such as random-access memory (RAM); it may also include non-volatile memory, such as flash memory, solid-state drive (SSD), etc.; or it may include a combination of the above types of memory. The processor 901 may be a central processing unit (CPU), and the storage device 902 stores program instructions. The processor 901 can call these program instructions to perform the following operations:
[0182] Obtain a target offline task request from the business party, wherein the target offline task request includes a target task identifier and a target task priority;
[0183] Identify a target cluster in at least one cluster of cloud servers whose cluster resource utilization is less than a preset threshold.
[0184] A target virtual device is determined from at least one virtual device corresponding to the target cluster. The at least one virtual device refers to a virtual device in the cloud server used to schedule the cluster resources of the target cluster. The priority of the target virtual device matches the priority of the target task.
[0185] A correspondence is established between the device identifier of the target virtual device and the target task identifier. The device identifier of the target virtual device and the corresponding target task identifier are sent to the business party, so that the business party sends the target task parameters of the target offline task corresponding to the target task identifier to the cloud server. The cloud server sends the target task parameters to the target virtual device, and the target virtual device executes the target offline task based on the target task parameters.
[0186] In one possible implementation, the at least one virtual device corresponding to the target cluster includes at least one pre-created first virtual device;
[0187] Processor 901, when determining a target virtual device among at least one virtual devices corresponding to the target cluster, specifically includes:
[0188] If the target task has a high priority, then the first virtual device that is in an idle state among the at least one first virtual devices is determined as the target virtual device;
[0189] If the target task has a low priority, a first virtual device creation request is sent to the cloud server. The first virtual device creation request carries the cluster identifier of the target cluster, so that the cloud server creates a second virtual device corresponding to the target cluster. The priority of the second virtual device is lower than that of the first virtual device.
[0190] Receive the device identifier of the second virtual device sent by the cloud server;
[0191] The second virtual device corresponding to the device identifier is identified as the target virtual device.
[0192] In one possible implementation, before the processor 901 acquires the target offline task request from the business party, it further includes:
[0193] Obtain the preset number of idle devices and the preset maximum utilization rate of the first virtual device;
[0194] The number of new virtual devices to be created is determined based on the preset number of idle devices and the preset maximum utilization rate.
[0195] A second virtual device creation request is sent to the cloud server. The second virtual device creation request carries the number of new virtual devices to be created and the cluster identifier of the target cluster, so that the cloud server creates the first virtual devices corresponding to the target cluster that meet the number of new virtual devices to be created.
[0196] In one possible implementation, the processor 901, when determining the number of new virtual devices to be created based on the preset idle quantity and the preset maximum utilization rate, specifically includes:
[0197] The difference between the preset number of idle devices and the number of first virtual devices in an idle state corresponding to the target cluster is determined as the first difference.
[0198] The difference between the first difference and the number of first virtual devices to be created corresponding to the target cluster is determined as the first new quantity;
[0199] The number of first virtual devices that establish a correspondence with the task identifier of the offline task in at least one virtual device corresponding to the target cluster, and the total number of first virtual devices are counted.
[0200] The ratio of the number of uses to the preset maximum usage rate is determined as the preset total number;
[0201] The difference between the preset total quantity and the total quantity of the first virtual devices is determined as the second new quantity;
[0202] The maximum value between the first newly added quantity and the second newly added quantity is determined as the newly added quantity to be created for the first virtual device.
[0203] In one possible implementation, the processor 901 is further configured to:
[0204] If the target task has a low priority, then the target offline task request will be stored in the request queue.
[0205] Count the first number of offline task requests in the request queue;
[0206] Based on the first quantity, the second quantity of second virtual devices in an idle state corresponding to the target cluster, and the third quantity of second virtual devices to be created corresponding to the target cluster, a fourth quantity of newly added second virtual devices to be created corresponding to the target cluster is determined.
[0207] When the processor 901 sends a first virtual device creation request to the cloud server, it specifically includes:
[0208] A first virtual device creation request is sent to the cloud server. The first virtual device creation request carries the fourth quantity and the cluster identifier of the target cluster, so that the cloud server creates a second virtual device corresponding to the target cluster that meets the fourth quantity.
[0209] In one possible implementation, when the processor 901 determines the fourth number of newly added second virtual devices to be created corresponding to the target cluster based on the first number, the second number of second virtual devices in an idle state corresponding to the target cluster, and the third number of second virtual devices to be created corresponding to the target cluster, the process specifically includes:
[0210] The difference between the first quantity and the second quantity of the second virtual devices in the idle state corresponding to the target cluster is determined as the second difference;
[0211] The difference between the second difference and the third number of second virtual devices to be created corresponding to the target cluster is determined as the fourth number of newly added second virtual devices to be created corresponding to the target cluster.
[0212] In one possible implementation, the processor 901 is further configured to:
[0213] If the cluster resource utilization rate of any cluster in the at least one cluster is greater than or equal to the preset threshold, then a virtual device that meets the preset condition is determined from at least one virtual device corresponding to any cluster.
[0214] The cloud server is notified to release the cluster resources occupied by the virtual devices that meet the preset conditions;
[0215] Update the cluster resource utilization of any of the clusters, triggering the execution of the step of determining the target cluster whose cluster resource utilization is less than a preset threshold in at least one cluster of the cloud server.
[0216] In one possible implementation, the processor 901, when determining a virtual device that meets preset conditions from at least one virtual device corresponding to any cluster, specifically includes:
[0217] From at least one virtual device corresponding to any cluster, determine a second virtual device whose offline task has not been executed for a duration longer than a preset duration;
[0218] The determined second virtual device is used as the virtual device that meets the preset conditions.
[0219] In one possible implementation, after configuring the determined second virtual device as the virtual device that meets the preset conditions, the processor 901 is further configured to:
[0220] The cloud server is notified to release the cluster resources occupied by the identified second virtual device;
[0221] Update the cluster resource utilization of any of the aforementioned clusters;
[0222] If the updated cluster resource utilization rate of any cluster is greater than or equal to the preset threshold, then a first virtual device with a duration of non-offline task execution greater than the preset duration is determined from at least one virtual device corresponding to any cluster.
[0223] The first virtual device is selected as the virtual device that meets the preset conditions.
[0224] In one possible implementation, after configuring the determined first virtual device as the virtual device that meets the preset conditions, the processor 901 is further configured to:
[0225] The cloud server is notified to release the cluster resources occupied by the identified first virtual device;
[0226] Update the cluster resource utilization of any of the aforementioned clusters;
[0227] If the updated cluster resource utilization rate of any cluster is greater than or equal to the preset threshold, then search for a virtual device that corresponds to any task identifier from at least one virtual device corresponding to any cluster.
[0228] Identify the virtual devices found that perform offline tasks for a duration longer than the preset duration;
[0229] The identified virtual devices are designated as virtual devices that meet the preset conditions.
[0230] In one possible implementation, after configuring the determined virtual device as the virtual device that meets the preset conditions, the processor 901 is further configured to:
[0231] Release the association between the identified virtual device and its corresponding task identifier, and notify the cloud server to release the cluster resources occupied by the identified virtual device;
[0232] Update the cluster resource utilization of any of the aforementioned clusters;
[0233] If the updated cluster resource utilization rate of any cluster is greater than or equal to the preset threshold, then a second virtual device that performs offline tasks within the preset time period is determined from the found virtual devices.
[0234] The second virtual device that performs offline tasks within a preset time period is designated as the virtual device that meets the preset conditions;
[0235] Remove the mapping relationship between the virtual devices that meet the preset conditions and their corresponding task identifiers.
[0236] In one possible implementation, the processor 901 is further configured to obtain an image file corresponding to any version identifier of an application used to perform offline tasks; the processing module is further configured to send the image file to the cloud server, so that the cloud server determines the virtual device associated with the any version identifier in at least one virtual device corresponding to each cluster, and the cloud server sends the image file to the virtual device associated with the any version identifier, so that the virtual device associated with the any version identifier runs the image file.
[0237] In one possible implementation, the target offline task request further includes a target version identifier of the application used to perform the target offline task;
[0238] The processor 901, when determining the target virtual device among at least one virtual device corresponding to the target cluster, specifically includes:
[0239] Among the at least one virtual device, at least one virtual device is identified that runs the target image file;
[0240] The target virtual device is determined in the at least one virtual device running the target image file.
[0241] It should be noted that the operational functions performed by each processor in the computer device of this application embodiment can be specifically implemented according to the methods in the above method embodiments. The specific implementation process and beneficial effects can be referred to the relevant descriptions in the above method embodiments, and will not be repeated here.
[0242] Furthermore, it should be noted that this application embodiment also provides a computer-readable storage medium storing a computer program executed by the aforementioned cluster resource scheduling device. This computer program includes program instructions, which, when executed by a processor, can execute the aforementioned... Figure 3 , Figure 6 , Figure 7 The methods described in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same methods will also not be repeated. For technical details not disclosed in the computer-readable storage medium embodiments related to this application, please refer to the description of the method embodiments of this application. As an example, program instructions can be deployed on a computer device, or executed on multiple computer devices located in one location, or executed on multiple computer devices distributed across multiple locations and interconnected via a communication network. These multiple computer devices distributed across multiple locations and interconnected via a communication network can constitute a blockchain system.
[0243] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned... Figure 3 , Figure 6 , Figure 7 The methods described in the corresponding embodiments are therefore not repeated here.
[0244] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0245] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A cluster resource scheduling method, characterized in that, The method includes: Obtain a target offline task request from the business party, wherein the target offline task request includes a target task identifier and a target task priority; Identify a target cluster in at least one cluster of cloud servers whose cluster resource utilization is less than a preset threshold. A target virtual device is determined from at least one virtual device corresponding to the target cluster. The at least one virtual device refers to a virtual device in the cloud server used to schedule the cluster resources of the target cluster. The priority of the target virtual device matches the priority of the target task. A correspondence is established between the device identifier of the target virtual device and the target task identifier. The device identifier of the target virtual device and the corresponding target task identifier are sent to the business party, so that the business party sends the target task parameters of the target offline task corresponding to the target task identifier to the cloud server. The cloud server sends the target task parameters to the target virtual device, and the target virtual device executes the target offline task based on the target task parameters. Obtain the image file corresponding to any version identifier of the application used to perform offline tasks; The image file is sent to the cloud server so that the cloud server can determine the virtual device associated with any version identifier in at least one virtual device corresponding to each cluster. The cloud server then sends the image file to the virtual device associated with any version identifier so that the virtual device associated with any version identifier can run the image file.
2. The method according to claim 1, characterized in that, The target cluster includes at least one pre-created first virtual device; Determining the target virtual device among at least one virtual device corresponding to the target cluster includes: If the target task has a high priority, then the first virtual device that is in an idle state among the at least one first virtual devices is determined as the target virtual device; If the target task has a low priority, a first virtual device creation request is sent to the cloud server. The first virtual device creation request carries the cluster identifier of the target cluster, so that the cloud server creates a second virtual device corresponding to the target cluster. The priority of the second virtual device is lower than that of the first virtual device. Receive the device identifier of the second virtual device sent by the cloud server; The second virtual device corresponding to the device identifier is identified as the target virtual device.
3. The method according to claim 2, characterized in that, Before obtaining the target offline task request from the business party, the process also includes: Obtain the preset number of idle devices and the preset maximum utilization rate of the first virtual device; The number of new virtual devices to be created is determined based on the preset number of idle devices and the preset maximum utilization rate. A second virtual device creation request is sent to the cloud server. The second virtual device creation request carries the number of new virtual devices to be created and the cluster identifier of the target cluster, so that the cloud server creates the first virtual devices corresponding to the target cluster that meet the number of new virtual devices to be created.
4. The method according to claim 3, characterized in that, The step of determining the number of new virtual devices to be created based on the preset number of idle devices and the preset maximum utilization rate includes: The difference between the preset number of idle devices and the number of first virtual devices in an idle state corresponding to the target cluster is determined as the first difference. The difference between the first difference and the number of first virtual devices to be created corresponding to the target cluster is determined as the first new quantity; The number of first virtual devices that establish a correspondence with the task identifier of the offline task in at least one virtual device corresponding to the target cluster, and the total number of first virtual devices are counted. The ratio of the number used to the preset maximum usage rate is determined as the preset total number; The difference between the preset total quantity and the total quantity of the first virtual devices is determined as the second new quantity; The maximum value between the first newly added quantity and the second newly added quantity is determined as the newly added quantity to be created for the first virtual device.
5. The method according to claim 2, characterized in that, The method further includes: If the target task has a low priority, then the target offline task request will be stored in the request queue. Count the first number of offline task requests in the request queue; Based on the first quantity, the second quantity of second virtual devices in an idle state corresponding to the target cluster, and the third quantity of second virtual devices to be created corresponding to the target cluster, a fourth quantity of newly added second virtual devices to be created corresponding to the target cluster is determined. Sending the first virtual device creation request to the cloud server includes: A first virtual device creation request is sent to the cloud server. The first virtual device creation request carries the fourth quantity and the cluster identifier of the target cluster, so that the cloud server creates a second virtual device corresponding to the target cluster that meets the fourth quantity.
6. The method according to claim 5, characterized in that, The step of determining the fourth number of newly added second virtual devices to be created corresponding to the target cluster based on the first number, the second number of second virtual devices in an idle state corresponding to the target cluster, and the third number of second virtual devices to be created corresponding to the target cluster includes: The difference between the first quantity and the second quantity of the second virtual devices in the idle state corresponding to the target cluster is determined as the second difference; The difference between the second difference and the third number of second virtual devices to be created corresponding to the target cluster is determined as the fourth number of newly added second virtual devices to be created corresponding to the target cluster.
7. The method according to claim 1, characterized in that, The method further includes: If the cluster resource utilization rate of any cluster in the at least one cluster is greater than or equal to the preset threshold, then a virtual device that meets the preset condition is determined from at least one virtual device corresponding to any cluster. The cloud server is notified to release the cluster resources occupied by the virtual devices that meet the preset conditions; Update the cluster resource utilization of any of the clusters, triggering the execution of the step of determining the target cluster whose cluster resource utilization is less than a preset threshold in at least one cluster of the cloud server.
8. The method according to claim 7, characterized in that, The step of determining a virtual device that meets a preset condition from at least one virtual device corresponding to any cluster includes: From at least one virtual device corresponding to any cluster, determine a second virtual device whose offline task has not been executed for a duration longer than a preset duration; The determined second virtual device is used as the virtual device that meets the preset conditions.
9. The method according to claim 8, characterized in that, After determining the second virtual device as the virtual device that meets the preset conditions, the method further includes: The cloud server is notified to release the cluster resources occupied by the identified second virtual device; Update the cluster resource utilization of any of the aforementioned clusters; If the updated cluster resource utilization rate of any cluster is greater than or equal to the preset threshold, then a first virtual device with a duration of non-offline task execution greater than the preset duration is determined from at least one virtual device corresponding to any cluster. The first virtual device is selected as the virtual device that meets the preset conditions.
10. The method according to claim 9, characterized in that, After determining the first virtual device as the virtual device that meets the preset conditions, the method further includes: The cloud server is notified to release the cluster resources occupied by the identified first virtual device; Update the cluster resource utilization of any of the aforementioned clusters; If the updated cluster resource utilization rate of any cluster is greater than or equal to the preset threshold, then search for a virtual device that corresponds to any task identifier from at least one virtual device corresponding to any cluster. Identify the virtual devices found that perform offline tasks for a duration longer than the preset duration; The identified virtual devices are designated as virtual devices that meet the preset conditions.
11. The method according to claim 10, characterized in that, After determining the virtual device as the virtual device that meets the preset conditions, the method further includes: Release the association between the identified virtual device and its corresponding task identifier, and notify the cloud server to release the cluster resources occupied by the identified virtual device; Update the cluster resource utilization of any of the aforementioned clusters; If the updated cluster resource utilization rate of any cluster is greater than or equal to the preset threshold, then a second virtual device that performs offline tasks within the preset time period is determined from the found virtual devices. The second virtual device that performs offline tasks within a preset time period is designated as the virtual device that meets the preset conditions; Remove the mapping relationship between the virtual devices that meet the preset conditions and their corresponding task identifiers.
12. The method according to claim 1, characterized in that, The target offline task request also includes a target version identifier of the application used to perform the target offline task; Determining the target virtual device among at least one virtual device corresponding to the target cluster includes: At least one virtual device running the target image file is identified among the at least one virtual device; The target virtual device is determined in the at least one virtual device running the target image file.
13. A computer device, characterized in that, The computer device includes a processor, a memory, and a network interface, wherein the processor is connected to the memory and the network interface; the network interface is used to provide network communication functions, the memory is used to store program code, and the processor is used to call the program code to implement the method as described in any one of claims 1-12.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, implement the method as described in any one of claims 1-12.
15. A computer program product comprising a computer program or computer instructions, characterized in that, When a computer program or computer instructions are executed by a processor, the method as described in any one of claims 1-12 is implemented.
Citation Information
Patent Citations
Server resource allocation method and device, storage medium and electronic device
CN113157418A