A distributed task scheduling method, apparatus, and electronic device based on the sidecar pattern
By adopting the distributed task scheduling method of the sidecar pattern, executor nodes are registered and scheduling instruction packets are processed, which solves the problem of scheduling instructions not being issued, realizes the normal issuance and execution of scheduling instructions, and improves the efficiency and accuracy of scheduling tasks.
Patent Information
- Application Number
- CN202210720399.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-23
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2042-06-23
AI Technical Summary
In existing technologies, scheduling instructions cannot be issued normally in distributed scheduling systems, leading to application startup anomalies and operational problems. This is especially true in cloud application scenarios, where the application size is cumbersome and prone to class conflicts.
The distributed task scheduling method in the sidecar mode is adopted. By registering executor nodes in the target executor, receiving task scheduling instruction packets from the task scheduling center, processing and splitting them in the executor node, and sending them to the corresponding sidecar container for scheduling, the normal issuance of scheduling instructions is realized.
This solution resolves the issue of scheduling instructions failing to be issued correctly, enabling the normal issuance and execution of scheduling instructions, improving the efficiency and accuracy of scheduling tasks, and avoiding application startup anomalies and maintenance problems.
Smart Images

Figure CN115220866B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing technology, and more specifically, to a distributed task scheduling method, apparatus, and electronic device based on the sidecar mode. Background Technology
[0002] Distributed scheduling systems typically consist of client executors and controllers. The client controller often requires iterative upgrades as the server version upgrades. With increasingly rapid version iterations and richer client functionality, the client itself also incorporates numerous platform-related JAR files. To integrate platform capabilities, the application is forced to grow larger, making the project bloated. Deploying the platform and client in a single JVM process can easily lead to conflicts between platform functionality and application code. In application scenarios such as cloud deployments, the application size becomes particularly cumbersome.
[0003] In existing technologies, to ensure the normal operation of existing application business functions while maintaining the platform client's capabilities and ensuring that batch scheduling instructions can be issued and executed normally, application architects typically need to analyze platform functions, align the versions of JAR packages introduced by the platform, and ensure that there are no class conflicts between platform-class JAR packages and application JAR packages. This ensures that the platform and application functions do not conflict at the JAR package level, and the project size is kept to a minimum. However, since the application and platform code are deployed in the same JVM, during project iteration, if the application's expected JAR package version and the platform client's dependent version are inconsistent, and if the application does not detect such potential problems in time, it can lead to production risks such as startup exceptions due to the order in which JAR packages are loaded by the JVM. Secondly, in operation and maintenance scenarios, application code problems are prone to occur, causing the application container to restart. Both of these will prevent scheduling instructions from being issued.
[0004] There is currently no effective solution to the problem of scheduling instructions failing to be issued correctly in related technologies. Summary of the Invention
[0005] The main purpose of this application is to provide a distributed task scheduling method, device and electronic device based on the sidecar mode, so as to solve the problem that scheduling instructions cannot be issued normally in related technologies.
[0006] To achieve the above objectives, according to one aspect of this application, a distributed task scheduling method based on the sidecar mode is provided. The method includes: registering an executor node in a target executor, wherein the executor node is a node in the sidecar mode; receiving a task scheduling instruction packet sent by a task scheduling center through the executor node; processing the task scheduling instruction packet in the executor node to obtain multiple task scheduling instructions; and sending each task scheduling instruction to a corresponding sidecar container, wherein the sidecar container is used to process the corresponding task scheduling instruction.
[0007] Furthermore, after registering the executor node in the target executor, the method also includes: monitoring whether the executor node registration is complete through the task scheduling center; if the executor node registration is completed, obtaining the registration information corresponding to the executor node through the task scheduling center, wherein the registration information includes at least: application information, port information, and IP information.
[0008] Furthermore, before receiving the task scheduling instruction package sent by the task scheduling center through the executor node, the method also includes: traversing the registration information obtained by the task scheduling center; determining the task list based on the registration information, wherein each task to be executed in the task list is arranged according to a preset trigger time.
[0009] Furthermore, before receiving the task scheduling instruction package sent by the task scheduling center through the executor node, the method further includes: determining the task scheduling instruction package according to the task list, wherein the task scheduling instruction package contains scheduling instructions for scheduling multiple tasks; and sending the task scheduling instruction package to the executor node through the task scheduling center.
[0010] Furthermore, the task scheduling instruction package is processed in the executor node to obtain multiple task scheduling instructions, including: parsing the task scheduling instruction package in the executor node to obtain a parsed task scheduling instruction package; and splitting the parsed task scheduling instruction package to obtain multiple task scheduling instructions.
[0011] Furthermore, after sending each task scheduling instruction to the corresponding sidecar container, the method further includes: in each sidecar container responding to the corresponding scheduling instruction, obtaining multiple response results, wherein the multiple response results are scheduling results for multiple tasks; and sending the multiple response results to the target executor.
[0012] Furthermore, after sending multiple response results to the target executor, the method further includes: sending multiple response results from the target executor to the task scheduling center so that the task scheduling center updates the execution status of multiple tasks.
[0013] To achieve the above objectives, according to another aspect of this application, a distributed task scheduling device based on a sidecar mode is provided. The device includes: a registration unit for registering executor nodes in a target executor, wherein the executor nodes are nodes in the sidecar mode; a receiving unit for receiving task scheduling instruction packets sent by a task scheduling center through the executor nodes; a processing unit for processing the task scheduling instruction packets in the executor nodes to obtain multiple task scheduling instructions; and a first sending unit for sending each task scheduling instruction to a corresponding sidecar container, wherein the sidecar container is used to process the corresponding task scheduling instruction.
[0014] Furthermore, the device also includes: a monitoring unit, used to monitor whether the executor node registration is complete through the task scheduling center after registering the executor node in the target executor; and an acquisition unit, used to acquire the registration information corresponding to the executor node through the task scheduling center if the registration of the executor node is detected to be complete, wherein the registration information includes at least: application information, port information, and IP information.
[0015] Furthermore, the device also includes: a traversal unit, used to traverse the registration information obtained by the task scheduling center before receiving the task scheduling instruction package sent by the task scheduling center through the executor node; and a first determination unit, used to determine the task list according to the registration information, wherein each task to be executed in the task list is arranged according to a preset trigger time.
[0016] Furthermore, the device also includes: a second determining unit, configured to determine the task scheduling instruction package based on the task list before receiving the task scheduling instruction package sent by the task scheduling center through the executor node, wherein the task scheduling instruction package contains scheduling instructions for scheduling multiple tasks; and a second sending unit, configured to send the task scheduling instruction package to the executor node through the task scheduling center.
[0017] Furthermore, the processing unit includes: a parsing module, used to parse the task scheduling instruction package in the executor node to obtain the parsed task scheduling instruction package; and a splitting module, used to split the parsed task scheduling instruction package to obtain multiple task scheduling instructions.
[0018] Furthermore, the device also includes: a response unit, configured to, after sending each task scheduling instruction to the corresponding sidecar container, respond to the corresponding scheduling instruction in each sidecar container and obtain multiple response results, wherein the multiple response results are scheduling results for scheduling multiple tasks; and a third sending unit, configured to send the multiple response results to the target executor.
[0019] Furthermore, the device also includes a fourth sending unit, which, after sending multiple response results to the target executor, sends multiple response results from the target executor to the task scheduling center, so that the task scheduling center updates the execution status of multiple tasks.
[0020] This application employs the following steps: registering an executor node in the target executor, wherein the executor node is a node in sidecar mode; receiving task scheduling instruction packets sent by the task scheduling center through the executor node; processing the task scheduling instruction packets in the executor node to obtain multiple task scheduling instructions; and sending each task scheduling instruction to the corresponding sidecar container, wherein the sidecar container is used to process the corresponding task scheduling instruction. This application solves the problem of scheduling instructions failing to be issued correctly in related technologies. By sending each task scheduling instruction to the corresponding sidecar container, the effect of correctly issuing scheduling instructions is achieved. Attached Figure Description
[0021] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0022] Figure 1 This is a flowchart of a distributed task scheduling method based on the sidecar mode provided in an embodiment of this application;
[0023] Figure 2 This is a schematic diagram of the executor operation of the distributed task scheduling method based on the sidecar mode provided in the embodiments of this application;
[0024] Figure 3 This is a schematic diagram of the task scheduling center operation of the distributed task scheduling method based on the sidecar mode provided in the embodiments of this application;
[0025] Figure 4 This is a business application communication diagram of the distributed task scheduling method based on the sidecar mode provided in the embodiments of this application;
[0026] Figure 5 This is a schematic diagram of a distributed task scheduling device based on the sidecar mode provided in the embodiments of this application. Figure 1 ;
[0027] Figure 6 This is a schematic diagram of a distributed task scheduling device based on the sidecar mode provided in the embodiments of this application. Figure 2 ;
[0028] Figure 7 This is a schematic diagram of a task scheduling electronic device network architecture based on the sidecar mode provided in the embodiments of this application. Detailed Implementation
[0029] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0030] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0032] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0033] The present invention will now be described in conjunction with preferred implementation steps. Figure 1 This is a flowchart of a distributed task scheduling method based on the sidecar mode provided in an embodiment of this application, as shown below. Figure 1 As shown, the method includes the following steps:
[0034] Step S101: Register the executor node in the target executor, wherein the executor node is a node in the sidecar mode.
[0035] Specifically, such as Figure 2 As shown, the target executor registers the sidecar (corresponding to the sidecar mode in this application) executor node with the task scheduling center so that the scheduling center can discover and issue instructions to the sidecar node.
[0036] Optionally, in the distributed task scheduling method based on the sidecar mode provided in the embodiments of this application, after registering the executor node in the target executor, the method further includes: listening to whether the executor node registration is completed through the task scheduling center; if the executor node registration is completed, obtaining the registration information corresponding to the executor node through the task scheduling center, wherein the registration information includes at least: application information, port information, and IP information.
[0037] Specifically, such as Figure 3 As shown, the task scheduling center monitors the registration information of the sidecar executor node. If the executor node registration is completed, the task scheduling center receives the registration information of the sidecar executor and records the application, IP and port information. By monitoring the registration information through the task scheduling center, the real-time performance of task scheduling is improved.
[0038] Optionally, in the distributed task scheduling method based on the sidecar mode provided in this application embodiment, before receiving the task scheduling instruction package sent by the task scheduling center through the executor node, the method further includes: traversing the registration information obtained by the task scheduling center; determining the task list according to the registration information, wherein each task to be executed in the task list is arranged according to a preset trigger time.
[0039] Specifically, the task scheduling center iterates through all unscheduled job definition information of the current application. It should be noted that the registration information obtained by iterating through the task scheduling center in this application is unscheduled job definition information. Based on all unscheduled job definition information of the current application, a list of jobs to be executed (corresponding to the task list in this application) is determined. By determining the task list, the accuracy of subsequent task scheduling is improved.
[0040] Optionally, in the distributed task scheduling method based on the sidecar mode provided in this application embodiment, before receiving the task scheduling instruction package sent by the task scheduling center through the executor node, the method further includes: determining the task scheduling instruction package according to the task list, wherein the task scheduling instruction package contains scheduling instructions for scheduling multiple tasks; and sending the task scheduling instruction package to the executor node through the task scheduling center.
[0041] Specifically, such as Figure 3 As shown, the task scheduling instruction package to be issued is generated by scanning the list of jobs to be executed, and the task scheduling instruction package is sent to the executor node. It should be noted that the scheduling center only communicates with the executor sidecar (corresponding to the executor node in this application) process, which further realizes the decoupling function between the scheduling center and the application, so that the application process is isolated from the platform process, and also ensures that batch scheduling instructions can be issued and executed normally.
[0042] Step S102: Receive the task scheduling instruction packet sent by the task scheduling center through the executor node.
[0043] Step S103: Process the task scheduling instruction packet in the executor node to obtain multiple task scheduling instructions.
[0044] Specifically, such as Figure 2 As shown, after the executor node receives the task scheduling instruction packet sent by the task scheduling center, the task scheduling instruction packet is processed in the target executor.
[0045] Optionally, in the distributed task scheduling method based on the sidecar mode provided in the embodiments of this application, processing the task scheduling instruction package in the executor node to obtain multiple task scheduling instructions includes: parsing the task scheduling instruction package in the executor node to obtain a parsed task scheduling instruction package; and splitting the parsed task scheduling instruction package to obtain multiple task scheduling instructions.
[0046] Specifically, by parsing and decomposing the task scheduling instruction package in the executor node into multiple job-granular atomic scheduling instructions, the efficiency of subsequent distributed scheduling tasks is further improved.
[0047] Step S104: Send each task scheduling instruction to the corresponding sidecar container, where the sidecar container is used to process the corresponding task scheduling instruction.
[0048] Specifically, the scheduling instructions at each job granularity (corresponding to each task scheduling instruction in this application) are issued to the sidecar container (i.e., the business application container). The system implementation principle of the sidecar container can be as follows: Figure 4 As shown in the business application communication diagram, the system receives scheduling instructions at each job granularity issued by the local executor (corresponding to the target executor in this application) sidecar, parses the scheduling instructions, reads the job definition configuration, matches the batch job scheduling entry, executes the scheduling instructions, calls the target batch job program, and executes the batch program. This application enables communication between the client and the application (sidecar container) through JVM processes via the target executor, thereby decoupling the scheduling center from the application and ensuring that batch scheduling instructions can be issued and executed normally.
[0049] Optionally, in the distributed task scheduling method based on the sidecar pattern provided in the embodiments of this application, after sending each task scheduling instruction to the corresponding sidecar container, the method further includes: responding to the corresponding scheduling instruction in each sidecar container to obtain multiple response results, wherein the multiple response results are scheduling results for multiple tasks; and sending the multiple response results to the target executor.
[0050] Specifically, such as Figure 4 As shown, the output returns multiple execution results (corresponding to the response results in this application), completes the scheduling process, and sends the multiple execution results to the target executor.
[0051] Optionally, in the distributed task scheduling method based on the sidecar mode provided in the embodiments of this application, after sending multiple response results to the target executor, the method further includes: sending multiple response results in the target executor to the task scheduling center, so that the task scheduling center updates the execution status of multiple tasks.
[0052] Specifically, this application receives the scheduling result (i.e., response result) of the scheduling instruction packet through the task scheduling center, and updates the application job scheduling status information according to the scheduling result.
[0053] In summary, the distributed task scheduling method based on the sidecar mode provided in this application's embodiments registers executor nodes in the target executor, where the executor nodes are nodes in the sidecar mode; the executor nodes receive task scheduling instruction packets sent by the task scheduling center; the executor nodes process the task scheduling instruction packets to obtain multiple task scheduling instructions; and each task scheduling instruction is sent to a corresponding sidecar container, where the sidecar container is used to process the corresponding task scheduling instruction. This application solves the problem of scheduling instructions failing to be issued correctly in related technologies. By sending each task scheduling instruction to the corresponding sidecar container, the effect of correctly issuing scheduling instructions is achieved.
[0054] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0055] This application also provides a distributed task scheduling device based on the sidecar mode. It should be noted that the distributed task scheduling device based on the sidecar mode in this application can be used to execute the distributed task scheduling method based on the sidecar mode provided in this application. The following describes the distributed task scheduling device based on the sidecar mode provided in this application.
[0056] Figure 5 This is a schematic diagram of a distributed task scheduling device based on the sidecar mode according to an embodiment of this application. Figure 1 .like Figure 5 As shown, the device includes: a registration unit 501, a receiving unit 502, a processing unit 503, and a first sending unit 504.
[0057] Specifically, registration unit 501 is used to register executor nodes in the target executor, wherein the executor nodes are nodes in the sidecar mode;
[0058] The receiving unit 502 is used to receive task scheduling instruction packets sent by the task scheduling center through the executor node;
[0059] The processing unit 503 is used to process the task scheduling instruction package in the executor node to obtain multiple task scheduling instructions;
[0060] The first sending unit 504 is used to send each task scheduling instruction to the corresponding sidecar container, wherein the sidecar container is used to process the corresponding task scheduling instruction.
[0061] In summary, the distributed task scheduling device based on the sidecar mode provided in this application embodiment registers executor nodes in the target executor through the registration unit 501, wherein the executor nodes are nodes in the sidecar mode; the receiving unit 502 receives task scheduling instruction packets sent by the task scheduling center through the executor nodes; the processing unit 503 processes the task scheduling instruction packets in the executor nodes to obtain multiple task scheduling instructions; and the first sending unit 504 sends each task scheduling instruction to the corresponding sidecar container, wherein the sidecar container is used to process the corresponding task scheduling instruction, thus solving the problem of scheduling instructions not being able to be sent normally in related technologies. By sending each task scheduling instruction to the corresponding sidecar container, the effect of normal sending of scheduling instructions is achieved.
[0062] Optionally, in the distributed task scheduling device based on the sidecar mode provided in the embodiments of this application, the device further includes: a listening unit, used to listen to whether the executor node has completed registration through the task scheduling center after registering the executor node in the target executor; and an acquisition unit, used to acquire the registration information corresponding to the executor node through the task scheduling center if the registration of the executor node is detected to be completed, wherein the registration information includes at least: application information, port information, and IP information.
[0063] Optionally, in the distributed task scheduling device based on the sidecar mode provided in the embodiments of this application, the device further includes: a traversal unit, used to traverse the registration information obtained by the task scheduling center before receiving the task scheduling instruction package sent by the task scheduling center through the executor node; and a first determination unit, used to determine the task list according to the registration information, wherein each task to be executed in the task list is arranged according to a preset trigger time.
[0064] Optionally, in the distributed task scheduling device based on the sidecar mode provided in the embodiments of this application, the device further includes: a second determining unit, used to determine the task scheduling instruction package according to the task list before receiving the task scheduling instruction package sent by the task scheduling center through the executor node, wherein the task scheduling instruction package contains scheduling instructions for scheduling multiple tasks; and a second sending unit, used to send the task scheduling instruction package to the executor node through the task scheduling center.
[0065] Optionally, in the distributed task scheduling device based on the sidecar mode provided in the embodiments of this application, the processing unit includes: a parsing module, used to parse the task scheduling instruction package in the executor node to obtain the parsed task scheduling instruction package; and a splitting module, used to split the parsed task scheduling instruction package to obtain multiple task scheduling instructions.
[0066] Optionally, in the distributed task scheduling device based on the sidecar mode provided in the embodiments of this application, the device further includes: a response unit, used to respond to the corresponding scheduling instruction in each sidecar container after sending each task scheduling instruction to the corresponding sidecar container, and obtain multiple response results, wherein the multiple response results are scheduling results for scheduling multiple tasks; and a third sending unit, used to send the multiple response results to the target executor.
[0067] Optionally, in the distributed task scheduling device based on the sidecar mode provided in the embodiments of this application, the device further includes: a fourth sending unit, used to send multiple response results from the target executor to the task scheduling center after sending multiple response results to the target executor, so that the task scheduling center updates the execution status of multiple tasks.
[0068] Optionally, Figure 6 This is a schematic diagram of a distributed task scheduling device based on the sidecar mode provided in the embodiments of this application. Figure 2 ,like Figure 6 As shown, it includes: a business application message receiving device, an actuator sidecar device, and a scheduling center device.
[0069] The distributed task scheduling device based on the sidecar mode includes a processor and a memory. The registration unit 501, receiving unit 502, processing unit 503, first sending unit 504, etc. are all stored in the memory as program units. The processor executes the program units stored in the memory to realize the corresponding functions.
[0070] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and distributed task scheduling based on a sidecar model can be achieved by adjusting kernel parameters.
[0071] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0072] This invention provides a computer-readable storage medium storing a program that, when executed by a processor, implements a distributed task scheduling method based on the sidecar pattern.
[0073] This invention provides a processor for running a program, wherein the program executes a distributed task scheduling method based on the sidecar mode during runtime.
[0074] like Figure 7 As shown, this embodiment of the invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: registering an executor node in a target executor, wherein the executor node is a node in sidecar mode; receiving a task scheduling instruction packet sent by a task scheduling center through the executor node; processing the task scheduling instruction packet in the executor node to obtain multiple task scheduling instructions; and sending each task scheduling instruction to a corresponding sidecar container, wherein the sidecar container is used to process the corresponding task scheduling instruction.
[0075] When the processor executes the program, it also performs the following steps: After registering the executor node in the target executor, it listens through the task scheduling center to see if the executor node registration is complete; if the executor node registration is complete, it obtains the registration information corresponding to the executor node through the task scheduling center, wherein the registration information includes at least: application information, port information, and IP information.
[0076] When the processor executes the program, it also performs the following steps: before receiving the task scheduling instruction packet sent by the task scheduling center through the executor node, it traverses the registration information obtained by the task scheduling center; and determines the task list based on the registration information, wherein each task to be executed in the task list is arranged according to a preset trigger time.
[0077] When the processor executes the program, it also performs the following steps: before receiving the task scheduling instruction packet sent by the task scheduling center through the executor node, it determines the task scheduling instruction packet according to the task list, wherein the task scheduling instruction packet contains scheduling instructions for scheduling multiple tasks; and sends the task scheduling instruction packet to the executor node through the task scheduling center.
[0078] When the processor executes the program, it also performs the following steps: parsing the task scheduling instruction packet in the executor node to obtain the parsed task scheduling instruction packet; splitting the parsed task scheduling instruction packet to obtain multiple task scheduling instructions.
[0079] When the processor executes the program, it also performs the following steps: after sending each task scheduling instruction to the corresponding sidecar container, each sidecar container responds to the corresponding scheduling instruction and obtains multiple response results, wherein the multiple response results are the scheduling results of scheduling multiple tasks; and sends the multiple response results to the target executor.
[0080] When the processor executes the program, it also performs the following steps: after sending multiple response results to the target executor, it sends multiple response results from the target executor to the task scheduling center so that the task scheduling center updates the execution status of multiple tasks.
[0081] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.
[0082] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: registering an executor node in a target executor, wherein the executor node is a node in sidecar mode; receiving a task scheduling instruction packet sent by a task scheduling center through the executor node; processing the task scheduling instruction packet in the executor node to obtain multiple task scheduling instructions; and sending each task scheduling instruction to a corresponding sidecar container, wherein the sidecar container is used to process the corresponding task scheduling instruction.
[0083] When executed on a data processing device, it is also suitable to execute a program with the following initialization steps: after registering the executor node in the target executor, the task scheduling center listens to whether the executor node registration is complete; if the executor node registration is completed, the task scheduling center obtains the registration information corresponding to the executor node, wherein the registration information includes at least: application information, port information, and IP information.
[0084] When executed on a data processing device, it is also suitable to execute an initialization program with the following steps: before receiving the task scheduling instruction package sent by the task scheduling center through the executor node, traverse the registration information obtained by the task scheduling center; determine the task list based on the registration information, wherein each task to be executed in the task list is arranged according to a preset trigger time.
[0085] When executed on a data processing device, it is also suitable to execute an initialization program with the following steps: before receiving a task scheduling instruction package sent by the task scheduling center through the executor node, determine the task scheduling instruction package according to the task list, wherein the task scheduling instruction package contains scheduling instructions for scheduling multiple tasks; and send the task scheduling instruction package to the executor node through the task scheduling center.
[0086] When executed on a data processing device, it is also suitable to execute an initialization program with the following steps: parsing the task scheduling instruction package in the executor node to obtain the parsed task scheduling instruction package; splitting the parsed task scheduling instruction package to obtain multiple task scheduling instructions.
[0087] When executed on a data processing device, it is also suitable to execute an initialization program with the following steps: after sending each task scheduling instruction to the corresponding sidecar container, in each sidecar container, in response to the corresponding scheduling instruction, multiple response results are obtained, wherein the multiple response results are scheduling results for multiple tasks; and the multiple response results are sent to the target executor.
[0088] When executed on a data processing device, it is also suitable to execute an initialization program with the following method steps: after sending multiple response results to the target executor, send multiple response results from the target executor to the task scheduling center so that the task scheduling center updates the execution status of multiple tasks.
[0089] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0090] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0091] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0092] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0093] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0094] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0095] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0096] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0097] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0098] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A distributed task scheduling method based on the sidecar pattern, characterized in that, include: Register executor nodes in the target executor, wherein the executor nodes are nodes in the sidecar mode; The executor node receives task scheduling instruction packets sent by the task scheduling center. The task scheduling instruction package is processed in the executor node to obtain multiple task scheduling instructions; Each task scheduling instruction is sent to the corresponding sidecar container, wherein the sidecar container is used to process the corresponding task scheduling instruction; Specifically, the task scheduling instruction package is processed in the executor node to obtain multiple task scheduling instructions, including: The task scheduling instruction packet is parsed in the executor node to obtain the parsed task scheduling instruction packet; The parsed task scheduling instruction package is split to obtain the multiple task scheduling instructions; The scheduling center communicates only with the executor node process. After registering the executor node in the target executor, the method further includes: The task scheduling center monitors whether the executor node has completed registration. If the executor node registration is detected, the registration information corresponding to the executor node is obtained through the task scheduling center. The registration information includes: application information, port information, and IP information. Before receiving the task scheduling instruction packet sent by the task scheduling center through the executor node, the method further includes: The registration information obtained from the task scheduling center is traversed. A task list is determined based on the registration information, wherein each task to be executed in the task list is arranged according to a preset trigger time; The task scheduling instruction package is determined based on the task list, wherein the task scheduling instruction package contains scheduling instructions for scheduling multiple tasks; The task scheduling instruction package is sent to the executor node through the task scheduling center.
2. The method according to claim 1, characterized in that, After sending each task scheduling instruction to the corresponding sidecar container, the method further includes: In each sidecar container, in response to the corresponding scheduling instruction, multiple response results are obtained, wherein the multiple response results are scheduling results for the multiple tasks; The multiple response results are sent to the target executor.
3. The method according to claim 2, characterized in that, After sending the plurality of response results to the target executor, the method further includes: The multiple response results from the target executor are sent to the task scheduling center so that the task scheduling center updates the execution status of the multiple tasks.
4. A distributed task scheduling device based on the sidecar mode, characterized in that, include: A registration unit is used to register an executor node in a target executor, wherein the executor node is a node in the sidecar mode; The receiving unit is used to receive task scheduling instruction packets sent by the task scheduling center through the executor node; The processing unit is used to process the task scheduling instruction package in the executor node to obtain multiple task scheduling instructions; The first sending unit is used to send each task scheduling instruction to the corresponding sidecar container, wherein the sidecar container is used to process the corresponding task scheduling instruction; The processing unit includes: a parsing module, used to parse the task scheduling instruction package in the executor node to obtain the parsed task scheduling instruction package; and a splitting module, used to split the parsed task scheduling instruction package to obtain multiple task scheduling instructions. The scheduling center communicates only with the executor node process. The device further includes: The monitoring unit is used to monitor whether the executor node registration is complete through the task scheduling center after the executor node is registered in the target executor; the acquisition unit is used to acquire the registration information corresponding to the executor node through the task scheduling center if the executor node registration is detected to be complete. The registration information includes: application information, port information, and IP information. The traversal unit is used to traverse the registration information obtained by the task scheduling center before receiving the task scheduling instruction package sent by the task scheduling center through the executor node; the first determination unit is used to determine the task list according to the registration information, wherein each task to be executed in the task list is arranged according to a preset trigger time. The second determining unit is used to determine the task scheduling instruction package based on the task list before receiving the task scheduling instruction package sent by the task scheduling center through the executor node. The task scheduling instruction package contains scheduling instructions for scheduling multiple tasks. The second sending unit is used to send the task scheduling instruction package to the executor node through the task scheduling center.
5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program, wherein the program performs the method according to any one of claims 1 to 3.
6. An electronic device, characterized in that, The method includes one or more processors and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method of any one of claims 1 to 3.
Citation Information
Patent Citations
Task processing method and device, electronic equipment and readable storage medium
CN112799854A
Task scheduling method and device
CN113342508A
Container management method and device in application development and computer readable storage medium
CN113467883A