HRRN-based distributed digital employee task hierarchical scheduling method and storage medium
Through MapReduce decomposition of tasks and HRRN priority adjustment, combined with the resource pool scaling of greedy algorithms, the problems of insufficient utilization of machine resources and timely process scheduling in digital employee technology are solved, and task execution efficiency and resource utilization are improved.
Patent Information
- Application Number
- CN202410572729.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-10
- Publication Date
- 2025-01-03
AI Technical Summary
In the existing digital employee technology, machine resources are not fully utilized and cannot be dynamically scaled, resulting in low efficiency in execution of strong timeliness processes and insufficient priority hierarchical scheduling of efficiency processes at different times, affecting work efficiency.
The MapReduce idea was introduced to decompose large tasks into subtasks, and dynamically adjust the priority through the HRRN algorithm, combining greedy algorithms to achieve elastic scaling of the machine resource pool, ensuring that strong timeliness processes are executed first, and weak timeliness processes are lagging behind.
It improves the task throughput per unit time, realizes hierarchical scheduling of different efficiencies processes, avoids resource waste, and improves the real-time execution of highly efficiencies processes and user satisfaction.
Smart Images

Figure CN119248432A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital employee technology in the computer field, and in particular to a distributed digital employee task hierarchical scheduling method based on HRRN and a storage medium. Background Art
[0002] Highest Response Ratio Next (HRRN) is an algorithm for allocating the response ratio of the CPU central controller. HRRN is a compromise algorithm between FCFS (First Come First Served) and SJF (Short Job First), which takes into account both the job waiting time and the job running time, taking care of short jobs while not making the long jobs wait too long, thus improving the scheduling performance. Highest Response Ratio Next (HRRN) takes into account both the job execution time and the job waiting time, combining the characteristics of the First Come First Served and Shortest Job First algorithms. The response ratio in the HRRN algorithm refers to the ratio of the job waiting time to the running time, and the response ratio formula is defined as follows: Response Ratio = (Waiting Time + Required Service Time) / Required Service Time.
[0003] Robotic process automation (digital employees) is one of the emerging digital transformation methods under the wave of AI in recent years. It uses digital employees to replace human employees to complete repetitive and cumbersome transactional processes, aiming to improve enterprise work efficiency and reduce enterprise operating costs.
[0004] Digital employees can work 24 / 7 without interruption. However, the number of digital employees is limited by the number of available machines. If there are too few machines, it will affect the execution time of the digital employee process. If there are too many machines, it will cause a waste of resources. In actual applications, there are some business scenarios with high timeliness requirements. Especially in the financial industry, the third-party business system is connected to the digital employee system, and the digital employee process is called up by triggering the digital employee interface to query certain information and fill the query results back to the business system. For example, the online account opening system is connected to the digital employee system, and the customer is queried for dishonesty by logging into the securities and futures market dishonesty record query platform, and the query results and screenshots are written back to the online account opening system for business personnel to improve the customer information and submit it for review. If the digital employee process returns the results slowly, it will delay the submission time of the business personnel, affect work efficiency, and lose the meaning of the existence of digital employees. For another example, in investment banking business, due diligence work runs through the entire investment banking business. Business personnel will go to many websites to search for the information they need to extract. If a business person needs to search many websites, although digital employee technology can be used to reduce manual operations, long retrieval tasks will keep the machine occupied, causing other tasks in the queue, especially tasks with high timeliness requirements, to be unable to be consumed, which will affect the efficiency of other tasks.
[0005] There are currently three problems in the implementation of digital employees: first, digital employee machines are not fully utilized, and the number of machines cannot be dynamically scaled up and down according to the number of tasks and the degree of urgency to work together; second, different time-sensitive processes are not prioritized, resulting in the inability to ensure the priority execution of processes with strong timeliness and the delayed execution of processes with weak timeliness; third, some tasks with longer execution times occupy machines for a long time and cannot be released, which will also lead to low execution efficiency of processes with high timeliness.
[0006] The Chinese patent document with application number CN202210944420.X describes a multi-task scheduling method for digital employees. The method calculates and decomposes the dependencies of the total tasks of the digital employees into a micro-task dependency tree to maximize the execution of micro-tasks. However, the method does not involve the priority strategy of batch micro-tasks in process scheduling.
[0007] The Chinese patent document with application number CN202211353019.5 describes a digital employee process scheduling method based on a genetic algorithm. By real-time monitoring of the resource fluctuations and hardware information of each machine in the cluster, a multi-objective optimization scheduling strategy for success rate and resource cost is formulated to improve the success rate of digital employee job scheduling and reduce cluster machine consumption. However, it is mainly aimed at some background operation processes that do not require timeliness. It is not applicable to some processes with high timeliness requirements involving front-end screenshots and other operations, and the fixed machine resource pool may result in resource waste.
[0008] So, how to maximize the application of digital employees' work and ensure the execution order of digital employee processes with different timeliness based on the limited available machines, and meet the real-time execution of highly time-sensitive processes, has become one of the problems that digital employees need to solve. Summary of the invention
[0009] In view of this, the present invention will solve the above problems from the following three aspects. First, the MapReduce idea is introduced into the digital employee process scheduling, and the generated large tasks are mapped into subtasks through the scheduling center (Master), and assigned to each machine node (Slave) for execution, aiming to solve the problem that the long-term tasks occupy the machine for a long time and cannot be released; second, the high response ratio priority scheduling algorithm (HRRN) of the operating system CPU processor job scheduling is introduced into the digital employee process scheduling, and a dynamic priority adjustment method of the process based on HRRN is proposed, aiming to solve the hierarchical scheduling of digital employee processes with different timeliness, and the problem of priority execution of processes with strong timeliness and delayed execution of processes with weak timeliness on limited machines; at the same time, a method for dynamic expansion or contraction of the digital employee machine resource pool based on a greedy algorithm is proposed, which further solves the problem of waste of machine resource pool resources through elastic scaling of the machine resource pool, and further improves the real-time execution of digital employee processes with strong timeliness.
[0010] The distributed digital employee task hierarchical scheduling method based on HRRN of the present invention comprises the following steps: S1, process initialization: create a digital employee process and initialize the estimated running time predict_exec_time and process priority flow_priority in the capability support system process management; S2, main task generation: users execute multiple digital employee processes and generate multiple digital employee main tasks; S3, main task mapping: The task mapping and reduction module (MapReduce) decomposes and maps the main task of the digital employee into subtasks with the smallest granularity, adds them to the task queue, and records relevant task information; S4, dynamic adjustment of subtask priority: Apply HRRN algorithm to dynamically adjust task priority; S5, dynamic expansion of node machine resource pool: Apply greedy algorithm to dynamically expand or shrink the digital employee machine resource pool, elastically scaling; S6, parallel execution of subtasks: The dispatch center (Master) dispatches node machines (Slaves) to execute digital employee subtasks in a distributed and parallel manner in the queue, monitors various indicators in real time, and reports to the dispatch center; S7, digital employee task summary: The task mapping and summary module (MapReduce) summarizes the digital employee subtasks and calls back the results.
[0011] Preferably, in step S3, when the task mapping and reduction module (MapReduce) detects that the current task is an unmappable task, it will be directly placed in the task queue as a subtask; when a mappable task is detected, the main task will be actively mapped in the background to generate multiple subtasks. The task information that needs to be recorded here is the subtask primary key task_id, the subtask flow_id, the main task main_task_id, the subtask priority task_priority, the subtask state task_state, the execution result exec_result, the execution count exec_count, and the update time update_time; Among them, the initial value of the subtask priority task_priority is the corresponding process priority in S1, the subtask state task_state and the execution result exec_result are both finite state machines, and the task state includes two state machines: issued (1) and not issued (2). The execution results include five state machines: waiting, successful execution (success), failed execution retry (error), failed execution without retry (stop), and pause (pause). The initial value of the execution count exec_count is 0.
[0012] Furthermore, the step S4 is specifically as follows: S41, remove the unconsumed subtask queue , including tasks with a subtask status of not issued (2) and an execution result of waiting (waiting), and tasks with a subtask status of issued (1) and an execution result of failed retry (error); S42, based on the response ratio of the task, the initial priority task_priority and the number of failed executions exec_count are added, and the current priority of each digital employee task is calculated according to the HRRN algorithm: ,in, is the weight of each element, the second element is the HRRN response ratio algorithm, task_priority is the task priority, waiting_time is the task waiting time, the expected running time predict_exec_time is the service time, and exec_count is the number of failed executions; the waiting time calculation formula is: , where current_time is the current time and update_time is the task update time; S43, according to the above formula, the subtask queue can be obtained Latest priority , update the priority of each subtask to the corresponding queue, sort and process the subtasks according to the priority, and execute the tasks in order from high to low priority, which can effectively realize the hierarchical scheduling problem of digital employee processes with different timeliness.
[0013] Furthermore, the step S5 is specifically as follows: S51, remove the unconsumed subtask queue ,in, , is the number of tasks in the queue, and they are sorted according to the priority updated in step S4. Tasks with the same priority are sorted according to the time they entered the queue to obtain the final subtask queue ,in , is the maximum priority value; S52, initialize the available machine resource pool set ,in To initialize the minimum number of available resource pools, determine the maximum expansion number ,in Each machine resource contains meta information {task number task_id, completion timestamp done_time, free flag free_flag}; S52, initialize the available machine resource pool set ,in To initialize the minimum number of available resource pools, determine the maximum expansion number ,in Each machine resource contains meta information {task number task_id, completion timestamp done_time, free flag free_flag}; S53, setting priority threshold , using binary search to calculate the task queue Exceeding the threshold Number of tasks , , then the number of machines to be expanded or reduced is: .
[0014] S54, set the machine average execution time threshold , according to the estimated running time predict_exec_time of each task in S1 and the total number of task queues N, the total running time of the task is obtained , then the expected number of machines to be expanded or reduced is: Since the maximum expansion limit is M, the number of machines to be expanded or reduced is: .
[0015] S55, obtain the number of machines that are finally expanded or reduced Expand or reduce the capacity of the machine.
[0016] Preferably, in step S6, the scheduling center (Master) is the global manager of digital employee tasks, and its specific responsibilities are: (1) Task scheduling: Distributed scheduling of unconsumed tasks in the queue according to the number of idle machines, and dynamic control of the start, end and initialization of tasks; (2) Feedback on operation results: The receiving node machine feedbacks the execution results, including but not limited to the task execution status, task execution result status, metadata of machine resources, and the results generated after the task execution (different display methods such as text, pictures, files, etc.); (3) Heartbeat monitoring: The receiving node machine monitors the node health status of the heartbeat signal sent by the scheduling center, and unhealthy nodes will be excluded from the resource pool; and nodes with a high failure rate in executing tasks at a certain moment in the same machine node are also considered to be unhealthy and are promptly excluded from the resource pool. As the actual executor of digital employee tasks, the node machine (Slave) has the following specific responsibilities: (1) Execute commands: execute various task start and stop commands issued by the dispatch center; (2) Callback notification: When the task is completed, the task of notifying the dispatch center is automatically executed, and the dispatch center is notified of the task execution status and task results; (3) Heartbeat reporting: Node machines periodically report various information on all nodes to the scheduling center through the heartbeat mechanism. This information includes machine-level information, such as node health status, and task-level information, such as task running status.
[0017] Preferably, in step S7, when all subtasks under the same main task are executed, the last executing subnode machine will be informed from the scheduling center (Master), and then the subnode machine will call the task mapping and reduction module (MapReduce) to summarize all subtasks and return the results.
[0018] The storage medium of the distributed digital employee task hierarchical scheduling method based on HRRN of the present invention optimizes the scheduling center, and adds a task mapping and summarization module, a dynamic priority adjustment module, and a machine resource pool expansion module on the basis of its modules: The dispatch center module is used for task scheduling, heartbeat monitoring, result feedback, etc. of digital employees; Task mapping and summarization module, used for task mapping and task summarization of digital employees; Dynamic priority adjustment module, used to adjust the priorities of digital employee tasks with different timeliness; The machine resource pool expansion module is used to elastically scale the machine resource pool.
[0019] The beneficial effects brought by the technical solution provided by the present invention are: (1) The present invention proposes a distributed task mapping and task reduction method based on a scheduling center, which maps large tasks into small tasks, significantly increases the task throughput per unit time, and improves the duty cycle of the task time slice; (2) The present invention proposes a distributed digital employee task hierarchical scheduling strategy, which innovatively implements a dynamic priority adjustment strategy for digital employee task instances and a dynamic expansion or reduction strategy for digital employee machine resource pools, thereby achieving hierarchical scheduling of digital employee processes with different timeliness, and effectively solving the problem of real-time lag in the execution of highly time-sensitive processes in the process queue; (3) The present invention dynamically adjusts the resource pool capacity according to the process priority and execution time, and more intelligently avoids resource waste; (4) In terms of execution efficiency, the algorithm time complexity of the present invention is O(n), the computational overhead is small, and the execution efficiency is high; (5) The operating system of the present invention adopts a B / S architecture, which is independent of the digital employee platform with a C / S architecture. It is not restricted by the operating system and will not add data pressure to the platform. The service is called in the form of an interface, which is simple to operate. (6) Multiple machines execute in parallel, greatly shortening the time it takes to serve users and improving user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a flow chart of the distributed digital employee task hierarchical scheduling method based on HRRN in the present invention; Figure 2 A state machine transition diagram of task status and task execution results in the present invention; Figure 3 It is a flowchart of the task scheduling and summarization module in the present invention; Figure 4 This is a system functional logic architecture diagram for hierarchical scheduling of distributed digital employee tasks in the present invention. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the following will provide a clear and complete description of the technical solutions in the embodiments of the present invention in combination with the embodiments of the present invention. Figure 1 The flowchart of the distributed digital employee task hierarchical scheduling method based on HRRN in the present invention provides a distributed digital employee task hierarchical scheduling strategy, including the following steps: S1, process initialization: create a digital employee process and initialize the estimated running time predict_exec_time and process priority flow_priority in the capability support system process management; S2, main task generation: users execute multiple digital employee processes and generate multiple digital employee main tasks; S3, main task mapping: The task mapping and reduction module (MapReduce) decomposes and maps the main task of the digital employee into subtasks with the smallest granularity, adds them to the task queue, and records relevant task information; S4, dynamic adjustment of subtask priority: Apply HRRN algorithm to dynamically adjust task priority; S5, dynamic expansion of node machine resource pool: Apply greedy algorithm to dynamically expand or shrink the digital employee machine resource pool, elastically scaling; S6, parallel execution of subtasks: The dispatch center (Master) dispatches node machines (Slaves) to execute digital employee subtasks in a distributed and parallel manner in the queue, monitors various indicators in real time, and reports to the dispatch center; S7, digital employee task summary: The task mapping and summary module (MapReduce) summarizes the digital employee subtasks and calls back the results.
[0022] Below, each step is described in further detail.
[0023] For step S1, in the capability support system based on the C / S architecture, several data initialization operations are performed on the digital employee process, including the online and offline status of the process, the business personnel to whom the process belongs, the expected running time, the process priority, whether it can be mapped and other parameter information. As the basic information of the process, this information will affect indicators such as process data statistics, process task instance execution, and machine resource expansion and contraction. In addition to the above-mentioned process management module, the capability support system also includes digital employee support functions such as scheduling module, monitoring module, and workflow module. Since they are not strongly related to the focus of the present invention, they are no longer listed in the present invention.
[0024] With respect to step S2, the third-party business system invokes the http interface provided by the capability support system to initiate a digital employee process and generates multiple task instances, which include mappable tasks and unmappable tasks.
[0025] For step S3, when the task mapping and reduction module (MapReduce) detects that the current task is an unmappable task, it is directly placed in the task queue as a subtask; when the task mapping and reduction module When (MapReduce) detects a mappable task, it will actively map the main task in the background and generate multiple subtasks. The task information that needs to be recorded here is the subtask primary key task_id, the subtask flow_id, the main task main_task_id, the subtask priority task_priority, the subtask state task_state, the execution result exec_result, the execution count exec_count, and the update time update_time.
[0026] Among them, the initial value of the subtask priority task_priority is the corresponding process priority in S1. The subtask state task_state and the execution result exec_result are both finite state machines. The task state includes two state machines: issued (1) and not issued (2). The execution results include five state machines: waiting, successful execution (success), failed execution retry (error), failed execution without retry (stop), and pause (pause). The initial value of the execution count exec_count is 0. For specific task state and execution result state machine transition diagrams, refer to Figure 2 shown.
[0027] With respect to step S4, the present invention proposes a HRRN-based process dynamic priority adjustment strategy for hierarchical scheduling of digital employee processes with different timeliness, with the purpose of improving the priority of processes with strong timeliness and relatively short execution time compared to processes with low real-time requirements and long execution time, so as to achieve the problem of giving priority to processes with strong timeliness and lagging execution of processes with weak timeliness on limited machines. The specific implementation process is as follows: S41, remove the unconsumed task queue , including tasks with a task status of Not Issued and an execution result of Waiting, and tasks with a task status of Issued and an execution result of Failed Retry; S42, based on the HRRN algorithm, taking into account the response ratio of the task, adding the initial priority task_priority and the number of failed executions exec_count, calculates the current priority for each digital employee task: ,in is the weight of each element, the second element is the HRRN response ratio algorithm, waiting_time is the task waiting time, and the expected running time predict_exec_time is the service time. The remaining parameters have been explained in detail in step S2 and will not be repeated here. The waiting time calculation formula is: , where current_time is the current time and update_time is the task update time; S43, according to the above formula, the task queue can be obtained Latest priority , update the priority of each task to the corresponding queue, sort and process the tasks according to the priority, which can effectively realize the hierarchical scheduling problem of digital employee processes with different timeliness.
[0028] For step S3, the relevant pseudo code is implemented as follows: With respect to step S5, the present invention proposes a method for dynamically expanding or shrinking the digital employee machine resource pool based on a greedy algorithm, which realizes elastic scaling of the machine resource pool by parsing the task priority and the average execution time of the task instance on the machine in the task queue. Through the implementation of this method, on the one hand, when the task queue meets certain conditions, the machine resource pool is dynamically expanded in real time, and the efficiency of distributed parallel execution of tasks is greatly improved after the expansion. When the task does not meet the condition, the machine resource pool is automatically shrunk, and the shrunk machine resources can be used for other transactions, effectively solving the problem of waste of machine resource pool resources; on the other hand, after the expansion, the number of distributed parallel execution tasks increases, the efficiency is improved, and the real-time execution of digital employee processes with strong timeliness is further improved, thereby realizing the hierarchical scheduling problem of digital employee processes with different timeliness.
[0029] The specific implementation process is as follows: S51, remove the unconsumed task queue ,in , is the number of tasks in the queue, and they are sorted according to the priority updated in step S3. Tasks with the same priority are sorted according to the time they entered the queue to obtain the final task queue. ,in , is the maximum priority value; S52, initialize the available machine resource pool set ,in To initialize the minimum number of available resource pools, determine the maximum expansion number ,in Each machine resource contains meta information {task number task_id, completion timestamp done_time, free flag free_flag}; S53, setting priority threshold , using binary search to calculate the task queue Exceeding the threshold Number of tasks , , then the number of machines to be expanded or reduced is:
[0030] S54, set the machine average execution time threshold , according to the estimated running time predict_exec_time of each task in S1 and the total number of task queues N, the total running time of the task is obtained , then the expected number of machines to be expanded or reduced is: Since the maximum expansion limit is M, the number of machines to be expanded or reduced is: .
[0031] S55, obtain the number of machines that are finally expanded or reduced Expand or reduce the capacity of the machine.
[0032] For step S4, the relevant pseudo code is implemented as follows: Algorithm: Dynamic expansion and contraction algorithm for digital employee machine resource pool 1 begin2 p_threshold = 5 / * Define the initial value of the priority threshold * / 3 t_threshold = 3600 / * Threshold for the average machine execution time, in seconds * / 4 max_extend_source_count = 20 / * Define the maximum number of machine resource expansions * / 6 not_consumed_task_sort_queue = query_not_consumed_sort_task() / * Query the ordered task list * / 7 free_sources = query_free_sources() / * Query the available machine resource pool * / 8 / * 1. Query the number of tasks exceeding the threshold and conditionally judge the maximum expansion value * / 9 task_exceed_p_count = binary_search(not_consumed_task_sort_queue, p_threshold)10 if task_exceed_p_count <= free_sources.size():11 source_count_1 = free_sources.size12 end if13 if task_exceed_p_count > free_sources.size()14 && task_exceed_p_count < max_extend_source_count15 source_count_1 = free_sources.size()16 end if17 if task_exceed_p_count < max_extend_source_count18 source_count_1 = max_extend_source_count19 end if20 / * 2. Calculate the expansion number based on the machine average time threshold and conditionally judge the maximum expansion value * / 21 time_exceed_t_count = task_sum_time / t_threshold22 if time_exceed_t_count <= free_sources.size():23 source_count_2 = free_sources.size24 end if25 if time_exceed_t_count > free_sources.size()26 && time_exceed_t_count < max_extend_source_count27 source_count_2 = free_sources.size() 28 end if 29 if time_exceed_t_count < max_extend_source_count 30 source_count_2 = max_extend_source_count 31 end if 32 source_count = max(source_count_1, source_count_2) / * Take the maximum value as the final expansion quantity * / 33 end. For step S6, according to the priority adjusted in step S4 and the new number of machine resource pools adjusted in step S5, the scheduling center (Master) implements distributed parallel execution of tasks, and timely and effectively adjusts the task priority and the number of machine resource pools before executing a scheduling, so that it can be updated in real time according to the data in the task queue to ensure that the data does not expire. Here, the scheduling center (Master) as the global manager of digital employee tasks declares its specific responsibilities as follows: (1) Task scheduling: Distributed scheduling of unconsumed tasks in the queue based on the number of idle machines, dynamically controlling the start, end, and initialization of tasks; (2) Feedback of operation results: The receiving node machine feedbacks the execution results, including but not limited to the task execution status, task execution result status, metadata of machine resources, and the results generated after the task execution (in different display modes such as text, pictures, and files). (3) Heartbeat monitoring: The receiving node machine monitors the node health status of the heartbeat signal sent by the dispatch center. Nodes in unhealthy state will be excluded from the resource pool. Nodes with a high failure rate in executing tasks at a certain moment in the same machine node are also considered to be in an unhealthy state and are promptly excluded from the resource pool.
[0033] As the actual executor of digital employee tasks, the node machine (Slave) declares its specific responsibilities as follows: (1) Execute commands: execute various task start and stop commands issued by the dispatch center; (2) Callback notification: When the task is completed, the task of notifying the dispatch center is automatically executed, and the dispatch center is notified of the task execution status and task results; (3) Heartbeat reporting: Node machines periodically report various information on all nodes to the scheduling center through the heartbeat mechanism. This information includes machine-level information, such as node health status, and task-level information, such as task running status.
[0034] Specifically, the node machine sends callback notifications to the dispatch center, including: task execution state flow_state, task execution result state exec_result, machine resource metadata, and results after task execution (different display methods such as text, pictures, and files). The task execution result state machine has been specifically described in S2. By feedback on the task execution result, it can be identified whether the task is executed successfully, failed, or retried, which serves as a basis for whether to call up the task for the next scheduling. By feeding back the machine resource metadata {task number task_id, completion timestamp done_time, free flag free_flag}, it is possible to know which machine the task is executed on and the task completion time, and update the machine free flag when the task is completed, so as to release the machine in time for the next task to be called up in time. By saving the results generated after the task is executed, the results can be summarized when all subtasks are executed.
[0035] Specifically, the heartbeat monitoring of the dispatch center mainly monitors two aspects: (1) Periodically monitor the offline status of the node machine client agent. If a machine is offline, remove it from the machine resource pool in a timely manner; (2) Periodically monitor the execution status of the node machine. If errors frequently occur in tasks at a certain time, it means that there is a problem with the node machine and it should be removed from the machine resource pool in a timely manner.
[0036] For step S7, when all subtasks under the same main task are executed, the last executing sub-node machine will be informed by the scheduling center (Master), and then the sub-node machine will call the task mapping and reduction module (MapReduce) to summarize all subtasks and return the results. Figure 3 The execution process of the task mapping and reduction module (MapReduce) is described in detail.
[0037] Due to the limitations of the article and the emphasis of the discussion, this article focuses on describing a mapping method and two grading strategies, and does not present the full picture of the scheduling process.
[0038] The storage medium of the distributed digital employee task hierarchical scheduling method based on HRRN includes a scheduling center module, a task mapping and summarization module, a dynamic priority adjustment module, and a machine resource pool expansion module: Among them, the dispatch center module is used for task scheduling, heartbeat monitoring, result feedback, etc. of digital employees; Task mapping and summarization module, used for task mapping and task summarization of digital employees; Dynamic priority adjustment module, used to adjust the priorities of digital employee tasks with different timeliness; The machine resource pool expansion module is used to elastically scale the machine resource pool.
[0039] refer to Figure 4 This is the system functional logic architecture diagram of the distributed digital employee task hierarchical scheduling strategy. As can be seen from the figure, manual processes, APP processes, and scheduled tasks will call the restful interface and call the task mapping module, corresponding to step S2; the task mapping module takes the task and maps it into subtasks, and assigns it to the task queue, corresponding to step S3; the dynamic priority adjustment module mainly performs relevant analysis and updates on the task queue, corresponding to step S4; the machine resource pool expansion module mainly performs relevant analysis and updates on the machine resource pool, corresponding to step S5; after the data is updated, the scheduling center starts to uniformly schedule tasks, calls the machine resource pool for execution, and the node machine periodically reports the heartbeat status, corresponding to step S6; after the machine is executed, the execution results are summarized and the results are called back, corresponding to step S7.
[0040] The innovative points of the present invention are as follows: The present invention proposes a distributed digital employee task hierarchical scheduling strategy, method and storage medium based on HRRN. In order to realize the strategy, optimization is carried out from three aspects: first, a task mapping and summarization method is proposed, and the mappable large tasks are mapped into small tasks and assigned to each machine node (Slave) for execution, which can solve the problem that tasks with longer time occupy the machine for a long time and cannot be released; second, a digital employee dynamic priority adjustment algorithm is proposed, and a high response ratio priority scheduling algorithm (HRRN) is introduced into the digital employee process scheduling, which can solve the hierarchical scheduling of digital employee processes with different timeliness, and the problem of priority execution of processes with strong timeliness and delayed execution of processes with weak timeliness on limited machines; third, a method for dynamic expansion or reduction of the digital employee machine resource pool is proposed, and a greedy algorithm is applied to dynamically adjust the resource pool capacity according to the process priority and execution time, so as to more intelligently avoid resource waste and further improve the real-time execution of digital employee processes with strong timeliness.
[0041] Obviously, the embodiments described above are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work, as well as changes made in specific implementation based on the ideas of the present invention, should all fall within the scope of protection of the present invention.
Claims
1. A distributed digital employee task hierarchical scheduling method based on HRRN, characterized in that: The following steps are involved: S1, process initialization: create a digital employee process and initialize the estimated running time predict_exec_time and process priority flow_priority in the capability support system process management; S2, main task generation: users execute multiple digital employee processes and generate multiple digital employee main tasks; S3, main task mapping: The task mapping and reduction module (MapReduce) decomposes and maps the main task of the digital employee into subtasks with the smallest granularity, adds them to the task queue, and records relevant task information; S4, dynamic adjustment of subtask priority: Apply HRRN algorithm to dynamically adjust subtask priority; S5, dynamic expansion of machine resource pool: Apply greedy algorithm to dynamically expand or shrink the digital employee machine resource pool, elastically scaling; S6, parallel execution of subtasks: The dispatch center (Master) dispatches node machines (Slaves) to execute digital employee subtasks in a distributed and parallel manner in the queue, monitors various indicators in real time, and reports to the dispatch center; S7, digital employee task summary: The task mapping and summary module (MapReduce) summarizes the digital employee subtasks and calls back the results.
2. The distributed digital employee task hierarchical scheduling method based on HRRN according to claim 1 is characterized in that: In step S3, when the task mapping and summarization module detects that the current task is an unmappable task, it is directly placed in the task queue as a subtask; When a mappable task is detected, the main task is actively mapped in the background to generate multiple subtasks; and the relevant task information is recorded as the task primary key task_id, the task flow flow_id, the main task main_task_id, the task priority task_priority, the task state task_state, the execution result exec_result, the number of executions exec_count, and the update time update_time; wherein the initial value of the task priority task_priority is the corresponding flow priority flow_priority in S1, and the task state includes two state machines: issued (1) and not issued (2); the execution result includes five state machines: waiting, successful execution, failed execution with retry (error), failed execution without retry (stop), and pause, and the initial value of the number of executions exec_count is 0.
3. The distributed digital employee task hierarchical scheduling method based on HRRN according to claim 2 is characterized in that: In step S4, the subtask priority dynamic adjustment step is: S41, remove the unconsumed task queue , including tasks with a task status of not issued (2) and an execution result of waiting (waiting), and tasks with a task status of issued (1) and an execution result of failed retry (error); S42, based on the response ratio of the task, the initial priority task_priority and the number of failed executions exec_count are added, and the current priority of each digital employee task is calculated according to the HRRN algorithm: in, is the weight of each element, task_priority is the task priority, waiting_time is the task waiting time, predicted running time predict_exec_time is the service time, and exec_count is the number of failed executions; The calculation formula for task waiting time is: Among them, current_time is the current time, update_time is the task update time; S43, according to the above formula, the task queue can be obtained Latest priority , update the priority of each task to the corresponding queue, sort and process the tasks according to the priority, and execute the tasks in order from high to low priority to achieve hierarchical scheduling of digital employee processes with different timeliness.
4. The distributed digital employee task hierarchical scheduling method based on HRRN according to claim 3 is characterized in that: In step S5, the steps of dynamically expanding the machine resource pool are: S51, remove the unconsumed task queue ,in , is the number of tasks in the queue, and they are sorted according to the priority updated in step S3. Tasks with the same priority are sorted according to the time they entered the queue to obtain the final task queue. ,in , is the maximum priority value; S52, initialize the available machine resource pool set ,in To initialize the minimum number of available resource pools, determine the maximum expansion number ,in , each machine resource contains meta information {task number task_id, completion timestamp done_time, free flag free_flag}; S53, setting priority threshold , using binary search to calculate the task queue Exceeding the threshold Number of tasks , , then the number of machines to be expanded or reduced is: ; S54, set the machine average execution time threshold , according to the estimated running time predict_exec_time of each task in S1 and the total number of task queues N, the total running time of the task is obtained , then the expected number of machines to be expanded or reduced is: , Since the maximum expansion limit is M, the number of machines to be expanded or reduced is: ; S55, obtain the number of machines that are finally expanded or reduced Expand or reduce the capacity of the machine.
5. The distributed digital employee task hierarchical scheduling method based on HRRN according to claim 4 is characterized in that: In step S6, the scheduling center (Master) is the global manager of the digital employee tasks, and performs distributed scheduling of unconsumed tasks in the queue according to the number of idle machines, and dynamically controls the start, end and initialization of tasks; the node machines promptly feedback the execution results, including but not limited to the task execution status, the task execution result status, the meta-information of the machine resources, and the results generated after the task execution; the node machines monitor the node health by sending heartbeat signals to the scheduling center, and the unhealthy nodes will be excluded from the resource pool, and the nodes with a high failure rate of executing tasks at a certain moment in the same machine node are also regarded as unhealthy and promptly excluded from the resource pool; wherein, the node machine (Slave) is the actual executor of the digital employee tasks, and executes various task start and stop commands issued by the scheduling center Master; when the task is executed, it automatically executes the task of notifying the scheduling center, and notifies the scheduling center of the task execution status and task results; the node machine periodically reports various information on all nodes to the scheduling center through the heartbeat mechanism.
6. The distributed digital employee task hierarchical scheduling method based on HRRN according to claim 5 is characterized in that: In step S7, when all subtasks under the same main task are executed, the last executing sub-node machine will be informed by the scheduling center (Master). At this time, the sub-node machine will call the task mapping and reduction module (MapReduce) to summarize all subtasks and return the results.
7. The storage medium of the distributed digital employee task hierarchical scheduling method based on HRRN according to any one of claims 1 to 6, characterized in that: Including the scheduling center module, task mapping and summary module, dynamic priority adjustment module, and machine resource pool expansion module: The dispatch center module is used for task scheduling, heartbeat monitoring, result feedback, etc. of digital employees; Task mapping and summarization module, used for task mapping and task summarization of digital employees; Dynamic priority adjustment module, used to adjust the priorities of digital employee tasks with different timeliness; The machine resource pool expansion module is used to elastically scale the machine resource pool.
