A workflow engine automatic scheduling method for AI service platform
By introducing the workflow engine automatic scheduling method into the AI service platform, and combining the resource limits set by the user and the current computing resource status, AI service instances are scheduled, which solves the problem of AI service error reporting caused by insufficient resources and improves the completion rate and completion rate of AI services. Resource usage.
Patent Information
- Application Number
- CN202111059617.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-10
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2041-09-10
AI Technical Summary
When computing resources such as GPUs are insufficient, the AI service platform often reports errors and fails to execute normally due to insufficient resources.
By introducing the workflow engine automatic scheduling method into the AI service platform, users can set limits on the time occupied by computing resources and the time limit waiting for execution, and schedule AI service instances based on current computing resource usage and waiting activation queue information to avoid problems caused by insufficient resources. Error, guide the user to modify parameters to complete service creation within an acceptable waiting time.
It effectively improves the completion rate of AI services and the utilization rate of computing resources, solves the problem of direct error reporting of AI services caused by insufficient resources, and ensures that AI services are successfully executed within a waiting time acceptable to users.
Smart Images

Figure CN113946413B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of artificial intelligence, and in particular to an automatic scheduling method for a workflow engine of an AI service platform. Background Art
[0002] With the rapid development of artificial intelligence technology, the research and development of scientific research platforms for managing artificial intelligence algorithms is also in full swing. Many general AI development platforms have appeared on the market, including ModelArts launched by Huawei Cloud, TI-ONE, an intelligent machine learning platform launched by Tencent Cloud, and AWS Machine Learning provided by Amazon, all of which provide users with full-process development support from data preprocessing, model training, model evaluation to model services.
[0003] However, the above-mentioned general AI development platforms are all based on sufficient underlying resources. For university laboratories and research institutes, when resources such as GPUs are insufficient, the AI services created by users are often forced to end due to insufficient resources and return corresponding error messages. Summary of the invention
[0004] The purpose of the present invention is to overcome the problem of AI service scheduling in the prior art when resources are insufficient, and proposes an automatic scheduling method for a workflow engine of an AI service platform. This method can solve the problem of direct error reporting of the created AI service when the computing resources of the AI service platform are insufficient. By guiding the user to modify the parameter information of the AI service, etc., the created AI service can be executed within an acceptable waiting time range for the user.
[0005] To achieve the above purpose, the technical solution provided by the present invention is: a workflow engine automatic scheduling method for an AI service platform, comprising the following steps:
[0006] 1) The AI service platform customizes the process definition of AI services for users and maintains a queue Q of AI service instances waiting to be activated;
[0007] 2) The user sets the execution time limit Tc_limit and the waiting execution time limit Tw_limit for the tasks occupying computing resources in the AI service, and starts an instance of the AI service;
[0008] 3) The AI service platform calculates the execution time Tc of the tasks that occupy computing resources in the AI service instance started by the user;
[0009] 4) The AI service platform schedules the AI service instance started by the user based on the calculated execution time Tc, combined with the current usage of the AI service platform's computing resources and the information of the queue waiting for activation.
[0010] Further, in step 1), there are tasks that occupy computing resources in the AI service process definition customized by the AI service platform for the user. If there are no such tasks, all tasks in the customized AI service process definition can be executed in the order of the process definition.
[0011] Further, in step 2), the AI service platform defaults the value of the execution duration limit Tc_limit for tasks that occupy computing resources in the AI service to Tc_default, and sets the value of the waiting execution duration limit Tw_limit to Tw_default. The user can use the default values set by the AI service platform or modify them.
[0012] Further, in step 3), for tasks that occupy computing resources in the AI service instance, there are prerequisite tasks in the AI service process that determine their execution duration. After the AI service platform completes its prerequisite tasks, it suspends the AI service instance and calculates the execution duration Tc of the tasks that occupy computing resources in the AI service instance.
[0013] Further, in step 4), the AI service platform judges the calculated execution duration Tc: if Tc > 2 * Tc_limit, delete the current AI service instance and end the AI service; if Tc_limit < Tc < 2 * Tc_limit, prompt the user whether to reset the relevant parameters of the prerequisite tasks; if Tc < Tc_limit, calculate the sum Tw_sum of the execution durations of the tasks that occupy computing resources in the AI service instances in the waiting activation queue Q, and make a judgment based on the usage of the computing resources of the AI service platform, as follows:
[0014] If the computing resources of the AI service platform are not occupied and Tw_sum = 0, that is, there are no AI service instances in the waiting activation queue, activate the currently suspended AI service instance and execute the tasks that occupy computing resources. If Tw_sum > 0, judge the magnitudes of Tw_sum and Tw_limit; if the computing resources of the AI service platform are occupied, calculate the remaining time Tl of the currently executing task. If Tw_sum + Tl > Tw_limit, delete the current AI service instance and end the AI service. If Tw_sum + Tl < Tw_limit, add the currently suspended AI service instance to the end of the waiting queue Q and wait for the tasks that occupy computing resources to finish execution.
[0015] Further, if the user resets the relevant parameters of the prerequisite tasks, after the AI service platform activates the AI service instance, it returns to step 3); if the user does not reset, delete the current AI service instance and end the AI service.
[0016] Further, if Tw_sum < Tw_limit, add the currently suspended AI service instance to the end of the waiting queue Q and wait for the task occupying computing resources to finish execution; if Tw_sum > Tw_limit, delete the current AI service instance and end the AI service.
[0017] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0018] The present invention can solve the problem that the created AI service directly reports an error when the computing resources of the AI service platform are insufficient. By guiding the user to modify the parameter information of the AI service (such as setting information such as the execution duration and waiting execution duration of the AI service), the created AI service is executed within the waiting time range acceptable to the user. In short, the present invention combines artificial intelligence services and workflows, and proposes an automatic scheduling method for the workflow engine of an AI service platform to schedule the created AI services when the computing resources are insufficient, greatly improving the completion rate of AI services and effectively improving the utilization rate of the computing resources of the AI service platform. It has practical application value and is worthy of promotion. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a schematic diagram of the logic flow of the present invention.
[0020] Figure 2 is a schematic diagram of the specific process of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0021] The present invention will be further described in detail below in conjunction with embodiments and the accompanying drawings, but the embodiments of the present invention are not limited thereto.
[0022] See Figure 1 As shown, this embodiment discloses an automatic scheduling method for the workflow engine of an AI service platform, and the specific steps are as follows:
[0023] 1) The AI service platform customizes the process definition of the AI service. The AI service platform customizes differentiable AI service process definitions for different users. For example, for model training, the service process of user A includes preprocessing of pictures, while user B does not. Different AI services have different process tasks. For AI services that do not include tasks occupying computing resources, the AI service platform directly executes in the order in the process definition until the process ends. At the same time, the AI service platform maintains a queue Q of AI service instances waiting to be activated.
[0024] 2) The user sets the execution time limit and waiting time limit for the tasks that occupy computing resources in the AI service, and starts an instance of the AI service. For AI services that include tasks that occupy computing resources, the AI service platform sets the default values of the task execution time limit Tc_limit and the waiting time limit Tw_limit to prevent the AI service from executing too long or waiting too long due to the problem of queuing computing resources. Users can use the default values set by the AI service platform or modify them.
[0025] 3) The AI service platform calculates the execution time of the tasks that occupy computing resources in the AI service instance started by the user. In the AI service process that contains tasks that occupy computing resources, there must be a pre-task that determines the execution time of the task. After the user starts an AI service instance, the AI service platform executes it in the order defined in the AI service process. After executing the pre-task, the entire AI service instance is suspended and the execution time Tc of the tasks that occupy computing resources is calculated.
[0026] 4) The AI service platform schedules the AI service instance started by the user based on the calculated execution time Tc and the current usage of computing resources. By analyzing the execution time result calculated in step 3), combined with the information in the waiting activation queue and the computing resource usage of the AI service platform, the AI service platform determines whether to delete, activate, or add the currently suspended AI service instance to the waiting activation queue Q.
[0027] like Figure 2 As shown, it is a specific flow chart of the automatic scheduling method of the workflow engine of the AI service platform in this embodiment, and the specific steps are as follows:
[0028] 1) The user starts an instance of the AI service process customized for him by the AI service platform.
[0029] 2) The AI service platform determines whether there are any tasks that occupy computing resources in the process tasks of the started AI service instance. If there are no tasks that occupy computing resources, the AI service platform directly executes them in the order of the process definition until the process ends. If there are, the AI service platform executes them in the order of the process definition until the predecessor tasks of the task end, suspends the AI service instance, and calculates the execution time Tc of the tasks that occupy computing resources in the AI service instance.
[0030] 3) The AI service platform judges the calculated execution duration result Tc: If Tc > 2 * Tc_limit, delete the current AI service instance and end the AI service; if Tc_limit < Tc < 2 * Tc_limit, proceed to the next step according to whether the user resets the relevant parameters of the pre-task; if Tc < Tc_limit, calculate the sum of the task execution durations Tw_sum of the AI service instances occupying computing resources in the waiting activation queue Q, and make a judgment based on the usage of the computing resources of the AI service platform and the value of Tw_sum.
[0031] If the user resets the relevant parameters of the pre-task, after the AI service platform activates the AI service instance, return to step 2); if the user does not reset, delete the current AI service instance and end the AI service.
[0032] If the computing resources of the AI service platform are not occupied and at the same time Tw_sum = 0, that is, there is no AI service instance in the waiting activation queue, activate the currently suspended AI service instance and execute the task occupying computing resources. If Tw_sum > 0, then judge the magnitudes of Tw_sum and Tw_limit; if the computing resources of the AI service platform are occupied, calculate the remaining time Tl of the currently executing task. If Tw_sum + Tl > Tw_limit, delete the current AI service instance and end the AI service. If Tw_sum + Tl < Tw_limit, add the currently suspended AI service instance to the end of the waiting queue Q and wait for the task occupying computing resources to finish execution.
[0033] 4) If Tw_sum < Tw_limit, add the currently suspended AI service instance to the end of the waiting queue Q and wait for the task occupying computing resources to finish execution; if Tw_sum > Tw_limit, delete the current AI service instance and end the AI service.
[0034] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications made without departing from the spirit and principle of the present invention shall be equivalent replacement methods and are all included in the protection scope of the present invention.
Claims
1. A workflow engine automatic scheduling method for an AI service platform, characterized in that: The steps include: 1) The AI service platform customizes the process definition of AI services for users and maintains a queue Q of AI service instances waiting to be activated; 2) The user sets the execution time limit Tc_limit and the waiting time limit Tw_limit for the tasks that occupy computing resources in the AI service, and starts an instance of the AI service; 3) The AI service platform calculates the execution time Tc of the tasks that occupy computing resources in the AI service instance started by the user; 4) The AI service platform schedules the AI service instance started by the user based on the calculated execution time Tc, combined with the current usage of the AI service platform's computing resources and the information of the queue waiting for activation; The AI service platform makes a judgment on the calculated execution time Tc: if Tc > 2*Tc_limit, the current AI service instance is deleted and the AI service is terminated; if Tc_limit < Tc < 2*Tc_limit, the user is prompted whether to reset the relevant parameters of the predecessor task; if Tc < Tc_limit, the sum of the task execution times Tw_sum of the computing resources occupied by the AI service instances in the waiting activation queue Q is calculated, and the judgment is made based on the usage of the computing resources of the AI service platform, as follows: If the computing resources of the AI service platform are not occupied and Tw_sum = 0, that is, there is no AI service instance in the waiting activation queue, the currently suspended AI service instance is activated to execute the task occupying the computing resources. If Tw_sum > 0, the size of Tw_sum and Tw_limit is determined; if the computing resources of the AI service platform are occupied, the remaining time Tl of the currently executing task is calculated. If Tw_sum + Tl > Tw_limit, the current AI service instance is deleted and the AI service is terminated. If Tw_sum + Tl < Tw_limit, the currently suspended AI service instance is added to the end of the waiting queue Q to wait for the task occupying the computing resources to be completed.
2. According to the workflow engine automatic scheduling method of an AI service platform according to claim 1, it is characterized in that: In step 1), there are tasks that occupy computing resources in the AI service process definition customized by the AI service platform for the user. If there are no tasks that occupy computing resources, all tasks in the customized AI service process definition can be executed in the order of the process definition.
3. The workflow engine automatic scheduling method of an AI service platform according to claim 1 is characterized in that: In step 2), the AI service platform sets the execution time limit value Tc_limit of the tasks occupying computing resources in the AI service to Tc_default by default, and sets the waiting execution time limit value Tw_limit to Tw_default. Users can use the default values set by the AI service platform or modify them.
4. The workflow engine automatic scheduling method of an AI service platform according to claim 1 is characterized in that: In step 3), the task that occupies computing resources in the AI service instance has a predecessor task in the AI service process that determines its execution time. After the AI service platform completes its predecessor task, it suspends the AI service instance and calculates the execution time Tc of the task that occupies computing resources in the AI service instance.
5. The workflow engine automatic scheduling method of an AI service platform according to claim 1 is characterized in that: If the user resets the relevant parameters of the predecessor task, the AI service platform activates the AI service instance and returns to step 3); if the user does not reset, the current AI service instance is deleted and the AI service ends.
6. The workflow engine automatic scheduling method of an AI service platform according to claim 1, characterized in that: If Tw_sum < Tw_limit, the currently suspended AI service instance is added to the end of the waiting queue Q, waiting for the task occupying computing resources to be completed; if Tw_sum > Tw_limit, the current AI service instance is deleted and the AI service is terminated.
