Distributed batch job processing system
By splitting the main task into subtasks in the distributed batch job processing system and registering them for execution on the message bus, the problems of low efficiency and poor scalability in the existing technology are solved, and efficient task execution and detailed monitoring are achieved.
Patent Information
- Application Number
- CN202110396759.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-13
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-04-13
AI Technical Summary
Existing distributed batch job scheduling technology has poor operating efficiency, cannot flexibly expand task nodes, and the monitoring details are not enough to track the internal status and load pattern of tasks.
A distributed batch job processing system is designed, including a message bus, main task splitting module, subtask execution module, collection task module, monitoring interface and database. By splitting the main task into subtasks and registering them on the message bus , realizing distributed execution and real-time status feedback of subtasks, improving scheduling efficiency and monitoring accuracy.
It achieves efficient splitting and distributed execution of large tasks, improves the running efficiency of batch jobs, supports flexible expansion of task nodes, and provides detailed task monitoring and status tracking.
Smart Images

Figure CN113110935B
Abstract
Description
Technical Field
[0001] The present application relates to the field of distributed processing, and in particular, to a distributed batch job processing system. Background Art
[0002] Traditional batch processing scheduling tasks are basically run on a single machine. A large number of job tasks are run on the same machine, sharing the same CPU and other hardware resources. When there are not many tasks and the load is not heavy, it can basically meet the requirements. With the explosive growth of Internet information, there are more and more batch processing jobs and more and more data to be processed. How to improve the efficiency of batch processing jobs is imperative, so there is a distributed batch processing architecture solution.
[0003] Distributed batch processing solutions have many advantages, such as the ability to utilize cheap machines and (theoretically) unlimited horizontal expansion. However, they also bring a series of thorny problems, such as network communication between machines, how to evenly distribute traffic to different machines, and how to deal with machine failures. Each problem is already a huge technical field.
[0004] For the distributed scheduling problem, the first thing to solve is how to distribute tasks to different machines. This requires that the scheduling system is usually divided into at least two layers. The first layer determines which tasks to process and which machines to distribute the tasks to. The second layer executes the tasks after receiving them. Although it is simple to describe, this process actually requires the support of a large number of supporting systems. For example, when distributing tasks, how to determine which machines can still process tasks may require a configuration center that can perceive the operating status of the entire cluster. Another example is how to distribute tasks, whether to use messages or real-time service interfaces. If messages are used, a message system is required. If it is a real-time service, a mature RPC distributed service framework is required. When the system reaches this complexity, it is no longer as simple as picking up and processing tasks, but the superposition of the complexity of multiple related systems.
[0005] Distributed batch job scheduling technology is widely used in the Internet and financial fields. Currently, the mainstream and mature ones include quartz, azkaban, tbschedule, xxl-job, etc., all of which provide similar distributed job scheduling implementation solutions. All solutions include functions such as scheduling center, scheduling executor, and scheduling management. The architecture is roughly as follows: Figure 1 As shown in the figure, the general scheduler performs distributed task scheduling on all tasks, and all tasks are allocated without distinguishing between large and small tasks.
[0006] Therefore, mainstream batch processing frameworks allocate tasks to designated nodes according to certain strategies. When large tasks are running, no specific business splitting is performed, and therefore the operating efficiency of batch jobs cannot be fundamentally improved.
[0007] In the large-scale, large-data batch processing mode, the number of distributed nodes for batch processing job scheduling increases, and the calling relationships become increasingly complex. At the same time, with the requirements of business, the time requirements for batch processing jobs are getting higher and higher. It is required to complete various complex, especially large file processing, as quickly as possible while ensuring the normal operation of each batch job node process. How to fundamentally improve performance under the existing mainstream distributed batch processing mode is the key focus of batch processing jobs:
[0008] The technical problems of current distributed job technology are as follows:
[0009] First, batch tasks are allocated according to functions and nodes. Large job tasks are run at a single point and sequentially, resulting in poor execution efficiency.
[0010] Second, it cannot be flexibly expanded according to task nodes. If it is expanded, the entire overall scheduling needs to be modified and tasks need to be reallocated.
[0011] Third, task monitoring cannot monitor the detailed running process within the task in detail, and cannot monitor the status of subtasks under load mode operation. Summary of the invention
[0012] The main purpose of the present application is to provide a distributed batch job processing system to solve the problem of poor operating efficiency of distributed batch job scheduling technology in the prior art.
[0013] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a distributed batch job processing system is provided, including: a message bus; a main task splitting module, used to split the main task into multiple subtasks, and register each of the subtasks on the message bus; a subtask execution module, used to subscribe to the subtasks from the message bus and execute the subtasks.
[0014] Furthermore, the system further comprises: a task aggregation module, which is used to receive the execution results of each of the subtasks through the message bus after all the subtasks are executed, and summarize the execution results.
[0015] Furthermore, the task aggregation module aggregates the execution results, and after obtaining the aggregated results, feeds the aggregated results back to the main task splitting module.
[0016] Furthermore, the subtask execution module sends the real-time status of the subtask to the message bus, and the message bus feeds back the real-time status of the subtask to the main task splitting module.
[0017] Furthermore, the system also includes: a monitoring interface for displaying the execution status of each of the subtasks.
[0018] Furthermore, the system further comprises: a database for storing the execution status of each of the subtasks.
[0019] Furthermore, the database is one of the following: MySQL, Microsoft Access, Microsoft SQL and Oracle.
[0020] Furthermore, the subtask execution module is a virtual machine, and the main task splitting module is further used to adjust the number of the subtasks according to the number of the virtual machines.
[0021] Furthermore, the subtask execution modules are virtual machines, and the number of the virtual machines is less than the number of the subtasks.
[0022] Furthermore, the main task is at least one of the following: file copying and memory operation.
[0023] By applying the technical solution of the present application, the main task splitting module splits the main task into multiple subtasks, and registers each of the above subtasks on the above message bus. The subtask execution module subscribes to the subtasks from the above message bus and executes the subtasks. The splitting of the main task and the distributed execution of the subtasks are realized, and the operating efficiency of the distributed batch job scheduling technology is improved. Compared with the mainstream batch processing framework in the prior art, when there is a large task running, no specific business splitting is performed, and the large task is only assigned to the specified node to run, which greatly improves the operating efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0025] Figure 1 The distributed batch job scheduling architecture in the prior art is shown;
[0026] Figure 2 A schematic diagram of a distributed batch job processing system according to an embodiment of the present application is shown;
[0027] Figure 3 A schematic diagram of a distributed batch job processing flow of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0028] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0029] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0031] It should be understood that when an element (such as a layer, film, region, or substrate) is described as being "on" another element, the element may be directly on the other element, or there may be intermediate elements. Moreover, in the specification and claims, when an element is described as being "connected" to another element, the element may be "directly connected" to the other element, or "connected" to the other element through a third element.
[0032] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0033] Message bus: Message bus is a communication tool that can transfer messages and files between machines. Message bus plays the role of message routing and has a complete routing mechanism to determine the direction of message transmission. The sending segment only needs to send a message to the message bus without worrying about how the message is forwarded. In order to avoid message loss, some message buses provide certain persistent storage and disaster recovery mechanisms.
[0034] Distributed batch processing: Distributed batch processing uses an architecture that separates job scheduling from job execution to simplify the development and operation of business system batch processing; it uses middleware and platform-based ideas to enhance its application scope and value; it is used for scheduling, execution and control of system jobs. The asynchronous distributed batch processing framework includes middleware basic components, job scheduling and control, coordination registration center, queues, etc.
[0035] Main task: refers to the main scheduling task in distributed batch processing, which is generally used to split subtasks and monitor status.
[0036] Subtask: Generally refers to an independent time-slice task. Subtasks can have independent processing flows. After the subtask is processed, the task status needs to be fed back to the main task.
[0037] As introduced in the background technology, the distributed batch job scheduling technology in the prior art has poor operating efficiency. In order to solve the problem of poor operating efficiency of the distributed batch job scheduling technology, an embodiment of the present application provides a distributed batch job processing system.
[0038] A typical embodiment of the present application provides a distributed batch job processing system. Figure 2 As shown, the system includes:
[0039] Message bus;
[0040] The main task splitting module is used to split the main task into multiple subtasks and register each of the above subtasks on the above message bus;
[0041] The subtask execution module is used to subscribe to the above subtask from the above message bus and execute the above subtask, that is, the subtask execution module can realize automatic claiming of the subtask.
[0042] Specifically, if the main task is to copy a large file, the file number needs to match the task record.
[0043] In the above scheme, the main task splitting module splits the main task into multiple subtasks, and registers each of the above subtasks to the above message bus. The subtask execution module subscribes to the subtasks from the above message bus and executes the subtasks. The splitting of the main task and the distributed execution of the subtasks are realized, and the operating efficiency of the distributed batch job scheduling technology is improved. Compared with the mainstream batch processing framework in the prior art, when there is a large task running, no specific business splitting is performed, and the large task is only assigned to the specified node to run, which greatly improves the operating efficiency.
[0044] In one embodiment of the present application, Figure 2As shown, the above system also includes: a task aggregation module, which is used to receive the execution results of each of the above subtasks through the above message bus after all the above subtasks are executed, and summarize the above execution results. That is, this system is a distributed batch scheduling technology of a total-division-total model. After the large task (main task) in the distributed job is decomposed, it obtains multiple subtasks, and the subtasks are registered on the message bus; the subtask execution module then subscribes to the subtasks from the message bus for consumption and execution. After all the subtasks are executed, the results are traced back to the task aggregation module, thus forming a technical mechanism of total-division-total task splitting, task execution, and task aggregation, thereby solving the performance efficiency problem of large task execution. Of course, in some scenarios, task aggregation may not be performed, and the subtasks can be directly executed according to the task nodes.
[0045] In one embodiment of the present application, the above-mentioned task aggregation module aggregates the above-mentioned execution results, and after obtaining the aggregated results, feeds the above-mentioned aggregated results back to the above-mentioned main task splitting module.
[0046] Specifically, there are two ways to summarize tasks: one is to trigger a unified summary task to perform summary after all subtasks are completed. This method generally tends to be memory operations or file collection. The other is that each subtask flows to the next task for data aggregation. This method generally tends to be operations that can be processed concurrently, such as databases. After the summary is executed, the status is synchronized to the general schedule (i.e., the main task splitting module) in real time through the message bus, and the task processing is completed at the same time.
[0047] In one embodiment of the present application, the subtask execution module sends the real-time status of the subtask to the message bus, and the message bus feeds back the real-time status of the subtask to the main task splitting module. That is, the main task splitting module can obtain the execution status of each subtask in real time. In addition, the main task splitting module can issue instructions to the aggregation task module, and the main task splitting module is the core of the entire system.
[0048] In one embodiment of the present application, Figure 2 As shown, the above system also includes: a monitoring interface for displaying the execution status of each of the above subtasks. Of course, the monitoring interface can also display the execution status of the main task; the detailed execution status of all tasks can be monitored more intuitively, further realizing more accurate task monitoring. Real-time monitoring and tracking of the execution status of all subtasks, tracking of all subtask information through task status detail query.
[0049] In one embodiment of the present application, Figure 2 As shown, the system further includes: a database for storing the execution status of each of the above subtasks. Specifically, the execution status of each subtask can be stored in a table of the database.
[0050] In one embodiment of the present application, the above database is one of the following: MySQL, Microsoft Access, Microsoft SQL and Oracle. Of course, databases other than MySQL, Microsoft Access, Microsoft SQL and Oracle can also be selected.
[0051] In one embodiment of the present application, the number of subtasks executed by the subtask execution module can be arbitrarily expanded. After completing a subtask, the subtask execution module can proactively check whether there are unfinished subtasks. If there are unfinished subtasks, the subtask execution module can continue to receive subtasks for execution. Until all subtasks are executed, the main task splitting module triggers the next step of the aggregation task.
[0052] In one embodiment of the present application, the subtask execution module is a virtual machine, and the main task splitting module is also used to adjust the number of the subtasks according to the number of the virtual machines. For example, the main task is originally split into 5 subtasks. When it is found that the number of virtual machines is 10, the main task is split into 10 subtasks, so that one subtask is executed on one virtual machine and executed synchronously, which speeds up the execution speed of the task. That is to say, the number of subtasks can be adjusted according to the number of subtask execution modules to achieve the fastest execution of the main task. It should be noted that the "virtual machine" in this embodiment is only schematic, and the subtask execution module can also be a physical machine, an execution unit in a machine, or a programmed module under a server. The main task splitting module, the subtask execution module and the aggregation task module can all be programmed modules under the server. Run each module in the server to realize the distributed execution of tasks and speed up the execution efficiency of tasks. That is, without modifying the entire general scheduling, the reallocation of the main task can be achieved. That is, the flexible configuration of the subtask nodes is realized.
[0053] In one embodiment of the present application, the subtask execution module is a virtual machine, and the number of the virtual machines is less than the number of the subtasks. For example, the number of subtasks is 10, and the number of virtual machines is 5. A virtual machine can subscribe to two subtasks from the message bus and execute the subscribed subtasks. Of course, due to the performance differences of virtual machines, the first virtual machine can also execute one subtask; the second virtual machine can execute three subtasks; the third virtual machine can execute two subtasks; the fourth virtual machine can execute two subtasks; and the fifth virtual machine can execute two subtasks.
[0054] In an embodiment of the present application, the main task is at least one of the following: file copying and memory operation. For copying some large files, the solution of the present application can greatly improve the file copying speed.
[0055] Example
[0056] This embodiment relates to a specific distributed batch job processing flow, such as Figure 3 shown.
[0057] After the main task splitting module splits the large job, it delivers the message to the message bus through 1.0;
[0058] The subtask execution module subscribes to the subtask from the message bus through 2.1, 2.2, and 2.3. After the subtask is executed, the execution result is fed back through 2.4, 2.5, and 2.6, and the subtask ends.
[0059] The main task splitting module receives feedback from each subtask through 2.7, and after confirming that all subtasks have been completed, the process proceeds to the next step;
[0060] The main task splitting module (i.e., the overall scheduling task) delivers the next task to the aggregation task module through 2.8;
[0061] The collection task module is summarized and executed through 2.9. After the execution is completed, the feedback task is submitted to the general schedule through 3.0, and the task is completed.
[0062] The core of the system is task splitting and distributed operation, and task mounting and status synchronization are performed through the message bus, so as to complete large batch tasks quickly and efficiently.
[0063] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0064] In the distributed batch job processing system of the present application, the main task splitting module splits the main task into multiple subtasks, and registers each of the above subtasks to the above message bus. The subtask execution module subscribes to the subtasks from the above message bus and executes the subtasks. The splitting of the main task and the distributed execution of the subtasks are realized, and the operating efficiency of the distributed batch job scheduling technology is improved. Compared with the mainstream batch processing framework in the prior art, when there is a large task running, no specific business splitting is performed, and the large task is only assigned to the specified node to run, which greatly improves the operating efficiency.
[0065] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A distributed batch job processing system, characterized in that: include: Message bus; A main task splitting module, used to split the main task into multiple subtasks and register each of the subtasks on the message bus; A subtask execution module, used to subscribe to the subtask from the message bus and execute the subtask; The subtask execution module sends the real-time status of the subtask to the message bus, and the message bus feeds back the real-time status of the subtask to the main task splitting module; Among them, the subtask execution module is a virtual machine, and the main task splitting module splits the main task into multiple subtasks. When the number of subtasks is equal to the number of virtual machines, one virtual machine corresponds to one subtask; when the number of subtasks is less than the number of virtual machines, the main task splitting module splits the main task again so that the number of subtasks is equal to the number of virtual machines; when the number of subtasks is greater than the number of virtual machines, the subtasks are allocated according to the performance of the virtual machines, wherein the subtasks allocated to the virtual machine with high performance are greater than the subtasks allocated to the virtual machine with low performance.
2. The system according to claim 1, characterized in that The system further comprises: The task aggregation module is used to receive the execution results of each subtask through the message bus after all the subtasks are executed, and summarize the execution results.
3. The system according to claim 2, characterized in that The task aggregation module aggregates the execution results, and after obtaining the aggregated results, feeds the aggregated results back to the main task splitting module.
4. The system according to claim 1, characterized in that The system further comprises: The monitoring interface is used to display the execution status of each of the subtasks.
5. The system according to claim 1, characterized in that The system further comprises: The database is used to store the execution status of each subtask.
6. The system according to claim 5, characterized in that The database is one of the following: MySQL, Microsoft Access, Microsoft SQL and Oracle.
7. The system according to any one of claims 1 to 6, characterized in that The main task is at least one of the following: File copying and memory operations.
Citation Information
Patent Citations
Method, device and system for converting high-performance distributed data
CN106777180A
Distributed task processing method, device, system and set
CN107688500A
Distributed task processing system and application method thereof
CN108647093A
Method and apparatus for providing spatial analysis services
CN109062697A
Data parallel processing method, device and equipment and storage medium
CN111400012A
