Task function processing method, device, equipment, storage medium and program product

By generating task function processing queues in the function computing platform and scheduling based on these queues, the response delay problem caused by the differences in execution environments of functions in different development languages ​​is solved, and the overall response speed of the platform is improved.

CN115061791BActive Publication Date: 2025-02-07INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210661122.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-13
Publication Date
2025-02-07
Estimated Expiration
2042-06-13

AI Technical Summary

Technical Problem

In the function computing platform, since business functions of different development languages ​​correspond to different execution environments, the problem of not responding to all functions in a timely manner when a large number of function schedules are run.

Method used

By obtaining the dependencies between task functions to be scheduled in the current production environment, multiple task function processing queues are generated. Task functions of the same type of execution environment are in the same queue and are scheduled based on these queues to optimize the task function's Perform environment allocation.

Benefits of technology

This method reduces the response delay of the initial execution environment and improves the overall response speed of the function computing platform by preparing a suitable execution environment in advance and a reasonable scheduling strategy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115061791B_ABST
    Figure CN115061791B_ABST
Patent Text Reader

Abstract

The present application relates to a task function processing method, device, equipment, storage medium and program product. According to the workflow information of the current production environment, the dependency relationship between the task functions to be scheduled in the current production environment is obtained, and then according to the execution environment type of the task function and the dependency relationship between the task functions, multiple task function processing queues are generated, and based on each task function processing queue, each task function is scheduled and processed. This method improves the overall response speed of the function computing platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a task function processing method, device, equipment, storage medium and program product. Background Art

[0002] As a serverless architecture, Function Compute eliminates the need for business development to worry about the management of underlying servers. Instead, you only need to focus on application layer development of business logic, making business development more professional and enabling faster iteration of business products.

[0003] Typically, developers can create multiple business functions on the function computing platform and combine them into a workflow according to business requirements to complete a set of specific business functions. However, different business functions are developed in different languages ​​and require their own execution environments. When there are a large number of functions that need to be scheduled and run on the function computing platform, since business functions in different development languages ​​correspond to different execution environments, there will be a problem of not being able to respond to all functions in a timely manner.

[0004] Therefore, how to improve the response speed of functions in the workflow is an urgent problem to be solved. Summary of the invention

[0005] Based on this, it is necessary to provide a task function processing method, device, equipment, storage medium and program product to address the above technical problems, which can improve the response speed of functions in the workflow.

[0006] In a first aspect, the present application provides a task function processing method, the method comprising:

[0007] According to the workflow information of the current production environment, obtain the dependency relationship between the task functions to be scheduled in the current production environment;

[0008] According to the execution environment type of the task function and the dependency relationship between the task functions, multiple task function processing queues are generated; task functions of the same type of execution environment are in the same task function processing queue;

[0009] Based on the processing queue of each task function, each task function is scheduled and processed.

[0010] In one embodiment, each task function is scheduled based on each task function processing queue, including:

[0011] Obtain the scheduling strategy of each task function processing queue and the execution environment corresponding to each task function processing queue;

[0012] According to each scheduling strategy in the corresponding execution environment, the task functions in each task function processing queue are scheduled and processed.

[0013] In one embodiment, obtaining the execution environment corresponding to each task function processing queue includes:

[0014] Get the types of each execution environment in the current production environment;

[0015] According to the types of execution environments in the current production environment and the types of execution environments required by each task function processing queue, the execution environment corresponding to each task function processing queue is determined.

[0016] In one embodiment, determining the execution environment corresponding to each task function processing queue according to the type of each execution environment in the current production environment and the type of execution environment required by each task function processing queue includes:

[0017] For any task function processing queue, if there is an execution environment of the same type as the task function processing queue among the execution environments in the current production environment, and the execution environment meets the preset execution conditions, then the execution environment of the same type in the current production environment is determined as the execution environment of the task function processing queue;

[0018] Otherwise, create a corresponding execution environment for the task function processing queue in the current production environment.

[0019] In one embodiment, the execution environment satisfies the preset execution condition including: the use state of the execution environment is an idle state, or the use state of the execution environment is a used state but the time for waiting for the end of the use of the execution environment is less than a preset time.

[0020] In one embodiment, creating a corresponding execution environment for a task function processing queue in a current production environment includes:

[0021] Obtain the idle computing resources of all computer devices in the current production environment;

[0022] If the idle computing resources are greater than the occupied resources required by the execution environment of the task function processing queue, the corresponding execution environment is created for the task function processing queue using the idle computing resources;

[0023] If the idle computing resources are less than the occupied resources required by the execution environment of the task function processing queue, a corresponding execution environment is created for the task function processing queue in a backup environment creation manner.

[0024] In one embodiment, creating a corresponding execution environment for a task function processing queue in a backup environment creation manner includes:

[0025] Traverse all computer devices in the current production environment to obtain a target computer device that is not currently executing a task; the computing resources of the target computer device are greater than the occupied resources required by the task function processing queue;

[0026] After deleting the existing execution environment in the target computer device, a corresponding execution environment is created using the computing resources in the target computer device as the task function processing queue.

[0027] In a second aspect, the present application further provides a task function processing device, the device comprising:

[0028] The acquisition module is used to obtain the dependency relationship between the task functions to be scheduled in the current production environment according to the workflow information of the current production environment;

[0029] A generation module, used to generate multiple task function processing queues according to the execution environment type of the task function and the dependency relationship between the task functions; task functions of the same type of execution environment are in the same task function processing queue;

[0030] The scheduling module is used to schedule each task function based on the processing queue of each task function.

[0031] In a third aspect, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any one of the methods provided in the embodiment of the first aspect are implemented.

[0032] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any one of the methods provided in the embodiment of the first aspect above are implemented.

[0033] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any one of the methods provided in the embodiments of the first aspect above.

[0034] The embodiment of the present application provides a task function processing method, device, equipment, storage medium and program product, which obtains the dependency between the task functions to be scheduled in the current production environment according to the workflow information of the current production environment, and then generates multiple task function processing queues according to the execution environment type of the task function and the dependency between the task functions, and schedules each task function based on each task function processing queue. In this method, multiple task function processing queues are determined according to the dependency between the task functions and the execution environment type of each task function, so that the appropriate function is executed at the appropriate time, and the task functions of the same type of execution environment are in the same task function processing queue, and each task function is queued, and the execution environment required by the task function processing queue is prepared in advance, and each task function processing queue is uniformly scheduled, which reduces the response delay caused by the initialization of the execution environment and improves the overall response speed of the function computing platform. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 An application environment diagram of a task function processing method in an embodiment;

[0036] Figure 2 A flowchart of a task function processing method in one embodiment;

[0037] Figure 3 is a flowchart of a task function processing method in another embodiment;

[0038] Figure 4 is a flowchart of a task function processing method in another embodiment;

[0039] Figure 5 is a flowchart of a task function processing method in another embodiment;

[0040] Figure 6 is a flowchart of a task function processing method in another embodiment;

[0041] Figure 7 is a flowchart of a task function processing method in another embodiment;

[0042] Figure 8 is a flowchart of a task function processing method in another embodiment;

[0043] Fig. 9 A schematic diagram of the structure of a task function processing system in one embodiment;

[0044] Fig.10 A schematic diagram of the structure of a task function processing system in another embodiment;

[0045] Fig.11 A schematic diagram of the structure of a task function processing system in another embodiment;

[0046] Fig.12 A schematic diagram of the structure of a task function processing system in another embodiment;

[0047] Fig.13 is a structural block diagram of a task function processing device in one embodiment;

[0048] Fig.14 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

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

[0050] The task function processing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the client 102 communicates with the function computing platform 104 through the network. The data storage system can store the data that the function computing platform 104 needs to process. The data storage system can be integrated on the function computing platform 104, or it can be placed on the cloud or other network servers. Among them, the client 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, etc.

[0051] Embodiments of the present application provide a task function processing method, apparatus, device, storage medium, and program product, which can improve the response speed of functions in a workflow.

[0052] The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments.

[0053] In one embodiment, a task function processing method is provided to be applied to Figure 1 Taking the application environment in as an example, this embodiment involves a specific process of obtaining the dependency relationship between the task functions to be scheduled in the current production environment according to the workflow information of the current production environment, and then generating multiple task function processing queues according to the execution environment type of the task function and the dependency relationship between the task functions, and scheduling each task function based on each task function processing queue, such as Figure 2 As shown, this embodiment includes the following steps:

[0054] S201, obtaining the dependency relationship between each task function to be scheduled in the current production environment according to the workflow information of the current production environment.

[0055] The production environment refers to an environment that officially provides services to the outside world, is deployed on a server, and is accessible to customers. It contains all functions. The current production environment is the production environment that has been deployed on the Function Compute platform.

[0056] Workflow refers to "the automation of part or all of a business process in a computer application environment". It is an abstract and general description of the business rules between the workflow and its various operating steps. In computers, workflow is part of computer-supported collaborative work. The main problem that workflow solves is to use computers to automatically transfer documents, information or tasks between multiple participants according to certain predetermined rules in order to achieve a certain business goal.

[0057] The function computing platform supports workflows, which are fully managed cloud services for distributed task collaboration. They support underlying computing resources such as function computing to achieve business orchestration. That is, when users need to perform business demand calculations, they combine business needs into a workflow to achieve business functions. One workflow contains multiple task functions.

[0058] It should be noted that in the actual current production environment, there will be multiple workflows, and the functions in each workflow may have dependencies; therefore, the dependencies between the task functions to be scheduled in the current production environment can be obtained based on the workflow information of the current production environment.

[0059] Function dependency is used to describe situations where relational functions are mutually constrained and interdependent. For example, there is a dependency relationship between function A and function B, and the dependency relationship may be that function A must be executed before function B.

[0060] S202, generating a plurality of task function processing queues according to the execution environment type of the task function and the dependency relationship between the task functions; task functions in the same type of execution environment are placed in the same task function processing queue.

[0061] The execution environment is an object of a built-in specification type. This object cannot be used by written code and is only generated to maintain the execution program. This object is associated with each executable code area in the source code text, such as global code, function code, etc.

[0062] A task function corresponds to a development language, such as Java, Python, etc. Therefore, each task function corresponds to an execution environment, that is, the task function of Java corresponds to the Java execution environment, and the task function of Python corresponds to the Python execution environment; the execution environment is also called the container environment.

[0063] Therefore, multiple task function processing queues can be generated according to the execution environment type of each task function and the functional dependencies between tasks, wherein task functions of the same type of execution environment are in the same task function processing queue, and each task function processing queue takes into account the dependencies between the task functions.

[0064] For example, when generating a task function processing queue, if function A and function B are in the same task function processing queue, and function A has a dependency relationship with function B, and function A is a pre-dependent function of function B, function A is placed before function B.

[0065] S203, scheduling each task function based on each task function processing queue.

[0066] When scheduling each task function processing queue, each task function is scheduled through the execution environment corresponding to each task function. Specifically, according to the execution environment type corresponding to each task function processing queue, the execution environment corresponding to the execution environment type is obtained in the current production environment, and the functions in the corresponding task function processing queue are scheduled according to the execution environment.

[0067] Optionally, each task function processing queue is scheduled and processed separately. Specifically, when processing each task function processing queue, each task function in each task function processing queue can be scheduled and processed separately according to a preset priority rule.

[0068] In the above-mentioned task function processing method, the dependency relationship between the task functions to be scheduled in the current production environment is obtained according to the workflow information of the current production environment, and then multiple task function processing queues are generated according to the execution environment type of the task function and the dependency relationship between the task functions, and each task function is scheduled based on each task function processing queue. In this method, multiple task function processing queues are determined according to the dependency relationship between the task functions and the execution environment type of each task function, so that the appropriate function is executed at the appropriate time, and the task functions of the same type of execution environment are in the same task function processing queue, and each task function is queued, and the execution environment required by the task function processing queue is prepared in advance, and each task function processing queue is uniformly scheduled, which reduces the response delay caused by initializing the execution environment and improves the overall response speed of the function computing platform.

[0069] Based on the above embodiment, the specific process of scheduling each task function is described below through an embodiment. In one embodiment, Figure 3 As shown, based on the processing queue of each task function, each task function is scheduled and processed, including the following steps:

[0070] S301, obtaining the scheduling strategy of each task function processing queue and the execution environment corresponding to each task function processing queue.

[0071] Scheduling strategies include: first-in-first-out strategy, last-in-last-out strategy, shortest job first strategy, and ready time first strategy; among them, the first-in-first-out strategy is to process in the order of entering the queue, and the first queued is processed first; the last-in-first-out strategy is to process the last queued first; the shortest job first strategy is to process the task function with the shortest execution time first; the ready time first strategy is to process the task function whose predecessor dependent function ends the earliest first.

[0072] In practical applications, a corresponding scheduling strategy is set for each task function processing queue according to actual conditions, which is not limited in the application embodiment.

[0073] Optionally, the information database of the current production environment stores scheduling strategies corresponding to each execution environment type. Therefore, the scheduling strategy of each task function processing queue can be determined based on the correspondence between the execution environment type and the scheduling strategy in the information database, and the corresponding execution environment can be obtained in the current production environment based on the execution environment type of each task function processing queue.

[0074] S302 , scheduling the task functions in each task function processing queue in the corresponding execution environment according to each scheduling strategy.

[0075] Based on the above scheduling strategies, the task functions in each task function processing queue are scheduled in the corresponding execution environment.

[0076] Specifically, each task function processing queue is scheduled and processed according to the scheduling strategy and execution environment corresponding to each task function, that is, each task function processing queue processes each task function in the task function processing queue using the corresponding scheduling strategy according to the corresponding execution environment.

[0077] Optionally, when scheduling the A task function processing queue, when any function in the A task function processing queue is scheduled, the function with a pre-dependency relationship with the scheduled function has been processed. Otherwise, the function will not be scheduled during this scheduling, and the next function will continue to be executed according to the scheduling strategy.

[0078] In the above-mentioned task function processing method, the scheduling strategy of each task function processing queue and the execution environment corresponding to each task function processing queue are obtained, and then the task functions in each task function processing queue are scheduled and processed in the corresponding execution environment according to each scheduling strategy. In this method, each task function is scheduled and processed according to the scheduling strategy and execution environment of each task function processing queue, which improves the overall response speed of the function computing platform.

[0079] In one embodiment, Figure 4 As shown, obtaining the execution environment corresponding to each task function processing queue includes the following steps:

[0080] S401, obtaining the type of each execution environment in the current production environment.

[0081] The type of the execution environment in the current production environment can be obtained in the environment information library of the current production environment. The execution environment types include Java execution environment, Python execution environment, C execution environment, C# execution environment, C++ execution environment, etc.

[0082] S402 , determining the execution environment corresponding to each task function processing queue according to the type of each execution environment in the current production environment and the type of execution environment required by each task function processing queue.

[0083] It is possible to search among the types of various execution environments in the current production environment whether there is a type of execution environment required by each task function processing queue.

[0084] For any task function processing queue, if the type of execution environment required by the task function processing queue exists among the types of execution environments in the current production environment, the execution environment corresponding to the execution environment type is determined as the execution environment of the task function processing queue; if the type of execution environment required by the task function processing queue does not exist among the types of execution environments in the current production environment, the execution environment corresponding to the task function processing queue will be created in the current production environment.

[0085] In the above task function processing method, the types of each execution environment in the current production environment are obtained, and the execution environment corresponding to each task function processing queue is determined according to the types of each execution environment in the current production environment and the types of execution environments required by each task function processing queue. This method allocates a corresponding execution environment to each task function processing queue, further improving the overall response speed of the function computing platform.

[0086] In one embodiment, Figure 5 As shown, according to the types of execution environments in the current production environment and the types of execution environments required by each task function processing queue, determining the execution environment corresponding to each task function processing queue includes the following steps:

[0087] S501, for any task function processing queue, if there is an execution environment of the same type as the task function processing queue in each execution environment in the current production environment, and the execution environment meets the preset execution conditions, then the execution environment of the same type in the current production environment is determined as the execution environment of the task function processing queue.

[0088] For any task function processing queue, before determining the execution environment corresponding to each task function processing queue, first, determine whether the type of each execution environment in the current production environment is the same as the execution environment type of the corresponding task function processing queue, and if the execution environment meets the preset execution conditions, then the execution environment of the same type in the current production environment is determined as the execution environment of the task function processing queue.

[0089] In one embodiment, the execution environment satisfies the preset execution condition, including: the use state of the execution environment is an idle state, or the use state of the execution environment is a used state but the time for waiting for the end of the use of the execution environment is less than a preset time.

[0090] The execution environment of the task function processing queue can be determined as follows: if there is an execution environment of the same type as the execution environment corresponding to the task function processing queue among the types of execution environments in the current production environment, and there is an execution environment in an idle state among the execution environments, then the execution environment in the idle state is determined as the execution environment of the task function processing queue.

[0091] For example, if the execution environment of task function processing queue A is a Java execution environment, there is a Java execution environment in the current production environment, and there is an idle Java execution environment, that is, unused, then the idle Java environment is determined as the execution environment of task function processing queue A.

[0092] Optionally, the execution environment of the task function processing queue can also be determined as follows: if there is an execution environment of the same type as the execution environment corresponding to the task function processing queue among the types of execution environments in the current production environment, and all execution environments are in use, but the time required to wait for the execution environment in use to end is less than a preset time, then the execution environment can be determined as the execution environment of the task function processing queue.

[0093] For example, if the execution environment of task function processing queue A is a Java execution environment, there is a Java execution environment in the current production environment, and all Java execution environments are in use, but there is a Java execution environment that needs to wait for the use time of the Java execution environment in use to end less than the preset time, then the Java execution environment that has ended in use less than the preset time will be determined as the execution environment of the task function processing queue.

[0094] It should be noted that there may be multiple execution environments of the same type in the current production environment.

[0095] S502, creating a corresponding execution environment for the task function processing queue in the current production environment.

[0096] If there is no execution environment of the same type as the execution environment corresponding to the task function processing queue among the types of execution environments in the current production environment, a corresponding execution environment is created for the task function processing queue in the current production environment.

[0097] For example, the type of execution environment corresponding to the A task function processing queue is a Java execution environment, but the Java execution environment does not exist in the current production environment. In this case, a Java-type execution environment needs to be created for the A task function processing queue.

[0098] Optionally, if there is an execution environment corresponding to the task function processing queue among the types of execution environments in the current production environment, but the execution environments are all in use, and the time required to wait for the execution environment in use to end is greater than or equal to the preset time, then it is necessary to create a corresponding execution environment for the task function processing queue in the current production environment.

[0099] For example, the type of execution environment corresponding to task function processing queue A is a Java execution environment. There is a Java execution environment in the current production environment, but all the Java execution environments in the current production environment are in use, and the length of time that the Java execution environments in use in the current production environment have ended is greater than or equal to the preset length of time. In this case, it is necessary to create a corresponding execution environment for the task function processing queue in the current production environment.

[0100] In the above task function processing method, for any task function processing queue, if there is an execution environment of the same type as the task function processing queue in each execution environment in the current production environment, and the execution environment meets the preset execution conditions, then the execution environment of the same type in the current production environment is determined as the execution environment of the task function processing queue, otherwise, a corresponding execution environment is created for the task function processing queue in the current production environment. This method timely allocates the corresponding execution environment to each task function processing queue, thereby improving the response speed of the function computing platform.

[0101] Based on the above embodiment, a corresponding execution environment is created for the task function processing queue in the current production environment. The following is a detailed description of this through an embodiment. In one embodiment, Figure 6 As shown, creating a corresponding execution environment for the task function processing queue in the current production environment includes the following steps:

[0102] S601, obtaining idle computing resources of all computer devices in the current production environment.

[0103] The current production environment includes multiple computer devices, and the execution environments in the current production environment are all installed in the computer devices. Optionally, the computer devices may be physical machines or virtual machines.

[0104] Creating a corresponding execution environment for the task function processing queue in the current production environment is essentially creating a corresponding execution environment for the task function processing queue on a computer device in the current production environment.

[0105] Therefore, before creating an execution environment for the task function processing queue, it is necessary to obtain the idle computing resources of all computer devices in the current environment, that is, the remaining available resources in the computer devices.

[0106] S602: If the idle computing resources are greater than the occupied resources required by the execution environment of the task function processing queue, a corresponding execution environment is created for the task function processing queue using the idle computing resources.

[0107] If there is a computer device whose idle computing resources are greater than the occupied resources required by the execution environment of the task function processing queue, then an idle computing resource on this computer device is used to create a corresponding execution environment for the task function processing queue.

[0108] S603: If the idle computing resources are smaller than the occupied resources required by the execution environment of the task function processing queue, a corresponding execution environment is created for the task function processing queue in a backup environment creation manner.

[0109] If the idle computing resources of all computer devices in the current production environment are less than the occupied resources required by the execution environment of the task function processing queue, a backup environment creation method is used to create a corresponding execution environment for the task function processing queue.

[0110] In the above-mentioned task function processing method, the idle computing resources of all computer devices in the current production environment are obtained. If the idle computing resources are greater than the occupied resources required by the execution environment of the task function processing queue, the corresponding execution environment is created for the task function processing queue using the idle computing resources. If the idle computing resources are less than the occupied resources required by the execution environment of the task function processing queue, the corresponding execution environment is created for the task function processing queue using the backup environment creation method. This method proposes a method for creating an execution environment for a task function processing queue, which can allocate a corresponding execution environment to the task function processing queue in a timely manner, thereby improving the response speed of the function computing platform.

[0111] In the above embodiment, it is proposed that if the idle computing resources are less than the occupied resources required by the execution environment of the task function processing queue, a corresponding execution environment is created for the task function processing queue in a backup environment creation manner. The following is a detailed description of creating a corresponding execution environment for the task function processing queue in a backup environment creation manner through an embodiment. In one embodiment, Figure 7 As shown, creating a corresponding execution environment for the task function processing queue in a backup environment creation manner includes the following steps:

[0112] S701, traverse all computer devices in the current production environment to obtain a target computer device that is not currently executing a task; the computing resources of the target computer device are greater than the occupied resources required by the task function processing queue.

[0113] If the idle computing resources of all computers in the current production environment are less than the occupied resources required by the execution environment of the task function processing queue, then all computer devices in the current production environment are traversed to obtain a computer device with sufficient resources and not executing any tasks, and the computer device is determined as the target computer device. Optionally, the sufficient resources are that the initial computing resources of the computer device are greater than the occupied resources required by the task function processing queue.

[0114] S702, after deleting the existing execution environment in the target computer device, create a corresponding execution environment using the computing resources in the target computer device as the task function processing queue.

[0115] After the target computer device is determined, all execution environments of the target computer device are deleted, and then a corresponding execution environment is created in the target computer device with the initial computing resources as the task function processing queue.

[0116] Optionally, if after traversing all computer devices in the current production environment, there is no computer device with sufficient computing resources and not executing any tasks, the task function processing queue needs to wait for the corresponding execution environment in the current production environment to be idle.

[0117] In the above-mentioned task function processing method, all computer devices in the current production environment are traversed to obtain the target computer device that is not currently executing the task, and after deleting the existing execution environment in the target computer device, the computing resources in the target computer device are used to create a corresponding execution environment for the task function processing queue. In this method, the computing resources of the target computer device are greater than the occupied resources required by the task function processing queue. By determining the computer device in the current production environment to create a corresponding execution environment for the task function processing queue, the response speed of the function computing platform is improved.

[0118] In one embodiment, Figure 8 As shown, taking the task function processing queue as a task function group as an example, this embodiment includes:

[0119] S801, grouping the task functions in the function computing platform according to the dependency relationship of the task functions in each workflow information and the type of the execution environment of each task function to obtain a plurality of task function groups.

[0120] Among them, the execution environment of each task function in the same task function group is the same.

[0121] S802, when scheduling each task function group, first traverse all execution environments in the function computing platform. If there is an execution environment type that meets the task function group and is not in use, then this execution environment is determined as the execution environment of the task function group.

[0122] S803, if there is an execution environment type that meets the task function group in the function computing platform, but the execution environment is being used, wait for the execution environment to be unused, and determine the execution environment as the execution environment of the task function group.

[0123] S804: If there is no execution environment that satisfies the task function group on the function computing platform, traverse the computer devices in the function computing platform to obtain a computer device that satisfies the creation condition, and create an execution environment for the task function group on the computer device;

[0124] The computer equipment includes physical machines and virtual machines, and the creation conditions include that the idle computing resources are greater than the resources required by the execution environment of the task function group.

[0125] S805, if the idle resources on the computer devices in the function computing platform are insufficient and the execution environment of the function computing platform cannot be created, then traverse the computer devices of the function computing platform, find a computer device with sufficient computing resources but not executing any tasks, remove the execution environment of the computer device, and create an execution environment for the task function group; if it does not exist, the task function group continues to queue.

[0126] S806, scheduling each task function group for execution according to the execution environment of each task function group and the scheduling strategy corresponding to each task function group;

[0127] Among them, the scheduling strategies include first-in-first-out, last-in-last-out, shortest job first and ready time first.

[0128] The specific limitations of the task function processing method provided in this embodiment can be found in the above step limitations of each embodiment of the task function processing method, which will not be repeated here.

[0129] It should be understood that, although each step in the attached flow chart in the above-described embodiment is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is clear explanation in this article, the execution of these steps does not have strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the attached figure in the above-described embodiment may include a plurality of steps or a plurality of stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of the steps or stages in other steps or other steps.

[0130] In one embodiment, Fig. 9 As shown, the embodiment of the present application also provides a task function processing system 900, which includes: a function queue module 901, a function scheduling module 902, and a function environment module 903. The function queue module 901 is connected to the function scheduling module 902, the function queue module 901 is connected to the function environment module 903, and the function scheduling module 902 is connected to the function environment module 903, wherein:

[0131] The function queue module 901 is used to queue the functions to be scheduled according to the function dependencies on all workflows. Functions of different workflows participate in queuing and scheduling together. In the actual production environment, there will be multiple different workflows to be executed at the same time.

[0132] The function scheduling module 902 is used to configure multiple scheduling strategies to process the task functions in the queue in sequence according to the scheduling strategies, and configure multiple scheduling strategies to take into account the differences between different task functions and execution environments.

[0133] Among them, the scheduling strategies include but are not limited to the following: first-in-first-out, which means processing in the order of entering the queue, and the first queued ones are processed first; last-in-first-out, which means processing the last queued ones first; shortest job first, which means processing the task function with the shortest execution time first; ready time first, which means processing the task function whose predecessor dependent function ends the earliest first.

[0134] The function environment module 903 is used to save the underlying environment resource information of the function platform and manage the computer equipment and execution environment as needed, such as creating and destroying the execution environment.

[0135] In one embodiment, Fig.10 As shown, the function queue module 901 includes:

[0136] The function queue unit 1001 is used to queue the functions to be scheduled according to the function dependencies on the workflow.

[0137] In one embodiment, Fig.11 As shown, the function scheduling module 902 includes:

[0138] The scheduling strategy unit 1101 is used to configure multiple scheduling strategies, including first-in-first-out, last-in-first-out, shortest job first, and limited ready time, and process the task functions in the queue in sequence.

[0139] In one embodiment, Fig.12 As shown, the function environment module 903 includes:

[0140] The environment information unit 1201 is used to store the underlying environment resource information of the function platform.

[0141] The environment change unit 1202 is used to manage the computer device and the execution environment as needed, such as creating and destroying the execution environment.

[0142] In one embodiment, Fig.13 As shown, the embodiment of the present application also provides a task function processing device 1300, the device 1300 includes: an acquisition module 1301, a generation module 1302 and a scheduling module 13043, wherein:

[0143] The acquisition module 1301 is used to acquire the dependency relationship between the task functions to be scheduled in the current production environment according to the workflow information of the current production environment;

[0144] A generating module 1302 is used to generate multiple task function processing queues according to the execution environment type of the task function and the dependency relationship between the task functions; task functions of the same type of execution environment are placed in the same task function processing queue;

[0145] The scheduling module 1303 is used to schedule each task function based on the processing queue of each task function.

[0146] According to the workflow information of the current production environment, obtain the dependency relationship between the task functions to be scheduled in the current production environment;

[0147] According to the execution environment type of the task function and the dependency relationship between the task functions, multiple task function processing queues are generated; task functions of the same type of execution environment are in the same task function processing queue;

[0148] Based on the processing queue of each task function, each task function is scheduled and processed.

[0149] In one embodiment, the scheduling module 1303 includes:

[0150] An acquisition unit, used to acquire the scheduling strategy of each task function processing queue and the execution environment corresponding to each task function processing queue;

[0151] The scheduling unit is used to schedule the task functions in each task function processing queue in the corresponding execution environment according to each scheduling strategy.

[0152] In one embodiment, the acquisition unit includes:

[0153] A first acquisition subunit is used to acquire the type of each execution environment in the current production environment;

[0154] The first determining subunit is used to determine the execution environment corresponding to each task function processing queue according to the type of each execution environment in the current production environment and the type of execution environment required by each task function processing queue.

[0155] In one embodiment, the first determining subunit includes:

[0156] The second determination subunit is used for determining, for any task function processing queue, the execution environment of the same type as the task function processing queue in the current production environment as the execution environment of the task function processing queue if there is an execution environment of the same type as the task function processing queue in each execution environment in the current production environment and the execution environment meets the preset execution condition;

[0157] The first creation subunit is used to create a corresponding execution environment for the task function processing queue in the current production environment.

[0158] In one embodiment, the second determining subunit includes: the use state of the execution environment is an idle state, or the use state of the execution environment is a use state but the time length for waiting for the end of the use of the execution environment is less than a preset time length.

[0159] In one embodiment, the first creation subunit includes:

[0160] The second acquisition subunit is used to acquire the idle computing resources of all computer devices in the current production environment;

[0161] The second creation subunit is used to create a corresponding execution environment for the task function processing queue using the idle computing resources if the idle computing resources are greater than the occupied resources required by the execution environment of the task function processing queue;

[0162] The third creation subunit is used to create a corresponding execution environment for the task function processing queue in a backup environment creation manner if the idle computing resources are less than the occupied resources required by the execution environment of the task function processing queue.

[0163] In one embodiment, the third creation subunit includes:

[0164] The third acquisition subunit is used to traverse all computer devices in the current production environment and acquire a target computer device that is not currently executing a task; the computing resources of the target computer device are greater than the occupied resources required by the task function processing queue;

[0165] The fourth creation subunit is used to delete the existing execution environment in the target computer device and then create a corresponding execution environment using the computing resources in the target computer device as the task function processing queue.

[0166] For the specific limitations of the task function processing device, please refer to the limitations of each step in the task function processing method above, which will not be repeated here. The various modules in the above-mentioned task function processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the target device in the form of hardware, or can be stored in the memory of the target device in the form of software, so that the target device can call and execute the operations corresponding to the above modules.

[0167] In one embodiment, a computer device is provided, such as Fig.14 As shown, the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a task function processing method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0168] Those skilled in the art will understand that Fig.14 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0169] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0170] According to the workflow information of the current production environment, obtain the dependency relationship between the task functions to be scheduled in the current production environment;

[0171] According to the execution environment type of the task function and the dependency relationship between the task functions, multiple task function processing queues are generated; task functions of the same type of execution environment are in the same task function processing queue;

[0172] Based on the processing queue of each task function, each task function is scheduled and processed.

[0173] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0174] Obtain the scheduling strategy of each task function processing queue and the execution environment corresponding to each task function processing queue;

[0175] According to each scheduling strategy in the corresponding execution environment, the task functions in each task function processing queue are scheduled and processed.

[0176] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0177] Get the types of each execution environment in the current production environment;

[0178] According to the types of execution environments in the current production environment and the types of execution environments required by each task function processing queue, the execution environment corresponding to each task function processing queue is determined.

[0179] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0180] For any task function processing queue, if there is an execution environment of the same type as the task function processing queue among the execution environments in the current production environment, and the execution environment meets the preset execution conditions, then the execution environment of the same type in the current production environment is determined as the execution environment of the task function processing queue;

[0181] Otherwise, create a corresponding execution environment for the task function processing queue in the current production environment.

[0182] In one embodiment, the execution environment satisfies the preset execution condition including: the use state of the execution environment is an idle state, or the use state of the execution environment is a used state but the time length for waiting for the end of the use of the execution environment is less than a preset time length.

[0183] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0184] Obtain the idle computing resources of all computer devices in the current production environment;

[0185] If the idle computing resources are greater than the occupied resources required by the execution environment of the task function processing queue, the corresponding execution environment is created for the task function processing queue using the idle computing resources;

[0186] If the idle computing resources are less than the occupied resources required by the execution environment of the task function processing queue, a corresponding execution environment is created for the task function processing queue in a backup environment creation manner.

[0187] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0188] Traverse all computer devices in the current production environment to obtain a target computer device that is not currently executing a task; the computing resources of the target computer device are greater than the occupied resources required by the task function processing queue;

[0189] After deleting the existing execution environment in the target computer device, a corresponding execution environment is created using the computing resources in the target computer device as the task function processing queue.

[0190] The above embodiment provides a computer device, whose implementation principle and technical effect are similar to those of the above method embodiment, and will not be repeated here.

[0191] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0192] According to the workflow information of the current production environment, obtain the dependency relationship between the task functions to be scheduled in the current production environment;

[0193] According to the execution environment type of the task function and the dependency relationship between the task functions, multiple task function processing queues are generated; task functions of the same type of execution environment are in the same task function processing queue;

[0194] Based on the processing queue of each task function, each task function is scheduled and processed.

[0195] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0196] Obtain the scheduling strategy of each task function processing queue and the execution environment corresponding to each task function processing queue;

[0197] According to each scheduling strategy in the corresponding execution environment, the task functions in each task function processing queue are scheduled and processed.

[0198] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0199] Get the types of each execution environment in the current production environment;

[0200] According to the types of execution environments in the current production environment and the types of execution environments required by each task function processing queue, the execution environment corresponding to each task function processing queue is determined.

[0201] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0202] For any task function processing queue, if there is an execution environment of the same type as the task function processing queue among the execution environments in the current production environment, and the execution environment meets the preset execution conditions, then the execution environment of the same type in the current production environment is determined as the execution environment of the task function processing queue;

[0203] Otherwise, create a corresponding execution environment for the task function processing queue in the current production environment.

[0204] In one embodiment, the execution environment satisfies the preset execution condition including: the use state of the execution environment is an idle state, or the use state of the execution environment is a used state but the time length for waiting for the end of the use of the execution environment is less than a preset time length.

[0205] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0206] Obtain the idle computing resources of all computer devices in the current production environment;

[0207] If the idle computing resources are greater than the occupied resources required by the execution environment of the task function processing queue, the corresponding execution environment is created for the task function processing queue using the idle computing resources;

[0208] If the idle computing resources are less than the occupied resources required by the execution environment of the task function processing queue, a corresponding execution environment is created for the task function processing queue in a backup environment creation manner.

[0209] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0210] Traverse all computer devices in the current production environment to obtain a target computer device that is not currently executing a task; the computing resources of the target computer device are greater than the occupied resources required by the task function processing queue;

[0211] After deleting the existing execution environment in the target computer device, a corresponding execution environment is created using the computing resources in the target computer device as the task function processing queue.

[0212] The implementation principles and technical effects of the steps implemented when the computer program in this embodiment is executed by the processor are similar to the principles of the above-mentioned task function processing method, and will not be repeated here.

[0213] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0214] According to the workflow information of the current production environment, obtain the dependency relationship between the task functions to be scheduled in the current production environment;

[0215] According to the execution environment type of the task function and the dependency relationship between the task functions, multiple task function processing queues are generated; task functions of the same type of execution environment are in the same task function processing queue;

[0216] Based on the processing queue of each task function, each task function is scheduled and processed.

[0217] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0218] Obtain the scheduling strategy of each task function processing queue and the execution environment corresponding to each task function processing queue;

[0219] According to each scheduling strategy in the corresponding execution environment, the task functions in each task function processing queue are scheduled and processed.

[0220] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0221] Get the types of each execution environment in the current production environment;

[0222] According to the types of execution environments in the current production environment and the types of execution environments required by each task function processing queue, the execution environment corresponding to each task function processing queue is determined.

[0223] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0224] For any task function processing queue, if there is an execution environment of the same type as the task function processing queue among the execution environments in the current production environment, and the execution environment meets the preset execution conditions, then the execution environment of the same type in the current production environment is determined as the execution environment of the task function processing queue;

[0225] Otherwise, create a corresponding execution environment for the task function processing queue in the current production environment.

[0226] In one embodiment, the execution environment satisfies the preset execution condition including: the use state of the execution environment is an idle state, or the use state of the execution environment is a used state but the time length for waiting for the end of the use of the execution environment is less than a preset time length.

[0227] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0228] Obtain the idle computing resources of all computer devices in the current production environment;

[0229] If the idle computing resources are greater than the occupied resources required by the execution environment of the task function processing queue, the corresponding execution environment is created for the task function processing queue using the idle computing resources;

[0230] If the idle computing resources are less than the occupied resources required by the execution environment of the task function processing queue, a corresponding execution environment is created for the task function processing queue in a backup environment creation manner.

[0231] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0232] Traverse all computer devices in the current production environment to obtain a target computer device that is not currently executing a task; the computing resources of the target computer device are greater than the occupied resources required by the task function processing queue;

[0233] After deleting the existing execution environment in the target computer device, a corresponding execution environment is created using the computing resources in the target computer device as the task function processing queue.

[0234] The implementation principles and technical effects of the steps implemented when the computer program in this embodiment is executed by the processor are similar to the principles of the above-mentioned task function processing method, and will not be repeated here.

[0235] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0236] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0237] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0238] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A task function processing method, characterized in that: The method comprises: According to the workflow information of the current production environment, the dependency relationship between the task functions to be scheduled in the current production environment is obtained; According to the execution environment type of the task function and the dependency relationship between the task functions, multiple task function processing queues are generated; task functions of the same type of execution environment are placed in the same task function processing queue; Based on the task function processing queue, each task function is scheduled; The scheduling process of each of the task functions based on the task function processing queue includes: Obtaining the scheduling strategy of each of the task function processing queues and the execution environment corresponding to each of the task function processing queues; According to each of the scheduling strategies, in the corresponding execution environment, the task functions in each of the task function processing queues are scheduled; Obtaining the execution environment corresponding to each of the task function processing queues, including: Obtaining the type of each execution environment in the current production environment; According to the types of each execution environment in the current production environment and the types of execution environments required by each task function processing queue, the execution environment corresponding to each task function processing queue is determined.

2. The method according to claim 1, characterized in that The determining, according to the types of the execution environments in the current production environment and the types of the execution environments required by the task function processing queues, the execution environments corresponding to the task function processing queues includes: For any task function processing queue, if there is an execution environment of the same type as the task function processing queue among the execution environments in the current production environment, and the execution environment meets the preset execution condition, then the execution environment of the same type in the current production environment is determined as the execution environment of the task function processing queue; Otherwise, a corresponding execution environment is created for the task function processing queue in the current production environment.

3. The method according to claim 2, characterized in that The execution environment meets the preset execution conditions including: The usage state of the execution environment is an idle state, or the usage state of the execution environment is a used state but the time length for waiting for the use of the execution environment to end is less than a preset time length.

4. The method according to claim 2 or 3, characterized in that: The creating a corresponding execution environment for the task function processing queue in the current production environment includes: Acquire idle computing resources of all computer devices in the current production environment; If the idle computing resources are greater than the occupied resources required by the execution environment of the task function processing queue, creating a corresponding execution environment for the task function processing queue using the idle computing resources; If the idle computing resources are smaller than the occupied resources required by the execution environment of the task function processing queue, a corresponding execution environment is created for the task function processing queue in a backup environment creation manner.

5. The method according to claim 4, characterized in that The step of creating a corresponding execution environment for the task function processing queue in a backup environment creation manner includes: Traversing all computer devices in the current production environment to obtain target computer devices that are not currently executing tasks; The computing resources of the target computer device are greater than the occupied resources required by the task function processing queue; After deleting the existing execution environment in the target computer device, a corresponding execution environment is created for the task function processing queue using the computing resources in the target computer device.

6. A task function processing device, characterized in that: The device comprises: An acquisition module, used to acquire the dependency relationship between the task functions to be scheduled in the current production environment according to the workflow information of the current production environment; A generation module, used to generate multiple task function processing queues according to the execution environment type of the task function and the dependency relationship between the task functions; task functions of the same type of execution environment are in the same task function processing queue; A scheduling module is used to schedule each of the task functions based on each of the task function processing queues; the scheduling of each of the task functions based on each of the task function processing queues includes: Obtaining the scheduling strategy of each of the task function processing queues and the execution environment corresponding to each of the task function processing queues; According to each of the scheduling strategies, in the corresponding execution environment, the task functions in each of the task function processing queues are scheduled; Obtaining the execution environment corresponding to each of the task function processing queues, including: Obtaining the type of each execution environment in the current production environment; According to the types of each execution environment in the current production environment and the types of execution environments required by each task function processing queue, the execution environment corresponding to each task function processing queue is determined.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. 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 method according to any one of claims 1 to 5 are implemented.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Model iteration implementation method and device based on acceleration chip

    CN112101565A

  • Data processing method and device, electronic equipment and storage medium

    CN113986401A