Task scheduling method and device, equipment and storage medium

CN116737342BActive Publication Date: 2026-10-16INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310721308.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-16
Publication Date
2026-10-16
Estimated Expiration
2043-06-16

AI Technical Summary

Technical Problem

用户在开发调试算法代码的过程中常常需创建多个开发环境,然而计算资源有限,且kubernets不支持暂停操作,因此,如何动态释放资源,简化用户的操作流程,是一个AI训练平台必须要解决的难题

Benefits of technology

[0058] This invention provides a task scheduling method that, in response to a user's pause operation on the development environment, controls the closure of the port through which the user enters the development environment and the corresponding container environment. It also updates the first number of computing resources occupied by the development environment and the second number of computing resources used by the user. In response to a user's restart operation on the development environment, it sends a restart task to a preset task scheduling queue. When the third number of computing resources on the node where the restart task is located exceeds a preset threshold, it starts the container environment, completing the restart task. This invention, while preserving the development environment, only requires pausing and restarting it, thus releasing resources without deleting the environment and reducing the time users spend saving images in the original process. After the development environment is paused, the released resources are updated for users to submit new tasks, thereby improving computing resource utilization. This method enables the release of computing resources through task pause and restart scheduling when user resource quotas and cluster computing resources are insufficient, preserving the user's development environment and facilitating the creation of new environments. It also enables rapid pause and restart to restore the development environment, thereby improving user development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116737342B_ABST
    Figure CN116737342B_ABST
Patent Text Reader

Abstract

The application provides a task scheduling method and device, equipment and a storage medium. The method comprises the following steps: in response to a user's pause operation on a development environment, controlling to close a port entered by the user into the development environment and a container environment corresponding to the development environment, updating a first number of computing resources occupied by the development environment and a second number of computing resources used by the user, in response to a restart operation of the development environment by the user, issuing a restart task to a preset task scheduling queue, and starting the container environment when a third number of computing resources of a node where the restart task is located is greater than a preset threshold value, and completing the restart task. The application pauses and restarts the development environment only by reserving the development environment, thereby releasing resources without deleting the environment, reducing the time for the user to save the image in the original process, and achieving the purpose of quickly pausing, restarting and recovering the development environment in the case of insufficient user resource quota and insufficient cluster computing resources, thereby improving the development efficiency of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of server technology, and in particular to a task scheduling method, apparatus, device, and storage medium. Background Technology

[0002] With the increasing prevalence of artificial intelligence applications, in the field of AI model training platforms, to improve the iteration speed of AI applications and technologies, Kubernetes technology is typically used to complete model training iterations. Kubernetes is an open-source system for automatically deploying, scaling, and managing containerized applications, combining the containers that make up the application into logical units to facilitate management and service discovery. Users often need to create multiple development environments during the development and debugging of algorithm code; however, computing resources are limited, and Kubernetes does not support pause operations. Therefore, how to dynamically release resources and simplify the user's operation process is a problem that an AI training platform must solve.

[0003] Currently, when users create a new development environment, they need to first save the development environment as an image, then delete the development environment to release resources, and then reconfigure the task parameters to create a new environment. However, this method involves frequently saving images and is complicated. If users make a mistake, the user's environment may be lost, requiring the user to reconfigure the environment, wasting storage space and consuming user development time, thus affecting the development efficiency of the AI ​​training platform. Summary of the Invention

[0004] In view of this, the present invention aims to provide a task scheduling method, apparatus, device and storage medium to solve the problem of achieving efficient online task scheduling and ensuring stable server operation.

[0005] According to a first aspect of the present invention, a task scheduling method is provided, the method comprising:

[0006] In response to the user's pause operation on the development environment, control the closure of the port through which the user can access the development environment and the container environment corresponding to the development environment;

[0007] Update the first number of computing resources occupied by the development environment and the second number of computing resources used by the user;

[0008] In response to the user's restart operation on the development environment, the restart task is sent to the preset task scheduling queue;

[0009] When the number of third computing resources on the node where the restart task is located exceeds a preset threshold, the container environment is started to complete the restart task.

[0010] Optionally, updating the first number of computing resources occupied by the development environment and the second number of computing resources used by the user includes:

[0011] Call the resource management plugin to obtain the number of primary computing resources used by the development environment and the number of secondary computing resources used by the user;

[0012] Update the first number of computing resources and the second number of computing resources so that the number of computing resources on the node where the paused task is located is consistent with the first number of computing resources.

[0013] Optionally, responding to the user's restart operation on the development environment by sending the restart task to a preset task scheduling queue includes:

[0014] Get the number of computing resources on the node where the paused task is located;

[0015] In response to the user's restart operation on the development environment, the restart task is sent to the preset task scheduling queue of the scheduling system;

[0016] Based on the number of computing resources on the node, the resource management plugin is invoked to occupy and allocate computing resources for the restart task.

[0017] Optionally, when the number of third computing resources on the node where the restart task is located exceeds a preset threshold, starting the container environment to complete the restart task includes:

[0018] When the number of third computing resources on the node where the restart task is located exceeds a preset threshold, a restart command is issued;

[0019] According to the restart command, control the container environment corresponding to the development environment to resume startup;

[0020] Update the number of primary computing resources used by the development environment and the number of secondary computing resources used by the user after the restart, and complete the restart task.

[0021] Optionally, after responding to the user's restart operation on the development environment and sending the restart task to a preset task scheduling queue, the method further includes:

[0022] Obtain scheduling tasks from a preset task scheduling queue, wherein the scheduling tasks include at least one task generated by the scheduling node based on the user's operation;

[0023] Task flags are pre-set for the scheduled tasks in the preset task scheduling queue, wherein the task flags include a paused task flag, which is used to distinguish the user's paused tasks from other newly created tasks in the preset task scheduling queue;

[0024] Detect whether the scheduled task carries the task flag bit to determine the task type of the scheduled task;

[0025] If it is detected that the scheduled task does not carry the paused task flag, then the scheduled task is determined to be a new task, and computing resources are allocated and scheduled for the new task.

[0026] If a scheduled task is detected to carry a paused task flag, the scheduled task is determined to be a paused task to be restarted, and the restart task is started.

[0027] Optionally, if it is detected that the scheduled task does not carry the paused task flag, then after determining that the scheduled task is a new task and allocating and scheduling computing resources for the new task, the method further includes:

[0028] If the number of computing resources on the node where the restart task is located is determined to be greater than the target number of computing resources for the restart task, the subsequent scheduling tasks of the restart task in the preset task scheduling queue will be interrupted.

[0029] According to a second aspect of the present invention, a task scheduling apparatus is provided, the apparatus comprising:

[0030] The first response module is used to respond to the user's pause operation on the development environment and control the closure of the port through which the user enters the development environment and the container environment corresponding to the development environment.

[0031] The resource update module is used to update the first number of computing resources occupied by the development environment and the second number of computing resources used by the user.

[0032] The second response module is used to respond to the user's restart operation on the development environment by sending the restart task to a preset task scheduling queue.

[0033] The task execution module is used to start the container environment and complete the restart task when the number of third computing resources on the node where the restart task is located is greater than a preset threshold.

[0034] Optionally, the updated resource module includes:

[0035] The first acquisition submodule is used to call the resource management plugin to obtain the number of first computing resources occupied by the development environment and the number of second computing resources used by the user.

[0036] The first update submodule is used to update the first number of computing resources and the second number of computing resources so that the number of computing resources of the node where the paused task is located is consistent with the first number of computing resources.

[0037] Optionally, the second response module includes:

[0038] The second acquisition submodule is used to acquire the number of computing resources of the node where the paused task is located;

[0039] The second response submodule is used to respond to the user's restart operation on the development environment by sending the restart task to the preset task scheduling queue of the scheduling system.

[0040] The first calling submodule is used to call the resource management plugin to occupy and allocate computing resources for the restart task based on the number of computing resources on the node.

[0041] Optionally, the task execution module includes:

[0042] The command submodule is used to issue a restart command when the number of third computing resources on the node where the restart task is located exceeds a preset threshold.

[0043] The control submodule is used to control the container environment corresponding to the development environment to resume startup according to the restart command;

[0044] The second update submodule is used to update the number of primary computing resources occupied by the development environment and the number of secondary computing resources used by the user after the restart, thus completing the restart task.

[0045] Optionally, the device further includes:

[0046] The task acquisition module is used to acquire scheduled tasks in a preset task scheduling queue, wherein the scheduled tasks include at least one task generated by the scheduling node according to the user's operation;

[0047] The preset flag module is used to preset task flag bits for the scheduled tasks in the preset task scheduling queue. The task flag bits include a paused task flag bit, which is used to distinguish the user's paused tasks from other newly created tasks in the preset task scheduling queue.

[0048] The detection flag module is used to detect whether the scheduled task carries the task flag bit in order to determine the task type of the scheduled task;

[0049] The first detection module is used to determine that the scheduling task is a new task if it is detected that the scheduling task does not carry the pause task flag, and to allocate and schedule computing resources for the new task.

[0050] The second detection module is used to determine that the scheduled task is a paused task to be restarted if it detects that the scheduled task carries a paused task flag, and to start executing the restart task.

[0051] Optionally, the device further includes:

[0052] The interrupt task module is used to determine that the number of computing resources on the node where the restart task is located is greater than the target number of computing resources for the restart task, and then interrupt the subsequent scheduling tasks of the restart task in the preset task scheduling queue.

[0053] According to a third aspect of the present invention, an electronic device is provided, comprising:

[0054] processor;

[0055] Memory used to store the processor's executable instructions;

[0056] The processor is configured to execute the instructions to implement the task scheduling method as described in the first aspect.

[0057] According to a fourth aspect of the present invention, a readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the task scheduling method as described in the first aspect.

[0058] This invention provides a task scheduling method that, in response to a user's pause operation on the development environment, controls the closure of the port through which the user enters the development environment and the corresponding container environment. It also updates the first number of computing resources occupied by the development environment and the second number of computing resources used by the user. In response to a user's restart operation on the development environment, it sends a restart task to a preset task scheduling queue. When the third number of computing resources on the node where the restart task is located exceeds a preset threshold, it starts the container environment, completing the restart task. This invention, while preserving the development environment, only requires pausing and restarting it, thus releasing resources without deleting the environment and reducing the time users spend saving images in the original process. After the development environment is paused, the released resources are updated for users to submit new tasks, thereby improving computing resource utilization. This method enables the release of computing resources through task pause and restart scheduling when user resource quotas and cluster computing resources are insufficient, preserving the user's development environment and facilitating the creation of new environments. It also enables rapid pause and restart to restore the development environment, thereby improving user development efficiency.

[0059] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0060] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0061] Figure 1 This is one of the flowcharts of a task scheduling method provided in an embodiment of the present invention;

[0062] Figure 2 yes Figure 1 A flowchart of step 102 of a task scheduling method according to an embodiment of the present invention is provided;

[0063] Figure 3 yes Figure 1 A flowchart of step 103 of a task scheduling method according to an embodiment of the present invention is provided;

[0064] Figure 4 yes Figure 1 A flowchart of step 104 of a task scheduling method according to an embodiment of the present invention is provided;

[0065] Figure 5 This is the second step flowchart of a task scheduling method provided in an embodiment of the present invention;

[0066] Figure 6 yes Figure 5 A flowchart of a task scheduling method according to an embodiment of the present invention is provided;

[0067] Figure 7 This is a schematic diagram of the structure of a task scheduling device provided in an embodiment of the present invention;

[0068] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0069] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details are presented in the various embodiments of the present invention to facilitate a better understanding of this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various changes and modifications based on the following embodiments. The division of the various embodiments below is for ease of description and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined with and referenced by each other without contradiction.

[0070] In AI model training platforms, users often need to create multiple development environments during model development and debugging. However, computing resources are limited. In this case, when a user needs to create a new development environment, saving the environment as an image, deleting it to release resources, and then creating a new environment requires a certain amount of time to complete the entire process. This cumbersome process seriously affects the user's development efficiency and platform experience. Based on the above problems, this invention optimizes and improves the platform's resource management, task scheduling, page display, and user quota management mechanisms based on the container pause function. This enables the pause and start function of the AI ​​training platform development environment, thereby improving user experience and development efficiency, and increasing the platform's competitiveness.

[0071] Reference Figure 1 The diagram illustrates one of the steps of a task scheduling method provided in an embodiment of the present invention, the method including:

[0072] Step 101: In response to the user's pause operation on the development environment, control the closure of the port through which the user enters the development environment and the container environment corresponding to the development environment.

[0073] In this embodiment of the invention, in order to solve the problem that users need to temporarily stop running the development environment when computing quotas are limited or during model development, the present invention is based on the container-level pause function of the artificial intelligence training platform, combined with the platform resource management plugin, to realize the pause and start of AI platform tasks.

[0074] Specifically, when users need to pause a development environment during model development and debugging through the AI ​​training platform, they can directly select that development environment and choose to pause. In response to the user's pause operation, the AI ​​training platform controls and closes the port through which the user enters the development environment and the corresponding container environment.

[0075] It should be noted that the development environment is a dedicated environment for writing code during model development and debugging. It is typically the user's local computer, but can also be a remote cloud server; no specific limitation is made here. This embodiment of the invention utilizes the pause function of the container environment corresponding to the development environment to achieve the pause operation of the development environment. A container is a running instance of an image. The Kubernetes container environment provides containers with several important resources, including a file system containing an image and one or more volumes, information about the container itself, and information about other objects in the cluster.

[0076] In this embodiment, in response to the user's pause operation on the development environment, the artificial intelligence training platform closes the port for the user to enter the development environment, so that the user cannot re-enter this development environment on the web page, and uses command syntax to pause a running container, that is, the container environment corresponding to the development environment. For example, you can use docker pauseCONTAINER to view the currently running containers and pause them.

[0077] Step 102: Update the number of first computing resources occupied by the development environment and the number of second computing resources used by the user.

[0078] In this embodiment of the invention, firstly, after the operation of pausing the development environment of the task is issued, it is necessary to ensure that the underlying development environment no longer occupies resources. At the same time, the computing resources related to this environment must be released. Therefore, the user's computing quota also needs to be updated so that the computing resources can be used by other users' other environments and the user can also submit new task environments. In this embodiment, when pausing a task, it is necessary to ensure that the computing resources of the node where the paused task is located and the user's corresponding computing resources are updated.

[0079] It should be noted that, in this embodiment of the invention, after the development environment performs a pause task, the first number of computing resources occupied by the development environment and the second number of computing resources used by the user are updated. The first number of computing resources may be the resource quota required by the node occupied by the development environment, and the second number of computing resources may be the resource quota used by the user to create the development environment. Computing resources refer to CPU resources, memory resources, hard disk resources, and network resources required for program execution.

[0080] Specifically, after pausing the container environment, the resource management plugin can be invoked to update the allocation and usage of resources in the layer above the container environment (POD environment), thereby releasing computing resources and enabling users to create more development environments, thus improving resource utilization.

[0081] In this embodiment, since the underlying container environment corresponding to the development environment is in a paused state, compared with the original solution of the platform, the user does not need to save the development environment and then recreate the development environment, thereby achieving the purpose of quickly pausing the environment and releasing resources.

[0082] Step 103: In response to the user's restart operation on the development environment, the restart task is sent to the preset task scheduling queue.

[0083] In this embodiment of the invention, the user's pause operation on the development environment corresponds to the restart operation on the development environment. When the user needs to restart the paused development environment, the user can select the development environment and select the restart operation. The artificial intelligence training platform responds to the user's restart operation on the development environment by sending the restart task to the preset task scheduling queue.

[0084] It should be noted that the preset task scheduling queue is a form of asynchronous concurrent task execution in an artificial intelligence training platform. The preset task scheduling queue includes tasks that the development model needs to perform, such as computation, data creation, and modification. The task scheduling queue is an object-like structure that manages the tasks submitted to it. It is a first-in, first-out (FIFO) data structure; therefore, generally, tasks added to the task scheduling queue always begin execution in the order they were added. This embodiment does not specifically limit the creation process and method of the task scheduling queue.

[0085] Specifically, in response to a user's restart request for the development environment, the AI ​​training platform displays the port the user entered after selecting the development environment, allowing the user to re-enter the environment on the web page. The restart task is then dispatched to a pre-defined task scheduling queue. This can be achieved using command-line syntax to restart temporarily not running containers, i.e., the container environment corresponding to the development environment. For example, the command `docker ps -a` can be used to view all current containers, including those not currently running, and then the command `docker run` can be used to restart the container environment corresponding to the development environment.

[0086] Step 104: When the number of third computing resources on the node where the restart task is located exceeds a preset threshold, start the container environment and complete the restart task.

[0087] In this embodiment of the invention, when the artificial intelligence training platform receives a user's restart operation, it first adds the restart task to the task scheduling queue. When the remaining computing resources of the node where the restart task is located meet the requirements, the restart task is scheduled, and the computing resources occupied by the restart of this development environment are updated. The container environment corresponding to the development environment is started, the number of computing resources used by the user is updated, and the restart task of the development environment is completed.

[0088] Specifically, the system obtains the computing resource information for the restart task, sends the restart task to a preset task scheduling queue in the task scheduling module, and completes the scheduling of the restart task once the computing resources of the node where the task resides meet the requirements; the node where this task resides is the original node where the paused task was located. After the restart task is scheduled, the number of computing resources occupied by this development environment is updated and allocated, the underlying container environment is started, and the user's computing resources and the web page running status are updated.

[0089] This invention provides a task scheduling method that, in response to a user's pause operation on the development environment, controls the closure of the port through which the user enters the development environment and the corresponding container environment. It also updates the first number of computing resources occupied by the development environment and the second number of computing resources used by the user. In response to a user's restart operation on the development environment, it sends a restart task to a preset task scheduling queue. When the third number of computing resources on the node where the restart task is located exceeds a preset threshold, it starts the container environment, completing the restart task. This invention, while preserving the development environment, only requires pausing and restarting it, thus releasing resources without deleting the environment and reducing the time users spend saving images in the original process. After the development environment is paused, the released resources are updated for users to submit new tasks, thereby improving computing resource utilization. This method enables the release of computing resources through task pause and restart scheduling when user resource quotas and cluster computing resources are insufficient, preserving the user's development environment and facilitating the creation of new environments. It also enables rapid pause and restart to restore the development environment, thereby improving user development efficiency.

[0090] Furthermore, refer to Figure 2 , showed Figure 1 The flowchart of step 102 of the provided task scheduling method is basically the same as the task scheduling method provided in the first embodiment of the present invention. Step 102 updates the first number of computing resources occupied by the development environment and the second number of computing resources used by the user, and may include:

[0091] Step 1021: Call the resource management plugin to obtain the number of first computing resources occupied by the development environment and the number of second computing resources used by the user.

[0092] Step 1022: Update the first number of computing resources and the second number of computing resources so that the number of computing resources of the node where the paused task is located is consistent with the first number of computing resources.

[0093] In this embodiment, when task execution is paused, in order to ensure that the container environment corresponding to the development environment no longer occupies resources and to release the computing resources associated with this container environment, it is necessary to update the user's computing quota so that the computing resources can be used by other users' other environments, and the user can also submit a new task environment.

[0094] Specifically, the AI ​​training platform calls the scheduler's resource management plugin to obtain the first number of computing resources occupied by the development environment and the second number of computing resources used by the user. This resource management plugin can be used to determine when and how to schedule tasks.

[0095] For example, the number of computing resources required to execute the task corresponding to the development environment may include the number of nodes, the number of cores required for each node, and the queue name for submitting the task. The artificial intelligence training platform calls the resource scheduling plugin to determine whether the number of computing resources in the existing node resources meets the number of computing resources required by the task. First, it obtains the first number of computing resources occupied by the development environment and the second number of computing resources used by the user. Second, after pausing the development environment, it updates the first number of computing resources and the second number of computing resources so that the number of computing resources on the node where the paused task is located is consistent with the first number of computing resources.

[0096] It should be noted that when the AI ​​training platform receives a pause task, it executes the operation of pausing the underlying container environment. At the same time, it also needs to set the number of computing resources of this container environment to 0 to ensure that the number of computing resources occupied by the computing node where this task is located is consistent with the number of resources occupied by all underlying environments.

[0097] Compared with the prior art, the embodiments of the present invention, when a task is paused, based on the container-level pause, the corresponding development environment functions are paused, the resource management plugin is called to update the number of computing resources related to the development environment, and after the user's computing resource usage is updated, the task pause process is completed. After the development environment is paused, the released resources can be used by this user or other users to submit new tasks, thereby improving the utilization rate of computing resources and maximizing the value of the cluster.

[0098] Furthermore, refer to Figure 3 , showed Figure 1 The flowchart of step 103 of the provided task scheduling method is basically the same as the task scheduling method provided in the first embodiment of the present invention. Step 103, in response to the user's restart operation on the development environment, sends the restart task to a preset task scheduling queue, and may include:

[0099] Step 1031: Obtain the number of computing resources of the node where the paused task is located.

[0100] Step 1032: In response to the user's restart operation on the development environment, the restart task is sent to the preset task scheduling queue of the scheduling system.

[0101] Step 1033: Based on the number of computing resources on the node, call the resource management plugin to occupy and allocate computing resources for the restart task.

[0102] It should be noted that in steps 1031 to 1033 above, during the process of restarting a paused task, after receiving the user's command to start the task, the restart task is sent to the preset task scheduling queue in the task scheduling system based on the original information of the task, namely the number of computing resources of the node where the paused task is located. After the restart task completes scheduling, the corresponding underlying container environment is started based on the container underlying startup scheme. According to the number of computing resources of the node, the resource management plugin is called to occupy and allocate computing resources for the restart task, so as to restore the development environment resources.

[0103] Furthermore, refer to Figure 4 , showed Figure 1 The flowchart of step 104 of the provided task scheduling method is basically the same as the task scheduling method provided in the first embodiment of the present invention. Step 104, when the number of third computing resources on the node where the restart task is located is greater than a preset threshold, starts the container environment and completes the restart task, which may include:

[0104] Step 1041: When the number of third computing resources on the node where the restart task is located exceeds a preset threshold, a restart command is issued.

[0105] In this embodiment of the invention, restarting a paused task differs from restarting a task created through the platform according to the normal process in that it requires sufficient resources on the original node before it can be started. Therefore, this restart task cannot be scheduled to other computing nodes. In this embodiment, a restart command is issued when the number of third computing resources on the node where the restart task is located exceeds a preset threshold. The number of third computing resources can be the number of resources required for the restart task to restore the development environment.

[0106] For example, the restart command can use command syntax to restart a container that is not currently running, i.e., the container environment corresponding to the development environment. For instance, you can use the command `docker ps -a` to view all current containers, including those that are not running, and then use the command `docker run` to restart the container environment corresponding to the development environment.

[0107] Step 1042: Based on the restart command, control the container environment corresponding to the development environment to resume startup.

[0108] Step 1043: Update the number of primary computing resources used by the development environment and the number of secondary computing resources used by the user after the restart, and complete the restart task.

[0109] In this implementation, after the restart task scheduling is completed, the process of creating tasks by the underlying components is interrupted. The computing resources of the paused task are restored by calling the resource management plugin, the corresponding container environment is started, and the number of first computing resources occupied by the restarted development environment and the number of second computing resources used by the user are updated, thus completing the restart of the paused task.

[0110] In the implementation of this invention, during the execution of the restart task, upon receiving the restart command, the restart task is sent to the scheduling system by pausing the original resource information of the task. After the restart task completes scheduling, the corresponding underlying container environment is started based on the container underlying startup scheme. At the same time, the development environment resources are restored and the number of user-level resources is updated. The key feature is that it enables users to quickly pause and restart the development environment while retaining the development environment, reducing the time for users to save images in the original process and improving the user experience.

[0111] The second embodiment of the present invention relates to a task scheduling method, which is basically the same as the task scheduling method provided in the first embodiment of the present invention, except that, with reference to Figure 5 The second flowchart of the task scheduling method provided in this embodiment of the invention is shown, the method including:

[0112] Step 105: Obtain the scheduled tasks from the preset task scheduling queue.

[0113] The scheduling task includes at least one task generated by the scheduling node based on the user's operation.

[0114] In this embodiment of the invention, regarding the pausing and starting of tasks in the development environment of an artificial intelligence platform, when a paused task is restarted, how is this task scheduled by the scheduling system? Based on the above task scheduling strategy, this invention proposes to add a flag indicating whether a task is paused, so as to distinguish paused tasks from tasks created through the normal process of the platform.

[0115] Specifically, after the AI ​​platform responds to the user's restart operation for the development environment and sends the restart task to the preset task scheduling queue, it retrieves the scheduled tasks in the preset task scheduling queue and checks whether the restart of the paused task has the corresponding flag bit. Once the scheduling is complete, there is no need to create a new task in the underlying environment. Instead, it executes the command to start the container environment, calls the resource management plugin, and sets the resources occupied by this environment.

[0116] Step 106: Set task flags for the scheduled tasks in the preset task scheduling queue.

[0117] Among them, the task flags include the paused task flag, which is used to distinguish the user's paused tasks from other newly created tasks in the preset task scheduling queue.

[0118] It should be noted that the artificial intelligence platform pre-sets task flags for the scheduled tasks in the preset task scheduling queue. These task flags may include a paused task flag, used to distinguish between the user's paused tasks and other newly created tasks in the preset task scheduling queue. This embodiment of the invention does not specifically limit the form in which the task flags are set; any flag capable of distinguishing task types can be used, and will not be elaborated upon here.

[0119] Step 107: Detect whether the scheduled task carries a task flag bit to determine the task type of the scheduled task.

[0120] In this embodiment of the invention, in a preset task scheduling queue, it is detected whether the scheduled task carries a task flag bit to determine the task type of the scheduled task, so as to distinguish the task type and perform different scheduling processes.

[0121] Step 108: If it is detected that the scheduled task does not carry a pause task flag, the scheduled task is determined to be a new task, and computing resources are allocated and scheduled for the new task.

[0122] Step 109: If the scheduled task is detected to carry a paused task flag, the scheduled task is determined to be a paused task to be restarted, and the restart task is started.

[0123] It should be noted that the task execution process is determined based on the detected pause task flag. After the restart task is sent to the scheduling system, the paused task will be restarted with the corresponding pause task flag. Once the restart task scheduling is completed, based on the pause task flag, there is no need to create a new task in the underlying environment. The command to start the container environment is executed directly, the resource management plugin is called, and the resources occupied by this environment are set.

[0124] Furthermore, if step 109 detects that the scheduled task carries a paused task flag, then it determines that the scheduled task is a paused task to be restarted. After starting to execute the restart task, it also includes:

[0125] If the number of computing resources on the node where the restart task is located is greater than the target number of computing resources for the restart task, then interrupt the scheduling of subsequent tasks in the preset task scheduling queue for the restart task.

[0126] In this embodiment, restarting a paused task differs from restarting a task created through the platform according to the normal process. It requires waiting for the original node to have sufficient resources before it can be started. Therefore, after the restart scheduling is completed, the process of creating the task by the underlying component is interrupted. The computing resources of the paused task are restored by calling the resource management plugin, the corresponding container environment is started, the user's computing resource usage is updated, and the restart of the paused task is completed.

[0127] Compared to existing technologies, the embodiments of this invention distinguish between paused and newly created tasks in the restart task by setting task flags in the preset task scheduling queue. This enables rapid task pause and restart, and importantly, allows users to quickly pause the development environment while preserving it. This reduces the time users spend saving images in the original process, improving the user experience. Furthermore, once the restart task scheduling is complete, the flag indicates that the restarted task is a paused task, eliminating the need to create a new task in the underlying environment. The command to start the container environment can then be executed, thereby improving the utilization of computing resources and maximizing the value of the cluster.

[0128] It should be noted that this embodiment does not limit the specific execution location of steps 105 to 109. In this embodiment, for ease of understanding, steps 105 to 109 are executed after step 103 as an example for explanation.

[0129] To enable those skilled in the art to more clearly understand the task scheduling method described above, the following refers to... Figure 6 For example, Figure 6 The diagram shown is a flowchart of a task scheduling method provided in an embodiment of the present invention, which specifically includes:

[0130] S201, issue the restart task to the scheduling system.

[0131] Specifically, when a user needs to restart a paused development environment, the user can select the development environment and choose to start it. The artificial intelligence training platform responds to the user's restart operation by sending the restart task to the preset task scheduling queue.

[0132] S202, determine whether the restart task is a paused task.

[0133] Specifically, in this embodiment, the scheduled tasks in the preset task scheduling queue are pre-set with task flags, including a paused task flag, which is used to distinguish the user's paused tasks from other newly created tasks in the preset task scheduling queue.

[0134] For example, after obtaining restart tasks from the preset task scheduling queue on the artificial intelligence training platform, it determines in sequence whether the restart task is a paused task, that is, whether the restart task is a restart of a paused task or the start of a new task. After distinguishing the task type, if it is, proceed to step 203. If it is a paused task to be restarted, there is no need to create a new development environment, saving computing resources and improving resource utilization. Otherwise, proceed to step 204 to allocate and schedule computing resources for the new task.

[0135] S203, execute the restart task to start the container environment corresponding to the development environment.

[0136] Specifically, the restart task is executed by pausing the original resource information of the task. After the restart task is scheduled, the container environment corresponding to the development environment is started based on the container underlying startup scheme. Then, step 205 is entered to update the number of computing resources after the restart and complete the restart task. This restores the development environment resources and updates the number of resources at the user level. The key feature is that it enables users to quickly pause and restart the development environment while retaining the development environment, reducing the time users spend saving images in the original process and improving the user experience.

[0137] S204 allocates and schedules computing resources for newly created tasks.

[0138] S205, update the number of computing resources after restart, and complete the restart task.

[0139] Compared with the prior art, the embodiments of the present invention only require pausing and restarting the development environment while preserving the development environment. This eliminates the need to delete the environment to release resources and reduces the time users spend saving images in the original process. By pausing and restarting tasks, computing resources are released, the user's development environment is preserved, and users can easily create new environments. At the same time, it enables quick pausing and restarting to restore the development environment, thereby improving the user's development efficiency.

[0140] Reference Figure 7 The diagram illustrates a structural schematic of a task scheduling device according to an embodiment of the present invention. The device may include:

[0141] The first response module 301 is used to respond to the user's pause operation on the development environment by controlling the closure of the port through which the user enters the development environment and the container environment corresponding to the development environment.

[0142] The resource update module 302 is used to update the first number of computing resources occupied by the development environment and the second number of computing resources used by the user.

[0143] The second response module 303 is used to respond to the user's restart operation on the development environment by sending the restart task to a preset task scheduling queue.

[0144] The task execution module 304 is used to start the container environment and complete the restart task when the number of third computing resources on the node where the restart task is located is greater than a preset threshold.

[0145] Optionally, the updated resource module 302 includes:

[0146] The first acquisition submodule is used to call the resource management plugin to obtain the number of first computing resources occupied by the development environment and the number of second computing resources used by the user.

[0147] The first update submodule is used to update the first number of computing resources and the second number of computing resources so that the number of computing resources of the node where the paused task is located is consistent with the first number of computing resources.

[0148] Optionally, the second response module 303 includes:

[0149] The second acquisition submodule is used to acquire the number of computing resources of the node where the paused task is located;

[0150] The second response submodule is used to respond to the user's restart operation on the development environment by sending the restart task to the preset task scheduling queue of the scheduling system.

[0151] The first calling submodule is used to call the resource management plugin to occupy and allocate computing resources for the restart task based on the number of computing resources on the node.

[0152] Optionally, the task execution module 304 includes:

[0153] The command submodule is used to issue a restart command when the number of third computing resources on the node where the restart task is located exceeds a preset threshold.

[0154] The control submodule is used to control the container environment corresponding to the development environment to resume startup according to the restart command;

[0155] The second update submodule is used to update the number of primary computing resources occupied by the development environment and the number of secondary computing resources used by the user after the restart, thus completing the restart task.

[0156] Optionally, the device further includes:

[0157] The task acquisition module is used to acquire scheduled tasks in a preset task scheduling queue, wherein the scheduled tasks include at least one task generated by the scheduling node according to the user's operation;

[0158] The preset flag module is used to preset task flag bits for the scheduled tasks in the preset task scheduling queue. The task flag bits include a paused task flag bit, which is used to distinguish the user's paused tasks from other newly created tasks in the preset task scheduling queue.

[0159] The detection flag module is used to detect whether the scheduled task carries the task flag bit in order to determine the task type of the scheduled task;

[0160] The first detection module is used to determine that the scheduling task is a new task if it is detected that the scheduling task does not carry the pause task flag, and to allocate and schedule computing resources for the new task.

[0161] The second detection module is used to determine that the scheduled task is a paused task to be restarted if it detects that the scheduled task carries the paused task flag, and to start executing the restart task.

[0162] Optionally, the device further includes:

[0163] The interrupt task module is used to determine that the number of computing resources on the node where the restart task is located is greater than the target number of computing resources for the restart task, and then interrupt the subsequent scheduling tasks of the restart task in the preset task scheduling queue.

[0164] This invention provides a task scheduling device that, in response to a user's pause operation on the development environment, controls the closure of the port through which the user enters the development environment and the corresponding container environment. It updates the first number of computing resources occupied by the development environment and the second number of computing resources used by the user. In response to a user's restart operation on the development environment, it sends a restart task to a preset task scheduling queue. When the third number of computing resources on the node where the restart task is located exceeds a preset threshold, it starts the container environment, completing the restart task. This invention, while preserving the development environment, only requires pausing and restarting the development environment, thus releasing resources without deleting the environment and reducing the time users spend saving images in the original process. After the development environment is paused, the updated and released resources are used for users to submit new tasks, thereby improving the utilization rate of computing resources. This allows for the release of computing resources through task pause and restart scheduling when user resource quotas and cluster computing resources are insufficient, preserving the user's development environment and facilitating the creation of new environments. It also enables rapid pause and restart to restore the development environment, thereby improving user development efficiency.

[0165] This invention also provides an electronic device, such as... Figure 8 As shown, it includes a processor 401, a communication interface 402, a memory 403, and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404.

[0166] Memory 403 is used to store computer programs;

[0167] When processor 401 executes the program stored in memory 403, it performs the following steps:

[0168] In response to the user's pause operation on the development environment, control the closure of the port through which the user can access the development environment and the container environment corresponding to the development environment;

[0169] Update the first number of computing resources occupied by the development environment and the second number of computing resources used by the user;

[0170] In response to the user's restart operation on the development environment, the restart task is sent to the preset task scheduling queue;

[0171] When the number of third computing resources on the node where the restart task is located exceeds a preset threshold, the container environment is started to complete the restart task.

[0172] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0173] The communication interface is used for communication between the aforementioned terminal and other devices.

[0174] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0175] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0176] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform any of the task scheduling methods described in the above embodiments.

[0177] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0178] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0179] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0180] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.

Claims

1. A task scheduling method, characterized in that, The method includes: In response to the user's pause operation on the development environment, the system controls the closure of the port through which the user can access the development environment and suspends the container environment corresponding to the development environment. Update the first number of computing resources occupied by the development environment and the second number of computing resources used by the user to release the computing resources occupied by the development environment; In response to the user's restart operation on the development environment, the restart task is sent to the preset task scheduling queue; When the number of third computing resources on the node where the restart task is located exceeds a preset threshold, the container environment is started to complete the restart task.

2. The method according to claim 1, characterized in that, The updating of the first number of computing resources occupied by the development environment and the second number of computing resources used by the user includes: Call the resource management plugin to obtain the number of primary computing resources used by the development environment and the number of secondary computing resources used by the user; Update the first number of computing resources and the second number of computing resources so that the number of computing resources on the node where the paused task is located is consistent with the first number of computing resources.

3. The method according to claim 1, characterized in that, The step of responding to the user's restart operation on the development environment by sending the restart task to a preset task scheduling queue includes: Get the number of computing resources on the node where the paused task is located; In response to the user's restart operation on the development environment, the restart task is sent to the preset task scheduling queue of the scheduling system; Based on the number of computing resources on the node, the resource management plugin is invoked to occupy and allocate computing resources for the restart task.

4. The method according to claim 1, characterized in that, When the number of third computing resources on the node where the restart task is located exceeds a preset threshold, the container environment is started to complete the restart task, including: When the number of third computing resources on the node where the restart task is located exceeds a preset threshold, a restart command is issued; According to the restart command, control the container environment corresponding to the development environment to resume startup; Update the number of primary computing resources used by the development environment and the number of secondary computing resources used by the user after the restart, and complete the restart task.

5. The method according to claim 1, characterized in that, After responding to the user's restart operation on the development environment and sending the restart task to the preset task scheduling queue, the method further includes: Obtain scheduling tasks from a preset task scheduling queue, wherein the scheduling tasks include at least one task generated by the scheduling node based on the user's operation; Task flags are pre-set for the scheduled tasks in the preset task scheduling queue, wherein the task flags include a paused task flag, which is used to distinguish the user's paused tasks from other newly created tasks in the preset task scheduling queue; Detect whether the scheduled task carries the task flag bit to determine the task type of the scheduled task; If it is detected that the scheduled task does not carry the paused task flag, then the scheduled task is determined to be a new task, and computing resources are allocated and scheduled for the new task. If the scheduled task is detected to carry the paused task flag, then the scheduled task is determined to be a paused task to be restarted, and the restart task is started.

6. The method according to claim 5, characterized in that, If it is detected that the scheduled task does not carry the paused task flag, then after determining that the scheduled task is a new task and allocating and scheduling computing resources for the new task, the method further includes: If the number of computing resources on the node where the restart task is located is determined to be greater than the target number of computing resources for the restart task, the subsequent scheduling tasks of the restart task in the preset task scheduling queue will be interrupted.

7. A task scheduling device, characterized in that, The device includes: The first response module is used to respond to the user's pause operation on the development environment, control the closure of the port for the user to enter the development environment and pause the container environment corresponding to the development environment; The resource update module is used to update the first number of computing resources occupied by the development environment and the second number of computing resources used by the user, so as to release the computing resources occupied by the development environment. The second response module is used to respond to the user's restart operation on the development environment by sending the restart task to a preset task scheduling queue. The task execution module is used to start the container environment and complete the restart task when the number of third computing resources on the node where the restart task is located is greater than a preset threshold.

8. The apparatus according to claim 7, characterized in that, The updated resource module includes: The first acquisition submodule is used to call the resource management plugin to obtain the number of first computing resources occupied by the development environment and the number of second computing resources used by the user. The first update submodule is used to update the first number of computing resources and the second number of computing resources so that the number of computing resources of the node where the paused task is located is consistent with the first number of computing resources.

9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to execute the instructions to implement the task scheduling method as described in any one of claims 1 to 6.

10. A readable storage medium, characterized in that, A computer program is stored on the readable storage medium, which, when executed by a processor, implements the task scheduling method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Scheduling method and system for test environment

    CN108132878A

  • Method, device and computer readable storage medium for processing operation instructions

    CN109343895A