Task scheduling processing method and device, equipment and storage medium

Through the task scheduling method of splitting and dependency processing, the problem of concurrent resource operation of cloud platform in multi-cloud environment and multi-resource combination is solved, and the efficiency of task scheduling and system stability are improved.

CN119987965APending Publication Date: 2025-05-13华润数字科技有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510038618.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-09
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

When facing multi-cloud environments and multi-resource combinations, cloud platforms are difficult to effectively handle concurrent resource operations, resulting in system load imbalance and complex resource dependencies, affecting task scheduling efficiency.

Method used

By judging the task type of the resource request task, if it is a combination task, it is split into the main resource task and the sub-resource task, obtain the dependency between the sub-resource task, and process each sub-resource task in turn using the pre-stored execution template, and finally process the main resource task according to the processing results of the sub-resource task.

Benefits of technology

Effectively manage and schedule each sub-resource task, ensure that critical tasks are given priority, avoid performance bottlenecks and instability caused by resource competition, reduce the complexity of resource operation calls, and improve the efficiency of task scheduling and processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987965A_ABST
    Figure CN119987965A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a task scheduling processing method and device, equipment and a storage medium. The method comprises the steps that the task type of a resource request task is judged; if the resource request task belongs to the combined task, generating a main resource task and at least one sub-resource task according to the resource request task, and obtaining a dependency relationship between the sub-resource tasks; according to the dependency relationship, processing each sub-resource task according to the execution template corresponding to each sub-resource task in sequence; and when the processing results of all the sub-resource tasks meet a preset condition, calling an execution template corresponding to the main resource task to process the main resource task. According to the method, the resource request task is split, each sub-resource task is effectively managed and scheduled, key tasks are ensured to be processed preferentially, and the problems of performance bottleneck and instability caused by resource competition are avoided; in addition, the corresponding execution template is adopted when the sub-resource tasks are processed, the complexity can be reduced, and the processing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a task scheduling processing method, device, equipment and storage medium. Background Art

[0002] As a conversion layer for multi-cloud resource operations, the cloud platform faces the primary challenge of the complexity of the cloud environment. It must uniformly manage the different resource operation characteristics of different cloud service providers. In addition to facing a complex multi-cloud environment, the cloud platform also faces the complexity of multiple resource combinations. Taking the creation of an elastic cloud server as an example, you can choose x86 and arm as the architecture of the central processor, allocate the number of cores of the central processor, determine the type of operating system, and allocate high-performance storage from one manufacturer for the system and affordable large-capacity storage from another manufacturer for data storage. Set up the server network. The network and storage need to be created first before they can be used by the elastic cloud server. If they are not completed, the elastic cloud server cannot be created.

[0003] When facing a large number of concurrent resource operations, the cloud platform not only needs a limited flow mechanism to achieve balanced management of the system load and prevent resource overload, but also needs to balance the operation scheduling of different resources and the ability to handle complex and combined resource dependencies.

[0004] Therefore, there is an urgent need for a task scheduling method that can handle concurrent resource operations. Summary of the invention

[0005] The embodiments of the present invention provide a task scheduling processing method, device, equipment and storage medium, which can effectively process concurrent resource tasks and improve the task scheduling processing efficiency.

[0006] In a first aspect, an embodiment of the present invention provides a task scheduling processing method, the method comprising:

[0007] Determine the task type of the resource request task, the task type including a combined task;

[0008] If the resource request task belongs to the combined task, a main resource task and at least one sub-resource task are generated according to the resource request task, and a dependency relationship between each sub-resource task is obtained;

[0009] According to the dependency relationship, each sub-resource task is processed in turn according to the execution template corresponding to each sub-resource task;

[0010] When the processing results of all sub-resource tasks meet the preset conditions, the execution template corresponding to the main resource task is called to process the main resource task.

[0011] Further, the step of generating a main resource task and at least one sub-resource task according to the resource request task comprises:

[0012] generating the main resource task according to the functional unit associated with the resource request task;

[0013] generating each sub-resource task according to each sub-unit associated with the resource request task within the functional unit;

[0014] It is determined whether each generated sub-resource task constitutes a complete dependency relationship. If each generated sub-resource task does not constitute a complete dependency relationship, a sub-resource task corresponding to the missing sub-unit is generated according to the missing sub-unit.

[0015] Further, the steps of processing each sub-resource task according to the dependency relationship and the execution template corresponding to each sub-resource task in turn include:

[0016] According to the dependency relationship, each sub-resource task is added to the queue in turn;

[0017] For each sub-resource task, sequentially controlling the queue to request a task lock from the distributed key-value storage system;

[0018] If the queue successfully requests the task lock, each sub-resource task is executed;

[0019] If the queue fails to request the task lock, the queue is controlled again to request the task lock from the distributed key-value storage system after waiting for a preset time.

[0020] Furthermore, before the step of sequentially adding each sub-resource task to the queue according to the dependency relationship, the step includes:

[0021] Generate a queue key based on the identity information of each sub-resource task;

[0022] According to the queue key, determining whether a queue corresponding to the queue key exists;

[0023] If the queue does not exist, create the queue.

[0024] Furthermore, the task type also includes a single task, and the step of determining the task type of the resource request task includes:

[0025] Acquire the functional unit associated with the resource request task;

[0026] If there is a dependency relationship between the functional units, or there is a dependency relationship between the sub-units within the functional units, determining that the task type of the resource request task is the combined task;

[0027] Otherwise, it is determined that the type of the resource request task is the single task.

[0028] Furthermore, the task scheduling processing method also includes:

[0029] If the resource task request belongs to the single task, the resource request task is added to the queue.

[0030] Furthermore, before the step of determining the task type of the resource request task, the task scheduling processing method further includes:

[0031] Determine the task type of the resource request task, the resource type including complex resources;

[0032] When the resource type is the complex resource, the task type of the resource request task is determined.

[0033] In a second aspect, an embodiment of the present invention provides a task scheduling processing device, the device comprising:

[0034] A type module, used to determine the task type of the resource request task, wherein the task type includes a combined task;

[0035] A generating module, configured to generate a main resource task and at least one sub-resource task according to the resource request task if the resource request task belongs to the combined task, and obtain a dependency relationship between each sub-resource task;

[0036] A dependency module, used to process each sub-resource task in turn according to the dependency relationship and the execution template corresponding to each sub-resource task;

[0037] The execution module is used to process the main resource task according to the processing result of each sub-resource task and the execution template corresponding to the main resource task.

[0038] In a third aspect, an embodiment of the present invention provides a computer device, the device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0039] Memory, used to store computer programs;

[0040] The processor is used to implement the steps of the task scheduling processing method as described in any one of the first aspects when executing the program stored in the memory.

[0041] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the task scheduling processing method as described in any one of the items provided in the first aspect are implemented.

[0042] An embodiment of the present invention provides a task scheduling processing method, apparatus, device and storage medium. The method first determines the task type of a resource request task; when it is determined that the resource request task is a combined task, the resource request task is split into a main resource task and multiple sub-resource tasks, and the dependency relationship between these sub-resource tasks is obtained; each sub-resource task is processed in turn according to the dependency relationship, and the sub-resource task is processed using a pre-stored execution template to obtain the processing result of each sub-resource task; finally, the main resource task is processed according to the processing result of each sub-resource task and the execution template corresponding to the main resource task.

[0043] The embodiment of the present invention splits the resource request task and processes the sub-resource tasks in sequence according to the dependency relationship. In this way, each sub-resource task can be effectively managed and scheduled, ensuring that key tasks are processed first and avoiding performance bottlenecks and instability problems caused by resource competition. In addition, using corresponding execution templates when processing sub-resource tasks can reduce the complexity of resource operation calls, improve the efficiency of task scheduling processing, and solve the problem of long waiting times when resource dependencies exist. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0045] Figure 1 A flowchart of a task scheduling processing method provided by an embodiment of the present invention;

[0046] Figure 2 A flowchart of a resource request splitting task provided by an embodiment of the present invention;

[0047] Figure 3 A flowchart of a sub-resource task processing provided by an embodiment of the present invention;

[0048] Figure 4 A flowchart of a task scheduling processing method provided by an embodiment of the present invention;

[0049] Figure 5 A schematic diagram of the structure of a task scheduling processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0051] In order to make the description of the disclosed content more detailed and complete, the following is an illustrative description of the implementation mode and specific examples of the present invention; however, this is not the only form of implementing or applying the specific embodiments of the present invention. The implementation mode covers the features of multiple specific embodiments and the method steps and their sequence for constructing and operating these specific embodiments. However, other specific embodiments can also be used to achieve the same or equal functions and step sequences. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0052] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.

[0053] In the description of the embodiments of the present invention, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two, and other quantifiers are similar. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention, and the embodiments of the present application and the features in the embodiments may be combined with each other without conflict.

[0054] A task scheduling processing method provided in an embodiment of the present invention can be applied in a cloud platform, which refers to a platform that mainly provides computing, network and storage capabilities based on services of hardware resources and software resources; cloud computing platforms can be divided into the following three categories: storage-type cloud platforms that focus on data storage, computing-type cloud platforms that focus on data processing, and comprehensive cloud computing platforms that take both computing and data storage processing into account.

[0055] The server of the cloud platform can be used as the execution subject of the task scheduling processing method. When the client of the cloud platform needs to perform task scheduling processing, it sends a resource request task to the server of the cloud platform. After receiving the resource request task, the server executes the task scheduling processing method. Specifically, first determine the task type of the resource request task; when it is determined that the resource request task is a combined task, split the resource request task into a main resource task and multiple sub-resource tasks, and obtain the dependency relationship between these sub-resource tasks; process each sub-resource task in turn according to the dependency relationship, and use the pre-stored execution template to process the sub-resource task to obtain the processing result of each sub-resource task; finally, process the main resource task according to the processing result of each sub-resource task and the execution template corresponding to the main resource task.

[0056] The server can be implemented by an independent server or a server cluster composed of multiple servers. The client can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The client and the server can be connected via Bluetooth, USB (Universal Serial Bus) or other communication connection methods, which is not limited in the embodiments of the present invention.

[0057] Figure 1 A flowchart of a task scheduling method provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method includes:

[0058] S110, determining the task type of the resource request task, the task type including a combined task;

[0059] After receiving the resource request task, the task type of the resource request task is first determined. In the embodiment of the present invention, the task type can be a combined task or a single task.

[0060] The resource request task includes a functional unit and a specific operation. The functional unit can be regarded as a request object of the voluntary request task, and the specific operation can be regarded as a request operation on the functional unit. The request object can be a server, a private network, a disk, etc. The specific object type can be classified in advance according to the actual situation, and the embodiment of the present invention does not make specific restrictions on this. The request operation is an operation related to the request object.

[0061] For example, when the request object is a server, the request operation may be to request the server to perform a task, and the server's task execution involves sub-units such as the CPU (Central Processing Unit), memory, and disk, so requesting the server is a combined task; when the request object is a private network, the request operation may be to request the private network to establish a network connection, and to establish a network connection with a private network, it is necessary to first create a VPC (virtual private cloud), then establish a subnet, and finally obtain a route, which involves sub-units such as VPC, subnet, and route, so requesting a private network is a combined task; when the request object is a disk, the request operation may be to create a disk, and to create a disk, it is only necessary to open up a space on the disk, and does not involve other sub-units, so it is a single task.

[0062] S120, if the resource request task belongs to the combined task, generating a main resource task and at least one sub-resource task according to the resource request task, and obtaining a dependency relationship between each sub-resource task;

[0063] If it is determined that the resource request task belongs to a combined task, then the main resource task and multiple sub-resource tasks are split according to the resource request task, and there is a dependency relationship between each sub-resource task. Among them, if a sub-resource task needs to use the execution result of another sub-resource task when executing, then the sub-resource task depends on the other sub-resource task, and there is a dependency relationship between the two sub-resource tasks. Therefore, the dependency relationship between sub-resource tasks can be determined based on whether the sub-resource task needs to use the execution result of other sub-resource tasks when executing.

[0064] For example, for the resource request task of requesting a private network, you must first create a VPC for the network segment, then create a subnet on the VPC, and then take an IP (Internet Protocol Address) from the subnet to create a route. Then the resource request task of requesting a private network can be divided into four tasks: requesting a private network, creating a VPC, creating a subnet, and requesting a route. Since requesting a private network must rely on the execution results of the three tasks of creating a VPC, creating a subnet, and requesting a route, requesting a private network is the main resource task, and creating a VPC, creating a subnet, and requesting a route are three sub-resource tasks. Since creating a VPC, creating a subnet, and requesting a route must be executed in sequence, the dependency relationship between creating a VPC, creating a subnet, and requesting a route is: creating a VPC sub-resource task -> creating a subnet sub-resource task -> requesting a route sub-resource task.

[0065] S130, processing each sub-resource task in turn according to the dependency relationship and according to the execution template corresponding to each sub-resource task, wherein the execution template includes a plurality of minimum unit functions combined according to the business logic of the sub-resource task;

[0066] Then, according to the above-mentioned dependency relationship, each sub-resource task is processed by using the execution template corresponding to each sub-resource task in turn. Among them, the execution template includes a number of minimum unit functions combined according to the business logic of the sub-resource task. In the embodiment of the present invention, multiple minimum unit functions are prepared in advance according to business needs, such as the first minimum unit function, the second minimum unit function, ..., the Nth minimum unit function, and different minimum unit functions implement different functions. Different execution templates may combine different minimum unit functions according to the business needs to be implemented; different execution templates may combine the same minimum unit functions according to the business needs to be implemented, but the combination order of the minimum unit functions is different, which can be determined according to the actual situation, and the embodiment of the present invention does not make specific limitations on this.

[0067] In the above example of requesting a private network, first obtain the execution template corresponding to the Create VPC sub-resource task, and use the execution template to process the Create VPC sub-resource task to create a VPC of the network segment, such as creating a VPC of the 100.234.0.0 / 16 network segment; then obtain the execution template corresponding to the Create Subnet sub-resource task, and use the execution template to process the Create Subnet sub-resource task to create a subnet, such as creating a 100.234.56.0 / 24 IP address segment subnet on the VPC; finally, obtain the execution template corresponding to the Request Route sub-resource task, and use the execution template to process the Request Route sub-resource task to create a route, such as taking an IP from the subnet to create a route.

[0068] S140: When the processing results of all sub-resource tasks meet the preset conditions, the execution template corresponding to the main resource task is retrieved to process the main resource task.

[0069] In the embodiment of the present invention, after executing each sub-resource task, if the processing results of all sub-resource tasks meet the preset conditions, it means that all sub-resource tasks are executed successfully; after all sub-resource tasks are executed successfully, the execution results of all sub-resource tasks are directly called, and the main resource task is processed in combination with the execution template of the main resource task.

[0070] Among them, meeting the preset conditions indicates that the execution result of the sub-resource task is successful. The preset conditions corresponding to different sub-resource tasks may be different, which can be determined according to actual conditions. The embodiment of the present invention does not make specific limitations on this.

[0071] If the execution result of any sub-resource task does not meet the preset condition, it means that the execution result of the sub-resource task is failed, and the main resource task cannot be processed.

[0072] In the above private network example, the execution template corresponding to the private network request is obtained, and the main task resources are processed using the execution template, such as creating a custom firewall rule. After the firewall rule is created, a firewall policy is created and the firewall rule is applied to the firewall policy. When the firewall policy and route are created, they are bound to the private network and the private network is created.

[0073] An embodiment of the present invention provides a task scheduling processing method, which first determines the task type of a resource request task; when it is determined that the resource request task is a combined task, the resource request task is split into a main resource task and multiple sub-resource tasks, and the dependency relationship between these sub-resource tasks is obtained; each sub-resource task is processed in turn according to the dependency relationship, and the sub-resource task is processed using a pre-stored execution template to obtain the processing result of each sub-resource task; finally, the main resource task is processed according to the processing result of each sub-resource task and the execution template corresponding to the main resource task.

[0074] The embodiment of the present invention splits the resource request task and processes the sub-resource tasks in sequence according to the dependency relationship. In this way, each sub-resource task can be effectively managed and scheduled, ensuring that key tasks are processed first and avoiding performance bottlenecks and instability problems caused by resource competition. In addition, using corresponding execution templates when processing sub-resource tasks can reduce the complexity of resource operation calls, improve the efficiency of task scheduling processing, and solve the problem of long waiting times when resource dependencies exist.

[0075] As an implementation method, Figure 2 A flowchart of a resource request splitting task provided by an embodiment of the present invention is as follows: Figure 2 As shown, in step S120, generating a main resource task and at least one sub-resource task according to the resource request task includes:

[0076] S121, generating the main resource task according to the functional unit associated with the resource request task;

[0077] S122: Generate each sub-resource task according to each sub-unit associated with the resource request task within the functional unit.

[0078] S123, determining whether each generated sub-resource task constitutes a complete dependency relationship; if each generated sub-resource task does not constitute a complete dependency relationship, generating a sub-resource task corresponding to the missing sub-unit according to the missing sub-unit;

[0079] The process of generating the main resource task and each sub-resource task in the embodiment of the present invention can refer to the above embodiment, and this embodiment will not be repeated here. Generally, the generated sub-resource tasks have complete dependencies, but in order to ensure the accuracy and precision of the task scheduling method, after the sub-resource tasks are generated, it is necessary to determine whether these sub-resource tasks have complete dependencies. When it is determined that all sub-resource tasks do not form a complete dependency, the missing sub-units in the dependency are obtained, and sub-resource tasks are created based on the missing sub-units.

[0080] In the above private network example, the complete dependency relationship is: Create VPC sub-resource task -> Create subnet sub-resource task -> Request route sub-resource task. If the Create subnet sub-resource task is missing among all the generated sub-resource tasks, it will affect the execution of the Request private network main resource task. In this case, create the missing sub-resource task again.

[0081] In some embodiments, the execution template is a domain-specific language template that conforms to the text template or template template syntax in the Go language standard library.

[0082] In the embodiment of the present invention, the execution template is a domain-specific language template. The full name of the domain-specific language is Domain-Specific Language, also referred to as DSL. It is a programming language specially designed for a specific problem domain. Compared with general programming languages, DSL is more concise and easy to understand, and is usually used to express the intentions and rules of a specific domain.

[0083] The DSL template conforms to the text template or template template syntax in the Go language standard library. The Go language, also known as Golang, is a statically typed compiled language with performance close to C and C++, supports cross-platform compilation, has a rich standard library covering network programming, file operations, encryption, testing and other aspects, simple error handling mechanism, simple and efficient concurrency, etc. This makes the GO language particularly suitable for building cloud environments and high-performance backend applications.

[0084] In addition, text / template templates provide a flexible way to generate text output, which is often used in configuration files, HTML pages, or other scenarios that require dynamic content.

[0085] In the embodiment of the present invention, different underlying resources are retrieved in this way, and parameter differences of different resources are matched by executing templates, so that the process is simpler, easier to modify and maintain, and code redundancy is reduced.

[0086] As an implementation method, Figure 3 A flowchart of a processing sub-resource task provided by an embodiment of the present invention, such as Figure 3 As shown, step S130 includes: processing each sub-resource task in turn according to the execution template corresponding to each sub-resource task according to the dependency relationship, the steps include:

[0087] S131, adding each sub-resource task to the queue in sequence according to the dependency relationship;

[0088] In the embodiment of the present invention, each sub-resource task is added to the queue in turn according to the dependency relationship, wherein the sub-resource task at the front of the dependency relationship is added to the queue first, and the sub-resource task at the back of the dependency relationship is added to the queue later.

[0089] In the specific implementation process, before adding to the queue, it is necessary to first determine whether the queue exists. If the queue exists, it is directly added to the queue. If the queue does not exist, a new queue is created and then the sub-resource task is added to the queue.

[0090] S132, for each sub-resource task, sequentially controlling the queue to request a task lock from the distributed key-value storage system;

[0091] The queue executes each sub-resource task in a first-in-first-out manner. Taking the execution of any sub-resource task as an example, when preparing to execute the sub-resource task, the control queue first requests a task lock from the distributed key-value storage system (ETCD for short), and ETCD will provide a certain number of task locks according to the initial settings.

[0092] Among them, ETCD is a highly available distributed key-value storage system, which is mainly used for configuration management, service discovery and coordination services, and provides key-based distributed lock functions. For example: create lock function, the client requests a lock by creating a unique key in ETCD. If the creation is successful, it means that the sub-resource task has obtained the lock; release lock function, the client deletes the task lock after completing the sub-resource task, thereby releasing the task lock; timeout mechanism: in order to prevent deadlock, a TTL (Time To Live) value can be set for the lock. When the TTL expires, the task lock will be automatically released.

[0093] S133, if the queue successfully requests the task lock, then execute each sub-resource task;

[0094] If the queue request is successful, the sub-resource task is executed.

[0095] S134: If the queue fails to request the task lock, control the queue to request the task lock from the distributed key-value storage system again after waiting for a preset time.

[0096] If there is no idle task lock in ETCD, the queue request fails, and the task lock is requested from ETCD again after waiting for a preset time. The value of the preset time can be determined according to actual conditions, and the embodiment of the present invention does not specifically limit this. Generally, the preset time can be TTL, such as 1s.

[0097] It should be added that if the sub-resource task is blocked in the queue, the task lock will be released after other tasks are completed before the blocked sub-resource task can continue to execute; and in order to prevent deadlock, the task lock is automatically released when the time to acquire the task lock reaches the TTL time.

[0098] As an implementation manner, before the step of sequentially adding each sub-resource task to the queue according to the dependency relationship, the step includes:

[0099] Generate a queue key based on the identity information of each sub-resource task;

[0100] According to the queue key, determining whether a queue corresponding to the queue key exists;

[0101] If the queue does not exist, create the queue.

[0102] In the embodiment of the present invention, before adding each sub-resource task to the queue, it is necessary to determine whether the queue exists. Specifically, taking one of the sub-resource tasks as an example, a queue key is generated according to the identity information of the sub-resource task, and the queue key is associated with the identity information of the sub-resource task.

[0103] The identity information includes platform ID, region ID, resource type and operation type. The platform ID refers to the ID of the application cloud platform, and the region ID refers to the ID of the region where the sub-resource task is located. It can be seen that the queue key of each sub-resource task under the same main resource task is the same.

[0104] In many programming languages, data structures are usually composed of key-value pairs. A "key" is an identifier used to uniquely identify and access a corresponding "value", and in the embodiment of the present invention, the queue key and the queue constitute a "key-value" relationship.

[0105] Next, determine whether the queue corresponding to the queue key exists. If other sub-resource tasks have been executed before the sub-resource task is executed, the queue already exists. If the sub-resource task is the first to be executed, the queue does not exist and needs to be created.

[0106] In some embodiments, in step S110, the task type further includes a single task, and the step of determining the task type of the resource request task includes:

[0107] S111, obtaining a functional unit associated with the resource request task;

[0108] S112, if there is a dependency relationship between the functional units, or there is a dependency relationship between the sub-units within the functional units, determining that the task type of the resource request task is the combined task;

[0109] S113: Otherwise, determine that the type of the resource request task is the single task.

[0110] In the embodiment of the present invention, when obtaining the functional unit associated with the resource request task, if there are multiple functional units and there are dependencies between the multiple functional units; or if there is only one functional unit but there are dependencies between the sub-units contained in the functional unit, in these two cases, the task type of the resource request task can be determined to be a combined task. In other cases, the task type of the resource request task can be determined to be a single task.

[0111] As an implementation mode, the task scheduling processing method further includes:

[0112] If the resource task request belongs to the single task, the resource request task is added to the queue.

[0113] When it is determined that the resource request task is a single task, the resource request task is added to the queue. The time of adding the queue can be determined according to the actual situation, and the embodiment of the present invention does not specifically limit this. Generally, after all the sub-resource tasks of the combined task are added to the queue, the single task is added to the queue, so that the single task is executed last.

[0114] The process of executing a single task using an execution template is the same as the execution process of the above-mentioned sub-resource task. For details, please refer to the above-mentioned embodiment, which will not be described in detail in this embodiment.

[0115] In some embodiments, before the step of determining the task type of the resource request task, the task scheduling processing method further includes:

[0116] Determine the task type of the resource request task, the resource type including complex resources;

[0117] When the resource type is the complex resource, the task type of the resource request task is determined.

[0118] First, determine the resource type of the resource request task. In the embodiment of the present invention, the resource type includes complex resources and simple resources. The resource type is determined in advance and included in the resource request task. Therefore, only when the resource type is determined to be a complex resource, the task type of the subsequent resource request task will be determined.

[0119] It should be added that if it is determined that the resource type of the resource request task is a simple resource, this directly matches the execution template, and the resource request task is implemented using the execution template without joining the queue for processing.

[0120] Figure 4 A flowchart of a task scheduling method provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, the resource request task is first received, and the resource type of the resource request task is determined; if the resource type is a complex resource, it is further determined whether it is a combined task or a single task; if it is determined that the resource request task is a combined task, the resource request task is split into a main resource task and multiple sub-resource tasks; according to the dependency relationship, each sub-resource task is added to the queue in turn, and it is first determined whether there is a queue. If not, a queue is created. If it exists, it is directly added to the queue.

[0121] For each sub-resource task in the queue, the control queue requests a task lock from ETCD. If the task lock request is successful, the corresponding execution template is obtained and the sub-resource task is executed using the execution template. If the task lock request fails, the task lock is requested from ETCD again after waiting for a preset time.

[0122] After executing each sub-resource task, if each sub-resource task and the main resource task are executed successfully, all execution results are sent to ETCD for storage and returned to the client through MQ information; if any sub-resource task or main resource task fails to execute, the return results of other successful executions are deleted.

[0123] If the task type of the resource request task is a single task, the resource request task is added to the queue, and the subsequent processing process is the same as that of the sub-resource task, which will not be repeated here.

[0124] If the task type of the resource request task is a simple type, the execution template is directly matched, and the resource request task is executed using the successfully matched execution template.

[0125] Figure 5 A structural diagram of a task scheduling processing device provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown, the device comprises:

[0126] A type module 510, used to determine the task type of the resource request task, wherein the task type includes a combined task;

[0127] A generating module 520, configured to generate a main resource task and at least one sub-resource task according to the resource request task if the resource request task belongs to the combined task, and obtain a dependency relationship between each sub-resource task;

[0128] A dependency module 530, for processing each sub-resource task in turn according to the dependency relationship and according to the execution template corresponding to each sub-resource task, wherein the execution template includes a number of minimum unit functions combined according to the business logic of the sub-resource task;

[0129] The execution module 540 is used to call the execution template corresponding to the main resource task to process the main resource task when the processing results of all sub-resource tasks meet the preset conditions.

[0130] This embodiment is a device embodiment corresponding to the above method embodiment, and its specific implementation process is the same as that of the above method embodiment. For details, please refer to the above method embodiment, and this device embodiment will not elaborate on it.

[0131] Based on the above task scheduling processing method, an embodiment of the present invention further provides a computer device, the computer device includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;

[0132] Memory, used to store computer programs;

[0133] The processor is used to implement the steps of the above-mentioned task scheduling processing method when executing the program stored in the memory.

[0134] For other details about the processor in the above-mentioned computer device implementing the above-mentioned technical solution, please refer to the description of the task scheduling processing method provided in the above-mentioned invention embodiment, which will not be repeated here.

[0135] Among them, the processor can also be called CPU (Central Processing Unit), the processor may be an integrated circuit chip with signal processing capabilities; the processor can also be a general-purpose processor, DSP (Digital Signal Process), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, among which the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0136] The embodiment of the present invention also provides a computer-readable storage medium, on which a readable computer program is stored; wherein the computer program can be stored in the above storage medium in the form of a software product, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, magnetic disk or optical disk, ROM (Read-Only Memory), RAM (Random Access Memory) and other media that can store program codes, or terminal devices such as computers, servers, mobile phones, and tablets.

[0137] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0138] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0139] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0140] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0141] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0142] The technical solution provided by the present application is introduced in detail above. The principles and implementation methods of the present application are explained by using specific examples in the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0143] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0144] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0145] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0146] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0147] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A task scheduling processing method, characterized in that: The method comprises: Determine the task type of the resource request task, the task type including a combined task; If the resource request task belongs to the combined task, a main resource task and at least one sub-resource task are generated according to the resource request task, and a dependency relationship between each sub-resource task is obtained; According to the dependency relationship, each sub-resource task is processed in turn according to the execution template corresponding to each sub-resource task; When the processing results of all sub-resource tasks meet the preset conditions, the execution template corresponding to the main resource task is called to process the main resource task.

2. The task scheduling processing method according to claim 1, characterized in that: The step of generating a main resource task and at least one sub-resource task according to the resource request task comprises: generating the main resource task according to the functional unit associated with the resource request task; generating each sub-resource task according to each sub-unit associated with the resource request task within the functional unit; It is determined whether each generated sub-resource task constitutes a complete dependency relationship. If each generated sub-resource task does not constitute a complete dependency relationship, a sub-resource task corresponding to the missing sub-unit is generated according to the missing sub-unit.

3. The task scheduling processing method according to claim 1, characterized in that: The steps of processing each sub-resource task according to the dependency relationship and the execution template corresponding to each sub-resource task in turn include: According to the dependency relationship, each sub-resource task is added to the queue in turn; For each sub-resource task, sequentially controlling the queue to request a task lock from the distributed key-value storage system; If the queue successfully requests the task lock, each sub-resource task is executed; If the queue fails to request the task lock, the queue is controlled again to request the task lock from the distributed key-value storage system after waiting for a preset time.

4. The task scheduling processing method according to claim 3 is characterized in that: Before the step of sequentially adding each sub-resource task to the queue according to the dependency relationship, the step includes: Generate a queue key based on the identity information of each sub-resource task; According to the queue key, determining whether a queue corresponding to the queue key exists; If the queue does not exist, create the queue.

5. The task scheduling processing method according to claim 1, characterized in that: The task type also includes a single task, and the step of determining the task type of the resource request task includes: Acquire the functional unit associated with the resource request task; If there is a dependency relationship between the functional units, or there is a dependency relationship between the sub-units within the functional units, determining that the task type of the resource request task is the combined task; Otherwise, it is determined that the type of the resource request task is the single task.

6. The task scheduling processing method according to claim 3, characterized in that: The task scheduling processing method also includes: If the resource task request belongs to the single task, the resource request task is added to the queue.

7. The task scheduling processing method according to any one of claims 1 to 6, characterized in that: Before the step of determining the task type of the resource request task, the task scheduling processing method further includes: Determine the task type of the resource request task, the resource type including complex resources; When the resource type is the complex resource, the task type of the resource request task is determined.

8. A task scheduling processing device, characterized in that: The device comprises: A type module, used to determine the task type of the resource request task, wherein the task type includes a combined task; A generating module, configured to generate a main resource task and at least one sub-resource task according to the resource request task if the resource request task belongs to the combined task, and obtain a dependency relationship between each sub-resource task; A dependency module, used to process each sub-resource task in turn according to the dependency relationship and the execution template corresponding to each sub-resource task; The execution module is used to call the execution template corresponding to the main resource task to process the main resource task when the processing results of all sub-resource tasks meet the preset conditions.

9. A computer device, characterized in that: The device includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; The processor is used to implement the steps of the task scheduling processing method described in any one of claims 1 to 7 when executing the program stored in the memory.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the task scheduling processing method according to any one of claims 1 to 7 are implemented.