Timed task execution method and system

By pre-determining and maintaining the ready state of computing resources in the work nodes of the AI platform, the work burden and resource limitation of users' timely submission of timing task scripts is solved, and the on-time execution of timing tasks and efficient utilization of resources is achieved.

CN120276823APending Publication Date: 2025-07-08LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510376742.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

When executing timing tasks, users need to submit task scripts regularly, resulting in a large workload and limited resources that cannot guarantee the execution reliability of timing tasks.

Method used

By determining the target computing resources in the work nodes of the AI platform and establishing the correspondence between the timing tasks and the target computing resources, making them in a ready state, automatically perform tasks in response to task execution time, or forcibly recycle resources when resources are occupied to ensure the execution of the timing tasks.

Benefits of technology

It reduces the user's workload, improves the execution reliability of timed tasks and the utilization efficiency of computing resources, and ensures that tasks are executed on time at a specified time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120276823A_ABST
    Figure CN120276823A_ABST
Patent Text Reader

Abstract

The invention discloses a timed task execution method and system, and the method comprises the steps: responding to a first task, determining a target computing resource from the computing resources of a working node, and building a first corresponding relation between the first task and the target computing resource; wherein the first task represents a timed task, and the target computing resource establishing a first corresponding relationship with the first task is in a ready state; sending first control information to the working node in response to the execution time of the first task; the first control information is used for indicating the working node to execute the first task by using the target computing resource in the ready state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to, but is not limited to, the field of computer technology, and particularly relates to a method and system for executing timed tasks. Background Art

[0002] Currently, an artificial intelligence (AI) platform supports users to input independent tasks (job-type tasks) with clear inputs, model parameters, and processing requirements. Users can submit the code corresponding to the tasks to the AI platform. When the AI platform has sufficient computing resources, the tasks can enter the running state.

[0003] For timed tasks that need to be executed at specific intervals or at specified times, if the AI platform is used for execution, users need to submit the corresponding task scripts to the platform regularly, which brings a heavy workload to users. At the same time, in the case of limited resources and the AI platform running multiple types of tasks simultaneously, when the specified execution time of the timed task arrives, the platform cannot guarantee that there are sufficient computing resources to successfully execute the timed task, resulting in the timed task losing its meaning of existence. Therefore, how to effectively execute timed tasks has become an urgent problem to be solved. Summary of the Invention

[0004] In view of this, the present disclosure provides at least a method and system for executing timed tasks.

[0005] The technical solution of the present disclosure is implemented as follows:

[0006] On the one hand, the present disclosure provides a data processing method, which includes:

[0007] In response to obtaining a first task, determining target computing resources from the computing resources of the working node, and establishing a first correspondence between the first task and the target computing resources; wherein, the first task represents a timed task, and the target computing resources having the first correspondence with the first task are in a ready state;

[0008] In response to the arrival of the execution time of the first task, sending first control information to the working node; the first control information is used to instruct the working node to execute the first task by using the target computing resources in a ready state.

[0009] In some embodiments, after establishing the first correspondence between the first task and the target computing resources, the method further includes:

[0010] In response to obtaining a second task, sending second control information to the working node; the second control information is used to instruct the working node to execute the second task by using the target computing resources in a ready state, and the second task represents a non-timed task.

[0011] In some embodiments, in response to the arrival of the execution time of the first task, send first control information to the worker node, including one of the following:

[0012] In response to the arrival of the execution time of the first task and the target computing resource not being occupied by the second task, send first control information to the worker node;

[0013] In response to the arrival of the execution time of the first task and the target computing resource being occupied by the second task, send first control information to the worker node; the first control information is used to instruct the worker node to release the occupancy of the target computing resource by the second task and use the target computing resource that enters the ready state to execute the first task.

[0014] In some embodiments, the method further includes:

[0015] Allocate first identification information to the target computing resource; the first identification information represents that the target computing resource is the reserved computing resource corresponding to the first task;

[0016] In response to the arrival of the execution time of the first task and the target computing resource being occupied by the second task, send first control information to the worker node, including:

[0017] In response to the arrival of the execution time of the first task, determine the target computing resource based on the first correspondence;

[0018] In response to the target computing resource being occupied by the second task and the target computing resource having the first identification information, send first control information to the worker node.

[0019] In some embodiments, after sending second control information to the worker node in response to obtaining the second task, the method further includes:

[0020] Establish a second correspondence between the second task and the first task;

[0021] After sending first control information to the worker node in response to the arrival of the execution time of the first task and the target computing resource being occupied by the second task, further include:

[0022] In response to the completion of the current job execution of the first task and the second task being in a pending execution state, send third control information to the worker node based on the second correspondence; the third control information is used to instruct the worker node to use the target computing resource to execute the second task.

[0023] In some embodiments, after establishing the first correspondence between the first task and the target computing resource, the method further includes: marking the target computing resource as a temporary computing resource;

[0024] In response to obtaining the second task, send second control information to the worker node, including:

[0025] Output a first prompt message to the user corresponding to the second task; the first prompt message is used to prompt the user whether to accept using the temporary computing resources to execute the second task when the remaining computing resources are less than the computing resources required for the second task.

[0026] In response to the feedback message that the user accepts using the temporary computing resources to execute the second task, send a second control message to the worker node.

[0027] On the other hand, the present disclosure provides a method for executing a timed task, including:

[0028] In response to the resource designation information sent by the management node, update the resource description information to make the target computing resources in a ready state; the resource designation information is used to instruct the worker node to update the resource description information so that the management node establishes a correspondence between the target computing resources and the first task, and the first task represents a timed task.

[0029] In response to the first control information sent by the management node, execute the first task using the target computing resources in a ready state; the first control information represents the control information sent by the management node when the execution time of the first task arrives.

[0030] On the other hand, the present disclosure provides a timed task execution system, including: a management node and a worker node; wherein,

[0031] The management node, in response to obtaining the first task, determines the target computing resources from the computing resources of the worker node, and sends resource designation information to the worker node; the first task represents a timed task.

[0032] The worker node, in response to the resource designation information, updates the resource description information to make the target computing resources in a ready state, and sends the updated resource description information to the management node.

[0033] The management node, based on the resource description information, establishes a first correspondence between the first task and the target computing resources; in response to the arrival of the execution time of the first task, based on the first correspondence, sends the first control information to the worker node.

[0034] The worker node, in response to the first control information, executes the first task using the target computing resources in a ready state.

[0035] In some embodiments, the management node includes a timed task controller and a scheduler; wherein,

[0036] The timed task controller monitors the execution time of the first task, and in response to the arrival of the execution time of the first task, submits the first task to the scheduler.

[0037] The scheduler sends the first control information to the worker node based on the first correspondence relationship.

[0038] In some embodiments, the management node includes a task manager; wherein,

[0039] The task manager submits a second task to the scheduler; the second task represents a non-timed task;

[0040] The scheduler determines that the target computing resource is in a ready state based on the resource description information of the worker node; and sends the second control information to the worker node;

[0041] The worker node, in response to the second control information, executes the second task using the target computing resource.

[0042] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit the technical solutions of the present disclosure. Brief Description of the Drawings

[0043] The drawings herein are incorporated into the specification and constitute a part of this specification. These drawings show embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure.

[0044] Figure 1 It is a schematic implementation flowchart of a method for executing a timed task provided by the present disclosure;

[0045] Figure 2 It is a schematic implementation flowchart of an embodiment provided by the present disclosure;

[0046] Figure 3 It is a schematic implementation flowchart of a method for executing a timed task provided by the present disclosure;

[0047] Figure 4 It is a system framework diagram of a timed task execution system provided by the present disclosure;

[0048] Figure 5 It is a system framework diagram of an embodiment of the timed task execution system provided by the present disclosure;

[0049] Figure 6 It is a timing diagram of an embodiment provided by the present disclosure;

[0050] Figure 7 It is a schematic diagram of the hardware entity of an electronic device provided by the present disclosure. Detailed Embodiments

[0051] To make the objectives, technical solutions, and advantages of the present disclosure clearer, the technical solutions of the present disclosure will be further elaborated in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be construed as limitations on the present disclosure. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present disclosure.

[0052] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and they can be combined with each other without conflict.

[0053] The terms "first / second / third" involved are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second / third" can be interchanged with a specific order or sequence when permitted, so that the embodiments of the present disclosure described herein can be implemented in an order other than that illustrated or described herein.

[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the art belonging to the technical field of the present disclosure. The terms used herein are only for the purpose of describing the present disclosure and are not intended to limit the present disclosure.

[0055] Before further elaborating on the present disclosure in detail, the nouns and terms involved in the present disclosure will be explained. The nouns and terms involved in the present disclosure are applicable to the following explanations:

[0056] The Kubernetes (abbreviated as K8s) cluster is an open-source container orchestration platform used for automating the deployment, scaling, and management of containerized applications.

[0057] The management node (Master Node) is responsible for the management and coordination of the cluster, including the Application Programming Interface Server (API server), database, Controller Manager, and Scheduler.

[0058] The worker node (Worker Node) is used to run the actual workload. Each worker node contains kubelet, kube-proxy, and a container runtime (such as Docker or rkt), and is responsible for executing the instructions of the control plane.

[0059] A Pod is the smallest deployable and manageable basic unit in a worker node and can contain one or more containers (usually Docker containers).

[0060] The kubelet is a key proxy component on each worker node in a Kubernetes cluster, mainly responsible for managing and maintaining the Pods on that node.

[0061] A DaemonSet is a controller that runs on worker nodes and is used to ensure that a specified Pod runs on each eligible worker node, deploying and managing specific system-level services or daemons on the worker nodes.

[0062] The present disclosure provides a method for executing a scheduled task. First, in response to obtaining a first task of a scheduled task type, target computing resources are determined from the computing resources of a worker node, and a first correspondence between the first task and the target computing resources is established, where the target computing resources having the first correspondence with the first task are in a ready state; in response to reaching the execution time of the first task, first control information is sent to the worker node, where the first control information is used to instruct the worker node to execute the first task by using the target computing resources in the ready state. In this way, a first correspondence between the scheduled task and the target computing resources is established after obtaining the scheduled task, and the target computing resources are switched to the ready state, so that the target computing resources can be used at any time to execute the first task, thereby enabling the first task to be immediately executed when the execution time arrives, improving the execution reliability of the first task; on the other hand, when the execution time of the first task arrives, the first control information is automatically sent to the worker node to start executing the first task. Compared with the related art solution of the user submitting a scheduled task script at a fixed time, the present disclosure can greatly reduce the workload of the user.

[0063] The method provided by the present disclosure can be executed by an electronic device. The electronic device can be various types of terminals such as a laptop computer, a tablet computer, a desktop computer, a mobile device (such as a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable gaming device), etc., or can also be implemented as a server. The server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.

[0064] Next, the technical solutions in the embodiments of the present disclosure will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present disclosure.

[0065] Figure 1The following is a schematic flowchart of an implementation method for a timing task provided by the present disclosure. As Figure 1 shown, the method includes the following steps S11 to S12:

[0066] Step S11: In response to obtaining a first task, determine target computing resources from the computing resources of the working node, and establish a first correspondence between the first task and the target computing resources; wherein, the first task represents a timing task, and the target computing resources having a first correspondence with the first task are in a ready state.

[0067] Here, the first task can be any type of timing task. In some embodiments, the first task may include multiple jobs, and the interval duration between adjacent jobs is the same, that is, the first task is a timing task executed according to a specified period. In some embodiments, the first task may include multiple jobs, and the interval duration between adjacent jobs is not equal. In some embodiments, the first task includes only one job, and this job has a specified execution time.

[0068] In some embodiments, obtaining the first task may be based on a user submitting a timing task to an AI platform (for example, the management node of a K8s cluster) through a terminal device to obtain the first task.

[0069] In some embodiments, obtaining the first task may be in response to the user creating a timing task on the AI platform to obtain the first task.

[0070] In response to obtaining the first task, query the available computing resource information in the working node, and determine the target computing resources from the available computing resource information. Here, the working node can be one or more nodes.

[0071] In some embodiments, a management application (for example, a management node) for running the method provided by the present disclosure maintains resource description information of each working node. The resource description information may include the computing resources, resource status, memory resources, storage resources, network resources, etc. of the corresponding working node. Among them, the computing resources may include: Central Processing Unit (CPU) resources, Graphics Processing Unit (GPU) resources, Neural Processing Unit (NPU) resources, etc.; the resource status refers to the usage status of the computing resources. In this way, the management node can determine the available computing resources in the working node through the most recently updated resource description information, and further determine the target computing resources.

[0072] In some embodiments, the management node may send computing resource query information to at least one worker node and receive computing resource feedback information from the corresponding worker node; based on the computing resource feedback information, the management node determines target computing resources from the available computing resources of at least one worker node.

[0073] In some embodiments, the target computing resources may be computing resources determined according to the type of the first task. For example, the type, size, or data processing speed, etc. of the target computing resources may be determined based on the type of the first task.

[0074] After determining the target computing resources, a first correspondence between the first task and the target computing resources is established so that when the execution time of the first task arrives, the first task can be executed using the target computing resources based on this first correspondence.

[0075] Meanwhile, the target computing resources having the first correspondence with the first task are in a ready state. Here, the ready state means that after the first correspondence is established, the target computing resources are in a ready state relative to the first task and can be used to execute the first task at any time.

[0076] In some embodiments, after determining the target computing resources, the management node may send resource assignment information to the corresponding worker node, where the resource assignment information at least includes the identification information of the first task and the quantity of the target computing resources. In this way, based on the resource assignment information, the worker node can update the resource description information of its own node to establish the correspondence between the target computing resources and the first task. After that, the worker node sends the updated resource description information to the management node so that the management node can establish the first correspondence between the first task and the target computing resources.

[0077] Step S12, in response to the arrival of the execution time of the first task, send first control information to the worker node; the first control information is used to instruct the worker node to execute the first task using the target computing resources in the ready state.

[0078] Here, when the execution time of the first task arrives, send the first control information to the worker node corresponding to the target computing resources so that the worker node executes the first task using the target computing resources based on this first control information.

[0079] In some embodiments, when the first task includes only one job, when the execution time of the first task arrives, that is, when the execution time corresponding to the one job arrives; when the first task includes multiple jobs, when the execution time of the first task arrives, that is, after a specified time interval, the execution time of the current job arrives.

[0080] The first control information is any type of control information sent to the worker node.

[0081] In some embodiments, the first control information may be one or a set of control data containing specific control content. For example, when the worker node has relatively abundant computing resources and can execute multiple tasks simultaneously, it is necessary to use the first control information containing specific control content to instruct the worker node to execute the first task using the target computing resources.

[0082] In some embodiments, the first control information may be a specified potential signal (e.g., a high potential signal or a low potential signal). For example, when the computing resources in the worker node are scarce or the worker node can only execute one task at the same time, the first control information in the form of a potential signal can be used to instruct the worker node to start executing the first task.

[0083] In some embodiments, the first control information may be control information sent by the management node to the worker node. During implementation, the management node can monitor the execution time of the first task and send the first control information to the worker node when the execution time of the first task arrives.

[0084] Here, in response to the first control information, the worker node uses the target computing resources to execute the first task, and at the same time switches the target computing resources from the ready state to the working state.

[0085] In the timing task execution method provided by the present disclosure, first, in response to obtaining the first task of the timing task type, determine the target computing resources from the computing resources of the worker node, and establish a first correspondence between the first task and the target computing resources, where the target computing resources having the first correspondence with the first task are in the ready state; in response to the arrival of the execution time of the first task, send the first control information to the worker node, where the first control information is used to instruct the worker node to execute the first task using the target computing resources in the ready state. In this way, after obtaining the timing task, the first correspondence between the timing task and the target computing resources is established, and the target computing resources are switched to the ready state, so that the target computing resources can be used at any time to execute the first task, so that the first task can be immediately executed when the execution time arrives, improving the execution reliability of the first task; on the other hand, when the execution time of the first task arrives, the first control information is automatically sent to the worker node to start executing the first task. Compared with the related art where the user submits the timing task script at a fixed time, the present disclosure can greatly reduce the workload of the user.

[0086] In some embodiments, after establishing the first correspondence between the first task and the target computing resources in the above step S11, the method further includes the following step S13:

[0087] Step S13: In response to obtaining the second task, send second control information to the working node; the second control information is used to instruct the working node to execute the second task by using the target computing resource in the ready state, and the second task represents a non-timed task.

[0088] Here, when the target computing resource is in the ready state, if a second task of the non-timed task type is received, send second control information to the working node so that the working node uses the target computing resource to execute the second task.

[0089] The second task refers to a non-timed task, that is, the second task is an ordinary task without a limited execution time. In some embodiments, the second task is an interruptible task, that is, interrupting the execution process of the second task will not affect the execution result of the second task.

[0090] The target computing resource being in the ready state indicates that the target computing resource can be used at any time to execute the first task, and the execution time of the first task has not yet arrived. Therefore, in the ready state, the target computing resource is not used to execute any task.

[0091] In this way, after receiving the second task of the non-timed task type, since the second task has no limit on the execution time and the execution process can be interrupted, using the target computing resource in the ready state to execute the second task will not affect the execution effect of the second task and can improve the usage efficiency of the target computing resource.

[0092] In some embodiments, the second control information is further used to instruct the working node to switch the target computing resource from the ready state to the working state.

[0093] In some embodiments, the step of sending the first control information to the working node in response to reaching the execution time of the first task, that is, the above step S12, can be implemented as one of the following steps S121 to S122:

[0094] Step S121: In response to reaching the execution time of the first task and the target computing resource not being occupied by the second task, send the first control information to the working node;

[0095] Step S122: In response to reaching the execution time of the first task and the target computing resource being occupied by the second task, send the first control information to the working node; the first control information is used to instruct the working node to release the occupation of the target computing resource by the second task and use the target computing resource that enters the ready state to execute the first task.

[0096] Here, in the case of executing a second task by using a target computing resource in a ready state, when the execution time of the first task arrives, it is necessary to determine the content of the first control information sent to the worker node according to the current execution state of the second task or the running state of the target computing resource.

[0097] When the execution time of the first task arrives, if the second task has been executed, the target computing resource is not occupied by the second task and has switched from the working state to the ready state. Therefore, the current job of the first task can be directly executed by using the target computing resource. In this way, the first control information sent to the worker node is used to instruct the worker node to execute the current job of the first task by using the target computing resource in the ready state.

[0098] When the execution time of the first task arrives, if the second task is in the process of execution, that is, the target computing resource is occupied by the second task, it is necessary to instruct the worker node to release the occupation of the target computing resource by the second task, so that the target computing resource switches back to the ready state, and use the target computing resource to execute the first task. In this way, the first control information sent to the worker node is used to instruct the worker node to release the occupation of the target computing resource by the second task and execute the first task by using the target computing resource that enters the ready state.

[0099] In some embodiments, the first control information is further used to instruct the worker node to switch the target computing resource from the ready state to the working state.

[0100] In the above embodiments of the present disclosure, when the execution time of the first task arrives and the target computing resource corresponding to the first task is occupied by the second task, by forcibly reclaiming the target computing resource and using the target computing resource to execute the first task, the first task can be executed on time, thereby improving the utilization efficiency of the target computing resource while ensuring the execution reliability of the first task.

[0101] In some embodiments, the method provided by the present disclosure further includes the following step S14:

[0102] Step S14: Allocate first identification information for the target computing resource; the first identification information represents that the target computing resource is the reserved computing resource corresponding to the first task.

[0103] Here, after establishing the first correspondence relationship between the first task and the target computing resource, allocate first identification information for the target computing resource, so as to use the first identification information to represent that the target computing resource is the reserved computing resource corresponding to the first task.

[0104] Reserved computing resources refer to the computing resources pre-allocated for scheduled tasks, and during the non-execution time of the scheduled tasks, the reserved computing resources can be used to execute non-scheduled tasks. Based on this first identification information, when the execution time of the first task arrives, the target computing resources can be forced to execute the first task.

[0105] In this way, the step of sending the first control information to the worker node in response to the arrival of the execution time of the first task and the target computing resources being occupied by the second task, that is, the above step S122, can be implemented as the following steps S1221 to S1222:

[0106] Step S1221, in response to the arrival of the execution time of the first task, determine the target computing resources based on the first correspondence.

[0107] Here, by monitoring the scheduled task, when it is determined that the execution time of the first task arrives, query the first correspondence related to the first task, and determine the target computing resources based on this first correspondence.

[0108] Step S1222, in response to the target computing resources being occupied by the second task and the target computing resources having the first identification information, send the first control information to the worker node.

[0109] In the case where the target computing resources corresponding to the first task are occupied by the second task, based on the target computing resources having the first identification information, it can be determined that the target computing resources are the reserved computing resources corresponding to the first task.

[0110] In this way, based on the usage method of the reserved computing resources defined in the present disclosure, send the first control information to the worker node so that the worker node forcibly reclaims the target computing resources, that is, releases the occupation of the target computing resources by the second task, so that the target computing resources switch from the working state to the ready state, and use the target computing resources that enter the ready state to execute the first task.

[0111] In the above embodiments provided by the present disclosure, by allocating the first identification information to the target computing resources, when the execution time of the first task arrives, the target computing resources occupied by the second task can be forcibly reclaimed and the target computing resources can be used to execute the first task, so that the first task can be executed on time, improving the execution reliability of the first task.

[0112] In some embodiments, after the step of sending the second control information to the worker node in response to obtaining the second task, that is, after the above step S13, the method further includes the following step S15:

[0113] Step S15, establish a second correspondence between the second task and the first task.

[0114] Here, after sending the second control information to the worker node to execute the second task using the target computing resource, a second correspondence between the second task and the first task is established. In implementation, a second correspondence between the identification information of the second task and the identification information of the first task can be established.

[0115] In some embodiments, the second correspondence can be stored in association with the first task and the second task. In some embodiments, the second correspondence can be written into a database for storing tasks.

[0116] Thus, after sending the first control information to the worker node in response to the execution time of the first task arriving and the target computing resource being occupied by the second task, that is, after the above step S122, the method further includes the following step S16:

[0117] Step S16, in response to the current job of the first task being executed and completed and the second task being in a pending execution state, based on the second correspondence, send the third control information to the worker node; the third control information is used to instruct the worker node to execute the second task using the target computing resource.

[0118] After the current job of the first task is executed and completed, the target computing resource is released. Here, in the case where the current job is the last job of the first task, the target computing resource is switched from the working state to the idle state; in the case where the current job is not the last job of the first task, the target computing resource is switched from the working state to the ready state.

[0119] Thus, after the current job of the first task is executed and completed, the second task corresponding to the first task is determined through the second correspondence; if the second task is still in a pending execution state (that is, the second task has not been executed and completed and is waiting for allocation of computing resources in the task scheduling queue), the third control information is sent to the worker node to instruct the worker node to reuse the target computing resource to execute the second task.

[0120] In the above embodiments of the present disclosure, by establishing the second correspondence between the first task and the second task, when the target computing resource is in the ready state or the idle state, the second task has the right to preferentially use the target computing resource, that is, the interrupted second task is preferentially processed, thereby improving the overall task processing efficiency.

[0121] In some embodiments, after establishing the first correspondence between the first task and the target computing resource, that is, after the above step S11, the method further includes the following step S17:

[0122] Step S17, mark the target computing resource as a temporary computing resource.

[0123] Here, after establishing the first correspondence between the first task and the target computing resource, the target computing resource switches to the ready state and is not occupied by any task. To improve the utilization efficiency of the target computing resource, the target computing resource is marked as a temporary computing resource, so that based on this temporary computing resource mark, the target computing resource can be temporarily allocated to non-timed tasks that have no time limit for execution. In implementation, the computing resources with the temporary computing resource mark can be put into a temporary resource pool.

[0124] Responding to obtaining the second task and sending the second control information to the working node, that is, the above-mentioned step S13, can be implemented as the following steps S131 to S132:

[0125] Step S131, output a first prompt message to the user corresponding to the second task; the first prompt message is used to prompt the user whether to accept executing the second task by using the temporary computing resource when the remaining computing resources are less than the computing resources required by the second task.

[0126] Since there is a risk that the second task may be interrupted during execution when using the temporary computing resource, and the execution interruption may be unacceptable to the user. Therefore, in the method provided by the present disclosure, a first prompt message is output to the user corresponding to the second task to prompt the user whether to accept executing the second task by using the temporary computing resource when the remaining computing resources are less than the computing resources required by the second task.

[0127] In implementation, the first prompt message can be output in any suitable manner such as display, voice, or video animation.

[0128] In some embodiments, the first prompt message can be output to the user after obtaining the second task.

[0129] In some embodiments, the first prompt message can be displayed and output at the same time when the user creates the second task, that is, the first prompt message is displayed and output in the task creation interface, so that the user can select whether to accept the content of the second prompt message while creating the second task.

[0130] Step S132, in response to the feedback information that the user accepts executing the second task by using the temporary computing resource, send the second control information to the working node.

[0131] Here, in a case where the user accepts to execute a second task using temporary computing resources and the remaining computing resources are less than the computing resources required for the second task, second control information is sent to the worker node to instruct the worker node to execute the second task using target computing resources marked as temporary computing resources.

[0132] In the above embodiments of the present disclosure, by sending a first prompt message to the user and determining the computing resources allocated for the second task based on the user's feedback, the second task can be executed using temporary computing resources with the user's consent, thereby improving the user's satisfaction.

[0133] Next, in combination with Figure 2 , an embodiment of the present disclosure will be described. As Figure 2 shown, this embodiment includes the following steps S201 to step S207:

[0134] Step S201, obtain a timing task submitted by the user; then, execute step S202;

[0135] Step S202, determine target computing resources from the available computing resources of the worker node and establish a first correspondence between the timing task and the target computing resources; then, execute step S203;

[0136] Here, the target computing resources are switched from the idle state to the ready state.

[0137] Step S203, determine whether the execution time of the timing task has arrived; if not, execute step S204; if so, execute step S205;

[0138] Step S204, put the target computing resources into the temporary resource pool;

[0139] Here, after putting the target computing resources into the temporary resource pool, the target computing resources can be allocated to non-timing tasks.

[0140] Step S205, determine whether the target computing resources are occupied by non-timing tasks; if so, execute step S206; if not, execute step S207;

[0141] Step S206, send fourth control information to the worker node to instruct the worker node to release the occupation of the target computing resources by the non-timing task and execute the timing task using the target computing resources;

[0142] Step S207, send fifth control information to the worker node to instruct the worker node to execute the timing task using the target computing resources.

[0143] As can be seen from the above, for the timing task execution method provided by the present disclosure, on the one hand, by specifying target computing resources for the timing task and making the target computing resources in a ready state, the timing task can be executed on time when it reaches the execution time, thereby improving the execution reliability of the timing task; on the other hand, during the non-execution time of the timing task, by allocating the target computing resources in a ready state to non-timing tasks, the utilization efficiency of the target computing resources can be improved; on the further hand, when the timing task reaches the execution time, if the target computing resources are occupied by non-timing tasks, the target computing resources are forcibly reclaimed (that is, the occupation of the target computing resources by non-timing tasks is released), which can further improve the execution reliability of the timing task.

[0144] In addition, the present disclosure also provides a timing task execution method. In some implementation manners, the timing task execution method may be a method executed on a working node in a cluster. In some embodiments, a working node refers to a node that can run a service load according to tasks assigned by a management node. In some embodiments, the working node may be implemented as a physical server, a virtual machine running in a virtual environment, a virtual machine provided by a public cloud, or an edge device, etc.

[0145] As Figure 3 shown, the method includes the following steps S31 to step S32:

[0146] Step S31, in response to resource specification information sent by the management node, update the resource description information to make the target computing resources in a ready state; the resource specification information is used to instruct the working node to update the resource description information so that the management node establishes a correspondence between the target computing resources and a first task, and the first task represents a timing task.

[0147] Here, the resource specification information refers to the information sent by the management node to the working node after the management node obtains the first task and determines the target computing resources for the first task. In implementation, the resource specification information at least includes the task identification information of the first task and the information on the amount of computing resources required by the first task. In some embodiments, the working node may determine the target computing resources based on the information on the amount of computing resources in the resource specification information.

[0148] After the working node updates the resource description information of its own node based on the resource specification information, the resource description information is fed back to the management node so that the management node establishes a first correspondence between the target computing resources and the first task.

[0149] Step S32, in response to the first control information sent by the management node, execute the first task by using the target computing resources in a ready state; the first control information represents the control information sent by the management node when the execution time of the first task is reached.

[0150] Here, in response to the execution time of the first task arriving, the management node sends first control information to the worker node; in response to the first control information, the worker node executes the first task using the target computing resources in the ready state.

[0151] In some embodiments, the method provided by the present disclosure further includes:

[0152] In response to the second control information sent by the management node, execute a second task using the target computing resources in the ready state; the second task represents a non-timed task.

[0153] In some embodiments, the executing the first task using the target computing resources in the ready state in response to the first control information sent by the management node includes at least one of the following:

[0154] In response to the first control information, execute the first task using the target computing resources in the ready state;

[0155] In response to the first control information, release the occupancy of the target computing resources by the second task, and execute the first task using the target computing resources that enter the ready state.

[0156] It should be noted that the descriptions of the above method embodiments applied to the worker node are similar to the descriptions of the method embodiments for the management node above and have similar beneficial effects. In some embodiments, for the technical details not disclosed in the method embodiments of the present disclosure applied to the worker node, please refer to the descriptions of the method embodiments of the present disclosure applied to the worker node for understanding.

[0157] The present disclosure also provides a timed task execution system. As Figure 4 shown, the timed task execution system 400 includes: a management node 410 and a worker node 420; wherein,

[0158] The management node 410, in response to obtaining a first task, determines target computing resources from the computing resources of the worker node 420, and sends resource designation information to the worker node 420; the first task represents a timed task;

[0159] The worker node 420, in response to the resource designation information, updates the resource description information to make the target computing resources in the ready state, and sends the updated resource description information to the management node 410;

[0160] The management node 410 establishes a first correspondence between the first task and the target computing resource based on the resource description information; in response to the arrival of the execution time of the first task, based on the first correspondence, the management node 410 sends first control information to the worker node 420;

[0161] In response to the first control information, the worker node 420 uses the target computing resource in a ready state to execute the first task.

[0162] Here, the management node 410 is a node in the timing task execution system for performing management and decision-making. In some embodiments, the management node 410 can be implemented as a physical server or as a virtual machine running in a virtual environment.

[0163] The worker node 420 is a node in the timing task execution system for specifically running the business load according to the tasks assigned by the management node 410. In some embodiments, the worker node can be implemented as a physical server, a virtual machine running in a virtual environment, a virtual machine provided by a public cloud, or an edge device, etc.

[0164] In some embodiments, the management node 410 includes a timing task controller and a scheduler; wherein,

[0165] The timing task controller monitors the execution time of the first task and submits the first task to the scheduler in response to the arrival of the execution time of the first task;

[0166] The scheduler sends the first control information to the worker node based on the first correspondence.

[0167] In some embodiments, the management node 410 includes a task manager; wherein,

[0168] The task manager submits a second task to the scheduler; the second task represents a non-timing task;

[0169] The scheduler determines that the target computing resource is in a ready state based on the resource description information of the worker node; and sends second control information to the worker node;

[0170] In response to the second control information, the worker node uses the target computing resource to execute the second task.

[0171] In some embodiments, the scheduler is configured to perform one of the following:

[0172] In response to the arrival of the execution time of the first task and the target computing resource not being occupied by the second task, send the first control information to the worker node;

[0173] In response to the execution time of the first task arriving and the target computing resource being occupied by the second task, send the first control information to the worker node; the first control information is used to instruct the worker node to release the occupation of the target computing resource by the second task and use the target computing resource that has entered the ready state to execute the first task.

[0174] In some embodiments, the task manager is configured to allocate first identification information to the target computing resource; the first identification information represents that the target computing resource is a reserved computing resource corresponding to the first task;

[0175] The scheduler is configured to, in response to the execution time of the first task arriving, determine the target computing resource based on the first correspondence; in response to the target computing resource being occupied by the second task and the target computing resource having the first identification information, send the first control information to the worker node.

[0176] In some embodiments, the task manager is configured to establish a second correspondence between the second task and the first task;

[0177] The scheduler is configured to, in response to the current job execution of the first task being completed and the second task being in a pending execution state, send third control information to the worker node based on the second correspondence; the third control information is used to instruct the worker node to use the target computing resource to execute the second task.

[0178] Figure 5 It is a framework diagram of an embodiment of the timing task execution system provided by the present disclosure. Among them, this embodiment improves the management node and the worker node of the K8s cluster to implement the timing task execution method provided by the present disclosure.

[0179] As Figure 5 shown, the timing task execution system 500 includes a management node 510, a worker node 520, and a database 530; among them,

[0180] The management node 510 includes:

[0181] A task service 511, configured to receive various tasks submitted by a user to the management node 510 through a user terminal 540 and write the tasks into the database 530; meanwhile, the task service 511 can also submit the tasks to be executed to a task scheduling queue in the scheduler 513;

[0182] A timed task manager 512, which is used to monitor the timed tasks in the database 530 and submit the timed tasks to the task service 511 when the execution time of the timed tasks arrives;

[0183] A scheduler 513, which is used to read the tasks in the task scheduling queue and allocate computing resources for the tasks in the task scheduling queue according to the available computing resources of the worker nodes 520;

[0184] An API server 514, which is used to receive the resource description information fed back by the worker nodes 520 and provide the resource description information to the scheduler 513;

[0185] Worker nodes 520, which can be one or more worker nodes, are used to provide computing resources and execute tasks under the control of the management node 510. Each worker node runs a kubelet component and a DaemonSet controller; among them, the kubelet component is used to manage the K8s computing resource information on the corresponding worker node; the DaemonSet controller is used to monitor the tasks executed on the worker node and modify the resource description information of the worker node (for example, add or delete the corresponding relationship information between the worker node and the timed task).

[0186] A database 530, which is used to provide task storage and maintenance services. In some embodiments, the database 530 can be implemented as a Remote Dictionary Server (Redis).

[0187] Next, in conjunction with Figure 6 the sequence diagram in Figure 5 illustrate an embodiment of executing a timed task using the Figure 6 shown timed task execution system. As

[0188] shown, this embodiment includes the following steps S601 to step S612:

[0189] Step S601, the user terminal 610 submits a timed task to the task service 620; then, step S602 is executed;

[0190] Step S602, the task service 620 writes the timed task into the database; then, step S603 is executed;

[0191] Step S603, the timed task controller 630 detects the timed task in the database; then, step S604 is executed;

[0192] Step S605, the task service 620 submits a timed task that has reached its execution time to the scheduler 640; then, step S606 is executed;

[0193] Step S606, the scheduler 640 sends resource scheduling information to the worker node 650; then, step S607 is executed;

[0194] Step S607, the worker node 650 executes the timed task; then, step S608 is executed;

[0195] Here, the worker node 650 executes the timed task using the computing resources reserved for the timed task.

[0196] Step S608, the scheduler 640 returns a scheduling success message to the task service 620; then, step S609 is executed;

[0197] Step S609, the task service 620 returns a scheduling success message to the user terminal 610;

[0198] Step S611, the user terminal 610 submits a task stop request to the task service 620; then, step S612 is executed;

[0199] Step S612, the task service 620 sends a task stop request to the worker node 650.

[0200] It should be noted that the description of the above system embodiments is similar to the description of the above method embodiments and has similar beneficial effects to the method embodiments. In some embodiments, the functions or modules included in the system provided by the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments. For the technical details not disclosed in the system embodiments of the present disclosure, please refer to the description of the method embodiments of the present disclosure for understanding.

[0201] It should be noted that in the embodiments of the present disclosure, if the above method for executing a timed task is implemented in the form of software function modules and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present disclosure, in essence, or the part that contributes to the related technology, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the various embodiments of the present disclosure. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), magnetic disks, or optical discs, etc., which can store program codes. In this way, the embodiments of the present disclosure are not limited to any specific hardware, software, or firmware, or any arbitrary combination of hardware, software, and firmware.

[0202] An embodiment of the present disclosure provides a computer device, including a memory and a processor. The memory stores a computer program that can run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.

[0203] An embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, some or all of the steps in the above method are implemented. The computer-readable storage medium can be transient or non-transient.

[0204] An embodiment of the present disclosure provides a computer program, including computer-readable code. When the computer-readable code runs in a computer device, the processor in the computer device executes to implement some or all of the steps in the above method.

[0205] An embodiment of the present disclosure provides a computer program product. The computer program product includes a non-transient computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, some or all of the steps in the above method are implemented. The computer program product can be specifically implemented by means of hardware, software, or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium. In other embodiments, the computer program product is specifically embodied as a software product, such as a Software Development Kit (SDK), etc.

[0206] It should be noted here that the descriptions of the above embodiments tend to emphasize the differences between the embodiments, and their similarities can be referred to each other. The descriptions of the above embodiments of the device, storage medium, computer program, and computer program product are similar to the descriptions of the above method embodiments and have beneficial effects similar to those of the method embodiments. For the technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product of the present disclosure, please refer to the descriptions of the method embodiments of the present disclosure for understanding.

[0207] It should be noted that Figure 7 is a schematic diagram of a hardware entity of an electronic device in the present disclosure. As Figure 7 shown, the hardware entity of the electronic device 700 includes: a processor 701, a communication interface 702, and a memory 703, where:

[0208] The processor 701 generally controls the overall operation of the electronic device 700.

[0209] The communication interface 702 can enable the electronic device to communicate with other terminals or servers through a network.

[0210] The memory 703 is configured to store instructions and applications executable by the processor 701, and can also cache data to be processed or already processed by the processor 701 and each module in the electronic device 700 (such as, image data, audio data, voice communication data, and video communication data), and can be implemented by a flash memory (FLASH) or a random access memory (RAM). Data transmission can be performed between the processor 701, the communication interface 702, and the memory 703 through the bus 704.

[0211] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures, or characteristics related to the embodiment are included in at least one embodiment of the present disclosure. Therefore, the appearances of "in one embodiment" or "in an embodiment" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present disclosure, the magnitudes of the serial numbers of the above steps / processes do not mean the order of execution, and the order of execution of each step / process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present disclosure. The serial numbers of the embodiments of the present disclosure above are only for description and do not represent the advantages or disadvantages of the embodiments.

[0212] It should be noted that in this article, the term "comprising", "including" or any other variation thereof is intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, the element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.

[0213] In several embodiments provided by the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the couplings, direct couplings, or communication connections between the components shown or discussed can be through some interfaces, and the indirect couplings or communication connections of devices or units can be electrical, mechanical, or other forms.

[0214] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units; and some or all of the units may be selected according to actual needs to achieve the objectives of the solution of this embodiment.

[0215] In addition, each functional unit in the various embodiments of the present disclosure may all be integrated in a processing unit, or each unit may be separately taken as a unit alone, or two or more units may be integrated in one unit; the above-mentioned integrated units may be implemented in the form of hardware, or in the form of a combination of hardware and software functional units.

[0216] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including the above method embodiments; and the foregoing storage medium includes: removable storage devices, read-only memory (ROM), magnetic disks, or optical disks and other various media that can store program codes.

[0217] Alternatively, if the above-mentioned integrated units of the present disclosure are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present disclosure essentially or the part that contributes to the related art can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the various embodiments of the present disclosure. And the foregoing storage medium includes: removable storage devices, ROM, magnetic disks, or optical disks and other various media that can store program codes.

[0218] The above is only the implementation manner of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present disclosure can easily think of changes or substitutions, which should all be covered by the protection scope of the present disclosure.

Claims

1. A method for executing a timed task, comprising: In response to obtaining a first task, determining target computing resources from the computing resources of a worker node, and establishing a first correspondence between the first task and the target computing resources; wherein the first task represents a timed task, and the target computing resources having the first correspondence with the first task are in a ready state; In response to the arrival of the execution time of the first task, sending first control information to the worker node; the first control information is used to instruct the worker node to execute the first task by using the target computing resources in the ready state.

2. The method according to claim 1, after establishing the first correspondence between the first task and the target computing resources, the method further comprises: In response to obtaining a second task, sending second control information to the worker node; The second control information is used to instruct the worker node to execute the second task by using the target computing resources in the ready state, and the second task represents a non-timed task.

3. The method according to claim 2, the step of in response to the arrival of the execution time of the first task, sending first control information to the worker node, includes one of the following: In response to the arrival of the execution time of the first task, and the target computing resources are not occupied by the second task, sending the first control information to the worker node; In response to the arrival of the execution time of the first task, and the target computing resources are occupied by the second task, sending the first control information to the worker node; The first control information is used to instruct the worker node to release the occupation of the target computing resources by the second task, and execute the first task by using the target computing resources entering the ready state.

4. The method according to claim 3, further comprising: Allocating first identification information to the target computing resources; The first identification information represents that the target computing resources are reserved computing resources corresponding to the first task; The step of in response to the arrival of the execution time of the first task, and the target computing resources are occupied by the second task, sending the first control information to the worker node, includes: In response to the arrival of the execution time of the first task, determining the target computing resources based on the first correspondence; In response to the target computing resources being occupied by the second task, and the target computing resources having the first identification information, sending the first control information to the worker node.

5. The method according to claim 3, after sending the second control information to the worker node in response to obtaining the second task, further comprising: Establishing a second correspondence between the second task and the first task; After sending the first control information to the worker node in response to the arrival of the execution time of the first task, and the target computing resources are occupied by the second task, further comprising: In response to the completion of the current execution of the first task, and the second task being in a pending execution state, sending third control information to the worker node based on the second correspondence; The third control information is used to instruct the working node to execute the second task by using the target computing resource.

6. The method according to claim 2, after establishing the first correspondence between the first task and the target computing resource, further comprising: Mark the target computing resource as a temporary computing resource; Sending the second control information to the working node includes: Outputting a first prompt message to the user corresponding to the second task; the first prompt message is used to prompt the user whether to accept executing the second task by using the temporary computing resource when the remaining computing resource is less than the computing resource required for the second task; In response to the feedback information that the user accepts to execute the second task by using the temporary computing resource, send the second control information to the working node.

7. A method for executing a timed task, including: In response to the resource designation information sent by the management node, update the resource description information to make the target computing resource in a ready state; The resource designation information is used to instruct the working node to update the resource description information so that the management node establishes a correspondence between the target computing resource and the first task, and the first task represents a timed task; In response to the first control information sent by the management node, execute the first task by using the target computing resource in a ready state; The first control information represents the control information sent by the management node when the execution time of the first task arrives.

8. A timed task execution system, comprising: A management node and a working node; wherein, The management node, in response to obtaining the first task, determines the target computing resource from the computing resources of the working node, and sends the resource designation information to the working node; the first task represents a timed task; The working node, in response to the resource designation information, updates the resource description information to make the target computing resource in a ready state, and sends the updated resource description information to the management node; The management node, based on the resource description information, establishes a first correspondence between the first task and the target computing resource; in response to the arrival of the execution time of the first task, based on the first correspondence, sends the first control information to the working node; The working node, in response to the first control information, executes the first task by using the target computing resource in a ready state.

9. The system according to claim 8, wherein, The management node includes a timed task controller and a scheduler; wherein, The timed task controller monitors the execution time of the first task, and in response to the arrival of the execution time of the first task, submits the first task to the scheduler; The scheduler, based on the first correspondence, sends the first control information to the working node.

10. The system according to claim 9, wherein, The management node includes a task manager; wherein, The task manager submits the second task to the scheduler; the second task represents a non-timed task; The scheduler, based on the resource description information of the working node, determines that the target computing resource is in a ready state; sends the second control information to the working node; The working node, in response to the second control information, executes the second task by using the target computing resource.