Method, device, storage medium and equipment for adjusting workflow task executor
By establishing a task status monitoring and adjustment mechanism between the workflow engine and the task monitor, and dynamically adjusting the number of task executors, the problem of mismatch between task executors and load in the prior art is solved, and the system resource utilization rate is improved.
Patent Information
- Application Number
- CN202111375213.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-19
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2041-11-19
AI Technical Summary
The existing distributed workflow engine lacks the ability to manage task executors, which leads to the mismatch between the task executors and the actual load, affecting the system processing efficiency.
The workflow is analyzed through the workflow engine, and the task is created, and the task monitor monitor monitors the task status, determines the task executor information required by the cloud network system, sends adjustment information to the task agent, and dynamically creates or deletes the task executor.
It realizes dynamic adjustment of task executors according to workflow load, improves resource utilization and avoids resource waste caused by excessive or too few task executors.
Smart Images

Figure CN114090206B_ABST
Abstract
Description
Background Art
[0002] The workflow engine and task executor are the core components of the workflow-based cloud network automation deployment platform. In order to meet the needs of deploying multiple physically dispersed cloud network systems at the same time, a distributed workflow engine architecture is usually adopted. The workflow engine is deployed at the central point and is responsible for the scheduling and management of workflow tasks. The task executor runs in each physically dispersed cloud network system and is responsible for receiving and executing workflow tasks. The existing distributed workflow engine lacks the ability to manage task executors, and task executors are managed manually. In practice, a fixed number of task executors are usually kept running. However, this method will result in a fixed system processing capacity for workflow tasks. When there are many workflow tasks, the processing efficiency is low due to the insufficient number of task executors; when there are fewer workflow tasks, the computing resources are ineffectively occupied due to the excessive number of task executors. Summary of the invention
[0003] The purpose of the present disclosure is to provide a method, apparatus, storage medium and device for adjusting a workflow task executor, which at least to some extent overcomes the problem in the related art that the workflow engine lacks management of the task executor, resulting in a mismatch between the task executor and the actual load.
[0004] According to the first aspect of the present disclosure, a method for adjusting a workflow task executor is provided, comprising: a workflow engine creates a task for at least one cloud network system by parsing an acquired workflow, and issues the task to a task executor; a task monitor monitors the status of tasks in the workflow engine, determines information of the task executor required by the at least one cloud network system according to the status of the tasks in the workflow engine, and sends task executor adjustment information to a task agent of the at least one cloud network system according to the information of the task executor required by the at least one cloud network system; the task agent creates or deletes the task executor according to the task executor adjustment information.
[0005] Optionally, the task monitor monitors the status of the tasks in the workflow engine, determines the information of the task executors required by the at least one cloud network system according to the status of the tasks in the workflow engine, and sends task executor adjustment information to the task agent of the at least one cloud network system according to the information of the task executors required by the at least one cloud network system, including: obtaining a task executor adjustment request from the task agent; determining the number and type of tasks in the at least one cloud network system requested in the task executor adjustment request; determining the allowed execution time and average execution time of various types of tasks in the at least one cloud network system; calculating the number of various types of task executors required by the at least one cloud network system according to the number of various types of tasks in the at least one cloud network system, the allowed execution time and the average execution time; generating the task executor adjustment information according to the actual number of various types of task executors currently existing in the at least one cloud network system and the required number of various types of task executors, and sending the task executor adjustment information to the task agent.
[0006] Optionally, the number of various types of task executors required for the at least one cloud network system is calculated based on the number of various types of tasks in the at least one cloud network system, the allowed execution time and the average execution time, including: multiplying the number of various types of tasks in the at least one cloud network system by the ratio of the average execution time of various types of task executors to the allowed execution time to obtain a target value; and rounding the target value upward to an integer to obtain the number of each type of task executor.
[0007] Optionally, the task agent creates or deletes a task executor based on the task executor adjustment information, including: the task agent periodically requests the task executor adjustment information from the task monitor; loads the task executor program according to the task executor adjustment information, creates a task executor instance, or publishes a task executor deletion message to a message queue to delete the task executor.
[0008] Optionally, the method further includes: after the task executor is started, periodically sending the working status information of the task executor to the task agent; after the task agent obtains the working status information of the task executor sent by the task executor, the task agent records the working status information, wherein the working status information includes a working status and an idle status; and ending the task executor whose working status is an idle status.
[0009] According to a second aspect of the present disclosure, a device for adjusting a workflow task executor is provided, comprising: a workflow engine, configured to create a task for at least one cloud network system by parsing an acquired workflow, and issue the task to a task executor; a task monitor, configured to monitor the status of tasks in the workflow engine, determine information of the task executor required by the at least one cloud network system according to the status of the tasks in the workflow engine, and send task executor adjustment information to a task agent of the at least one cloud network system according to the information of the task executor required by the at least one cloud network system; and the task agent, configured to create or delete a task executor according to the task executor adjustment information.
[0010] Optionally, the task monitor comprises: an acquisition module for acquiring a task executor adjustment request from the task agent; a task statistics module for determining the number and type of tasks in the at least one cloud network system requested in the task executor adjustment request; a task rule for determining the allowed execution time and average execution time of various types of tasks in the at least one cloud network system; a calculation module for calculating the number of various types of task executors required for the at least one cloud network system based on the number of various types of tasks in the at least one cloud network system, the allowed execution time and the average execution time; a sending module for generating the task executor adjustment information based on the actual number of various types of task executors currently existing in the at least one cloud network system and the required number of various types of task executors, and sending the task executor adjustment information to the task agent.
[0011] Optionally, the calculation module is specifically used to: multiply the number of tasks of each type in the at least one cloud network system by the ratio of the average execution time of each type of task executor to the allowed execution time to obtain a target value; round the target value upward to an integer to obtain the number of each type of task executors.
[0012] Optionally, the task agent includes: an information request module, used to periodically request the task executor adjustment information from the task monitor; a life cycle module, used to load the task executor program according to the task executor adjustment information, create a task executor instance, or publish a task executor deletion message to the message queue to delete the task executor.
[0013] Optionally, the task agent also includes: a status statistics module; the task executor is also used to periodically send the working status information of the task executor to the status statistics module after the task executor is started; the status statistics module is used to record the working status information of the task executor after obtaining the working status information of the task executor sent by the task executor, wherein the working status information includes a working status and an idle status; and end the task executor whose working status is an idle status.
[0014] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the methods for adjusting a workflow task executor provided by an embodiment of the present disclosure by executing the executable instructions.
[0015] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any method for adjusting a workflow task executor provided in the embodiments of the present disclosure is implemented.
[0016] The method, apparatus, storage medium and device for adjusting workflow task executors in one or more embodiments of the present invention monitor the status of tasks in the workflow engine through a task monitor, determine the information of the task executor required by at least one cloud network system, generate task executor adjustment information based on the information, and send the task executor adjustment information to the task agent, so that the task agent can create or delete the task executor according to the task executor adjustment information. The task executors in the cloud network system can be dynamically adjusted according to the workflow load without changing the operation of the workflow engine, thereby improving resource utilization.
[0017] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0019] Figure 1 is a structural diagram of a system provided by an exemplary embodiment of the present disclosure;
[0020] Figure 2is a flowchart of a method for adjusting a workflow task executor according to one or more embodiments of the present disclosure;
[0021] Figure 3 is a flowchart of a task monitor generating task executor adjustment information according to one or more embodiments of the present disclosure;
[0022] Figure 4 is a schematic diagram of the structure of a task monitor according to one or more embodiments of the present disclosure;
[0023] Figure 5 is a flow chart of calculating the number of various types of task executors required by a cloud network system according to one or more embodiments of the present disclosure;
[0024] Figure 6 is a flowchart of a task agent according to one or more embodiments of the present disclosure creating or deleting a task executor according to the task executor adjustment information;
[0025] Figure 7 is a schematic diagram of the structure of a task agent according to one or more embodiments of the present disclosure;
[0026] Figure 8 is a flow chart of a method for adjusting a workflow task executor according to one or more embodiments of the present disclosure;
[0027] Fig. 9 is a flowchart of a method for adjusting a workflow task executor according to one or more embodiments of the present disclosure;
[0028] Fig.10 is a structural diagram of an apparatus for adjusting a workflow task executor according to one or more embodiments of the present disclosure; and
[0029] Fig.11 is a schematic diagram of the structure of an electronic device according to one or more embodiments of the present disclosure. DETAILED DESCRIPTION
[0030] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0031] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0032] Figure 1 : is a schematic diagram of a task system provided by an exemplary embodiment of the present disclosure, the system comprising:
[0033] The workflow engine 110, the task monitor 114, the task agent 1162 of the cloud network system 1, the task agent 1164 of the cloud network system 2...the task agent 1166 of the cloud network system N, and a plurality of task executors in each cloud network system.
[0034] The workflow engine is used to parse workflows and provide services for different cloud network systems (such as Figure 1 In the cloud network system 1 to cloud network system N shown in the figure, an independent namespace is created, and task queues are created for different task types (A / B / ... / X tasks) in the namespace. All tasks are added to the corresponding queues in sequence according to the time of submission, and the task status is managed. At the same time, it is also responsible for sending tasks to the task executor.
[0035] The task monitor is used to monitor the status of all tasks in the workflow engine and calculate the type and number of task executors required for each cloud network system.
[0036] The task agent is connected to the task monitor to periodically obtain task executor adjustment information and perform operations to create / delete task executors.
[0037] The task executor is used to execute tasks in the cloud network system and feed the results back to the workflow engine.
[0038] Figure 2 is a flowchart of a method for adjusting a workflow task executor according to one or more embodiments of the present disclosure. Figure 2 As shown, the method includes:
[0039] Step S202: the workflow engine creates a task for at least one cloud network system by parsing the acquired workflow, and sends the task to the task executor;
[0040] Optionally, before step S202, the process may further include: the automated deployment platform submitting the workflow to the workflow engine.
[0041] Step S204: The task monitor monitors the status of the tasks in the workflow engine, determines the information of the task executor required by the at least one cloud network system according to the status of the tasks in the workflow engine, and sends task executor adjustment information to the task agent of the at least one cloud network system according to the information of the task executor required by the at least one cloud network system;
[0042] Optionally, the status of tasks in the workflow engine may include the types and quantities of tasks in each cloud network system. The workflow engine may count the types and quantities of tasks in each cloud network system in real time, and store the types and quantities of actual task executors in each cloud network system. The information of the task executors required by each cloud network system may be determined based on the types and quantities of tasks in each cloud network system, and the task executor adjustment information may be determined in combination with the types and quantities of actual task executors in each cloud network system, so as to determine how to adjust each cloud network system based on the existing task executors to meet the task executors actually required by each cloud network system.
[0043] Step S206: the task agent creates or deletes the task executor according to the task executor adjustment information.
[0044] Optionally, the task executor adjustment information is used to indicate the type and number of task executors to be created and / or deleted. Based on this, the task executor adjustment information may include the type and number of task executors to be adjusted (created or deleted). Based on this, the task agent may create a new task executor according to the task executor adjustment information, or delete an existing task executor. It should be noted that when deleting an existing task executor, for task executors of the same type, the task executors with an idle working state may be deleted first.
[0045] Optionally, the task monitor in one or more embodiments of the present disclosure can be a task monitor plug-in added to the workflow engine to monitor the workflow load, so that the number of task executors required can be determined in real time, and the functions of the workflow engine can be increased by means of plug-ins, and new functions can be introduced without affecting the original functions of the workflow engine, and the system has good scalability. At the same time, the task agent can be set in the cloud network system, and each cloud system is provided with a task agent, and each cloud system can dynamically manage the task executor according to the calculation results of the task monitor plug-in.
[0046] The method for adjusting a workflow task executor in one or more embodiments of the present invention monitors the status of tasks in a workflow engine through a task monitor, determines information of a task executor required by at least one cloud network system, generates task executor adjustment information based on the information, and sends the task executor adjustment information to a task agent, so that the task agent can create or delete a task executor based on the task executor adjustment information. The task executor in the cloud network system can be dynamically adjusted based on the workflow load without changing the operation of the workflow engine, thereby improving resource utilization.
[0047] In one or more embodiments of the present disclosure, Figure 3 As shown, the task monitor monitors the status of the tasks in the workflow engine, determines the information of the task executor required by the at least one cloud network system according to the status of the tasks in the workflow engine, and sends the task executor adjustment information to the task agent of the at least one cloud network system according to the information of the task executor required by the at least one cloud network system, which may include:
[0048] Step S2042: Obtaining a task executor adjustment request from the task agent;
[0049] Optionally, the task executor adjustment request is used to request task executor adjustment information.
[0050] Optionally, each cloud network system is provided with a corresponding task agent, and the task agent of each cloud network system is used to request the task monitor to adjust the task executor of the corresponding cloud network system. For example, if task agent a is provided in cloud network system A, task agent a is used to send a task executor adjustment request of cloud network system A to the task monitor. Based on this, all network requests are initiated from the cloud network system side to the central workflow engine side, and there will be no problem of restricting external active access due to network security issues in the cloud network system.
[0051] Step S2044: Determine the number and type of tasks in the at least one cloud network system requested in the task executor adjustment request;
[0052] Optionally, the task monitor may include a task statistics module for real-time statistics of the types and quantities of tasks in each cloud network system. Based on this, the number n of tasks of the cloud network system requested in the task executor adjustment request can be read from the task statistics module.
[0053] Step S2046: Determine the allowed execution time and average execution time of various types of tasks in the at least one cloud network system;
[0054] Optionally, the task monitor may include a task rule, which records the allowed execution time (PT) and average execution time (AT) of each type of task. Based on this, the task rule can be read from the task rule to obtain the allowed execution time and average execution time of various types of tasks.
[0055] Step S2048: Calculate the number of task executors of various types required by the at least one cloud network system according to the number of tasks of various types in the at least one cloud network system, the allowed execution time, and the average execution time;
[0056] Step S20410: Generate the task executor adjustment information according to the actual number of various types of task executors currently existing in the at least one cloud network system and the required number of various types of task executors, and send the task executor adjustment information to the task agent.
[0057] Optionally, the task monitor may also include a storage module, which may store the types and quantities of actual task executors in each cloud network system. The task monitor may also include a calculation module, which may be used to calculate the types and quantities of task executors required by the cloud network system, store the calculation results in the storage module, generate task executor adjustment information, and return the adjustment information to the task agent. Through this method, adaptive management of workflow task executors can be achieved, workflow processing capabilities can be improved, and resource utilization can be improved.
[0058] Exemplarily, the task monitor of one or more embodiments of the present invention is as follows: Figure 4 As shown, it includes: a task statistics module 412 , a storage module 414 , a task rule 416 and a calculation module 418 .
[0059] Among them, the task statistics module 412 is used to count the types and quantities of tasks in each cloud network system in real time; the storage module 414 is used to store the types and quantities of task executors actually existing in each cloud network system. Task rules 416 are stored in the database and are used to record the allowed execution time (PT) and average execution time (AT) of each type of task. Among them, AT can be automatically counted and updated by the system based on historical execution tasks. The calculation module 418 is used to calculate the types and quantities of task executors required by the cloud network system, store the calculation results in the storage module 414, generate task executor adjustment information, and return the task executor adjustment information to the task agent.
[0060] In one embodiment of the present disclosure, Figure 5 As shown, calculating the number of task executors of various types required for the at least one cloud network system according to the number of tasks of various types in the at least one cloud network system, the allowed execution time, and the average execution time may include:
[0061] Step S20482: multiplying the number of tasks of each type in the at least one cloud network system by the ratio of the average execution time of the task executors of each type to the allowed execution time to obtain a target value;
[0062] Step S20484: round the target value upward to an integer to obtain the number of each type of task executors.
[0063] Specifically, the number of tasks n of the requested cloud network system can be read from the task statistics module, and the task rules can be read from the task rules to obtain the allowed execution time (PT) and average execution time (AT) of each type of task, and then the number of task executors currently required (rounded up) can be obtained according to the formula E=n*AT / PT.
[0064] Based on this, the task executor adjustment information is generated according to the actual number of various types of task executors currently existing in the at least one cloud network system and the required number of various types of task executors, and the task executor adjustment information is sent to the task agent, which may include: the calculation module can read the number m of task executors currently existing in the requested cloud network system from the storage module. The calculation module calculates the difference between the required number E and the actual number m, obtains the type and number of task executors that need to be adjusted, that is, the task executor adjustment information, and returns the task executor adjustment information to the task agent. At the same time, the number E can be updated to the storage module as a new m value.
[0065] In one or more embodiments of the present disclosure, Figure 6 As shown, the task agent creates or deletes the task executor according to the task executor adjustment information, which may include:
[0066] Step S2062: the task agent periodically requests the task monitor to adjust the task executor;
[0067] Optionally, the task agent may send a task executor adjustment request to the task monitor at a fixed time point or at a fixed time interval to trigger the task monitor to generate task executor adjustment information. The task executor adjustment request may include the requested cloud network system information.
[0068] Step S2064: Load the task executor program according to the task executor adjustment information, create a task executor instance, or publish a task executor deletion message to the message queue to delete the task executor.
[0069] Optionally, when it is determined that a new task executor needs to be created according to the task executor adjustment information, the executor program in the program warehouse can be loaded to create an executor instance to implement the creation of the task executor. When it is determined that an existing task executor needs to be deleted according to the task executor adjustment information, a task executor deletion message can be published to the message queue to delete the existing task executor.
[0070] For example, the task agent of one or more embodiments of the present disclosure may be as follows: Figure 7 As shown, including:
[0071] An information request module 712 , a life cycle module 714 , and a status statistics module 716 .
[0072] Among them, the information request module 712 is used to periodically request the task monitor 114 for executor adjustment information, and call the life cycle module 714 to create / delete the task executor. The life cycle module 714 obtains the type and number of task executors that need to be adjusted from the call of the information request module 712. For the type that needs to increase the number of task executors, the corresponding program is loaded from the program warehouse and the required number of task executor instances are created in the task executor pool 722; for the type that needs to reduce the number of task executors, the status of each task executor of this type is obtained from the status statistics module 716, and a number of executors are selected from them according to the number of requested reductions (executors in the idle state are selected first, and executors in the working state are selected when the number of idle state executors is insufficient), and the information of the executors that need to be deleted is published and sent to the executor deletion message queue. The status statistics module 716 is used to count the status of each task executor, and subscribe to the executor deletion message queue 720, remove the executors that need to be deleted, and no longer count their status. After the task executor instance is created in the task executor pool 722, on the one hand, it connects to the workflow engine 110 to request tasks, and at the same time periodically reports its own working status to the status statistics module 716; on the other hand, it subscribes to the executor deletion message queue 720, and when it receives a message that requires it to be deleted, it calls the function inside the executor to safely end the program (an executor in the idle state can end immediately, and an executor in the working state ends after completing the current task).
[0073] In one or more embodiments of the present disclosure, Figure 8 As shown, the method for adjusting the workflow task executor may further include:
[0074] Step S802: After the task executor is started, the task executor sends the working status information of the task executor to the task agent at a regular interval;
[0075] Optionally, after the task executor is started, it may send its own working status information to the task agent at a fixed time point or a fixed time interval, wherein the working status information may include a working status and an idle status.
[0076] Step S804: after acquiring the working status information of the task executor sent by the task executor, the task agent records the working status information;
[0077] Optionally, the task agent may obtain and record the working status information of all task executors in the system, and update the stored working status information of the task executors in real time according to the working status information of the task executors received in real time.
[0078] Step S806: End the task executor whose working state is the idle state.
[0079] Optionally, the task executor can subscribe to the executor deletion message queue. When receiving a message that requires deleting itself, it can call a function inside the task executor to safely end the program. Among them, the task executor in the idle state can end immediately, and the executor in the working state can end after completing the current task.
[0080] In order to facilitate understanding of the method for adjusting the workflow task executor in one or more embodiments of the present disclosure, the following is combined with Fig. 9 The method is illustrated by an example.
[0081] The automated deployment platform 910 submits two workflows to the workflow engine 920, namely the deployment task workflow of cloud network system 1 (including two A tasks and one B task, and the three tasks can be executed in parallel), and the deployment task workflow of cloud network system 2 (including one B task and one C task, and the two tasks are executed serially).
[0082] The workflow engine 920 parses the received workflow, creates namespaces for the cloud network system 1 and the cloud network system 2 respectively, and creates task queues in their respective namespaces.
[0083] The task agent 930 of cloud network system 1 and the task agent 940 of cloud network system 2 request task executor adjustment information from the task monitor 950. The task monitor 950 monitors and calculates that cloud network system 1 needs two A task executors and one B task executor, and generates executor adjustment information for the task agent 930 of cloud network system 1 based on the calculation results. The cloud network system 2 needs one B task executor and one C task executor, and generates task executor adjustment information based on the calculation results and sends it to the task agent 940 of cloud network system 2.
[0084] After the task agent 930 of the cloud network system 1 obtains the task executor adjustment information, it creates A task executor 11, A task executor 12 and B task executor 11. After the task agent 940 of the cloud network system 2 obtains the task executor adjustment information, it creates B task executor 21 and C task executor 21.
[0085] Each task executor is connected to the workflow engine 920 to obtain tasks. A task executor 11, A task executor 12, B task executor 11 and task executor 21 obtain A task 11, A task 12, B task 11 and B task 21 respectively. After executing the tasks in the cloud network system, they feed back the results to the workflow engine 920. The workflow engine 920 removes the corresponding tasks from the task queue.
[0086] The C task executor 21 is connected to the workflow engine 920 to obtain the C task 21, and then executes the task in the cloud network system.
[0087] The task agent 930 of cloud network system 1 and the task agent 940 of cloud network system 2 request task executor adjustment information from the task monitor 950. The task monitor 950 obtains the task executors required by cloud network system 1 and cloud network system 2 through calculation, and determines through calculation that cloud network system 1 needs to delete task executor A 11, task executor A 12 and task executor B 11, and cloud network system 2 needs to delete task executor B 21.
[0088] After obtaining the task executor adjustment information, the task agent 930 of the cloud network system 1 deletes the A task executor 11, the A task executor 12 and the B task executor 11. After obtaining the task executor adjustment information, the task agent 940 of the cloud network system 2 deletes the B task executor 21.
[0089] After receiving the message that the C-task executor 21 has completed the C-task 21 , the workflow engine 920 removes the C-task 21 from the task queue.
[0090] The task agent 940 of the cloud network system 2 requests the task executor adjustment information. After obtaining the task executor adjustment information, the task agent of the cloud network system 2 deletes the C task executor 21.
[0091] Fig.10 is a schematic diagram of a structure of an apparatus for adjusting a workflow task executor according to one or more embodiments of the present disclosure, such as Fig.10 As shown, the device 1010 includes:
[0092] The workflow engine 1012 is used to create a task for at least one cloud network system by parsing the acquired workflow, and send the task to the task executor;
[0093] The task monitor 1014 is used to monitor the status of the tasks in the workflow engine, determine the information of the task executor required by the at least one cloud network system according to the status of the tasks in the workflow engine, and send task executor adjustment information to the task agent of the at least one cloud network system according to the information of the task executor required by the at least one cloud network system;
[0094] The task agent 1016 is used to create or delete a task executor according to the task executor adjustment information.
[0095] In one or more embodiments of the present disclosure, the task monitor may include:
[0096] An acquisition module, used for acquiring a task executor adjustment request from the task agent;
[0097] A task statistics module, used to determine the number and type of tasks in the at least one cloud network system requested in the task executor adjustment request;
[0098] Task rules, used to determine the allowed execution time and average execution time of various types of tasks in the at least one cloud network system;
[0099] A calculation module, configured to calculate the number of task executors of various types required by the at least one cloud network system according to the number of tasks of various types in the at least one cloud network system, the allowed execution time, and the average execution time;
[0100] A sending module is used to generate the task executor adjustment information according to the actual number of various types of task executors currently existing in the at least one cloud network system and the required number of various types of task executors, and send the task executor adjustment information to the task agent.
[0101] In one or more embodiments of the present disclosure, the computing module may be specifically used for:
[0102] The target value is obtained by multiplying the number of tasks of each category in the at least one cloud network system by the ratio of the average execution time of task executors of each category to the allowed execution time;
[0103] The target value is rounded upward to an integer to obtain the number of each type of task executors.
[0104] In one or more embodiments of the present disclosure, the task agent may include:
[0105] An information request module, used for periodically requesting adjustment information of the task executor from the task monitor;
[0106] The life cycle module is used to load the task executor program according to the task executor adjustment information, create a task executor instance, or publish a task executor deletion message to a message queue to delete the task executor.
[0107] In one or more embodiments of the present disclosure, the task agent further includes: a state statistics module;
[0108] The task executor is also used to send the working status information of the task executor to the status statistics module at a regular interval after the task executor is started;
[0109] The status statistics module is used to record the working status information of the task executor after obtaining the working status information of the task executor sent by the task executor, wherein the working status information includes working status and idle status; and end the task executor whose working status is idle status.
[0110] One or more embodiments of the present disclosure also provide an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the methods for adjusting a workflow task executor provided by the embodiments of the present disclosure by executing the executable instructions.
[0111] One or more embodiments of the present disclosure further provide a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, any one of the methods for adjusting a workflow task executor provided in the embodiments of the present disclosure is implemented.
[0112] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0113] Refer to the following Fig.11 The electronic device 1100 according to this embodiment of the present invention is described. Fig.11 The electronic device 1100 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0114] like Fig.11 As shown, the electronic device 1100 is in the form of a general computing device. The components of the electronic device 1100 may include but are not limited to: at least one processing unit 1110, at least one storage unit 1120, and a bus 1130 connecting different system components (including the storage unit 1120 and the processing unit 1110).
[0115] The storage unit stores program codes, which can be executed by the processing unit 1110, so that the processing unit 1110 executes the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification.
[0116] The storage unit 1120 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 11201 and / or a cache storage unit 11202 , and may further include a read-only storage unit (ROM) 11203 .
[0117] The storage unit 1120 may also include a program / utility 11204 having a set (at least one) of program modules 11205, such program modules 11205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0118] Bus 1130 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0119] The electronic device 1100 may also communicate with one or more external devices 1200 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1100, and / or communicate with any device that enables the electronic device 1100 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1150. Furthermore, the electronic device 1100 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1160. As shown, the network adapter 1160 communicates with other modules of the electronic device 1100 via a bus 1130. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0120] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0121] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.
[0122] A program product for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0123] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0124] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0125] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0126] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0127] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0128] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0129] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0130] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A method for adjusting a workflow task executor, characterized in that: include: The workflow engine creates a task for at least one cloud network system by parsing the acquired workflow, and sends the task to the task executor; The task monitor monitors the status of the tasks in the workflow engine, determines the information of the task executor required by the at least one cloud network system according to the status of the tasks in the workflow engine, and sends task executor adjustment information to the task agent of the at least one cloud network system according to the information of the task executor required by the at least one cloud network system; The task agent creates or deletes the task executor according to the task executor adjustment information; The task monitor monitors the status of the tasks in the workflow engine, determines the information of the task executor required by the at least one cloud network system according to the status of the tasks in the workflow engine, and sends task executor adjustment information to the task agent of the at least one cloud network system according to the information of the task executor required by the at least one cloud network system, including: Obtaining a task executor adjustment request from the task agent; Determining the number and type of tasks in the at least one cloud network system requested in the task executor adjustment request; Determining the allowed execution time and average execution time of various types of tasks in the at least one cloud network system; The number of tasks of each type in the at least one cloud network system is multiplied by the ratio of the average execution time of the task executors of each type to the allowed execution time to obtain a target value; the target value is rounded upward to an integer to obtain the number of task executors of each type required by the at least one cloud network system; The task executor adjustment information is generated according to the actual number of various types of task executors currently existing in the at least one cloud network system and the required number of various types of task executors, and the task executor adjustment information is sent to the task agent.
2. The method according to claim 1, characterized in that: The task agent creates or deletes the task executor according to the task executor adjustment information, including: The task agent periodically requests the task monitor for adjustment information of the task executor; The task executor program is loaded according to the task executor adjustment information, a task executor instance is created, or a task executor deletion message is published to a message queue to delete the task executor.
3. The method according to any one of claims 1 to 2, characterized in that: The method further comprises: After the task executor is started, the working status information of the task executor is sent to the task agent at a regular interval; After acquiring the working status information of the task executor sent by the task executor, the task agent records the working status information, wherein the working status information includes a working status and an idle status; Ends the task executor whose working state is idle.
4. A device for adjusting a workflow task executor, characterized in that: include: A workflow engine, configured to create a task for at least one cloud network system by parsing the acquired workflow, and send the task to a task executor; A task monitor, configured to monitor the status of tasks in the workflow engine, determine information of task executors required by the at least one cloud network system according to the status of tasks in the workflow engine, and send task executor adjustment information to a task agent of the at least one cloud network system according to the information of task executors required by the at least one cloud network system; The task agent is used to create or delete a task executor according to the task executor adjustment information; The task monitor comprises: An acquisition module, used for acquiring a task executor adjustment request from the task agent; A task statistics module, used to determine the number and type of tasks in the at least one cloud network system requested in the task executor adjustment request; Task rules, used to determine the allowed execution time and average execution time of various types of tasks in the at least one cloud network system; A calculation module, configured to obtain a target value by multiplying the number of tasks of each category in the at least one cloud network system by the ratio of the average execution time of task executors of each category to the allowed execution time; and rounding the target value upward to obtain the number of task executors of each category required by the at least one cloud network system; A sending module is used to generate the task executor adjustment information according to the actual number of various types of task executors currently existing in the at least one cloud network system and the required number of various types of task executors, and send the task executor adjustment information to the task agent.
5. The device according to claim 4, characterized in that The task agent comprises: An information request module, used for periodically requesting the task monitor to adjust the task executor information; The life cycle module is used to load the task executor program according to the task executor adjustment information, create a task executor instance, or publish a task executor deletion message to a message queue to delete the task executor.
6. The device according to any one of claims 4 to 5, characterized in that: The task agent also includes: a status statistics module; The task executor is also used to send the working status information of the task executor to the status statistics module at a regular interval after the task executor is started; The status statistics module is used to record the working status information of the task executor after obtaining the working status information of the task executor sent by the task executor, wherein the working status information includes working status and idle status; and end the task executor whose working status is idle status.
7. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the method for adjusting a workflow task executor according to any one of claims 1 to 3 by executing the executable instructions.
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 method for adjusting a workflow task executor according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Intelligent elastic telescoping method based on Docker container cluster
CN106961351A