Node scheduling, switching and coordination method and corresponding device, equipment and medium
By querying and upgrading execution nodes in the node database, the multi-center structure and automatic switching mechanism of the distributed task scheduling system are realized, which solves the problem of scheduling center failure and task execution node availability, and improves the system's disaster recovery capability and processing efficiency.
Patent Information
- Application Number
- CN202011157270.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-26
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2040-10-26
AI Technical Summary
The existing distributed task scheduling system is unavailable when the dispatch center fails, and the availability of task execution nodes is not considered, resulting in task conflicts and load imbalance, affecting processing efficiency.
Query the task type through the node database, respond to the node query request, upgrade the execution node to a service node, and automatically switch when the service node is down to ensure task scheduling and load balancing, and realize a multi-center distributed task scheduling system.
It improves the system's disaster recovery capability and processing efficiency, avoids task conflicts, and ensures efficient task execution and system flexibility.
Smart Images

Figure CN112269647B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer networks, and in particular to a node scheduling, switching and coordination method, as well as corresponding devices, equipment and non-volatile storage media for these methods. Background Art
[0002] The system scale of major Internet companies is growing, and the number of business-related tasks is increasing and becoming more and more complex, especially in a distributed environment. When there are multiple business systems, each business system has the need to process tasks. Therefore, there is a need for a task platform to uniformly manage and schedule the tasks of each business system, that is, a distributed task scheduling system, in order to promptly respond to a large number of task processing requests from various types of business systems and meet the task processing needs of the corresponding businesses.
[0003] At present, the execution logic of most distributed scheduling task systems is roughly as follows: first, a unique scheduling node is configured through the scheduling center, and the scheduling node assigns tasks to execution nodes so that the corresponding execution nodes can execute the assigned tasks; secondly, for the execution of tasks, multiple task execution nodes periodically scan task configuration records to preempt unexecuted tasks and execute them. According to this execution logic, there are at least the following defects:
[0004] First, the method of configuring the dispatching node by the dispatching center adopted in the prior art, even if the dispatching center adopts a high-availability solution, because it only has a single dispatching center structure, that is, there is only one dispatching center node that provides dispatching services. If the dispatching center node fails, the system will be unavailable for a period of time, and it will take a long time to recover to an available state, resulting in a large number of tasks being unable to be executed, causing various types of services to be unable to be provided to users.
[0005] Secondly, the task execution-related processing method in the prior art does not take into account the availability of the execution nodes, but directly and unconditionally allows multiple execution nodes to preempt the same task. This can easily cause task conflicts, resulting in multiple execution nodes repeatedly executing the same task. In addition, due to the unbalanced task loads on different execution nodes, it is actually impossible to reasonably and efficiently achieve greater processing efficiency.
[0006] In view of the above common problems faced by distributed task scheduling systems, some effective solutions are urgently needed. Summary of the invention
[0007] The primary purpose of the present application is to provide a node scheduling method and its corresponding device, electronic device, and non-volatile storage medium.
[0008] The second purpose of the present application is to provide a node switching method and its corresponding device, electronic device, and non-volatile storage medium to adapt to the primary purpose.
[0009] The third purpose of the present application is to provide a node coordination method and its corresponding device, electronic device, and non-volatile storage medium to adapt to the primary purpose.
[0010] In order to meet the various objectives of this application, this application adopts the following technical solutions:
[0011] A node scheduling method provided to meet the primary purpose of this application includes the following steps:
[0012] In response to the node query request, the task type specified therein is obtained, and the access entry of the service node corresponding to the task type is determined from the node database. As feedback to the request, each service node is used to schedule a specific execution node for the task of the corresponding type;
[0013] When no service node corresponding to the task type can be found in the node database, responding to a role switching instruction of any of the execution nodes, the access entry of the execution node is associated with the task type and stored as a data record of the node database, so that the execution node is upgraded to the service node;
[0014] The connection status of any of the service nodes is monitored, and when any of the service nodes is disconnected, the data records corresponding to the service node are cleared from the node database.
[0015] In a further embodiment, the node query request originates from the execution node, and when there is no service node feedback, the execution node issues the role switching instruction accordingly.
[0016] In a preferred embodiment, the node query request originates from a task proxy node, and the fed-back service node is a task operation request for the proxy node to schedule the task.
[0017] In some embodiments, the node database includes data records of multiple different service nodes, each service node corresponds to a task type, and at the same time, there is only one service node corresponding to a task type.
[0018] In a further embodiment, the steps of the method are executed concurrently.
[0019] A node switching method provided for the second purpose of the present application comprises the following steps:
[0020] Initiate a node query request, query the node database for service nodes that match the task type preset by the current node, and obtain the corresponding feedback results;
[0021] When the feedback result indicates that there is no data record of the corresponding service node in the node database, a role switching instruction is initiated to associate the access entry of the current node with its preset task type and store it in the node database for query, so as to upgrade the current node to the service node;
[0022] After the current node is upgraded to a service node, a task operation request corresponding to the task type is received, and the task operation request is added to the task pool for preemption processing by the execution node;
[0023] When the feedback result includes an access entry of a matching service node, the current node is kept as the execution node for processing the task operation request of the preset task type.
[0024] In a further embodiment, the current node performs the following steps in the role of a service node:
[0025] Receive task operation requests from agent nodes that meet the preset task types and add them to the task pool;
[0026] Selecting some execution nodes for processing the task operation request according to the load balancing information reported by the execution nodes matching the preset task type;
[0027] Sending a task message to the partial execution nodes to notify them to process the task operation request;
[0028] The first responder among the partial execution nodes implements the preemption process of the task operation request.
[0029] In a further embodiment, the current node performs the following steps in the role of a service node:
[0030] Continuously upload its own load balancing information to the service node that matches its preset task type;
[0031] When receiving a task message sent by the service node to notify processing of a task operation request, preempting at least one task operation request from the task pool;
[0032] Implement task processing for successfully preempted task operation requests.
[0033] A node coordination method provided for the third purpose of the present application comprises the following steps:
[0034] Adapt to multiple task types. Multiple service nodes of each task type compete for the scheduling right to serve tasks of this type. The one that obtains the scheduling right is determined as the service node of this type, which is used to schedule specific execution nodes for tasks of this type.
[0035] Each determined service node selects part of the execution nodes for the task requested to be processed by the proxy node according to the load balancing information reported by multiple execution nodes associated with it in terms of task type;
[0036] The determined service node sends a task message about the task requested to be processed to the part of the execution nodes;
[0037] The determined service node dispatches the task requested for processing to the winner of the competition for the execution right of the task requested for processing among the said part of the execution nodes to implement the task processing.
[0038] A node scheduling device proposed to meet the primary purpose of this application includes:
[0039] A request response unit, used to respond to a node query request, obtain the task type specified therein, query and determine the access entry of the service node corresponding to the task type from the node database, as feedback to the request, and each service node is used to schedule a specific execution node for the task of its corresponding type;
[0040] An instruction response unit, for responding to a role switching instruction of any of the execution nodes when no service node corresponding to the task type can be found in the node database, and storing the access entry of the execution node in association with the task type as a data record of the node database, so that the execution node is upgraded to the service node;
[0041] The node monitoring unit is used to monitor the connection status of any of the service nodes, and when any service node is disconnected, clear the data record corresponding to the service node from the node database.
[0042] A node switching device proposed to meet the second purpose of the present application includes:
[0043] A request initiating unit, used to initiate a node query request, query the node database for a service node that matches the task type preset by the current node, and obtain a corresponding feedback result;
[0044] An instruction initiating unit, for initiating a role switching instruction to associate the access entry of the current node with its preset task type and store it in the node database for query, when the feedback result indicates the access entry of the service node of the node, and to upgrade the current node to the service node when the current node is kept as the execution node for processing the data record of the corresponding service node that does not exist in the preset point database;
[0045] A request adding unit, used for receiving a task operation request corresponding to the task type after the current node is upgraded to a service node, and adding the task operation request to the task pool for preemption processing by the execution node;
[0046] The feedback determination unit is used to keep the current node as the execution node for processing the task operation request of the preset task type when the feedback result includes the access entry of the matching service node.
[0047] A node coordination device proposed to meet the third objective of the present application includes:
[0048] A node determination unit is used to adapt to multiple task types. Multiple service nodes of each task type compete for the scheduling right to serve the tasks of the task type, and correspondingly determine a service node for scheduling a specific execution node for the task of the corresponding type;
[0049] A node screening unit, configured to select, for each determined service node, some execution nodes for the task requested to be processed by the proxy node according to load balancing information reported by multiple execution nodes associated with the service node in terms of task type;
[0050] A task initiating unit, configured for the determined service node to send a task message about the task requested for processing to the part of the execution nodes;
[0051] The task scheduling unit is used to schedule the task requested to be processed by the determined service node to the winner of the competition for the execution right of the task requested to be processed among the said part of execution nodes to implement task processing.
[0052] An electronic device provided to meet another purpose of the present application includes a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the node scheduling method, the node switching method or the node coordination method described in the present application.
[0053] A non-volatile storage medium is provided to meet another purpose of the present application, which stores a computer program implemented according to the node scheduling method, the node switching method or the node coordination method. When the computer program is called and executed by a computer, the steps included in the corresponding method are executed.
[0054] Compared with the prior art, the advantages of this application are as follows:
[0055] First of all, the present application allows tasks to be classified and processed according to different types, and multiple service nodes are equipped to adapt to different task types. Each service node plays the role of a scheduling center, responsible for scheduling corresponding execution nodes to process tasks of corresponding types. Among them, the service nodes and execution nodes are equipped with unified operating logic. When this logic runs on a certain server, the server has the ability to first write its own information to the node database and seize the ability to become the scheduling center of a certain type of task, that is, to become the said service node. When the service node, that is, the scheduling center, of the corresponding task type already exists in the node database, the (node) server can make itself work as an execution node, and is responsible for accepting the scheduling of the corresponding service node of this type and cooperating in processing tasks of the corresponding type. It can be seen that by applying this principle, deploying multiple servers as described above, and using the node database for unified management, a distributed task scheduling system with multiple scheduling centers can be realized. Compared with the distributed task scheduling system of a single center without distinguishing task types, it has stronger adaptability. Even if the service node serving a certain type of task goes down, it will only affect the corresponding task scheduling of the service node in a short time. Soon other servers will switch from the role of execution node to the role of service node to replace it, quickly repair the current fault, have strong disaster recovery capabilities, and will not cause the collapse of the entire scheduling system.
[0056] Secondly, the present application utilizes the same set of operating logic to run on the same server to implement an automatic role switching mechanism. When the node database responds to the node query request of the execution node and the service node corresponding to the node query request cannot be found in the database, it will respond to the role switching instruction sent by the execution node to switch the execution node to a service node. Through this principle, the same server has two working modes, that is, a node server can be responsible for both the work of the execution node and the work of the service node, so that the node server has mobility and can flexibly and automatically switch working modes, which can improve the deployment and maintenance efficiency of the scheduling system.
[0057] In addition, when determining the service nodes of each task type, the present application records the service nodes of each task type with the help of a node database, allowing any node server to write a role switching instruction indicating its willingness to work as a service node into the node database, and then allowing the node server whose instruction is first responded to to become the corresponding scheduling center according to the principle of first come first served, thereby realizing a competition mechanism. The application of this competition mechanism enables each node server under the same task type to be converted into a service node when needed, that is, to become a scheduling center. Therefore, for the entire distributed task scheduling system deployed with the solution of the present application, since each node server is given a fair opportunity to compete, the node server with more urgent needs can more easily obtain scheduling rights, thereby also taking into account the improvement of the time efficiency of the scheduling system itself during internal self-coordination. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0059] Figure 1 A schematic diagram showing the deployment of the technical solution of the present application in a network environment;
[0060] Figure 2 A schematic diagram of the system principle of a multi-center distributed task scheduling system formed to implement the technical solution of the present application;
[0061] Figure 3 A flowchart of a typical embodiment of the node scheduling method of the present application;
[0062] Figure 4 This is a principle block diagram of a typical embodiment of a node scheduling device of the present application;
[0063] Figure 5 A flowchart of a typical embodiment of the node switching method of the present application;
[0064] Figure 6 A schematic diagram of a flow chart of another embodiment of a node switching method of the present application;
[0065] Figure 7 A flowchart of another embodiment of the node switching method of the present application;
[0066] Figure 8 A principle block diagram of a typical embodiment of a node switching device of the present application;
[0067] Fig. 9 A flowchart of a typical embodiment of the node coordination method of the present application;
[0068] Fig.10 This is a principle block diagram of a typical embodiment of the node coordination device of the present application. DETAILED DESCRIPTION
[0069] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0070] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0071] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0072] It will be understood by those skilled in the art that the "client", "terminal" and "terminal device" used herein include both devices with wireless signal receivers, which are devices with only wireless signal receivers without transmission capabilities, and devices with receiving and transmitting hardware, which are devices with receiving and transmitting hardware capable of two-way communication on a two-way communication link. Such devices may include: cellular or other communication devices such as personal computers, tablet computers, which have single-line displays or multi-line displays or cellular or other communication devices without multi-line displays; PCS (Personal Communications Service, personal communication system), which can combine voice, data processing, fax and / or data communication capabilities; PDA (Personal Digital Assistant, personal digital assistant), which may include a radio frequency receiver, pager, Internet / intranet access, web browser, notepad, calendar and / or GPS (Global Positioning System, global positioning system) receiver; conventional laptop and / or palmtop computers or other devices, which have and / or include a conventional laptop and / or palmtop computer or other device with and / or including a radio frequency receiver. The "client", "terminal" and "terminal device" used herein may be portable, transportable, installed in a vehicle (air, sea and / or land), or suitable for and / or configured to run locally, and / or in a distributed form, at any other location on the earth and / or in space. The "client", "terminal" and "terminal device" used herein may also be a communication terminal, an Internet terminal, a music / video playing terminal, for example, a PDA, a MID (Mobile Internet Device) and / or a mobile phone with a music / video playing function, or a smart TV, a set-top box and other devices.
[0073] The hardware referred to by the names such as "server", "client", and "service node" in this application is essentially an electronic device with the equivalent capabilities of a personal computer. It is a hardware device with the necessary components revealed by the von Neumann principle, such as a central processing unit (including an arithmetic unit and a controller), a memory, an input device, and an output device. The computer program is stored in its memory, and the central processing unit calls the program stored in the external memory into the internal memory for execution, executes the instructions in the program, and interacts with the input and output devices to complete specific functions.
[0074] It should be pointed out that the concept of "server" referred to in this application can also be extended to the case of server clusters. According to the network deployment principle understood by those skilled in the art, the servers should be logically divided. In physical space, these servers can be independent of each other but can be called through interfaces, or integrated into a physical computer or a set of computer clusters. Those skilled in the art should understand this flexibility, and should not use it to restrict the implementation of the network deployment method of this application.
[0075] See also Figure 1 , the hardware foundation required for the implementation of the relevant technical solutions of this application can be deployed by referring to the architecture shown in the figure. The service node 80, proxy node 81 and execution node 82 described in this application are all deployed in the cloud, wherein the service node 80 is dedicated to receiving task operation requests sent by the proxy node and receiving other interactions such as load balancing information reported by the execution node. Each node 80, 81 and 82 can act as an application server and further connect to other servers such as storage servers and backup servers to interact with the node database, thereby forming a logically related service cluster. The service node 80, the proxy node 81 and the execution node 82 can all access the Internet through well-known network access methods, and data communication links can be established between each other to achieve various data exchanges.
[0076] See also Figure 2, the system structure of the multi-center distributed task scheduling system constructed by implementing the relevant technical solutions of the present application is shown in the figure, and the system consists of a node database A, an execution node B, a service node C and an agent node D. The node database A is the first layer of the system, the execution node B, the service node C and the agent node are located in the second layer of the system, and the terminal device D is located in the third layer of the system. The node database located in the first layer will provide corresponding services for all devices in the second layer, such as providing query service node services for execution node B and agent node D, providing role switching services for execution node B, and real-time monitoring of the connection status of service node C to update the data records in its library in real time. The various devices located in the second layer establish data communication links with each other to provide corresponding services to each other. For example, execution node B can send its own load balancing information to service node C, so that service node C sends it a task operation request sent by agent node D, and execution node B can feedback the corresponding results to agent node D after completing the task operation request. The terminal device E of the third layer establishes a data communication link with the proxy node D so that the task to be processed can be uploaded to the multi-center distributed task scheduling system of this application through the proxy node D for processing, and the proxy node D can feed back the execution result of the task to the terminal device E. It should be noted that when the execution node B switches to the service node through the role switching instruction, its execution logic can refer to the execution logic of the service node C, and its interaction with other devices is roughly the same. This schematic diagram only reflects the situation where each device exists alone. When this system is actually deployed, there will be multiple Figure 2 The execution node B, service node C, proxy node D and terminal device E in the system, and the node database A does not necessarily exist in a single server, but can also be stored in a distributed manner, or multiple terminals can back up each other and synchronize in real time, as long as it can provide services for the corresponding devices. Technical personnel in this field can design it flexibly, as long as the system can operate according to the method implemented in this application.
[0077] The terminal device of the present application is equipped with relevant operating systems, such as IOS, HMS (Hongmeng), Android and other operating systems that provide equivalent functions. With the support of such operating systems, data communication can be carried out between the server and the terminal device through a communication link agreed upon by both parties, and application programs adaptively developed for these operating systems can also run normally in the terminal device, realizing human-computer interaction and remote interaction through the terminal device.
[0078] The application of the present application, in its general meaning, refers to an application running on an electronic device such as a server or a terminal device. These applications implement the relevant technical solutions of the present application in a programming manner, and their program codes can be stored in a non-volatile storage medium recognizable by a computer in the form of computer executable instructions, and can be loaded into the memory by the central processing unit for execution. The relevant devices of the present application are constructed by the operation of the application on the computer.
[0079] Those skilled in the art should be aware that, although the various methods of the present application are described based on the same concept and thus present commonality to each other, unless otherwise specified, these methods can be independently executed. Similarly, for each embodiment disclosed in the present application, they are all proposed based on the same inventive concept, therefore, concepts with the same expression, and concepts that are appropriately changed for convenience despite different expressions, should be understood as equivalent.
[0080] See also Figure 3 A node scheduling method of the present application is implemented by an application program of a server equipped with a node database. In a typical embodiment, it includes the following steps:
[0081] Step S11, in response to the node query request, obtain the task type specified therein, query and determine the access entry of the service node corresponding to the task type from the node database, as feedback to the request, each service node is used to schedule a specific execution node for the task of its corresponding type:
[0082] The node database refers to a database that stores data records related to information about service nodes, so as to respond to the node query request, obtain the task type specified in the request, query the service node corresponding to the task type, send the access entrance of the service node to the corresponding execution node or proxy node as feedback of the node query request, and complete the operation of scheduling the corresponding service node for the execution node or proxy node.
[0083] The node query request is sent by the execution node or the proxy node to the node database, so that the node database can query the service node corresponding to the task type specified by the node query request. If the service node of the corresponding task type exists, the node database will send the access entry of the service node to the execution node or the proxy node accordingly, so that the execution node or the proxy node can access the service node to perform task scheduling. If the data record of the service node of the corresponding task type does not exist in the node database, the node database will send the corresponding feedback result to the execution node, so that the execution node can send the role switching instruction to it accordingly.
[0084] The node database refers to a database for storing data records related to multiple different service nodes. It is deployed in the corresponding server and provides data services for determining the corresponding relationship between tasks of multiple task types and their service nodes, so that the execution node or proxy node can query the corresponding service node in the node database through a node query request; each service node stored in the node database can only be scheduled for its corresponding task type, and at the same time, there is only one service node corresponding to a task type, so that the feedback from the control node database to the proxy node only contains an access entrance to the corresponding service node, preventing the proxy node from sending task operation requests to multiple service nodes, resulting in the repeated processing of tasks to be processed by the proxy node.
[0085] The data record refers to the data of the node database storing relevant service node information, which includes the service node's own configuration information such as the service node's access entrance and the scheduling task type, so that the node database can determine the service node that handles the scheduling of the corresponding task type through the data record stored therein, and send the access entrance and other information of the service node to the corresponding execution node.
[0086] When the node query request comes from an execution node, the execution node will continuously upload its server address and load balancing information to the service node through the access portal so that the service node can add it to the corresponding database and select at least one execution node for processing the task corresponding to the task operation request by screening the execution nodes existing in the database.
[0087] When the execution node is not fully loaded, it will periodically send node query requests for corresponding tasks to the node database, query the corresponding service nodes, obtain the corresponding tasks for processing, and realize reasonable and efficient use of the computing resources of the execution node.
[0088] The proxy node generally refers to a server that receives tasks to be processed sent by the client. When the user terminal performs corresponding task operations, it will send the tasks to be processed to the corresponding proxy server, so that the proxy node sends the node query request to the node database, obtains the access entry of the corresponding service node from the node database, and sends the corresponding task operation request to the service node through the access entry, so that the service node sends the task operation request to the corresponding partial execution node to complete the scheduling of the task.
[0089] When the execution node sends the node query request to the node database, if the feedback result it receives does not include the access entry of the corresponding service node, it will send a role switching instruction of the corresponding task type to the node database so as to switch it to the service node corresponding to the task type and schedule the task of this type. For the implementation method of role switching, please refer to the description of subsequent steps.
[0090] Step S12, when no service node corresponding to the task type can be found in the node database, in response to a role switching instruction of any of the execution nodes, the access entry of the execution node is associated with the task type and stored as a data record of the node database, so that the execution node is upgraded to the service node:
[0091] When the node database responds to the node query request sent by the execution node and no service node corresponding to the task type corresponding to the node query request is found, the feedback result sent to the execution node will not include the access entry of the service node, and the execution node will send a role switching instruction to the node database so that the node database will store the information associating the access entry of the execution node with the task type in the data record of the node database by responding to the role switching instruction, so that the execution node switches to the service node of the task type corresponding to the node query request.
[0092] When the node database receives multiple role switching instructions at the same time, it will respond to the role switching instruction received first, and store the access entry and task type information of the execution node to which the role switching instruction belongs as a data record, so as to determine the task type of the execution node and send the access entry of the execution node to the corresponding execution node, thereby completing the upgrade of the execution node to a service node of its corresponding task type.
[0093] After the execution node switches to the service node, it will continue to receive load balancing information from the execution nodes of the task type corresponding to the node query request, and receive task operation requests corresponding to the task type sent by the proxy node, and add the task operation request to the task pool, so as to schedule at least one of the execution nodes corresponding to the task operation request, so that the task corresponding to the task operation request can be processed by the execution node.
[0094] The role switching module constructed through this step can efficiently utilize the computing resources of the execution node, and can also provide a solution for a certain task type when its corresponding service node is in a down state. When the node database responds to the node query request sent by the execution node and finds that the corresponding service node is in a down state, it will not be able to provide feedback to the execution node. Therefore, the execution node will send a role switching instruction to the node database so that the node database responds to the computing switching instruction, switches it to the service node of the corresponding task type, performs task scheduling of the task type, and repairs the task scheduling service of the task type.
[0095] Step S13, monitoring the connection status of any of the service nodes, and when any service node is disconnected, clearing the data record corresponding to the service node from the node database:
[0096] In order to monitor the current operating status of each service node and promptly discover and handle service nodes that are in a downtime state, the node database can monitor the connection status of the service nodes it stores. When it is monitored that the service node is disconnected for a predetermined period of time, or the service node has not responded to related requests for multiple times, it indicates that the service node is in a downtime state. The node database will clear the data record of the service node so that the execution node that sends the node query request corresponding to the service node can upgrade to a new service node to handle the task scheduling of this type of task by sending a role switching instruction.
[0097] All the steps implemented by this method will be executed concurrently, that is, the node database can concurrently execute responses to node query requests, responses to role switching instructions, and the connection status of service nodes in the monitoring node database, and update the data records of the node database in the corresponding server in real time through the network link, thereby building a multi-center distributed task scheduling system with a multi-threaded working mode.
[0098] Furthermore, by functionalizing each step in the method disclosed in the above embodiments, a node scheduling device of the present application can be constructed. Figure 4 In a typical embodiment, the device comprises:
[0099] The request response unit 11 is used to respond to the node query request, obtain the task type specified therein, query and determine the access entry of the service node corresponding to the task type from the node database, as feedback to the request, and each service node is used to schedule a specific execution node for the task of its corresponding type;
[0100] The instruction response unit 12 is used to respond to the role switching instruction of any of the execution nodes when no service node corresponding to the task type can be found in the node database, and store the access entry of the execution node in association with the task type as a data record of the node database, so that the execution node is upgraded to the service node;
[0101] The node monitoring unit 13 is used to monitor the connection status of any of the service nodes, and when any service node is disconnected, clear the data record corresponding to the service node from the node database.
[0102] See also Figure 5 A node switching method of the present application is implemented by an application program on the node server side. In a typical embodiment, it includes the following steps:
[0103] Step S21, initiate a node query request, query the node database for a service node that matches the task type preset by the current node, and obtain the corresponding feedback result:
[0104] The execution node will periodically send the node query request of the corresponding task type to the node database, so that the node database responds to the node query request, queries the service node corresponding to the task type, and sends the response feedback information to the execution node.
[0105] When the feedback information contains the access entrance of the service node corresponding to the node query request, the execution node will continuously upload its own responsible balancing information to the corresponding service node through the access entrance, so as to participate in the task operation request scheduling activities of the service node and seize the execution right of the task type corresponding to the corresponding task operation request.
[0106] When the feedback result does not contain the access entrance of the service node corresponding to the node query request, the execution node will send a role switching instruction to the node database to switch itself to the service node of the task type corresponding to the node query request, and schedule the corresponding execution node for the task operation request of this task type.
[0107] The processing or scheduling task type corresponding to each execution node or service node can generally be set by technical personnel during deployment or modified in a timely manner to determine that the execution node sends the corresponding node query request to the node database to query the corresponding service node, and the service node receives the corresponding task operation request.
[0108] Step S22, when the feedback result indicates that there is no data record of the corresponding service node in the node database, a role switching instruction is initiated to associate the access entry of the current node with its preset task type and store it in the node database for query, so as to upgrade the current node to the service node:
[0109] As mentioned above, when the node database responds to the node query request sent by the execution node and cannot find the service node corresponding to the node query request, it will send a response feedback result to the execution node so that the execution node can send the role switching instruction and send its access entry, scheduling task type, and other node configuration information to the node database. The node database responds to the role switching instruction, stores the node information of the execution node as a data record, and completes the operation of upgrading the execution node to a service node.
[0110] The execution node completes the operation of switching from the execution node to the service node by sending the role switching instruction to the node database, thereby realizing the node server role automatic switching mechanism. Therefore, the same node server has two working modes, that is, a node server can be responsible for the work of both the execution node and the service node, so that the node server has mobility and can flexibly and automatically switch the working mode, thereby improving the deployment of the scheduling system and handling failures in the scheduling system. For example, when the service node of a certain task type goes down, the corresponding execution node can automatically switch to the service node of that task type to handle the task operation request of that task type, thereby improving the disaster recovery of the scheduling system.
[0111] When the node database subsequently accepts the same node query request scheduling as above, it will feed back the access entrance, task type and other information of the service node upgraded by the execution node to the execution node or proxy node to which the node query request belongs, so that it can perform corresponding operations.
[0112] Step S23, after the current node is upgraded to a service node, a task operation request corresponding to the task type is received and added to the task pool for execution node preemption processing:
[0113] In a typical embodiment, after the execution node completes the upgrade to the service node by sending a role switching instruction to the node database, the proxy node can send a task operation request of the task type corresponding to the service node through the access portal of the service node, so that the service node can add it to the task pool, and notify the task operation request to some execution nodes that have reported through the access portal to complete the scheduling of the task type corresponding to the task operation request.
[0114] The task operation request includes task type information, task operation information, etc., so as to represent the information of the task to be processed by the proxy node. When the task operation request is sent to the corresponding service node, it will be added to the task pool by the service node so that the service node can dispatch the task operation request to the corresponding execution node.
[0115] The task pool refers to a database that stores one or more task operation requests received by the service node. The service node parses the task operation request, obtains and adds the access entry of the proxy node to which the task operation request belongs, the computing resource information required to execute the task operation, etc. to the task pool as its data. Generally, the task pool is constructed in the form of a list so as to schedule the task operation requests in an orderly manner. The service node will give priority to the task operation request received first.
[0116] For a more comprehensive description of the implementation details of upgrading an execution node to a service node, please refer to Figure 6 , when the node is the service node, it can be executed by executing the following specific steps:
[0117] Step S231, receiving a task operation request that meets the preset task type sent by the proxy node, and adding it to the task pool:
[0118] The proxy node sends the task operation request to be processed to the corresponding service node through the access entry in the feedback result sent by the node database, so that the service node adds the task operation request to the task pool and schedules the corresponding execution node to process the corresponding task for the task operation request.
[0119] The task pool stores all task operation requests received by the service node in the form of a list, so the service node will give priority to processing the task operation request that is currently added earliest in the task pool, and effectively process all task operation requests it receives.
[0120] Step S232: Select some execution nodes for processing the task operation request according to the load balancing information reported by the execution nodes matching the preset task type:
[0121] The execution node reports its load balancing information to the service node through the access entry of the service node in the feedback result obtained from the node database, so that the service node schedules the task operation request for it.
[0122] The load balancing information is used to indicate the current occupancy of computing resources of the execution node to which it belongs. The execution node accesses the portal, and the service node can analyze the load balancing information to screen out some execution nodes with sufficient computing resources, and send the task operation requests stored in the task pool to the some execution nodes.
[0123] After receiving the load balancing information reported by the execution nodes matching its own task type, the service node will store it in the corresponding database so as to analyze all the load balancing information it receives and select some execution nodes suitable for processing its current task operation request.
[0124] Step S233: Send a task message to the partial execution nodes to notify them to process the task operation request:
[0125] The service node determines the partial execution nodes suitable for processing the tasks corresponding to the task operation request currently to be scheduled by analyzing all the load balancing information in the execution node database, and sends the task operation request to the partial execution nodes so that the partial execution nodes can seize the processing right (execution right) of the task corresponding to the task operation request by implementing the task operation request.
[0126] Step S234: The first responder among the partial execution nodes implements the preemption process for the task operation request:
[0127] After the service node notifies the task operation request to some of the execution nodes it has screened, the execution node that first responds to the task operation request among the execution nodes will obtain the processing right of the task corresponding to the task operation request.
[0128] When some of the nodes receive a task operation request from the service node, they will parse the task operation request and obtain task operation information to determine whether there are currently excess computing resources to meet the computing resources required for the task execution corresponding to the task operation request. If so, a response notification will be sent to the service node.
[0129] The service node uses the execution node to which the response notification is first received as the execution node for processing the task operation request, and grants the execution node the processing right to process the task operation request so that the execution node can process the task to be processed by the proxy node to which the task operation request belongs.
[0130] Step S24: when the feedback result includes an access entry of a matching service node, the current node is kept as the execution node for processing the task operation request of the preset task type:
[0131] When the execution node sends a node query request to the node database and receives an access entry in the feedback result sent by the node database, the execution node will continue to report its load balancing information to the corresponding service node through the access entrance, so as to obtain the task operation request of the corresponding task type from the service node and preemptively process the task.
[0132] For a more comprehensive description of the implementation details of the execution node receiving the feedback result including the access entry of the matching service node, please refer to Figure 7 , the execution node can be executed by executing the following specific steps:
[0133] Step S241, continuously upload its own load balancing information to the service node matching its own preset task type:
[0134] When the execution node receives the feedback result sent by the node database containing the access entrance of the matching service node, it will continuously upload its own load balancing information to the service node through the access entrance, so as to continuously update its own load balancing information stored on the service node, obtain task operation requests from the service node, preempt tasks for processing, and use its own idle computing resources to make itself work at full capacity as much as possible.
[0135] Step S242: when receiving a task message sent by the service node to notify the processing of a task operation request, at least one task operation request is seized from the task pool:
[0136] When the load balancing information of the execution node meets the computing resources required by the task operation request currently to be processed by the service node, the execution node will receive the task operation request, and the execution node will continue to send its own load balancing information to the service node, so as to continuously receive other task operation requests from the service node, and continuously respond to the received task operation requests, thereby obtaining the execution right of at least one task therefrom.
[0137] In one embodiment, the execution node can process any type of task, and the execution node can obtain task operation requests from multiple service nodes. Therefore, when the execution node combines its own current computing resources, it will determine the currently executable task operation request from the multiple task operation requests obtained and respond, and notify the service node that sent the task operation request in order to preempt the task execution right of the task operation request.
[0138] Step S243, performing task processing on the successfully preempted task operation request:
[0139] When the execution node is the execution node that first responds to a task operation request sent by the service node, the execution node will obtain the execution right of the task corresponding to the task operation request and process the task.
[0140] After obtaining the task execution right of the task operation request, the execution node will parse the task operation request to obtain the task information and proxy node access portal carried by it, execute the corresponding task according to the task information, and send the execution result of the completed task to the corresponding proxy node through the proxy node access portal, so that the proxy node can obtain the data and other information required for the task operation request.
[0141] Furthermore, by functionalizing each step in the method disclosed in the above embodiments, a node switching device of the present application can be constructed. Figure 8 In a typical embodiment, the device comprises:
[0142] A request initiating unit 21 is used to initiate a node query request, query the node database for a service node that matches the task type preset by the current node, and obtain a corresponding feedback result;
[0143] The instruction initiating unit 22 is used for initiating a role switching instruction to associate the access entry of the current node with its preset task type and store it in the node database for query when the feedback result indicates the access entry of the service node of the node, and to upgrade the current node to the service node when the current node is kept as the execution node for processing the data record of the corresponding service node that does not exist in the preset point database;
[0144] A request adding unit 23, configured to receive a task operation request corresponding to the task type after the current node is upgraded to a service node, and add the task operation request to the task pool for preemption processing by the execution node;
[0145] The feedback determination unit 24 is configured to keep the current node as the execution node for processing the task operation request of the preset task type when the feedback result includes an access entry of a matching service node.
[0146] See also Fig. 9 A node coordination method of the present application is implemented by an application program on the service node side. In a typical embodiment, it includes the following steps:
[0147] Step S31, adapting to multiple task types, multiple service nodes of each task type compete for the scheduling right to serve the task of this type, and determining the one that obtains the scheduling right as the service node of this type, which is used to schedule the specific execution node for the task of this type:
[0148] When multiple execution nodes attempt to switch themselves to service nodes of corresponding task types through the role switching instruction, the node database upgrades the execution node that first responds to the role switching instruction to the service node and stores its data record in the database, thereby identifying the corresponding service node of the task type.
[0149] After the execution node is upgraded to the service node, it will continue to receive task operation requests sent through its access portal and add them to the task pool so as to process each task operation request in an orderly manner.
[0150] In addition to receiving the task operation request, the determined service node will also continue to receive the load balancing information of each execution node uploaded through its access portal, so as to update the load balancing information of each execution node in real time to prevent the load balancing information from not matching the load situation of the corresponding execution node when some execution nodes are subsequently determined.
[0151] Step S32: Each determined service node selects some execution nodes for the task requested to be processed by the proxy node according to the load balancing information reported by multiple execution nodes associated with it in terms of task type:
[0152] The service node selects execution nodes that meet the computing resources required to execute the task operation request as partial execution nodes by analyzing the latest load balancing information reported by multiple execution nodes associated with it in terms of task type, and sends the task operation request to the partial execution nodes so that the partial execution nodes respond to the task operation request.
[0153] The service node parses the task operation request to determine the computing resources required to execute the task corresponding to the task operation request, and selects at least one execution node that meets the computing resources from the multiple load balancing information received most recently as the execution node that can process the task corresponding to the task operation request.
[0154] Step S33: The determined service node sends a task message about the task requested to be processed to the partial execution nodes:
[0155] After selecting some execution nodes, the service node sends the task operation request to the some execution nodes so that the some execution nodes respond to the task operation request and send a response notification to the service node.
[0156] After receiving the task operation request sent by the service node, the execution node will analyze whether its current computing resources meet the computing resources of the task corresponding to the task operation request. If so, it will send a response notification to the service node. If not, it will wait for its own computing resources to meet the computing resources of the request before sending a response notification to the service node.
[0157] The service node will record the response time of all execution nodes that receive the task operation request, so as to determine the execution node that responds first in the subsequent steps.
[0158] Step S34: The determined service node dispatches the requested task to the winner of the competition for the execution right of the requested task among the execution nodes to perform task processing.
[0159] The competition means that the service node will select the execution node with the earliest response time among the response times of all the execution nodes that receive the task operation requests. The execution node with the earliest response time will have the opportunity to process the task operation request, and the execution node will process the task corresponding to the task operation request.
[0160] The service node issues corresponding instructions to grant the execution node with the earliest response time the execution right to process the task corresponding to the task operation request. After obtaining the execution right of the task, the execution node will parse the task operation request to obtain the task information and proxy node access portal carried by it. After completing the processing of the task through the task information, the execution result will be sent to the proxy node through the proxy node access portal to complete the processing of the task.
[0161] Furthermore, by functionalizing each step in the method disclosed in the above embodiments, a node coordination device of the present application can be constructed. Fig.10 In a typical embodiment, the device comprises:
[0162] A node determination unit 31 is used to adapt to multiple task types. Multiple service nodes of each task type compete for the scheduling right to serve the task of the task type, and correspondingly determine a service node for scheduling a specific execution node for the task of the corresponding type;
[0163] The node screening unit 32 is used for each determined service node to select part of the execution nodes for the task requested to be processed by the proxy node according to the load balancing information reported by multiple execution nodes associated with it in terms of task type;
[0164] The task initiating unit 33 is configured to send a task message about the task requested to be processed to the part of the execution nodes by the determined service node;
[0165] The task scheduling unit 34 is used for the determined service node to schedule the task requested to be processed to the winner of the competition for the execution right of the task requested to be processed among the said part of execution nodes to implement task processing.
[0166] Furthermore, to facilitate the execution of the present application, the present application provides an electronic device, including a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the node scheduling method, the node switching method, and the node coordination method described in the aforementioned embodiments.
[0167] It can be seen that the memory is suitable for using a non-volatile storage medium. By implementing the aforementioned method as a computer program and installing it in an electronic device such as a mobile phone or a computer, the relevant program code and data are stored in the non-volatile storage medium of the electronic device. The program is further run by the central processor of the electronic device, and it is transferred from the non-volatile storage medium to the memory for operation, so that the desired purpose of the present application can be achieved. Therefore, it can be understood that in one embodiment of the present application, a non-volatile storage medium can also be provided, in which a computer program implemented according to each embodiment of the node scheduling method, the node switching method, and the node coordination method is stored. When the computer program is called and executed by the computer, the steps included in the method are executed.
[0168] In summary, the present application implements a multi-center distributed task scheduling system, which efficiently and orderly schedules various types of tasks pre-processed by the client, and through the role switching module, realizes that the node server has two working modes, reflecting the mobility of the multi-center distributed task scheduling system to deal with problems arising in the scheduling task process.
[0169] It will be understood by those skilled in the art that the present application includes devices for performing one or more of the operations and methods described in the present application. These devices may be specially designed and manufactured for the desired purpose, or may also include known devices in general-purpose computers. These devices have computer programs stored in their memory, which are selectively activated or reconstructed. Such computer programs may be stored in a device (e.g., computer) readable medium or in any type of medium suitable for storing electronic instructions and coupled to a bus, respectively, the computer readable medium including but not limited to any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic card or optical card. That is, the readable medium includes any medium that stores or transmits information in a readable form by a device (e.g., computer).
[0170] Those skilled in the art will appreciate that each block in these structure diagrams and / or block diagrams and / or flow charts and combinations of blocks in these structure diagrams and / or block diagrams and / or flow charts can be implemented using computer program instructions. Those skilled in the art will appreciate that these computer program instructions can be provided to a general-purpose computer, a professional computer, or a processor of other programmable data processing methods to implement, thereby executing the scheme specified in the block or multiple blocks of the structure diagrams and / or block diagrams and / or flow charts disclosed in this application through the processor of the computer or other programmable data processing method.
[0171] Those skilled in the art will appreciate that the various operations, methods, steps, measures, and schemes in the processes discussed in this application may be alternated, altered, combined, or deleted. Further, other steps, measures, and schemes in the various operations, methods, and processes discussed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted. Further, the steps, measures, and schemes in the prior art that are similar to those disclosed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted.
[0172] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A node scheduling method, It is characterized in that It is executed by the application of the server equipped with the node database, including the following steps: In response to a node query request, the task type specified therein is obtained, and the access entry of the service node corresponding to the task type is determined from the node database. As feedback to the request, each service node is used to schedule a specific execution node for the task of the corresponding type; the node database includes data records of multiple different service nodes, each service node corresponds to a task type, and at the same time, only one service node corresponds to a task type; When no service node corresponding to the task type can be found in the node database, responding to a role switching instruction of any of the execution nodes, the access entry of the execution node is associated with the task type and stored as a data record of the node database, so that the execution node is upgraded to the service node; The connection status of any of the service nodes is monitored, and when any of the service nodes is disconnected, the data records corresponding to the service node are cleared from the node database.
2. The method according to claim 1, Features: The node query request originates from the execution node, and when there is no service node feedback, the execution node issues the role switching instruction accordingly; or, The node query request originates from a task proxy node, and the fed-back service node is a task operation request for the proxy node to schedule the task.
3. A node switching method, It is characterized in that It is applied to the current node working in the role of an execution node and includes the following steps: Initiate a node query request, query the node database for a service node that matches the task type preset by the current node, and obtain corresponding feedback results; the node database includes data records of multiple different service nodes, each service node corresponds to a task type, and at the same time, there is only one service node corresponding to a task type; When the feedback result indicates that there is no data record of the corresponding service node in the node database, a role switching instruction is initiated to associate the access entry of the current node with its preset task type and store it in the node database for query, so as to upgrade the current node to the service node; After the current node is upgraded to a service node, the current node receives a task operation request corresponding to the task type and adds it to the task pool for other execution nodes to preempt and process; When the feedback result includes an access entry of a matching service node, the current node is kept as an execution node role for processing the task operation request of the preset task type.
4. The method according to claim 3, It is characterized in that The current node performs the following steps as a service node: Receive task operation requests from agent nodes that meet the preset task types and add them to the task pool; Selecting some execution nodes for processing the task operation request according to the load balancing information reported by the execution nodes matching the preset task type; Sending a task message to the partial execution nodes to notify them to process the task operation request; The first responder among the partial execution nodes implements the preemption process of the task operation request.
5. The method according to claim 4, It is characterized in that The current node performs the following steps as an execution node: Continuously upload its own load balancing information to the service node that matches its preset task type; When receiving a task message sent by the service node to notify processing of a task operation request, preempting at least one task operation request from the task pool; Implement task processing for successfully preempted task operation requests.
6. A node coordination method, It is characterized in that It includes the following steps: Adapting to multiple task types, multiple service nodes of each task type compete for the scheduling right to serve the tasks of this type, and the one that obtains the scheduling right is determined to be the service node of this type, which is used to schedule specific execution nodes for the tasks of this type; wherein, multiple execution nodes competing for the scheduling right send role switching instructions to the node database to switch themselves to the service nodes of the corresponding task types, and the node database upgrades the execution node that first responds to the role switching instruction to a service node, and stores its data record in the database, thereby confirming the corresponding service node of the task type; the node database includes data records of multiple different service nodes, each service node corresponds to a task type, and at the same time, there is only one service node corresponding to a task type; Each determined service node selects some execution nodes for the task requested to be processed by the proxy node according to the load balancing information reported by multiple execution nodes associated with it in terms of task type; The determined service node sends a task message about the task requested to be processed to the part of the execution nodes; The determined service node dispatches the task requested for processing to the winner of the competition for the execution right of the task requested for processing among the said part of execution nodes to implement the task processing.
7. A node switching device, It is characterized in that It applies to the current node working in the role of an execution node, including: A request initiating unit is used to initiate a node query request, query the node database for a service node that matches the task type preset by the current node, and obtain a corresponding feedback result; the node database includes data records of multiple different service nodes, each service node corresponds to a task type, and at the same time, there is only one service node corresponding to a task type; An instruction initiating unit, for initiating a role switching instruction when the feedback result indicates that there is no data record of the corresponding service node in the node database, so as to associate the access entry of the current node with its preset task type and store it in the node database for query, so as to upgrade the current node to the service node; A request adding unit, used for receiving a task operation request corresponding to the task type after the current node is upgraded to a service node, and adding the task operation request to the task pool for preemption processing by the execution node; The feedback determination unit is used to keep the current node as the execution node for processing the task operation request of the preset task type when the feedback result includes the access entry of the matching service node.
8. An electronic device comprising a central processing unit and a memory, It is characterized in that The central processing unit is used to call and run a computer program stored in the memory to execute the steps of the node scheduling method as described in any one of claims 1 to 2; or execute the steps of the node switching method as described in any one of claims 3 to 5; or execute the steps of the node coordination method as described in claim 6.
9. A non-volatile storage medium, It is characterized in that It stores a computer program implemented according to the node scheduling method described in any one of claims 1 to 2 in the form of computer-readable instructions; or a computer program implemented according to the node switching method described in any one of claims 3 to 5; or a computer program implemented according to the node coordination method described in claim 6. When the computer program is called and executed by a computer, the steps included in the corresponding method are executed.
