Batch processing task dynamic control methods, devices, computer equipment, and storage media

CN115269185BActive Publication Date: 2026-09-01INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210869694.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-22
Publication Date
2026-09-01
Estimated Expiration
2042-07-22

AI Technical Summary

Technical Problem

[0003]然而,云服务器在处理任务时,存在个别任务卡死现象,从而只能根据反馈信息解除对应任务的卡死,操作很不便捷和及时,导致后续排队处理的任务挤压,效率明显降低

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269185B_ABST
    Figure CN115269185B_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, computer device, and storage medium for dynamic control of batch processing tasks. The method includes: creating or adding user tasks through a visual interface, and setting task categories, task binding devices, and task priorities; dividing the user tasks into different sets according to each task binding device, and distributing each set to its corresponding task binding device; hierarchically splitting each set and combining them according to task categories to generate a workflow, allocating the workflow to its corresponding thread pool and task queue, and sorting them according to task priority; executing tasks in the workflow hierarchically; and recording task execution logs and task status modifications during workflow execution by monitoring task completion. This method enables hierarchical control of tasks, improves user experience, reduces the complexity of the software used by users, improves software usability and scalability, and enhances user operability of the server management system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of server management technology, and in particular to a method, apparatus, computer equipment, and storage medium for dynamic control of batch processing tasks. Background Technology

[0002] With technological advancements, the number of users is constantly increasing, applications are expanding, and the scale and equipment configuration of data centers are also continuously growing to meet service demands. Data centers typically serve as cloud servers to provide task processing services, but the ever-expanding data centers also bring some problems. On the one hand, the increasing number of servers inevitably leads to greater operational and maintenance pressure, requiring more manpower; on the other hand, previous server management software largely lacked control over task scheduling, failing to provide functions such as stopping or pausing tasks at any time, and not allowing modification of the task execution order.

[0003] However, when cloud servers process tasks, some tasks may freeze, requiring the system to unfreeze them based on feedback information. This process is inconvenient and untimely, leading to a backlog of subsequent tasks and a significant decrease in efficiency. Furthermore, this task processing lacks visual monitoring, resulting in extremely poor operability. Therefore, improving the operability of the server management system and enhancing its availability and scalability are urgent technical challenges that need to be addressed. Summary of the Invention

[0004] Therefore, it is necessary to provide a batch processing task dynamic control method, device, computer equipment, and storage medium that can visualize and monitor the task processing process, improve the user's operability of the server management system, and enhance the availability and scalability of the server management system, in order to address the above-mentioned technical problems.

[0005] On the one hand, a method for dynamic control of batch processing tasks is provided, the method comprising:

[0006] Create or add user tasks through a visual interface, and set task category, task-bound device, and task priority;

[0007] The user tasks are divided into different sets according to the device bound to each task, and each set is distributed to the corresponding task-bound device;

[0008] Each set is hierarchically split and then combined according to task category to generate a workflow. The workflow is then assigned to its corresponding thread pool and task queue and sorted according to task priority.

[0009] Hierarchical execution of tasks within the workflow; and

[0010] During workflow execution, task execution logs and task status modifications are recorded by monitoring task completion.

[0011] In one embodiment, the step of hierarchically splitting each set and combining them according to task categories to generate a workflow includes:

[0012] The user task is sent to the task scheduling center, which divides the user task into different sets according to the device bound to each task, and distributes each set to the corresponding device bound to the task.

[0013] In the task conversion factory, each set is divided into task levels according to the user's task splitting rules, and then combined and arranged into a workflow according to task categories;

[0014] The task conversion factory identifies the corresponding thread pool and task queue according to the task category of the workflow; and

[0015] The task conversion factory sorts the workflow in the task queue according to task priority, and then sequentially enters the thread pool.

[0016] In one embodiment, the hierarchical execution of tasks in the workflow includes:

[0017] Define a task executor in the workflow execution center. The task executor includes a first-level task work and a second-level task node, where each work contains multiple nodes.

[0018] The task executor is invoked to check the task queue; if the task queue is empty, the process continues to wait; if the task queue contains workflows, the relevant information of the workflows is immediately read from the task queue, and the corresponding actions are executed in stages.

[0019] In one embodiment, the step of recording task execution logs and modifying task status by monitoring task completion during workflow execution includes:

[0020] The task listener is invoked to perform workflow monitoring, and the task listener obtains the next task.

[0021] The task listener determines whether the task in the current work is empty; if so, it executes the workflow listener to end; otherwise, it executes the work listener.

[0022] When the task listener is performing work listening, it detects in real time whether there are pause, termination, or resumption events. If there is a termination, the workflow listening ends. If there is a pause, an object lock is added to the workflow and the thread is released, waiting for a resumption event. If there are no pause, termination, or resumption events, the first-level task work begins and the listening event is executed, and the next node is obtained according to the second-level task node process.

[0023] After obtaining the next node, the task listener determines whether the node is empty; if so, it ends the workflow listening and returns to obtain the next work step; otherwise, it determines whether there is a control event; if so, it executes the user-defined node executor until the node listening ends and returns to obtain the next node step.

[0024] In one embodiment, when executing tasks in a hierarchical manner in the workflow, the method further includes:

[0025] The workflow control center is invoked to control the pause and resumption of user tasks. The workflow control center includes workflow control and primary task control. The workflow control and the primary task control respectively set up workflow locking graphs and task locking graphs to control the corresponding object locks, thereby controlling the pause and resumption of user tasks.

[0026] In one embodiment, when the task listener is invoked to perform workflow listening, the task listener performs workflow listening in a hierarchical manner; wherein the task listener includes a workflow listener, a first-level task work listener, and a second-level task node listener; the workflow listener is used to listen to the execution process of the workflow, the first-level task work listener is used to listen to the execution process of the first-level task work, and the second-level task node listener is used to listen to the execution process of the second-level task node.

[0027] In one embodiment, the workflow control center uses the visual interface to control task creation or addition, task deletion, task execution, task pause, task resumption, and task stopping; when executing tasks in a hierarchical manner within the workflow, the system further includes:

[0028] Each user task also has a timeout period. When the user task is executed and exceeds its corresponding timeout period, the task will end and an object lock will be added. The next task in the workflow will then be executed until all workflow tasks are completed. The workflow control center controls the pausing and resuming of user tasks by controlling the object lock.

[0029] On the other hand, a batch processing task dynamic control device is provided, the device comprising:

[0030] The workflow control center is used to create or add user tasks through a visual interface, and to set task categories, task-bound devices, and task priorities.

[0031] The task scheduling center is used to divide the user tasks into different sets according to the devices bound to each task, and to distribute each set to the corresponding task-bound devices;

[0032] The task conversion factory is used to split each set hierarchically and combine them according to task categories to generate workflows, allocate the workflows to their corresponding thread pools and task queues, and sort them according to task priority.

[0033] The workflow execution center is used to hierarchically execute tasks within a workflow; and

[0034] The workflow monitoring center is used to record task execution logs and task status modifications during workflow execution by monitoring task completion.

[0035] In another aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:

[0036] Create or add user tasks through a visual interface, and set task category, task-bound device, and task priority;

[0037] The user tasks are divided into different sets according to the device bound to each task, and each set is distributed to the corresponding task-bound device;

[0038] Each set is split into hierarchical components and combined according to task categories to generate workflows. Workflows are then assigned to their corresponding thread pools and task queues and sorted according to task priority. Tasks in the workflow are executed hierarchically. During workflow execution, task execution logs and task status modifications are recorded by listening to task completion.

[0039] In another aspect, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0040] Create or add user tasks through a visual interface, and set task category, task-bound device, and task priority;

[0041] The user tasks are divided into different sets according to the device bound to each task, and each set is distributed to the corresponding task-bound device;

[0042] Each set is split into hierarchical components and combined according to task categories to generate workflows. Workflows are then assigned to their corresponding thread pools and task queues and sorted according to task priority. Tasks in the workflow are executed hierarchically. During workflow execution, task execution logs and task status modifications are recorded by listening to task completion.

[0043] The aforementioned batch processing task dynamic control method, device, computer equipment, and storage medium decompose and combine user tasks into a workflow. The workflow completes according to a hierarchical task execution process, and workflow monitoring and logging can be performed through a workflow monitoring center. Furthermore, a two-level control mechanism through the server's workflow control center module, using object locks to modify task states, enables hierarchical task control, resulting in more precise task control and improved user experience. Moreover, task decomposition and combination allows multiple server management tasks to be executed simultaneously, reducing the complexity of the software used by users and improving its usability and scalability. Combined with a visual interface for managing the workflow processes corresponding to tasks, the user's operability of the server management system is enhanced. Attached Figure Description

[0044] Figure 1 This is an application environment diagram of the batch task dynamic control method in one embodiment;

[0045] Figure 2 This is an overall network topology diagram of the server in one embodiment;

[0046] Figure 3 This is a flowchart illustrating a batch task dynamic control method in one embodiment;

[0047] Figure 4 This is a flowchart of a batch task dynamic control method in one embodiment;

[0048] Figure 5 This is a flowchart illustrating how each set is hierarchically split and then combined according to task categories to generate workflow steps in one embodiment.

[0049] Figure 6 This is a flowchart illustrating the hierarchical execution steps of tasks in a workflow in one embodiment;

[0050] Figure 7 This is a flowchart illustrating the steps of recording task execution logs and modifying task status during workflow execution in one embodiment.

[0051] Figure 8 This is a flowchart illustrating the hierarchical execution of workflow tasks in one embodiment;

[0052] Figure 9 This is a structural block diagram of a batch processing task dynamic control device in one embodiment;

[0053] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0055] The batch processing task dynamic control method provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. Server 104 can be a standalone server or a server cluster consisting of multiple servers. Terminal 102 has a visual interface, which is one of the main channels for communication with the user; the visual interface includes a web page. The main functions that can be implemented on terminal 102 include adding, deleting, executing, pausing, resuming, and stopping tasks. Server 104 is used to integrate the management system into a task control system, becoming a batch task processing system.

[0056] like Figure 2 As shown, Figure 2 The overall network topology diagram of server 104 shows that server 104 deploys a management program on a cloud server according to the network topology. This program can be integrated into the management program using tools such as Maven or Gradle, or it can be deployed as a service to provide task management services. First, the management program needs to implement the task scheduling service definition, defining interfaces such as executors, task splitting rules, and task listeners. Users can create tasks through a webpage, setting task categories, bound devices, and priorities, and then send them to server 104. Therefore, the overall network topology diagram of server 104 includes a management program 1 and multiple task scheduling services 2. Each task scheduling service 2 corresponds to a server room 3, and each server room 3 contains multiple server devices 31. The management program 1 and the multiple task scheduling services 2 are connected via a first network connection device 4, and each task scheduling service 2 and each server device 31 in each server room 3 are connected via a second network connection device 5.

[0057] Understandably, in order to facilitate the effective processing and status tracking of user tasks by server 104, its structure includes a workflow control center, a task scheduling center, a task execution center, a task conversion factory, and a workflow monitoring center.

[0058] The main functions of the workflow control center include adding, deleting, executing, pausing, resuming, and stopping tasks.

[0059] The task scheduling center is mainly responsible for distributing tasks to different task execution modules (i.e., server devices 31) according to scheduling rules for task execution.

[0060] The main function of the task conversion factory is to perform hierarchical task splitting according to the user's task splitting rules, split and combine newly added tasks according to task information, arrange them into a workflow, and finally send the workflow to the task execution center.

[0061] The task execution center mainly defines the abstract logic implemented by the executor and the orchestrated task execution logic, including the definition of the abstract executor and the logic of hierarchical execution of combined tasks.

[0062] The workflow monitoring center defines a series of monitoring events, including workflow monitoring, first-level task monitoring, and second-level task monitoring, and completes task log recording and task status modification through task monitoring.

[0063] In one embodiment, such as Figure 3 As shown, a dynamic control method for batch processing tasks is provided, which can be applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps S1-S5.

[0064] Step S1: Create or add user tasks through the visual interface, and set the task category, task binding device, and task priority.

[0065] In step S1, the workflow control center uses the visual interface to control tasks such as creating or adding tasks, deleting tasks, executing tasks, pausing tasks, resuming tasks, and stopping tasks.

[0066] During operation, first follow Figure 2 As shown, management program 1 is deployed in the data center of server 104. Ensure smooth network connectivity between management program 1 and server device 31. Management program 1 needs to integrate with server device 31 and implement interfaces such as workflow, task executor, and listener for the task scheduling center. Create n task templates M = {m1, m2, ..., mn} on the web page. j …m n Each task template consists of multiple steps. For example, firmware upgrade includes steps such as firmware file upload, file verification, performing refresh, reading refresh progress, and obtaining refresh version. Therefore, each template m can be broken down into l steps, i.e., S = {s1, s2, ..., sm}. j …s l The task template corresponds to m devices, denoted as R = {r1, r2, ..., r}. j …r mThe task is then submitted to the task scheduling center. Here, a workflow refers to a collection of tasks. The task executor includes first-level tasks (Works) and second-level tasks (Nodes). Each Work contains multiple Nodes, including a set of Nodes, the Next Work, the workflow listening center, and timeout information. The listening interface includes a Work Flow Listener, a First-Level Task Listener, and a Second-Level Task Listener.

[0067] Step S2: Divide the user tasks into different sets according to the device bound to each task, and distribute each set to the corresponding task-bound device.

[0068] In step S2, the task-bound device is the server device 31 mentioned earlier. The generated task template M and task-bound device R are first split and called to different task scheduling centers based on the different data centers where the devices are located. Then, the task template and device information are used to generate the tasks required for task scheduling through a task transformation factory. In the task transformation factory, according to the task template, its corresponding splitting steps, and its parameters, the task template required by the scheduling system is generated using reflection technology. Finally, the task order is reordered, a task workflow is designed and generated, and task listening is bound using dynamic registration technology.

[0069] Step S3: After splitting each set into hierarchical levels, combine them according to task categories to generate workflows, allocate the workflows to their corresponding thread pools and task queues, and sort them according to task priority.

[0070] In step S3, the generated task flow dynamically uses its own thread pool and task queue according to the different types of tasks managed by the server. Here, the queue is a priority queue, and the queue order can be adjusted according to the set priority. If the thread pool is not full, it can directly enter the task execution scheduling module. If the thread pool is full, the task queue position is set according to the task priority in the workflow, and the task waits for task scheduling.

[0071] Step S4: Execute tasks in the workflow in a hierarchical manner.

[0072] In step S4, the workflow execution schedules the corresponding executors according to the first-level tasks and second-level tasks, while simultaneously listening to the task corresponding to the task being executed.

[0073] Step S5: During the workflow execution process, the task execution log and task status modification are recorded by monitoring the task.

[0074] In step S5, after the workflow starts executing, it follows... Figure 3 As shown, the workflow listener task begins first, the next Work is obtained, it is checked whether the Work is empty, the Work listener is executed, and the workflow control center is queried to see if there is a control task. If it is a stop event, the workflow ends; if it is a pause event, a lock is added to the workflow and the thread is released, waiting for the workflow to resume event. If there is no workflow control event, the first-level task is executed, the listener event is executed, it is checked whether there is a work control event, and the work termination, pause and resume, etc. events are executed according to the event type. The task executor is executed in sequence according to the second-level task flow, the node listener is executed, the first-level task is completed, the next Work of the Work is obtained, and the workflow is executed in sequence.

[0075] Please combine Figure 3 , Figure 4 As shown, in the above batch task dynamic control method, server 104 classifies received tasks according to the task-bound device and task category, dividing tasks from the same device into different sets. Then, tasks within each set are grouped and arranged into a workflow according to task category. The workflow then searches for different thread pools and task queues based on task type, and sets the position of the corresponding task queue according to the task priority within the workflow. Workflow execution proceeds sequentially, executing the corresponding executors for first-level tasks and second-level tasks. Simultaneously, task listeners are used to record task logs. Here, the task executors and task listeners need to implement interfaces defined by the task scheduling center.

[0076] Therefore, the above-mentioned batch task dynamic control method can complete the functions of task scheduling and task hierarchical dynamic control in the server management process. In this way, batch task processing can be completed in one task scheduling, reducing service scheduling and execution time. Moreover, the task execution log is recorded in detail through the task monitoring mechanism, and a multi-level controllable task mechanism is provided to improve the interactivity of task execution and enhance the usability of the software.

[0077] Specifically, such as Figure 5 As shown, the step of hierarchically splitting each set and then combining them according to task categories to generate a workflow includes:

[0078] Step S31: The user task is sent to the task scheduling center. The task scheduling center divides the user task into different sets according to the task binding device and distributes each set to the corresponding task binding device.

[0079] Step S32: In the task conversion factory, each set is divided into task levels according to the user's task splitting rules, and then combined and arranged into a workflow according to the task category.

[0080] Step S33: The task conversion factory searches for corresponding thread pools and task queues for the workflow according to task categories; and

[0081] In step S34, the task conversion factory sorts the workflow in the task queue according to task priority, and then sequentially enters the thread pool.

[0082] like Figure 6 As shown, step S4, which involves hierarchically executing tasks in the workflow, includes:

[0083] Step S41: Define a task executor in the workflow execution center. The task executor includes a first-level task work and a second-level task node, wherein each work contains multiple nodes.

[0084] Step S42: Call the task executor to check the task queue; if the task queue is empty, continue to wait; if the task queue has workflows, immediately read the relevant information of the workflows from the task queue and execute the corresponding actions in stages.

[0085] like Figure 7 , Figure 8 As shown, step S5, which involves recording task execution logs and modifying task status during workflow execution by monitoring tasks, includes:

[0086] Step S51: Invoke the task listener to perform workflow listening, and the task listener obtains the next task;

[0087] Step S52: The task listener determines whether the task in the current work is empty; if so, the workflow listening ends; otherwise, the work listening begins.

[0088] Step S53: When the task listener is performing work listening, it detects in real time whether there are pause, termination, or resumption events; if a termination occurs, the workflow listening ends; if a pause occurs, an object lock is added to the workflow and the thread is released, waiting for a resumption event; if no pause, termination, or resumption events occur, the first-level task work begins and the listening event is executed, and the next node is obtained according to the second-level task node process; and

[0089] Step S54: After obtaining the next node, the task listener determines whether the node is empty; if so, the workflow listening ends and returns to obtain the next work step; otherwise, it determines whether there is a control event; if so, the user-defined node executor is executed until the node listening ends and returns to obtain the next node step.

[0090] When the task listener is invoked to perform workflow listening, the task listener performs workflow listening in a hierarchical manner; wherein the task listener includes a workflow listener, a first-level task work listener, and a second-level task node listener; the workflow listener is used to listen to the execution process of the workflow, the first-level task work listener is used to listen to the execution process of the first-level task work, and the second-level task node listener is used to listen to the execution process of the second-level task node.

[0091] Therefore, this application adopts a hierarchical management approach, dividing user tasks into two levels. The corresponding task executors include first-level task works and second-level task nodes. Each work contains multiple nodes, including a set of nodes, the next work, a workflow listening center, and timeout information. Correspondingly, the workflow listening center's interfaces include a workflow listener, a first-level task listener, and a second-level task listener. This allows for comprehensive second-level task execution and third-level task listening. The management program can integrate a workflow control center, task scheduling center, task execution center, task transformation factory, and workflow listening center, implementing defined interfaces for task executors, listening, task splitting rules, and task feedback. This enables rapid task integration. The management program only needs to create tasks, listen to and manage tasks, and bind devices to complete task execution and scheduling, thus improving processing efficiency.

[0092] This application embodiment can split tasks into multi-level tasks according to user-defined task splitting rules, and then use reflection technology to transform user tasks into system-defined tasks, forming a workflow. Within the workflow, executors and listeners are executed sequentially according to task level, completing workflow and task log recording. Furthermore, a two-layer control mechanism is provided within the workflow to achieve hierarchical task control. This approach not only enables batch task processing with a single task scheduling, reducing service scheduling and execution time, but also provides detailed task execution log recording through the task listening mechanism and a multi-level controllable task mechanism, enhancing task execution interactivity and improving software usability.

[0093] Example 2

[0094] Embodiment 2 of this application includes all the technical features of Embodiment 1. The difference is that Embodiment 2 further improves the scheme for controlling user tasks in the workflow control center when they are paused and resumed.

[0095] For each task, a custom timeout period can be set. If the timeout period is exceeded, the task will end and the next task in the workflow will be executed until all tasks in the workflow are completed, thus avoiding tasks being stuck for a long time. In addition, users can control the execution, stopping, and pausing of tasks through the page.

[0096] Therefore, in this embodiment, when executing tasks in a hierarchical manner in the workflow, the following is also included: each user task is also provided with a timeout period. When the user task is executed and exceeds its corresponding timeout period, the task will end and an object lock will be added, and the next task in the workflow will be executed until all workflow tasks are completed; the workflow control center controls the pause and resumption of user tasks by controlling the object lock.

[0097] In this embodiment, to facilitate the visualization and management of abnormal situations in the workflow, when executing tasks in the workflow in a hierarchical manner, the method further includes: calling the workflow control center to control the pause and resumption of user tasks, wherein the workflow control center includes workflow control and primary task control; the workflow control and the primary task control respectively set a flow lock map and a work lock map to control the corresponding object locks, thereby controlling the pause and resumption of user tasks.

[0098] Therefore, this embodiment uses object locks to achieve dynamic control of tasks. This server 104 can not only complete the execution of multiple tasks at once, but also achieve dynamic control of tasks through the system, thereby improving software usability.

[0099] It should be understood that, although Figure 2-7 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2-7 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0100] In one embodiment, such as Figure 9 As shown, a batch processing task dynamic control device 10 is provided, including a workflow control center 11, a task scheduling center 12, a task conversion factory 13, a workflow execution center 14, and a workflow monitoring center 15.

[0101] The Workflow Control Center 11 is used to create or add user tasks through a visual interface, and to set task categories, task-bound devices, and task priorities.

[0102] The task scheduling center 12 is used to divide the user tasks into different sets according to the task binding device, and distribute each set to the corresponding task binding device.

[0103] Task conversion factory 13 is used to split each set hierarchically and combine them according to task categories to generate workflows, allocate the workflows to their corresponding thread pools and task queues, and sort them according to task priority.

[0104] Workflow Execution Center 14 is used to execute tasks in a hierarchical manner within a workflow.

[0105] The workflow monitoring center 15 is used to record task execution logs and task status modifications during workflow execution by monitoring tasks.

[0106] The aforementioned batch processing task dynamic control device integrates five parts—workflow control center 11, task scheduling center 12, task conversion factory 13, workflow execution center 14, and workflow monitoring center 15—to perform dynamic task scheduling and task hierarchical management during server management. This approach not only enables batch task processing to be completed in a single task scheduling, reducing service scheduling and execution time, but also allows for detailed recording of task execution logs through the task monitoring mechanism of workflow monitoring center 15. Furthermore, it provides a multi-level controllable task mechanism, enhancing the interactivity of task execution and improving software usability.

[0107] Specific limitations regarding the batch task dynamic control device can be found in the limitations of the batch task dynamic control method described above, and will not be repeated here. Each module in the aforementioned batch task dynamic control device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0108] In summary, using the method of this invention, the management system implements functions such as task executor, listener, custom thread pool, and task queue for server 104. Then, the management program creates server management tasks and sends them to the task scheduling center 12 along with the task execution devices. The task scheduling center 12 dispatches these tasks to different task centers 11 based on the device. At task center 11, the user task is first converted into a task supported by task scheduling center 12 through task conversion factory 13, and then the user task is broken down and combined into a workflow. The workflow is executed according to a hierarchical task execution process, and the workflow can be monitored and logged through workflow listening center 15. Furthermore, the two-level control mechanism of the workflow control center 11 of server 104, using object locks, enables hierarchical task control, resulting in more precise task control and improved user experience. By splitting and combining tasks, multiple server management tasks can be executed at once, reducing the complexity of the software used by the user and improving its scalability.

[0109] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores dynamic control data for batch processing tasks. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a dynamic control method for batch processing tasks.

[0110] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0111] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. See [link to relevant documentation]. Figure 3 When a processor executes a computer program, it performs the following steps:

[0112] Step S1: Create or add user tasks through the visual interface, and set the task category, task binding device, and task priority;

[0113] Step S1: Divide the user tasks into different sets according to the device bound to each task, and distribute each set to the corresponding task-bound device;

[0114] Step S3: After splitting each set into hierarchical levels, combine them according to task categories to generate workflows, allocate the workflows to their corresponding thread pools and task queues, and sort them according to task priority.

[0115] Step S4: Execute tasks in the workflow in a hierarchical manner; and

[0116] Step S5: During the workflow execution process, the task execution log and task status modification are recorded by monitoring the task.

[0117] In one embodiment, see Figure 5 When the processor executes a computer program, the process of generating a workflow by combining each set according to task categories after hierarchical splitting specifically includes:

[0118] Step S31: The user task is sent to the task scheduling center. The task scheduling center divides the user task into different sets according to the task binding device and distributes each set to the corresponding task binding device.

[0119] Step S32: In the task conversion factory, each set is divided into task levels according to the user's task splitting rules, and then combined and arranged into a workflow according to the task category.

[0120] Step S33: The task conversion factory searches for corresponding thread pools and task queues for the workflow according to task categories; and

[0121] In step S34, the task conversion factory sorts the workflow in the task queue according to task priority, and then sequentially enters the thread pool.

[0122] Please see Figure 6 When the processor executes the computer program, the step S4 of hierarchically executing tasks in the workflow specifically includes:

[0123] Step S41: Define a task executor in the workflow execution center. The task executor includes a first-level task work and a second-level task node, wherein each work contains multiple nodes.

[0124] Step S42: Call the task executor to check the task queue; if the task queue is empty, continue to wait; if the task queue has workflows, immediately read the relevant information of the workflows from the task queue and execute the corresponding actions in stages.

[0125] Please see Figure 7 , Figure 8 When the processor executes a computer program, step S5, which involves recording task execution logs and modifying task status by monitoring tasks during workflow execution, specifically includes:

[0126] Step S51: Invoke the task listener to perform workflow listening, and the task listener obtains the next task;

[0127] Step S52: The task listener determines whether the task in the current work is empty; if so, the workflow listening ends; otherwise, the work listening begins.

[0128] Step S53: When the task listener is performing work listening, it detects in real time whether there are pause, termination, or resumption events; if a termination occurs, the workflow listening ends; if a pause occurs, an object lock is added to the workflow and the thread is released, waiting for a resumption event; if no pause, termination, or resumption events occur, the first-level task work begins and the listening event is executed, and the next node is obtained according to the second-level task node process; and

[0129] Step S54: After obtaining the next node, the task listener determines whether the node is empty; if so, the workflow listening ends and returns to obtain the next work step; otherwise, it determines whether there is a control event; if so, the user-defined node executor is executed until the node listening ends and returns to obtain the next node step.

[0130] When the task listener is invoked to perform workflow listening, the task listener performs workflow listening in a hierarchical manner; wherein the task listener includes a workflow listener, a first-level task work listener, and a second-level task node listener; the workflow listener is used to listen to the execution process of the workflow, the first-level task work listener is used to listen to the execution process of the first-level task work, and the second-level task node listener is used to listen to the execution process of the second-level task node.

[0131] Therefore, this application adopts a hierarchical management approach, dividing user tasks into two levels. The corresponding task executors include first-level task works and second-level task nodes. Each work contains multiple nodes, including a set of nodes, the next work, a workflow listening center, and timeout information. Correspondingly, the workflow listening center's interfaces include a workflow listener, a first-level task listener, and a second-level task listener. This allows for comprehensive second-level task execution and third-level task listening. The management program can integrate a workflow control center, task scheduling center, task execution center, task transformation factory, and workflow listening center, implementing defined interfaces for task executors, listening, task splitting rules, and task feedback. This enables rapid task integration. The management program only needs to create tasks, listen to and manage tasks, and bind devices to complete task execution and scheduling, thus improving processing efficiency.

[0132] This application embodiment can split tasks into multi-level tasks according to user-defined task splitting rules, and then use reflection technology to transform user tasks into system-defined tasks, forming a workflow. Within the workflow, executors and listeners are executed sequentially according to task level, completing workflow and task log recording. Furthermore, a two-layer control mechanism is provided within the workflow to achieve hierarchical task control. This approach not only enables batch task processing with a single task scheduling, reducing service scheduling and execution time, but also provides detailed task execution log recording through the task listening mechanism and a multi-level controllable task mechanism, enhancing task execution interactivity and improving software usability.

[0133] For each task, a custom timeout period can be set. If the timeout period is exceeded, the task will end and the next task in the workflow will be executed until all tasks in the workflow are completed, thus avoiding tasks being stuck for a long time. In addition, users can control the execution, stopping, and pausing of tasks through the page.

[0134] Therefore, in this embodiment, when executing tasks in a hierarchical manner in the workflow, the following is also included: each user task is also provided with a timeout period. When the user task is executed and exceeds its corresponding timeout period, the task will end and an object lock will be added, and the next task in the workflow will be executed until all workflow tasks are completed; the workflow control center controls the pause and resumption of user tasks by controlling the object lock.

[0135] In this embodiment, to facilitate the visualization and management of abnormal situations in the workflow, when executing tasks in the workflow in a hierarchical manner, the method further includes: calling the workflow control center to control the pause and resumption of user tasks, wherein the workflow control center includes workflow control and primary task control; the workflow control and the primary task control respectively set up a workflow lock graph and a task lock graph to control the corresponding object locks, thereby controlling the pause and resumption of user tasks.

[0136] Therefore, this embodiment achieves dynamic control of tasks through object locks. This computer device can not only execute multiple tasks at once, but also achieve dynamic control of tasks through the system, thereby improving software usability.

[0137] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon; see [link to relevant documentation]. Figure 3 When a computer program is executed by a processor, it performs the following steps:

[0138] Step S1: Create or add user tasks through the visual interface, and set the task category, task binding device, and task priority;

[0139] Step S1: Divide the user tasks into different sets according to the device bound to each task, and distribute each set to the corresponding task-bound device;

[0140] Step S3: After splitting each set into hierarchical levels, combine them according to task categories to generate workflows, allocate the workflows to their corresponding thread pools and task queues, and sort them according to task priority.

[0141] Step S4: Execute tasks in the workflow in a hierarchical manner; and

[0142] Step S5: During the workflow execution process, the task execution log and task status modification are recorded by monitoring the task.

[0143] In one embodiment, see Figure 5 When a computer program is executed by a processor, it generates a workflow by combining each set according to task categories after hierarchical splitting, specifically including:

[0144] Step S31: The user task is sent to the task scheduling center. The task scheduling center divides the user task into different sets according to the task binding device and distributes each set to the corresponding task binding device.

[0145] Step S32: In the task conversion factory, each set is divided into task levels according to the user's task splitting rules, and then combined and arranged into a workflow according to the task category.

[0146] Step S33: The task conversion factory searches for corresponding thread pools and task queues for the workflow according to task categories; and

[0147] In step S34, the task conversion factory sorts the workflow in the task queue according to task priority, and then sequentially enters the thread pool.

[0148] Please see Figure 6 When the computer program is executed by the processor, the step S4 of hierarchically executing tasks in the workflow specifically includes:

[0149] Step S41: Define a task executor in the workflow execution center. The task executor includes a first-level task work and a second-level task node, wherein each work contains multiple nodes.

[0150] Step S42: Call the task executor to check the task queue; if the task queue is empty, continue to wait; if the task queue has workflows, immediately read the relevant information of the workflows from the task queue and execute the corresponding actions in stages.

[0151] Please see Figure 7 , Figure 8 When a computer program is executed by a processor, step S5, which involves recording task execution logs and modifying task status by monitoring tasks during workflow execution, specifically includes:

[0152] Step S51: Invoke the task listener to perform workflow listening, and the task listener obtains the next task;

[0153] Step S52: The task listener determines whether the task in the current work is empty; if so, the workflow listening ends; otherwise, the work listening begins.

[0154] Step S53: When the task listener is performing work listening, it detects in real time whether there are pause, termination, or resumption events; if a termination occurs, the workflow listening ends; if a pause occurs, an object lock is added to the workflow and the thread is released, waiting for a resumption event; if no pause, termination, or resumption events occur, the first-level task work begins and the listening event is executed, and the next node is obtained according to the second-level task node process; and

[0155] Step S54: After obtaining the next node, the task listener determines whether the node is empty; if so, the workflow listening ends and returns to obtain the next work step; otherwise, it determines whether there is a control event; if so, the user-defined node executor is executed until the node listening ends and returns to obtain the next node step.

[0156] When the task listener is invoked to perform workflow listening, the task listener performs workflow listening in a hierarchical manner; wherein the task listener includes a workflow listener, a first-level task work listener, and a second-level task node listener; the workflow listener is used to listen to the execution process of the workflow, the first-level task work listener is used to listen to the execution process of the first-level task work, and the second-level task node listener is used to listen to the execution process of the second-level task node.

[0157] Therefore, this application adopts a hierarchical management approach, dividing user tasks into two levels. The corresponding task executors include first-level task works and second-level task nodes. Each work contains multiple nodes, including a set of nodes, the next work, a workflow listening center, and timeout information. Correspondingly, the workflow listening center's interfaces include a workflow listener, a first-level task listener, and a second-level task listener. This allows for comprehensive second-level task execution and third-level task listening. The management program can integrate a workflow control center, task scheduling center, task execution center, task transformation factory, and workflow listening center, implementing defined interfaces for task executors, listening, task splitting rules, and task feedback. This enables rapid task integration. The management program only needs to create tasks, listen to and manage tasks, and bind devices to complete task execution and scheduling, thus improving processing efficiency.

[0158] This application embodiment can split tasks into multi-level tasks according to user-defined task splitting rules, and then use reflection technology to transform user tasks into system-defined tasks, forming a workflow. Within the workflow, executors and listeners are executed sequentially according to task level, completing workflow and task log recording. Furthermore, a two-layer control mechanism is provided within the workflow to achieve hierarchical task control. This approach not only enables batch task processing with a single task scheduling, reducing service scheduling and execution time, but also provides detailed task execution log recording through the task listening mechanism and a multi-level controllable task mechanism, enhancing task execution interactivity and improving software usability.

[0159] For each task, a custom timeout period can be set. If the timeout period is exceeded, the task will end and the next task in the workflow will be executed until all tasks in the workflow are completed, thus avoiding tasks being stuck for a long time. In addition, users can control the execution, stopping, and pausing of tasks through the page.

[0160] Therefore, in this embodiment, when executing tasks in a hierarchical manner in the workflow, the following is also included: each user task is also provided with a timeout period. When the user task is executed and exceeds its corresponding timeout period, the task will end and an object lock will be added, and the next task in the workflow will be executed until all workflow tasks are completed; the workflow control center controls the pause and resumption of user tasks by controlling the object lock.

[0161] In this embodiment, to facilitate the visualization and management of abnormal situations in the workflow, when executing tasks in the workflow in a hierarchical manner, the method further includes: calling the workflow control center to control the pause and resumption of user tasks, wherein the workflow control center includes workflow control and primary task control; the workflow control and the primary task control respectively set up a workflow lock graph and a task lock graph to control the corresponding object locks, thereby controlling the pause and resumption of user tasks.

[0162] Therefore, this embodiment achieves dynamic control of tasks through object locks. When the computer program stored on this computer-readable storage medium is executed by the processor, it can not only complete the execution of multiple tasks at once, but also achieve dynamic control of tasks through the system, thereby improving software usability.

[0163] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0164] The aforementioned batch processing task dynamic control method, device, computer equipment, and storage medium decompose and combine user tasks into a workflow. The workflow completes according to a hierarchical task execution process, and workflow monitoring and logging can be performed through a workflow monitoring center. Furthermore, a two-level control mechanism through the server's workflow control center module, using object locks to modify task states, enables hierarchical task control, resulting in more precise task control and improved user experience. Moreover, task decomposition and combination allows multiple server management tasks to be executed simultaneously, reducing the complexity of the software used by users and improving its usability and scalability. Combined with a visual interface for managing the workflow processes corresponding to tasks, the user's operability of the server management system is enhanced.

[0165] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.

[0166] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for dynamically controlling batch processing tasks, characterized by, include: Create or add user tasks through a visual interface, and set task category, task-bound device, and task priority; This involves creating multiple task templates, each task template consisting of multiple steps. The task template corresponds to a task-bound device tag and is then submitted to the task scheduling center. The user tasks are divided into different sets according to the device bound to each task, and each set is distributed to the corresponding task-bound device; Each set is hierarchically split and then combined according to task category to generate a workflow. The workflow is then assigned to its corresponding thread pool and task queue and sorted according to task priority. Tasks in the workflow are executed in a hierarchical manner; as well as During workflow execution, task execution logs and task status modifications are recorded by monitoring task completion. The step of hierarchically splitting each set and combining them according to task categories to generate a workflow includes: The user tasks are sent to the task scheduling center, which divides the user tasks into different sets according to the devices bound to each task, and distributes each set to the corresponding devices bound to the task. The generated task templates and devices are split and called to different task scheduling centers according to the different data centers where the devices are located. The task templates and device information are used to generate the tasks required for task scheduling through the task conversion factory. In the task conversion factory, the tasks required by the task scheduling center are generated according to the task templates, the corresponding splitting steps of the task templates and the task template parameters. The task order is reordered to generate a task workflow. In the task conversion factory, each set is divided into task levels according to the user's task splitting rules, and then combined and arranged into a workflow according to task categories; The task conversion factory identifies the corresponding thread pool and task queue according to the task category of the workflow; and The task conversion factory sorts the workflow in the task queue according to task priority, and then sequentially enters the thread pool.

2. The batch processing task dynamic control method according to claim 1, characterized in that, The hierarchical execution of tasks in the workflow includes: Define a task executor in the workflow execution center. The task executor includes a first-level task work and a second-level task node, where each work contains multiple nodes. The task executor is invoked to check the task queue; if the task queue is empty, the process continues to wait; if the task queue contains workflows, the relevant information of the workflows is immediately read from the task queue, and the corresponding actions are executed in stages.

3. The batch processing task dynamic control method according to claim 2, characterized in that, The process of recording task execution logs and modifying task status by monitoring tasks during workflow execution includes: The task listener is invoked to perform workflow monitoring, and the task listener obtains the next task. The task listener determines whether the task in the current work is empty; if so, it executes the workflow listener to end; otherwise, it executes the work listener. When the task listener is performing work listening, it detects in real time whether there are pause, termination, or resumption events. If there is a termination, the workflow listening ends. If there is a pause, an object lock is added to the workflow and the thread is released, waiting for a resumption event. If there are no pause, termination, or resumption events, the first-level task work begins and the listening event is executed, and the next node is obtained according to the second-level task node process. After obtaining the next node, the task listener determines whether the node is empty; if so, it ends the workflow listening and returns to obtain the next work step; otherwise, it determines whether there is a control event; if so, it executes the user-defined node executor until the node listening ends and returns to obtain the next node step.

4. The batch processing task dynamic control method according to claim 3, characterized in that, When assigning tasks to different levels in a workflow, the following is also included: The workflow control center is invoked to control the pause and resumption of user tasks. The workflow control center includes workflow control and primary task control. The workflow control and the primary task control respectively set up workflow locking graphs and task locking graphs to control the corresponding object locks, thereby controlling the pause and resumption of user tasks.

5. The batch processing task dynamic control method according to claim 3, characterized in that, When the task listener is invoked to perform workflow listening, the task listener performs workflow listening in a hierarchical manner; wherein the task listener includes a workflow listener, a first-level task work listener, and a second-level task node listener; the workflow listener is used to listen to the execution process of the workflow, the first-level task work listener is used to listen to the execution process of the first-level task work, and the second-level task node listener is used to listen to the execution process of the second-level task node.

6. The batch processing task dynamic control method according to claim 1, characterized in that, The workflow control center uses the visual interface to control task creation or addition, deletion, execution, pause, resumption, and stopping. When executing tasks in a hierarchical manner within the workflow, the system also includes: Each user task also has a timeout period. When the user task is executed and exceeds its corresponding timeout period, the task will end and an object lock will be added. The next task in the workflow will then be executed until all workflow tasks are completed. The workflow control center controls the pausing and resuming of user tasks by controlling the object lock.

7. A batch processing task dynamic control device, characterized in that, The apparatus for implementing the batch processing task dynamic control method according to any one of claims 1 to 6, the apparatus comprising: The workflow control center is used to create or add user tasks through a visual interface, and to set task categories, task-bound devices, and task priorities. The task scheduling center is used to divide the user tasks into different sets according to the devices bound to each task, and to distribute each set to the corresponding task-bound devices; The task conversion factory is used to split each set hierarchically and combine them according to task categories to generate workflows, allocate the workflows to their corresponding thread pools and task queues, and sort them according to task priority. The workflow execution center is used to hierarchically execute tasks within a workflow; and The workflow monitoring center is used to record task execution logs and task status modifications during workflow execution by monitoring tasks.

8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Thread pool management method and device

    CN105760234A

  • Task management method and device in data management

    CN109800226A

  • Workflow-based data analysis model calculation engine system and operation method

    CN113886111A