Scheduling method for tasks, computing device, and storage medium - Patents.com

The scheduling method optimizes resource allocation in cloud servers by determining actual execution times and adjusting scheduling times, addressing the challenge of heterogeneous resource management in cloud environments.

JP7779849B2Active Publication Date: 2025-12-03クラウド インテリジェンス アセッツ ホールディング (シンガポール)プライベート リミテッド
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
JP2022558396
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-05-29
Filing Date
2021-05-17
Publication Date
2025-12-03
Estimated Expiration
2041-05-17

AI Technical Summary

Technical Problem

The challenge of efficiently and conveniently scheduling heterogeneous hardware resources in cloud servers, particularly GPUs and NPUs, has emerged with the rise of artificial intelligence and container technology, where existing methods struggle to balance resource allocation and quality of service.

Method used

A scheduling method and apparatus that utilize a task scheduler to determine actual execution times, adjust scheduling times based on comparisons, and manage resource allocation across containers, ensuring fair and efficient use of hardware resources without relying on device drivers.

Benefits of technology

This approach enables quick and easy task scheduling, optimizes resource utilization, balances scheduling times, and ensures fair allocation, reducing the risk of excessive time occupation by current tasks and maintaining quality of service.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007779849000001
    Figure 0007779849000001
  • Figure 0007779849000002
    Figure 0007779849000002
  • Figure 0007779849000003
    Figure 0007779849000003
Patent Text Reader

Abstract

A scheduling method, computing device, and storage medium for tasks are provided. The method includes obtaining task information for a current task to be executed, determining an actual execution time for the current task to be executed according to the task information, comparing the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjusting the actual scheduling time corresponding to the next task to be executed according to the comparison result to determine whether the next task to be executed should be scheduled. After determining the actual execution time, by comparing the actual execution time with the preset scheduling time, the actual scheduling time corresponding to the next task to be executed can be adjusted to determine whether task scheduling should be performed, thus realizing quick and easy task scheduling and full utilization of hardware resources. Moreover, since the actual scheduling time is adjusted, the actual scheduling time for each task can be accurately and efficiently allocated, and scheduling time can be balanced among tasks.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This application claims priority to Chinese Patent Application No. 202010475800.4, filed on May 29, 2020, and entitled "SCHEDULING METHOD FOR TASKS, COMPUTING DEVICE, AND STORAGE MEDIUM," which is incorporated herein by reference in its entirety.

[0002] The present application relates to the field of computers, and in particular to scheduling methods, computing devices, and storage media for tasks. [Background technology]

[0003] With the rapid development of the Internet, cloud services have several advantages over traditional computing services, such as low price, easy expansion, scalability, easy management, and high availability, and therefore occupy an increasingly important position in the information Internet era. Furthermore, in the field of cloud services, container technology is widely used due to its characteristics. Summary of the Invention [Problem to be solved by the invention]

[0004] However, with the rapid development of artificial intelligence, heterogeneous computing has become an emerging hotspot for cloud services. As a result, cloud servers can accommodate multiple types of hardware resources, such as multiple types of physical processing devices. How to efficiently and conveniently schedule these hardware resources is the key to resource scheduling. [Means for solving the problem]

[0005] Various aspects of the present application provide a scheduling method, computing device, and storage medium for tasks that achieve efficient and convenient scheduling of hardware resources.

[0006] An embodiment of the present application provides a scheduling method for a task, including: obtaining task information of a current task to be executed, where the task information describes the current task to be executed; determining an actual execution time for the current task to be executed according to the task information; comparing the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjusting the actual scheduling time corresponding to the next task to be executed according to a comparison result, so as to determine whether the next task to be executed should be scheduled.

[0007] An embodiment of the present application further provides a scheduling method for container tasks, including: receiving a current task to be executed sent by an arbitrary container, and obtaining task information of the current task to be executed, where the task information describes the current task to be executed; determining an actual execution time for the current task to be executed according to the task information; comparing the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjusting the actual scheduling time corresponding to the next task to be executed from the same container according to a comparison result, so as to determine whether the next task to be executed from the same container should be scheduled.

[0008] An embodiment of the present application further provides a scheduling apparatus for tasks, comprising: an acquisition module for acquiring task information of a current task to be executed, where the task information describes the current task to be executed; a determination module for determining an actual execution time for the current task to be executed according to the task information; and an adjustment module for comparing the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjusting the actual scheduling time corresponding to the next task to be executed according to a comparison result, so as to determine whether the next task to be executed should be scheduled.

[0009] An embodiment of the present application further provides a scheduling device for container tasks, comprising: a receiving module for receiving a current task to be executed sent by an arbitrary container and obtaining task information of the current task to be executed, where the task information describes the current task to be executed; a determining module for determining an actual execution time for the current task to be executed according to the task information; and an adjusting module for comparing the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjusting the actual scheduling time corresponding to the next task to be executed from the same container according to a comparison result, so as to determine whether the next task to be executed from the same container should be scheduled.

[0010] An embodiment of the present application further provides a computing device comprising a memory and a processor, wherein the memory is used for storing a computer program, and the processor is used for executing the computer program to: obtain task information of a current task to be executed, where the task information describes the current task to be executed; determine an actual execution time for the current task to be executed according to the task information; compare the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjust the actual scheduling time corresponding to the next task to be executed according to a comparison result, so as to determine whether the next task to be executed should be scheduled.

[0011] An embodiment of the present application further provides a computing device comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program for: receiving a current task to be executed sent by any container; obtaining task information of the current task to be executed, wherein the task information describes the current task to be executed; determining an actual execution time for the current task to be executed according to the task information; comparing the actual execution time with a preset scheduling time corresponding to the current task to be executed; and adjusting the actual scheduling time corresponding to the next task to be executed from the same container according to the comparison result, so as to determine whether the next task to be executed from the same container should be scheduled.

[0012] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by one or more processors, causes the one or more processors to perform the steps in the method described above.

[0013] In an embodiment of the present application, task information of a current task to be executed is obtained, the task information describes the current task to be executed, an actual execution time for the current task to be executed is determined according to the task information, the actual execution time is compared with a preset scheduling time corresponding to the current task to be executed, and the actual scheduling time corresponding to the next task to be executed is adjusted according to the comparison result to determine whether the next task to be executed should be scheduled. After determining the actual execution time, by comparing the actual execution time with the preset scheduling time, the actual scheduling time corresponding to the next task to be executed can be adjusted to determine whether task scheduling should be performed, thus realizing quick and easy task scheduling and full utilization of hardware resources. Moreover, since the actual scheduling time is adjusted, the actual scheduling time for each task can be accurately and efficiently allocated, and scheduling time can be balanced between tasks, thereby reducing the situation where the current task to be executed excessively occupies the scheduling time for other tasks.

[0014] Furthermore, since no device driver is used to obtain a drive method for implementing task scheduling, it does not need to care whether the device driver is open source or not (i.e., the device driver can be open source or non-open source), which makes it very easy to use for non-open source device drivers and can reduce the development of device drivers.

[0015] The accompanying drawings set forth herein are used to provide a further understanding of the present application and form a part of the present application. The schematic embodiments and the description thereof are used to explain the present application, but are not to be considered as undue limitations to the present application. [Brief explanation of the drawings]

[0016] [Figure 1] FIG. 1 is a schematic structural diagram of a scheduling system for tasks in an exemplary embodiment of the present application; [Figure 2] 1 is a flowchart of a scheduling method for tasks in an exemplary embodiment of the present application; [Figure 3] 4 is a flowchart of a scheduling method for tasks in another exemplary embodiment of the present application; [Figure 4] 10 is a flowchart of a scheduling method for container tasks in another exemplary embodiment of the present application; [Figure 5] FIG. 10 is a schematic structural diagram of a scheduling apparatus for tasks provided in another exemplary embodiment of the present application; [Figure 6] FIG. 10 is a schematic structural diagram of a scheduling device for container tasks provided in another exemplary embodiment of the present application; [Figure 7] FIG. 1 is a schematic structural diagram of a computing device provided in an exemplary embodiment of the present application; [Figure 8] FIG. 10 is a schematic structural diagram of a computing device provided in another exemplary embodiment of the present application. DETAILED DESCRIPTION OF THE INVENTION

[0017] In order to clarify the purpose, technical solution and advantages of the present application, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments of the present application and corresponding accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without performing any inventive work fall within the scope of protection of the present application.

[0018] Container technology is a technology for packaging software into standardized units for use in development, distribution, and deployment. It ensures consistency in the application operating environment, achieves faster startup, and has characteristics such as isolation, scalability, ease of migration, and sustainable distribution and deployment. Based on the above characteristics, container technology is widely applied in the field of cloud services. With the rapid development of artificial intelligence, heterogeneous computing has become an emerging hotspot for cloud services.

[0019] In a cloud server that houses multiple processing devices, such as GPUs (graphics processing units), NPUs (neural network processing units), and containers, a key issue is how to efficiently and easily schedule GPU hardware resources so that they can be seamlessly shared across multiple containers, while keeping the overhead of the scheduling algorithm small enough in nature.

[0020] The embodiments of the present application propose a method that can meet the above requirements and also work well for scheduling non-open source black-box GPU device drivers.

[0021] The technical solutions provided by the embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0022] 1 is a schematic structural diagram of a scheduling system for tasks provided in an exemplary embodiment of the present application. As shown in FIG. 1, the system 100 can include a first device 101 and a second device 102.

[0023] Among these, the first device 101 may be a device with a certain computing capability, which can perform the functions of transmitting data to the second device 102 and obtaining response data from the second device 102. The basic structure of the first device 101 may include at least one processor. The number of processors may depend on the configuration and type of the device with the certain computing capability. The device with the certain computing capability may also include memory, which may be volatile, such as RAM, or non-volatile, such as read-only memory (ROM) or flash memory, or may include both types simultaneously. The memory typically stores an operating system (OS), one or more applications, and may also store program data, among other things. In addition to the processing unit and memory, the device with the certain computing capability further includes several basic components, such as a network card chip, an IO bus, a display component, and several peripheral devices. Alternatively, these several peripheral devices may include, for example, a keyboard, an input pen, and the like. Other peripheral devices are well known in the art and will not be described in detail herein. Alternatively, the first device 101 may be a smart terminal, such as, for example, a cell phone, a desktop computer, a laptop, a tablet computer, or the like.

[0024] The second device 102 may be a device that can provide computing and processing services in a network virtual environment and perform data processing and task scheduling using a network. In terms of physical implementation, the second device 102 may be any device that can provide computing services, respond to service requests, and return data processing results. For example, the second device 102 may be a cloud server, a cloud host, a virtual center, a traditional server, etc. The components of the second device 102 mainly include a processor, a hard disk, a memory, a system bus, etc., which are similar to the components of common computer architectures.

[0025] In an embodiment of the present application, the first device 101 transmits data to the second device 102. The second device 102 receives the data and transmits the data to a corresponding virtual device, such as a container. The second device 102 includes at least one virtual device, such as a container. Meanwhile, the second device 102 may further include a device driver (sometimes referred to as a device driver layer or a device driver program) and an intermediate driver layer. A task scheduler may be provided in the intermediate driver layer for use in task scheduling. The intermediate driver layer communicates with the device driver via a communication interface. When the virtual device in the second device 102 receives the data, the virtual device needs to process the data, i.e., process the data to generate a task (i.e., a task to be executed), and transmit the task to the task scheduler in the intermediate driver layer. Upon receiving the task, the task scheduler performs the following steps: acquiring task information of the current task to be executed, where the task information describes the current task to be executed; determining an actual execution time for the task to be executed according to the task information; comparing the actual execution time with a preset scheduling time corresponding to the current task to be executed; and adjusting the actual scheduling time corresponding to the next task to be executed according to the comparison result to determine whether to schedule the next task to be executed (which may be from the same source or a different source). Furthermore, the task scheduler sends the task to a corresponding processing device, such as a GPU, through a device driver to enable the corresponding processing device to process the task. After processing the task, the corresponding processing device returns the task result to the corresponding virtual device. The virtual device then returns the task result to the first device 101.

[0026] It should be noted that the process of returning the task results to the first device 101 by the virtual device may be a process of execution by a device driver in the second device 102, and the specific execution process is similar to that described above and will not be described here.

[0027] Furthermore, the task scheduler may be provided in the driver device if the driver device is open source, without the need to introduce an additional intermediate driver layer.

[0028] In an application scenario of an embodiment of the present application, a user sends data, such as an account login request, which may include an account number and password, to a second device 102, such as a cloud server, via a first device 101, such as a computer. The user can send the data through a browser installed on the first device 101. A virtual device in the second device 102, such as Container 1, receives the data and obtains the account number and password. Container 1 then sends a task to a task scheduler in the intermediate driver layer of the second device 102, which may be an execution instruction for verifying whether the account number and password are correct. After receiving the task, the task scheduler can obtain the execution instruction based on the storage address of the task and input the execution instruction into a pre-configured model for use in predicting the actual execution time. At the same time, the task scheduler can send the task to a corresponding processing device, such as a GPU, via a device driver. After receiving the task, the GPU processes the task. If the processing result indicates that the account number and password are correct, it can be determined that the result is correct and the login can be performed. Container 1 obtains the results of the processing and returns the results to the user's computer via the second device 102, indicating that the login was successful.

[0029] Furthermore, after predicting the actual execution time, the task scheduler compares the actual execution time with the corresponding preset scheduling time, and if the actual execution time is longer than the preset scheduling time, determines an overtime. The task scheduler shortens the actual scheduling time for the next task to be executed from Container 1, the shortened time is the same as the overtime, and then uses the updated actual scheduling time as the actual scheduling time for the subsequent task to be executed. Until the actual scheduling time for the subsequent task to be executed from Container 1 is updated to be shortened to 0, the task scheduler does not schedule the subsequent task to be executed, but waits for the next time when task scheduling can be performed, and then can schedule the task to be executed when the next preset scheduling time arrives. If the predicted actual execution time is shorter than the preset scheduling time, the task scheduler determines an idle time. In this case, the task scheduler may either perform no processing or may compensate for this idling time in the actual scheduling time for the next task to be executed (which may be a task from the same container or a task from a different container). After the task scheduler performs the adjustment of the actual scheduling time for the current task and the task scheduling, the task scheduler performs the scheduling of the next task, i.e., repeats the above.

[0030] In this embodiment, the network connection is implemented between the first device 101 and the second device 102, and the network connection may be a wireless connection. When there is a communication connection between the first device 101 and the second device 102, the network standard of the mobile network may be any one of 2G (GSM), 2.5G (GPRS), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS), 4G (LTE), 4G+ (LTE+), WiMax, 5G, etc.

[0031] The scheduling process for tasks is described in detail below along with method embodiments.

[0032] 2 is a flowchart of a scheduling method for a task according to an exemplary embodiment of the present application. The method 200 provided by the embodiment of the present application is implemented by a computing device, such as a cloud server, more specifically, a task scheduler in the cloud server. The method 200 includes the following steps: 201: Obtain task information of the current task to be executed, where the task information describes the current task to be executed. 202: Determine the actual execution time for the current task to be executed according to the task information. 203: Compare the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjust the actual scheduling time corresponding to the next task to be executed according to the comparison result, so as to determine whether the next task to be executed should be scheduled.

[0033]

[0013] According to the foregoing, it can be seen that the task scheduler may be provided in the device driver in the cloud server or in the intermediate driver layer, and it should be noted that the intermediate driver layer may be implemented on top of the device driver, i.e., the intermediate driver layer is communicatively connected to the device driver. If the task scheduler is implemented in the intermediate driver layer, there is no need to care whether the device driver is open source or whether the device driver is a third-party one.

[0034] Details of the above steps are provided below. 201: Obtain task information of the current task to be executed, where the task information describes the current task to be executed.

[0035] Here, the task to be executed (hereinafter also referred to as the task to be executed) is a task to be processed by a hardware resource (hereinafter also referred to as a hardware device) in a physical device, such as a task to be processed by a GPU in a cloud server, and the task may be a task to instruct at least one processing device to verify whether a password and a user name are correct. The current task to be executed is a task that the task scheduler is currently preparing to schedule.

[0036] The hardware resources may include, for example, a CPU, an NPU, memory, a disk, a network, etc. In addition to the processing device, other hardware devices may assist the processing device in performing task processing, etc., and thus the utilization of the other hardware devices may also be balanced.

[0037] An approach to acquiring the current task to be executed may include receiving the current task to be executed transmitted by the virtual device via a communication interface, where each virtual device corresponds to an independent communication interface. That is, each virtual device has a one-to-one correspondence with the communication interface. Furthermore, each virtual device and communication interface has a unique identifier, such as an ID. Therefore, based on this correspondence, upon receiving the current task to be executed, the task scheduler in the cloud server can know the virtual device to which the current task to be executed belongs based on the identifier of the communication interface used to transmit the current task to be executed.

[0038] Here, this communication interface can realize communication by creating a node file.

[0039] A virtual device is a standalone device, such as a container or sandbox, that operates directly on the operating system of a physical device. Here, a physical device may also refer to a physical host, such as a cloud server host. It should be understood that a virtual machine does not operate directly on the operating system of a physical device, but operates indirectly on the operating system. A virtual machine has its own virtual operating system and also virtual hardware resources, such as a virtual CPU, but these are not actually the hardware resources of a physical device, but are virtualizations of the hardware resources.

[0040] Furthermore, virtual devices that can implement the embodiments of the present application are within the scope of protection of the embodiments of the present application and are not limited to containers.

[0041] It should also be noted that the virtual device is already created on the physical device. Or, in other words, the physical device can create a virtual device as needed. The creation process belongs to the prior art, so it will not be described in detail here. It should be understood that the embodiment of the present application is based on a situation where the physical device has already created multiple virtual devices or at least one virtual device. Here, the virtual device can create a user mode on the physical device, where the user mode is a privilege level in an operating system (e.g., the Linux operating system), and in the user mode, a program in the user mode is not allowed to perform an operation that requires a privilege mode in a processor (e.g., a CPU, a GPU, etc.) to avoid crashing the operating system.

[0042] Specifically, obtaining the task information of the current task to be executed includes obtaining the task information according to a storage address that the current task to be executed has.

[0043] Here, task information describes the current task to be executed, for example, execution instructions for the current task to be executed.

[0044] The storage address is an address for storing task information, such as a buffer address of a buffer or a cache address of a cache.

[0045] It should be noted that in addition to having a storage address, a task to be executed may also have other information, such as information indicating which processing device will perform the task processing (with an identifier of the processing device), and the like.

[0046] For example, a task scheduler in a cloud server receives a current task a to be executed (hereinafter also referred to as task a), reads the current task a to be executed, and obtains the buffer address of the command buffer held by task a from task a. The task scheduler reads this buffer address and reads the corresponding execution command. That is, as shown in FIG. 3, step 301 is executed to read the information of the command buffer.

[0047] It should be noted that the buffer address may be the start address of the corresponding buffer and the length of the buffer, which allow the task scheduler to read the execution instructions from the corresponding buffer location in the corresponding buffer. The buffer address may also be the head and tail pointers of the buffer, which allow the task scheduler to read the execution instructions from the corresponding buffer location in the corresponding buffer. If there are multiple buffers, the buffer address may also have information such as a buffer identifier, which allows the task scheduler to find the corresponding buffer.

[0048] 202: Determine the actual execution time for the current task to be executed according to the task information.

[0049] Here, the actual execution time is the execution time for executing this task that is scheduled to be executed, specifically, the actual execution time for executing this task that is scheduled to be executed by the processing device.

[0050] Determining the actual execution time for the current task to be executed according to the task information includes determining the actual execution time for executing the task information as the actual execution time for the current task to be executed, that is, the actual execution time obtained by executing the task information is used as the actual execution time for executing this task to be executed.

[0051] Here, the actual execution time may be determined as follows:

[0052] 1). Determining the actual execution time for executing the task information includes inputting the task information into a pre-configured model and determining the output of the pre-configured model as the actual execution time.

[0053] Here, the pre-configured model is a model for predicting the actual execution time for task information. The model may be a neural network model, and the model may be generated through training. Before training, corresponding training data, such as a plurality of task information (e.g., a plurality of execution instructions) and the actual execution time for the corresponding processing device, may be obtained. During the training process, the pre-configured model is generated by analyzing the task information to obtain features of the task information, and then performing training according to the corresponding actual execution time.

[0054] It should be noted that since the processing devices may be of different types, such as CPUs, GPUs, and NPUs, multiple corresponding pre-configured models may be generated according to different types of processing devices for use in respectively predicting the actual execution time for each of the processing devices.

[0055] Once the model is generated, prediction can be performed. A task scheduler in the cloud server can input task information into a corresponding pre-configured model; for example, if an execution instruction is for a GPU processing device, the execution instruction is input into a pre-configured model corresponding to the GPU, and the output of this pre-configured model is obtained to use as the actual execution time for the GPU to execute the execution instruction. That is, as shown in FIG. 3, step 302 is performed to determine the actual execution time for the processing device.

[0056] 2). Determining an actual execution time for the current task to be executed according to the task information includes: matching the task information with a plurality of preset task information; and selecting, according to the matching result, a preset execution time corresponding to the matched preset task information as the actual execution time.

[0057] In addition, the cloud server may also acquire multiple execution instructions and actual execution times corresponding to different processing devices, and store such information in a local pre-configured storage area or database server; after the task scheduler in the cloud server acquires task information such as execution instructions, the task scheduler compares or matches the execution instructions with the acquired multiple execution instructions, determines which execution instructions have similarity or are the same within a certain threshold, and acquires the corresponding actual execution times according to the determined execution instructions.

[0058] It should be understood that the actual execution time may vary depending on the processing device, so the execution instruction may store multiple actual execution times, and different processing devices correspond to different actual execution times, and the corresponding actual execution times are determined for the task scheduler based on the processing device required task information.

[0059] 203: Compare the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjust the actual scheduling time corresponding to the next task to be executed according to the comparison result, so as to determine whether the next task to be executed should be scheduled.

[0060] Here, the preset scheduling time, sometimes referred to as a preset time slice, is the time used to occupy a hardware resource, typically a period of 10 ms (milliseconds). An explanation is provided below using a processor example. For example, for a CPU, multiple time slices may be divided for each CPU and assigned to different containers, allowing the CPU to process tasks scheduled for processing from the container according to the time slice, thus enabling the CPU to process multiple tasks over a certain period of time. Furthermore, for a multi-core CPU, multiple time slices may be divided for each core and assigned to different containers, allowing the CPU core to process tasks scheduled for processing from the container according to the time slice, thus enabling the CPU to process multiple tasks over a certain period of time. The situation is similar for GPUs and NPUs, but will not be described in detail here. This may also be used as a basis for dividing other hardware resources. Therefore, a cloud server can divide time slices for different virtual devices, such as containers. The preset time slices for the same container are the same, i.e., the preset scheduling time is the same. Therefore, the preset time slices for different tasks scheduled to run from the same container are also the same. The time slices may be different or the same for different containers. The preset scheduling time may be pre-divided by the task scheduler.

[0061] There is also an actual scheduling time corresponding to the preset scheduling time, which refers to the time that the processing device may actually have to allow to perform task processing on the task to be executed, taking into account the preset scheduling time.

[0062] Although a corresponding preset scheduling time is set for each container, the execution time for a task scheduled to run on a hardware resource such as a processing device may exceed the preset scheduling time, occupying the preset scheduling time for tasks scheduled to run later. For example, for a GPU1 processing device, a task scheduler may first schedule task 1 from container 1 to GPU1 for task processing. However, GPU1 may take a very long time to process task 1, exceeding the preset scheduling time, thereby shortening the processing time for subsequent tasks. For example, the task waiting for GPU1 to process after task 1 is currently task 2 from container 2. Because the scheduling time for task 2 is occupied, task 2 cannot fully utilize its preset scheduling time, which affects the quality of service (QoS) of container 2.

[0063] Therefore, an actual scheduling time is set here to quantify how long each task in each container can actually occupy a processing device, i.e., how much time is actually available for each task.

[0064] For example, as described above, when the task scheduler in the cloud server receives task a sent by container A, it determines that task a is targeted for GPU1 and also determines the actual execution time of processing task a through the GPU. The task scheduler compares the actual execution time of 15 ms with the preset scheduling time of 10 ms corresponding to container A and finds that the actual execution time is longer than the preset scheduling time. Therefore, the task scheduler shortens the actual scheduling time for the next task to be executed from container A. That is, as shown in FIG. 3 , step 303 is performed to shorten the next actual scheduling time. In this way, the scheduling time for the next task to be executed from container A is used to compensate for the scheduling time for tasks to be processed from other containers.

[0065] Furthermore, the task scheduler compares the actual execution time of 7 ms with the preset scheduling time of 10 ms corresponding to Container A and detects that the actual execution time is shorter than the preset scheduling time, so in this case, the task scheduler may idle the corresponding processing device or compensate for the actual scheduling time for the next task to be executed from Container A. As shown in FIG. 3, step 305 is executed to determine the idling time or compensate for the next actual scheduling time.

[0066] Note that if the task scheduler detects that the actual execution time is equal to the preset scheduling time corresponding to Container A, the task scheduler can either make no adjustment or maintain the reduced current scheduling time (i.e., the actual scheduling time).

[0067] Furthermore, for a current task to be executed, if the current task to be executed is in the container initialization phase, i.e., if the current task to be executed sent by the container is the first task to be executed from this container, the actual scheduling time is the preset scheduling time and may continue to be used as the actual scheduling time for the second task to be executed from this container for use in subsequent updates. At this point, before performing step 302, the task scheduler may perform step 306, submitting the task to the processing device for task processing by the processing device. Upon receiving a task from container A, the task scheduler obtains an execution instruction and then directly submits task a to the corresponding GPU for task processing. On the other hand, if the container has been running for a certain period of time, upon receiving task a, the task scheduler may first detect whether the actual scheduling time for container A to which the current task belongs is 0. If it is 0, the task scheduler does not perform any processing, does not perform step 306, and must wait for the next preset scheduling time to arrive before performing step 306 and the step of adjusting the actual scheduling time.

[0068] For the current task to be executed, after completing the adjustment of the actual scheduling time corresponding to the next task to be executed from the same source, the task scheduler can continue to schedule this next task to be executed and adjust the actual scheduling time, i.e., step 304 is executed to perform next task scheduling.

[0069] A specific implementation of step 203 is as follows.

[0070] Wherein, adjusting the actual scheduling time corresponding to the next task to be executed according to the comparison result includes: when the comparison result is that the actual execution time is longer than the preset scheduling time, determining an overtime; adjusting the actual scheduling time corresponding to the next task to be executed from the same source according to the overtime to obtain an updated actual scheduling time; and continuing to use the updated actual scheduling time as the actual scheduling time for the subsequent task to be executed from the same source until the subsequent updated actual scheduling time is reduced to 0; when the current task to be executed is an initial task to be executed from the same source, the actual scheduling time corresponding to the current task to be executed is the same as the actual scheduling time corresponding to the next task to be executed from the same source, which is the preset scheduling time.

[0071] For example, as described above, the task scheduler receives task a (i.e., the current task to be executed) sent from container A, obtains the execution instruction of task a, and thereby determines that the corresponding actual execution time is 15 ms. Then, the task scheduler compares the corresponding actual execution time with the preset scheduling time of 10 ms for container A and determines that the overtime is 5 ms. Then, when the task scheduler next receives a task sent by container A, such as task b, its actual scheduling time is 10=5 ms, i.e., changes from the original 10 ms to 5 ms (in this case, the preset scheduling time may be considered the actual scheduling time if there is no overtime; for example, if task a is the first task from container A, or if none of the previous tasks from container A have overtime or idling time, the actual scheduling time for task a is the preset scheduling time and can be used as the actual scheduling time for task b). Thereafter, the actual scheduling time for task b is updated to 5 ms and used as the actual scheduling time for the next task c from container A. Nevertheless, because the actual scheduling time corresponding to task a is the preset scheduling time and is greater than 0, the task scheduler will send task a to a corresponding processing device, such as GPU1, before calculating the actual scheduling time of task b, and GPU1 can obtain an execution instruction from a storage address in the task to perform task processing. Because the actual scheduling time for task b is updated to 5 ms but is still greater than 0, task b may also be scheduled by the task scheduler and processed by a corresponding processing device. If the actual execution time for task b is also 15 ms, the actual execution time for task b is greater than the preset scheduling time of 10 ms, and the overtime is also 5 ms. Therefore, for the next task scheduled to run from container A, such as task c, its actual scheduling time will be updated from 5 ms to 0 ms, i.e., 5−5=0.At this point, after receiving task c, the task scheduler will not schedule this task c when its preset scheduling time arrives, but must wait.

[0072] It should be understood that a subsequent task to be executed may be referred to as a task that follows the current task to be executed or a task that follows the next task to be executed.

[0073] It should be noted that adjusting the actual scheduling time prevents the forced occupation of scheduling time for other virtual devices such as other containers, thus ensuring fairness in scheduling while satisfying quality of service (QoS) requirements, and further avoids malicious occupation of time slices (i.e., pre-configured scheduling times) of other virtual devices such as other containers by some programs, thus ensuring security in container scheduling.

[0074] Based on the overtime, the actual scheduling time is adjusted, and the specific process is as follows:

[0075] Specifically, the method 200 further includes, for the current task to be executed, reducing the overtime to an actual scheduling time corresponding to the current task to be executed, updating the corresponding actual scheduling time, and using the updated actual scheduling time as the actual scheduling time for the next task to be executed.

[0076] This has already been discussed above and will not be detailed here.

[0077] The above-mentioned waiting process may specifically be as follows, and the method 200 further includes: determining not to schedule a subsequent task to be executed when a subsequent updated actual scheduling time is 0, at the arrival of a preset scheduling time corresponding to the subsequent task to be executed.

[0078] For example, as described above, after the task scheduler receives task c, its actual scheduling time is updated to 0, and then the task scheduler waits for the arrival of the preset scheduling time corresponding to the container to which task c belongs, and does not schedule this task c any more, i.e., the task scheduler does not send task c to a corresponding processing device, such as GPU1, for task processing through the device driver.

[0079] However, if the actual scheduling time for task c is not 0 after the update, or if the actual scheduling time for a subsequent task is not 0 after the update, scheduling may be performed.

[0080] Specifically, the method 200 further includes determining, when the actual scheduling time corresponding to the subsequent task to be executed is not zero after the update, to schedule the subsequent task to be executed according to the actual execution time when the corresponding preset scheduling time arrives.

[0081] For example, as described above, after the task scheduler receives task b, the actual scheduling time is updated to 5 ms, so after receiving task b, the task scheduler waits until the preset scheduling time for container A arrives, and then sends task b to a corresponding processing device, such as GPU1, for task processing through the driver device of the cloud server. Meanwhile, the actual execution time for GPU1 to process task b is 15 ms, as predicted above.

[0082] Note that because the actual execution time for task b is 15 ms, the task scheduler can access the processing device before 15 ms by polling to determine whether the processing device has finished processing task b, and send the next task after determining that the processing device has finished processing. Under normal circumstances, the processing device can finish processing the task in exactly 15 ms, or alternatively, can finish processing the task within a margin of error relative to 15 ms.

[0083] After the scheduling of the current task to be executed is completed, it can be determined whether the next task to be executed should be scheduled, and after it is determined that scheduling should be performed, task scheduling is performed.

[0084] Specifically, after determining to schedule the next task to be executed, the method 200 further includes: receiving the next task to be executed, waiting for a corresponding preset scheduling time to arrive, and then sending the next task to be executed to a corresponding processing device for performing task processing according to the corresponding actual execution time.

[0085] This has already been mentioned above and will not be detailed here. If a subsequent task is not scheduled for execution, its preset scheduling time may be used to compensate the task from other sources, thus allowing for balancing of scheduling times for tasks.

[0086] Specifically, the method 200 further includes receiving a subsequent task to be executed, and transmitting the task to be executed from another source to a corresponding processing device to perform task processing according to the corresponding actual execution time upon the arrival of the corresponding preset scheduling time.

[0087] For example, as described above, the task scheduler may not schedule task c when the corresponding preset scheduling time arrives, but may schedule other tasks, such as tasks from other containers that follow task c, such as task m from container B. This allows for the scheduling of subsequent schedulable tasks from other containers before the arrival of the next preset scheduling time for container A, thus sharing the current scheduling time for container A with the other containers for use.

[0088] The scheduling of tasks to be executed from other sources by the task scheduler is the same as the scheduling process described above, and will not be described in detail here. It should be noted that tasks from any container can be scheduled using the scheduling method of the embodiment of the present application. For tasks from other containers, the actual scheduling time may be updated and the tasks may wait to be scheduled, but this will not be described in detail here.

[0089] Furthermore, since there are multiple containers on the cloud server, the task scheduler may receive multiple tasks to be executed, which must be queued for processing, where the tasks are processed sequentially after the arrival of the pre-configured scheduling time for the container to which they belong and in the order of the queue.

[0090] If the task scheduler determines that the task is not scheduled in time and waits to be scheduled, after waiting until the task can be scheduled, its specific scheduling process may be as follows: the method 200 further includes waiting for the arrival of a corresponding next preset scheduling time, and then sending the subsequent task to be executed to a corresponding processing device to perform task processing according to the corresponding actual execution time, where when the corresponding next preset scheduling time arrives, the actual scheduling time corresponding to the subsequent task to be executed is equal to the preset scheduling time.

[0091] For example, as described above, the task scheduler does not schedule task c, but instead waits for the arrival of the next preset scheduling time for container A to which task c belongs after determining that task c is waiting.

[0092] It should be noted that in an embodiment of the present application, a task in a container can occupy the scheduling time for a task from another container, but the scheduling time for the other container will be compensated. Nevertheless, after the scheduling time for the other container is occupied, the task from the other container may not be scheduled to the corresponding processing device exactly on time. That is, the task from the other container cannot be scheduled immediately after the arrival of the preset scheduling time, but there will be some time delay. Nevertheless, the task can be scheduled only after the corresponding preset scheduling time arrives, and the task can be scheduled to the corresponding processing device only after the task scheduler polls and finds that the corresponding processing device has completed the current task.

[0093] In addition to the actual execution time being longer than the preset scheduling time, it is also possible that the actual execution time is shorter than the preset scheduling time, in which case the actual scheduling time is adjusted as follows:

[0094] Specifically, adjusting the actual scheduling time corresponding to the next task to be executed according to the comparison result includes: determining an idling time when the comparison result is that the actual execution time is shorter than the preset scheduling time; adjusting the actual scheduling time corresponding to the next task to be executed from the same source according to the idling time to obtain an updated actual scheduling time; and continuing to use the updated actual scheduling time as the actual scheduling time for the subsequent task to be executed from the same source.

[0095] For example, as described above, the task scheduler receives task a (i.e., the current task to be executed) sent from container A, obtains the execution instruction for task a, and thereby determines that the corresponding actual execution time is 7 ms. Then, the task scheduler compares the corresponding actual execution time with the preset scheduling time of 10 ms for container A and determines that the idling time is 3 ms. Then, when the task scheduler next receives a task sent by container A, such as task b, its actual scheduling time is 10+3=13 ms, i.e., changes from the original 10 ms to 13 ms. (In this case, the preset scheduling time may be considered the actual scheduling time if there is no overtime; for example, if task a is the first task from container A, or if none of the previous tasks from container A have overtime or idling time, the actual scheduling time for task a is the preset scheduling time and can be used as the actual scheduling time for task b.) Thereafter, the actual scheduling time for task b is updated to 13 ms and used as the actual scheduling time for the next task c from container A.

[0096] Note that in addition to giving that idle time to tasks from the same container, it is also possible to idle this idle time directly, thus allowing the corresponding processing device to be idle. Furthermore, it is also possible to distribute the idle time to tasks from other containers to provide compensation, assistance, etc.

[0097] After determining that there is idle time, tasks can be scheduled.

[0098] Specifically, the method 200 further includes determining to schedule the next task to be executed when the comparison result is that the actual execution time is less than or equal to the preset scheduling time.

[0099] For example, as described above, if the task scheduler determines that task a has an idle time of 3 ms, and the actual scheduling time for task b is updated to 13 ms, which is greater than 0, the task scheduler can schedule task b simultaneously upon receiving task b.

[0100] It should be understood that if the actual execution time for task a is 10 ms, which is equal to the preset scheduling time, the actual scheduling time for task b will not be updated and will remain at 10 ms or any other value greater than 0 (if the actual scheduling time is a value equal to 0, task a is not schedulable, so here it is assumed that task a is schedulable and not in a waiting state), and task b may be scheduled.

[0101] Here, the specific process of adjusting the actual scheduling time based on the idling time is as follows.

[0102] Specifically, the method 200 further includes, for the current task to be executed, increasing the idling time to an actual scheduling time corresponding to the current task to be executed to update the corresponding actual scheduling time, and using the updated actual scheduling time as the actual scheduling time for the next task to be executed.

[0103] This has already been discussed above and will not be detailed here.

[0104] After the actual scheduling time is updated to 0, the corresponding task is not schedulable for the time being, so the task must wait for the next preset scheduling time to arrive before the task can be scheduled. At this point, since the task no longer owes scheduling time to tasks from other containers, its actual scheduling time may also be reset to the preset scheduling time. The specific process is as follows:

[0105] Specifically, the method 200 further includes: if the updated actual scheduling time is 0, the actual scheduling time corresponding to the next task to be executed is equal to the preset scheduling time if it is determined that the next task to be executed can be scheduled.

[0106] For example, as described above, after the actual scheduling time for task c is updated to 0, the next preset scheduling time for container A is awaited, and when it arrives, task c can be scheduled. Then, the actual scheduling time of task c is also reset to 10 ms, which is equal to the preset scheduling time and may be used as the actual scheduling time for the next task to be executed from container A, such as task d, so that when the task scheduler subsequently receives task d, the actual scheduling time of 10 ms is updated. For the specific update process, please refer to the above description.

[0107] It should be noted that subsequent tasks appearing in the embodiments of the present application, such as tasks b, c, d, etc., are intended only to enable a clear explanation of the example and are not intended to indicate that these tasks are identified and that the present solution can only be executed if the identifiers match; rather, these identifiers simply indicate that these tasks are subsequent tasks from the same container.

[0108] Furthermore, in the process of adjusting the actual scheduling time, the actual scheduling time does not need to be updated directly to exactly 0, but may be updated from 5 ms to -1 ms, so in this case, the adjustment process is as follows:

[0109] Specifically, the method 200 further includes: when the actual scheduling time corresponding to the subsequent task to be executed from the same source is reduced directly from a positive number to a negative number, determining a difference value between the negative number and 0; adjusting the actual scheduling time corresponding to the subsequent task to be executed from the same source to 0; receiving the subsequent task to be executed from the same source; and, at the arrival of the corresponding preset scheduling time, sending the task to be executed from the other source to the corresponding processing device; waiting for the arrival of the corresponding next preset scheduling time, and then sending the subsequent task to be executed from the same source to the corresponding processing device to perform task processing according to the corresponding actual execution time, wherein, at the arrival of the corresponding next preset scheduling time, the actual scheduling time corresponding to the subsequent task to be executed from the same source is equal to the difference between the preset scheduling time and the difference value.

[0110] For example, as described above, the task scheduler receives task a (i.e., the current task to be executed) sent from container A, obtains the execution instruction of task a, and thereby determines that the corresponding actual execution time is 16 ms. Then, the task scheduler compares the corresponding actual execution time with the preset scheduling time of 10 ms for container A and determines that the overtime is 6 ms. Then, when the task scheduler next receives a task sent by container A, such as task b, the actual scheduling time of the task is 10=4 ms, i.e., changes from the original 10 ms to 4 ms. (In this case, the preset scheduling time may be considered the actual scheduling time if there is no overtime; for example, if task a is the first task from container A, or if none of the previous tasks from container A have overtime or idling time, the actual scheduling time for task a is the preset scheduling time and can be used as the actual scheduling time for task b.) Thereafter, the actual scheduling time for task b is updated to 4 ms and used as the actual scheduling time for the next task c from container A. After receiving task b, the task scheduler determines that the actual execution time of task b is 16 ms and the overtime of task b is 6 ms. The task scheduler then updates the actual scheduling time of task b to 4-6=-2 ms. At this point, the task scheduler may then directly update the actual scheduling time to 0 ms and use this as the actual scheduling time for task c, while determining 2 ms as the difference value. The task scheduler can schedule tasks a and b, but cannot schedule task c for the time being and must wait. After the corresponding preset scheduling time arrives, task c will not be scheduled for the time being, and subsequent tasks from other containers may be scheduled, and the next preset scheduling time may be waited for, after which task c may be scheduled.At this time, the actual scheduling time for task c is 0, but in the case of rescheduling, the actual scheduling time of task c can be reset to 10 ms, which is equal to the preset scheduling time, so the actual scheduling time for the next task d from this container A can be updated to 10 ms-2=8 ms.

[0111] It should be noted that the task scheduling in the embodiments of the present application is independent of whether the device driver is open source or not, and can be easily applied to processing devices with open source or non-open source device drivers, and therefore has a wider range of applications.

[0112] Based on the same inventive concept described above, Fig. 4 shows a flowchart of a scheduling method for container tasks provided by another exemplary embodiment of the present application. The method 400 provided by the embodiment of the present application is executed by the above-mentioned cloud server, more specifically, by a task scheduler provided in the cloud server. As shown in Fig. 4, the method 400 includes the following steps: 401: Receive a current task to be executed sent by any container, and obtain task information of the current task to be executed, where the task information describes the current task to be executed; 402: Determine the actual execution time for the current task to be executed according to the task information; and 403: Compare the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjust the actual scheduling time corresponding to the next task to be executed from the same container according to the comparison result to determine whether the next task to be executed from the same container should be scheduled.

[0113] The specific implementation of steps 401-403 has been described in detail above and will not be detailed here.

[0114] Here, receiving the current task to be executed sent by any container includes receiving the current task to be executed according to a communication interface corresponding to the container, and method 400 further includes determining a container identifier according to the communication interface to determine a task to be executed from the same container according to the container identifier.

[0115] This has already been discussed above and will not be detailed here.

[0116] Furthermore, for the contents not described in detail in this method 400, reference can be made to the steps in the method 200 described above.

[0117] 5 is a schematic diagram of a structural framework of a task scheduling apparatus provided in an exemplary embodiment of the present application. The apparatus 500 may be applied to a cloud server, more specifically, a task scheduler in a cloud server. The apparatus 500 includes an acquisition module 501, a determination module 502, and an adjustment module 503. A detailed description of the function of each module is provided below.

[0118] The acquisition module 501 is used to acquire task information of the current task to be executed, where the task information describes the current task to be executed.

[0119] The determination module 502 is used to determine the actual execution time for the current task to be executed according to the task information.

[0120] The adjustment module 503 is used to compare the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjust the actual scheduling time corresponding to the next task to be executed according to the comparison result, so as to determine whether the next task to be executed should be scheduled.

[0121] Specifically, the acquisition module 501 is used to acquire task information according to the storage address that the current task to be executed has.

[0122] Specifically, the determination module 502 is used to determine the actual execution time for executing the task information as the actual execution time for the current task to be executed.

[0123] Specifically, the determination module 502 is used to input task information into the pre-configured model and determine the output of the pre-configured model as the actual execution time.

[0124] Specifically, the determination module 502 is used to match the task information with multiple preset task information, and select, according to the matching result, the preset execution time corresponding to the matched preset task information as the actual execution time.

[0125] Specifically, the adjustment module 503 includes: a determination unit for determining an overtime when the comparison result is that the actual execution time is longer than the preset scheduling time; and an adjustment unit for adjusting the actual scheduling time corresponding to the next task to be executed from the same source according to the overtime to obtain an updated actual scheduling time, and continuing to use the updated actual scheduling time as the actual scheduling time for the subsequent task to be executed from the same source until the subsequent updated actual scheduling time is reduced to 0, where when the current task to be executed is an initial task to be executed from the same source, the actual scheduling time corresponding to the current task to be executed is the same as the actual scheduling time corresponding to the next task to be executed from the same source, which is the preset scheduling time.

[0126] Moreover, the apparatus 500 further includes a scheduling module for determining, when the subsequent updated actual scheduling time is 0, not to schedule the subsequent task to be executed upon arrival of the preset scheduling time corresponding to the subsequent task to be executed.

[0127] Furthermore, the scheduling module is further used for determining, when the actual scheduling time corresponding to the subsequent task to be executed is not 0 after updating, to schedule the subsequent task to be executed according to the actual execution time when the corresponding preset scheduling time arrives.

[0128] Furthermore, the apparatus 500 further includes a sending module for, after determining to schedule the next task to be executed, receiving the next task to be executed, waiting for the arrival of a corresponding preset scheduling time, and then sending the next task to be executed to a corresponding processing device for performing task processing according to the corresponding actual execution time.

[0129] Furthermore, the sending module is further used for receiving subsequent tasks to be executed, and sending the tasks to be executed from other sources to corresponding processing devices, so as to perform task processing according to corresponding actual execution times when corresponding preset scheduling times arrive.

[0130] Furthermore, the sending module is further used for waiting for the arrival of the corresponding next preset scheduling time, and then sending the subsequent task to be executed to the corresponding processing device, for performing task processing according to the corresponding actual execution time, and when the corresponding next preset scheduling time arrives, the actual scheduling time corresponding to the subsequent task to be executed is equal to the preset scheduling time.

[0131] Moreover, the determining unit is further used for determining an idling time when the comparison result is that the actual execution time is shorter than the preset scheduling time, and the adjusting unit is further used for adjusting the actual scheduling time corresponding to the next task to be executed from the same source according to the idling time to obtain an updated actual scheduling time, and continuing to use the updated actual scheduling time as the actual scheduling time for the subsequent task to be executed from the same source.

[0132] Moreover, the decision unit is further used for deciding to schedule the next task to be executed when the comparison result is that the actual execution time is less than or equal to the preset scheduling time.

[0133] Furthermore, the adjustment unit is further used for increasing the idling time for the current task to be executed to the actual scheduling time corresponding to the current task to be executed, and updating the corresponding actual scheduling time, and using the updated actual scheduling time as the actual scheduling time for the next task to be executed.

[0134] Furthermore, the adjustment unit is further used for reducing the overtime for the current task to be executed to the actual scheduling time corresponding to the current task to be executed, and updating the corresponding actual scheduling time, and using the updated actual scheduling time as the actual scheduling time for the next task to be executed.

[0135] In addition, the adjustment unit is further used for: if the updated actual scheduling time is 0, the actual scheduling time corresponding to the next task to be executed is equal to the preset scheduling time if it is determined that the next task to be executed can be scheduled;

[0136] Here, the preset scheduling times corresponding to tasks due to be executed from the same source are the same.

[0137] Furthermore, the determination module 502 is further used to determine a difference value between a negative number and 0 when the actual scheduling time corresponding to the subsequent task to be executed from the same source is directly reduced from a positive number to a negative number. The adjustment module 503 is further used to adjust the actual scheduling time corresponding to the subsequent task to be executed from the same source to 0. The sending module is further used to receive the subsequent task to be executed from the same source and to send the task to be executed from the other source to a corresponding processing device when the corresponding preset scheduling time arrives. The sending module is further used to wait for the arrival of the corresponding next preset scheduling time, and then send the subsequent task to be executed from the same source to the corresponding processing device to perform task processing according to the corresponding actual execution time, when the corresponding next preset scheduling time arrives, the actual scheduling time corresponding to the subsequent task to be executed from the same source is equal to the difference between the preset scheduling time and the difference value.

[0138] Specifically, the acquisition module 501 is used to receive, via the communication interface, the current tasks to be executed sent by the virtual device.

[0139] 6 is a schematic diagram of a structural framework of a scheduling apparatus for container tasks provided in an exemplary embodiment of the present application. The apparatus 600 may be applied to a cloud server, and more specifically, may be a task scheduler provided in the cloud server. The apparatus 600 includes a receiving module 601, a determining module 602, and an adjusting module 603. A detailed description of the function of each module is provided below.

[0140] The receiving module 601 is used to receive a current task to be executed sent by any container and obtain task information of the current task to be executed, where the task information describes the current task to be executed.

[0141] The determination module 602 is used to determine the actual execution time for the current task to be executed according to the task information.

[0142] The adjustment module 603 is used to compare the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjust the actual scheduling time corresponding to the next task to be executed from the same container according to the comparison result, so as to determine whether the next task to be executed from the same container should be scheduled.

[0143] Specifically, the receiving module 601 is used to receive a current task to be executed according to a communication interface corresponding to a container, and the determining module 602 is specifically used to determine a container identifier according to the communication interface, so as to determine a task to be executed from the same container according to the container identifier.

[0144] It should be noted that for parts of the device 600 not mentioned above, reference can be made to the contents of the device 500 described above.

[0145] 5 has been described above, in a possible design, the structure of the device 500 shown in FIG. 5 may be implemented as a computing device, such as a server. As shown in FIG. 7, the device 700 may include a memory 701 and a processor 702.

[0146] The memory 701 is used to store computer programs.

[0147] The processor 702 is used to execute a computer program for performing the steps of: acquiring task information of a current task to be executed, where the task information describes the current task to be executed; determining an actual execution time for the current task to be executed according to the task information; comparing the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjusting the actual scheduling time corresponding to the next task to be executed according to a comparison result, so as to determine whether the next task to be executed should be scheduled.

[0148] Specifically, the processor 702 is specifically used to obtain task information according to the storage address that the current task to be executed has.

[0149] Specifically, the processor 702 is specifically used to determine the actual execution time for executing the task information as the actual execution time for the current task to be executed.

[0150] Specifically, the processor 702 is specifically used to input task information into the pre-configured model and determine the output of the pre-configured model as the actual execution time.

[0151] Specifically, the processor 702 is specifically used for matching the task information with a plurality of preset task information, and selecting the preset execution time as the actual execution time according to the matching result.

[0152] Specifically, the processor 702 is specifically used to perform the steps of: determining an overtime when the comparison result is that the actual execution time is longer than the preset scheduling time; adjusting the actual scheduling time corresponding to the next task to be executed from the same source according to the overtime to obtain an updated actual scheduling time; and continuing to use the updated actual scheduling time as the actual scheduling time for the subsequent task to be executed from the same source until the subsequent updated actual scheduling time is reduced to 0, where when the current task to be executed is an initial task to be executed from the same source, the actual scheduling time corresponding to the current task to be executed is the same as the actual scheduling time corresponding to the next task to be executed from the same source, which is the preset scheduling time.

[0153] Furthermore, the processor 702 is further used to determine not to schedule a subsequent task to be executed when the subsequent updated actual scheduling time is 0, upon arrival of the preset scheduling time corresponding to the subsequent task to be executed.

[0154] Furthermore, the processor 702 is further used to determine that when the actual scheduling time corresponding to the subsequent task to be executed is not 0 after updating, the subsequent task to be executed is scheduled according to the actual execution time when the corresponding preset scheduling time arrives.

[0155] Furthermore, after determining to schedule the next task to be executed, the processor 702 is further used for receiving the next task to be executed, waiting for the arrival of a corresponding preset scheduling time, and then sending the next task to be executed to a corresponding processing device for performing task processing according to the corresponding actual execution time.

[0156] Furthermore, the processor 702 is further used to receive subsequent tasks to be executed and transmit the tasks to be executed from other sources to corresponding processing devices to perform task processing according to the corresponding actual execution times when the corresponding preset scheduling times arrive.

[0157] Furthermore, the processor 702 is further used to wait for the arrival of the corresponding next preset scheduling time, and then send the subsequent task to be executed to the corresponding processing device to perform task processing according to the corresponding actual execution time, and when the corresponding next preset scheduling time arrives, the actual scheduling time corresponding to the subsequent task to be executed is equal to the preset scheduling time.

[0158] Furthermore, the processor 702 is further used for determining an idling time when the comparison result is that the actual execution time is shorter than the preset scheduling time, adjusting the actual scheduling time corresponding to the next task to be executed from the same source according to the idling time to obtain an updated actual scheduling time, and continuing to use the updated actual scheduling time as the actual scheduling time for the subsequent task to be executed from the same source.

[0159] Furthermore, the processor 702 is further used to determine to schedule the next task to be executed when the comparison result is that the actual execution time is less than or equal to the preset scheduling time.

[0160] Furthermore, the processor 702 is further used to increase the idling time for the current task to be executed to the actual scheduling time corresponding to the current task to be executed, to update the corresponding actual scheduling time, and to use the updated actual scheduling time as the actual scheduling time for the next task to be executed.

[0161] Furthermore, the processor 702 is further used for, for the current task to be executed, reducing the overtime to the actual scheduling time corresponding to the current task to be executed, and updating the corresponding actual scheduling time, and using the updated actual scheduling time as the actual scheduling time for the next task to be executed.

[0162] Furthermore, the processor 702 is further used to: if the updated actual scheduling time is 0, the actual scheduling time corresponding to the next task to be executed is equal to the preset scheduling time if it is determined that the next task to be executed can be scheduled.

[0163] Here, the preset scheduling times corresponding to tasks due to be executed from the same source are the same.

[0164] Furthermore, the processor 702 is further used for: determining a difference value between the negative number and 0 when the actual scheduling time corresponding to the subsequent task to be executed from the same source is directly reduced from a positive number to a negative number; adjusting the actual scheduling time corresponding to the subsequent task to be executed from the same source to 0; receiving the subsequent task to be executed from the same source; and transmitting the task to be executed from the other source to the corresponding processing device when the corresponding preset scheduling time arrives; the sending module is further used for waiting for the arrival of the corresponding next preset scheduling time, and then transmitting the subsequent task to be executed from the same source to the corresponding processing device to perform task processing according to the corresponding actual execution time; when the corresponding next preset scheduling time arrives, the actual scheduling time corresponding to the subsequent task to be executed from the same source is equal to the difference between the preset scheduling time and the difference value.

[0165] Specifically, the processor 702 is specifically used to receive, via the communication interface, the current task to be executed sent by the virtual device.

[0166] Furthermore, an embodiment of the present invention provides a computer storage medium having a computer program that, when executed by one or more processors, causes the one or more processors to perform steps of a scheduling method for tasks of the method embodiment of FIG.

[0167] 6 has been described above, in a possible design, the structure of the device 600 shown in FIG. 6 may be implemented as a computing device, such as a server. As shown in FIG. 8, the device 800 may include a memory 801 and a processor 802.

[0168] The memory 801 is used to store computer programs.

[0169] The processor 802 is used to execute a computer program for receiving a current task to be executed sent by any container, obtaining task information of the current task to be executed, where the task information describes the current task to be executed, determining an actual execution time for the current task to be executed according to the task information, comparing the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjusting the actual scheduling time corresponding to the next task to be executed from the same container according to the comparison result, so as to determine whether the next task to be executed from the same container should be scheduled.

[0170] Specifically, the processor 802 is specifically used to receive a current task to be executed according to a communication interface corresponding to a container, and the processor 802 is further used to determine a container identifier according to the communication interface, so as to determine a task to be executed from the same container according to the container identifier.

[0171] It should be noted that for parts of the device 800 not mentioned above, reference can be made to the contents of the device 700 described above.

[0172] Furthermore, an embodiment of the present invention provides a computer storage medium having a computer program that, when executed by one or more processors, causes the one or more processors to perform steps of a scheduling method for container tasks of the method embodiment of FIG.

[0173] Furthermore, while some of the processes described in the above embodiments and accompanying drawings contain multiple operations that appear in a specific order, it should be clearly understood that these operations may be performed outside the specific order in which they appear herein or in parallel, and that the serial numbers of operations such as 201, 202, and 203 are used only to distinguish between various different operations, and the serial numbers themselves do not represent any order of execution. Alternatively, these processes may include more or fewer operations, and these operations may be performed sequentially or in parallel. It should be noted that the terms "first" and "second" in this specification are used to distinguish between different messages, devices, modules, etc., but do not represent a sequential order, nor are they intended to limit "first" and "second" to being of different types.

[0174] The above-described device embodiments are merely schematic, and the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the objectives of the solutions of the present embodiment. Those skilled in the art can understand and implement the solutions of the present embodiment without any creative efforts.

[0175] From the description of the above implementation forms, those skilled in the art can clearly understand that various implementation forms may be implemented by software in addition to a required general hardware platform, and undoubtedly may also be implemented by a combination of hardware and software. Based on such understanding, the above technical solutions may essentially, or the parts that contribute to the prior art, be embodied in the form of a computer product. The present invention may be in the form of a computer program product embodied in one or more computer-usable storage media (including, but not limited to, magnetic disk memory, CD-ROM, optical memory, and the like) containing computer-usable program code.

[0176] The present invention will be described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams, may be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or a processor of another programmable multimedia data processing device to produce a machine, such that the instructions, when executed by a processor of the computer or another programmable multimedia data processing device, produce an apparatus for implementing the functions specified in one or more flows of the flowcharts and / or one or more blocks of the block diagrams.

[0177] These computer program instructions may also be stored in a computer-readable memory, and the computer program instructions may direct a computer or another programmable multimedia data processing device to operate in a particular manner so as to produce an article of manufacture including an instruction apparatus that implements the functions specified in one or more flows of the flowcharts and / or one or more blocks of the block diagrams, wherein the instructions stored in the computer-readable memory.

[0178] These computer program instructions can also be loaded into a computer or another programmable multimedia data processing device so that a series of operating steps are performed on the computer or another programmable device to produce a computer-executed process, such that the instructions, which execute on the computer or another programmable device, provide steps for implementing the functions specified in one or more flows of the flowcharts and / or one or more blocks of the block diagrams.

[0179] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0180] The memory may include volatile memory, random access memory (RAM), and / or non-volatile memory in a computer-readable medium, such as read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0181] Computer-readable media include permanent and non-permanent, removable and non-removable media, which may employ any method or technology to store information. Information may be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, cassette magnetic tape, tape and disk storage or other magnetic storage devices, or any other non-transmission medium that may be configured to store information accessible by a computing device. As defined herein, computer-readable media does not include computer-readable transient media such as modulated data signals and carriers.

[0182] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions recorded in the above various embodiments can still be modified, or some of its technical features may be replaced with equivalents. These modifications or replacements do not deviate from the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. 1. A scheduling method for a task, comprising: obtaining task information for a current task to be executed, the task information describing the current task to be executed; determining an actual execution time for the current task to be executed according to the task information; comparing the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjusting the actual scheduling time corresponding to the next task to be executed according to the comparison result to determine whether the next task to be executed should be scheduled; Including, adjusting the actual scheduling time corresponding to the next task to be executed in response to the comparison, determining an overtime when the comparison result indicates that the actual execution time is longer than the preset scheduling time; adjusting the actual scheduling time corresponding to the next task to be executed from the same container according to the overtime to obtain an updated actual scheduling time, and continuing to use the updated actual scheduling time as the actual scheduling time for subsequent tasks to be executed from the same container until the subsequent updated actual scheduling time is reduced to zero; Including, When the current task to be executed is an initial task to be executed from the same container, the actual scheduling time corresponding to the current task to be executed is the same as the actual scheduling time corresponding to the next task to be executed from the same container, and is the preset scheduling time.

2. The step of obtaining task information of a current task to be executed includes: obtaining the task information according to a storage address of the current task to be executed; The method of claim 1 , comprising:

3. determining an actual execution time for the current task to be executed according to the task information; determining an actual execution time for executing the task information as the actual execution time for the current task to be executed; The method of claim 1 , comprising:

4. determining an actual execution time for executing the task information; inputting the task information into a pre-configured model and determining the output of the pre-configured model as the actual execution time; The method of claim 3, comprising:

5. determining an actual execution time for the current task to be executed according to the task information; Matching the task information with a plurality of preset task information, and selecting a preset execution time corresponding to the matched preset task information as the actual execution time according to the matching result. The method of claim 1 , comprising:

6. determining not to schedule the subsequent task to be executed when a preset scheduling time corresponding to the subsequent task to be executed arrives when the subsequent updated actual scheduling time is zero; The method of claim 1 further comprising:

7. determining, when the actual scheduling time corresponding to the subsequent task to be executed is not zero after updating, to schedule the subsequent task to be executed according to the actual execution time when the corresponding preset scheduling time arrives; The method of claim 1 further comprising:

8. After determining to schedule the next task to be executed, receiving the next task to be executed, waiting for a corresponding preset scheduling time to arrive, and then sending the next task to be executed to a corresponding processing device to perform task processing according to the corresponding actual execution time. The method of claim 7 further comprising:

9. receiving the subsequent tasks to be executed, and transmitting the tasks to be executed from other sources to corresponding processing devices to perform task processing according to corresponding actual execution times at the arrival of the corresponding preset scheduling times; The method of claim 6 further comprising:

10. waiting for the arrival of a corresponding next preset scheduling time, and then sending the subsequent task to be executed to a corresponding processing device for performing task processing according to the corresponding actual execution time; further comprising at the arrival of the corresponding next preset scheduling time, the actual scheduling time corresponding to the subsequent task to be executed is equal to the preset scheduling time; 10. The method of claim 9.

11. adjusting the actual scheduling time corresponding to the next task to be executed in response to the comparison, determining an idle time when the comparison result is that the actual execution time is shorter than the preset scheduling time; adjusting the actual scheduling time corresponding to the next task to be executed from the same container according to the idling time to obtain an updated actual scheduling time, and continuing to use the updated actual scheduling time as the actual scheduling time for subsequent tasks to be executed from the same container; The method of claim 1 , comprising:

12. determining to schedule the next task to be executed when the comparison result is that the actual execution time is less than or equal to the preset scheduling time; The method of claim 11 further comprising:

13. adding the idling time to the actual scheduling time corresponding to the current task to be executed for the current task to be executed to update the corresponding actual scheduling time, and using the updated actual scheduling time as the actual scheduling time for the next task to be executed. The method of claim 11 further comprising:

14. The method according to any one of claims 1 to 13, wherein the preset scheduling times corresponding to tasks scheduled to be executed from the same container are the same.

15. The step of obtaining task information of a current task to be executed includes: receiving, via a communication interface, the current task to be executed transmitted by a virtual device; The method of claim 1 , comprising:

16. 1. A scheduling method for container tasks, comprising: receiving a current task to be executed sent by any container and obtaining task information of the current task to be executed, the task information describing the current task to be executed; determining an actual execution time for the current task to be executed according to the task information; comparing the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjusting the actual scheduling time corresponding to the next task to be executed from the same container according to the comparison result to determine whether the next task to be executed from the same container should be scheduled; Including, adjusting the actual scheduling time corresponding to the next task to be executed in response to the comparison, determining an overtime when the comparison result indicates that the actual execution time is longer than the preset scheduling time; adjusting the actual scheduling time corresponding to the next task to be executed from the same container according to the overtime to obtain an updated actual scheduling time, and continuing to use the updated actual scheduling time as the actual scheduling time for subsequent tasks to be executed from the same container until the subsequent updated actual scheduling time is reduced to zero; Including, When the current task to be executed is an initial task to be executed from the same container, the actual scheduling time corresponding to the current task to be executed is the same as the actual scheduling time corresponding to the next task to be executed from the same container, and is the preset scheduling time.

17. The step of receiving a current task to be executed sent by any container includes: receiving the current task to be executed according to a communication interface corresponding to the container; Including, The method comprises: determining a container identifier according to the communication interface to determine a task to be executed from the same container according to the container identifier; 17. The method of claim 16, further comprising:

18. A scheduling apparatus for a task, comprising: an acquisition module for acquiring task information of a current task to be executed, the task information describing the current task to be executed; a determination module for determining an actual execution time for the current task to be executed according to the task information; an adjusting module for comparing the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjusting the actual scheduling time corresponding to the next task to be executed according to a result of the comparison, so as to determine whether the next task to be executed should be scheduled; Equipped with the regulation module: determining an overtime when the comparison result indicates that the actual execution time is longer than the preset scheduling time; adjusting the actual scheduling time corresponding to the next task to be executed from the same container according to the overtime to obtain an updated actual scheduling time, and continuing to use the updated actual scheduling time as the actual scheduling time for subsequent tasks to be executed from the same container until the subsequent updated actual scheduling time is reduced to zero; and further configured to: When the current task to be executed is an initial task to be executed from the same container, the actual scheduling time corresponding to the current task to be executed is the same as the actual scheduling time corresponding to the next task to be executed from the same container, and is the preset scheduling time.

19. A scheduling device for container tasks, comprising: a receiving module for receiving a current task to be executed sent by any container and obtaining task information of the current task to be executed, the task information describing the current task to be executed; a determination module for determining an actual execution time for the current task to be executed according to the task information; an adjustment module for comparing the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjusting the actual scheduling time corresponding to the next task to be executed from the same container according to a result of the comparison, in order to determine whether the next task to be executed from the same container should be scheduled; the regulation module: determining an overtime when the comparison result indicates that the actual execution time is longer than the preset scheduling time; adjusting the actual scheduling time corresponding to the next task to be executed from the same container according to the overtime to obtain an updated actual scheduling time, and continuing to use the updated actual scheduling time as the actual scheduling time for subsequent tasks to be executed from the same container until the subsequent updated actual scheduling time is reduced to zero; and further configured to: When the current task to be executed is an initial task to be executed from the same container, the actual scheduling time corresponding to the current task to be executed is the same as the actual scheduling time corresponding to the next task to be executed from the same container, and is the preset scheduling time.

20. A computing device comprising a memory and a processor, the memory is used to store a computer program; the processor: obtaining task information for a current task to be executed, the task information describing the current task to be executed; determining an actual execution time for the current task to be executed according to the task information; comparing the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjusting the actual scheduling time corresponding to the next task to be executed according to the comparison result to determine whether the next task to be executed should be scheduled; is used to execute the computer program for performing adjusting an actual scheduling time corresponding to the next task to be executed in response to the comparison; determining an overtime when the comparison result indicates that the actual execution time is longer than the preset scheduling time; adjusting the actual scheduling time corresponding to the next task to be executed from the same container according to the overtime to obtain an updated actual scheduling time, and continuing to use the updated actual scheduling time as the actual scheduling time for subsequent tasks to be executed from the same container until the subsequent updated actual scheduling time is reduced to zero; Including, When the current task to be executed is an initial task to be executed from the same container, the actual scheduling time corresponding to the current task to be executed is the same as the actual scheduling time corresponding to the next task to be executed from the same container, and is the preset scheduling time.

21. A computing device comprising a memory and a processor, the memory is used to store a computer program; the processor: receiving a current task to be executed sent by any container and obtaining task information of the current task to be executed, the task information describing the current task to be executed; determining an actual execution time for the current task to be executed according to the task information; comparing the actual execution time with a preset scheduling time corresponding to the current task to be executed, and adjusting the actual scheduling time corresponding to the next task to be executed from the same container according to the comparison result to determine whether the next task to be executed from the same container should be scheduled; is used to execute the computer program for performing adjusting an actual scheduling time corresponding to the next task to be executed in response to the comparison; determining an overtime when the comparison result indicates that the actual execution time is longer than the preset scheduling time; adjusting the actual scheduling time corresponding to the next task to be executed from the same container according to the overtime to obtain an updated actual scheduling time, and continuing to use the updated actual scheduling time as the actual scheduling time for subsequent tasks to be executed from the same container until the subsequent updated actual scheduling time is reduced to zero; Including, When the current task to be executed is an initial task to be executed from the same container, the actual scheduling time corresponding to the current task to be executed is the same as the actual scheduling time corresponding to the next task to be executed from the same container, and is the preset scheduling time.

22. 18. A computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by one or more processors, causes the one or more processors to perform the steps of the method of any one of claims 1 to 17.

Citation Information

Patent Citations

  • A Method for Time-Split Application Scheduling in Computer Operating Systems

    JP2003509766A

  • Method and apparatus for establishing a service quality model

    JP2007510229A

  • Rolling Resource Credits for Scheduling Virtual Computer Resources

    JP2017526999A

  • System for Container Management and Scheduling

    JP2017538204A

  • Method and apparatus for flexible job pre-emption

    US7752622B1