Method, device and computer equipment for cluster manager scheduling engine instance

By receiving the token information in the message, it performs identity authentication and judgment of the available status of the engine instance, combined with the load balancing algorithm, the load imbalance problem of the cluster manager dispatching engine instance is solved, ensuring effective message processing, and improving the reliability and processing of the cluster speed.

CN113905048BActive Publication Date: 2024-11-15BEIJING LANHAI YIXIN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111162019.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2024-11-15
Estimated Expiration
2041-09-30

AI Technical Summary

Technical Problem

The prior art has failed to effectively implement the scheduling of multiple running processing instances by the cluster manager, resulting in unbalanced engine instance call load, unable to ensure the effective processing of messages, affecting the reliability and processing speed of the cluster.

Method used

By receiving messages containing Token information, endpoint identity authentication and engine instance availability status judgment, appropriate engine instances are allocated according to the message type, and engine instances are selected using the load balancing algorithm to process the message to ensure that the message is effectively processed.

Benefits of technology

It realizes load balancing of engine instance calls, ensures that messages are effectively processed, improves the reliability and processing speed of the cluster, and avoids the impact of a single point of failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113905048B_ABST
    Figure CN113905048B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a method, device and computer equipment for scheduling engine instances by a cluster manager, which not only achieves the purpose of calling load balancing by the engine instance, but also ensures that the message is effectively processed, and truly brings into play the role of the cluster. The method for scheduling engine instances by the cluster manager, wherein the engine instance can only be accessed by the cluster manager, comprises: receiving a message, wherein the message contains the token information of the endpoint; identifying the identity of the endpoint according to the token information, authenticating the identity of the endpoint, and determining whether the endpoint has the right to send the message; for messages that pass the authentication, determining the current available state of the engine; if there is an available engine at present, preliminarily allocating a corresponding engine instance according to the message type; selecting an engine instance according to the load balancing algorithm, and sending the message to the engine instance for processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer networks, and in particular to a method for cluster manager scheduling engine instances. Background Art

[0002] For information management systems of enterprises and institutions in industries such as medical care, education, military industry, and real estate, there are usually many internal and external business systems involved (possibly hundreds of them), and the daily volume of interactive messages between systems may reach tens of millions.

[0003] In order to solve the problem of point-to-point interaction between business systems, consider launching an information integration platform. The business system, as an endpoint, only connects to the integration platform. The integration platform completes the docking process with other business systems, realizes the decoupling and configurable interaction between business systems, and realizes the tracking, monitoring and alarm of the interaction process between business systems.

[0004] As the load center, the integrated platform hopes to use clustered operation to improve reliability and processing speed and avoid the wide-ranging impact caused by single point failures. Clustered operation requires a cluster manager to effectively schedule multiple running processing instances (hereinafter referred to as engine instances). It is necessary to not only achieve the purpose of load balancing when calling engine instances, but also ensure that messages are effectively processed and truly play the role of the cluster. At present, the existing technology has not yet proposed a mechanism for cluster managers to schedule engine instances. Summary of the invention

[0005] The embodiment of the present invention provides a method, apparatus and computer equipment for a cluster manager to schedule engine instances, aiming to not only achieve the purpose of load balancing when calling the engine instance, but also ensure that the message is effectively processed and the role of the cluster is truly brought into play.

[0006] In order to achieve the above purpose, the embodiment of the present invention provides the following technical solutions:

[0007] In a first aspect, a method for a cluster manager to schedule an engine instance, wherein the engine instance can only be accessed by the cluster manager, wherein the method comprises:

[0008] Receive a message, wherein the message includes the Token information of the endpoint;

[0009] Identify the endpoint identity based on the Token information, authenticate the endpoint identity, and determine whether the endpoint has the right to send the message;

[0010] For messages that pass authentication, determine the current engine availability status;

[0011] If there is an available engine, a suitable engine instance is initially allocated according to the message type;

[0012] An engine instance is selected based on the load balancing algorithm and the message is sent to the engine instance for processing.

[0013] Optionally, the identity authentication is specifically to determine whether the endpoint has the right to send a message based on the IP address and access rights of the endpoint.

[0014] Optionally, the engine availability status is marked in the following manner:

[0015] Determine whether the engine instance address is accessible. If the access times out, the engine available status = 0;

[0016] Determine whether the engine instance can connect to the log database. If it cannot connect to the log database, the engine available status = 0;

[0017] Determine the heartbeat value of the engine instance. If the heartbeat value = 0, the engine availability status = 0;

[0018] Otherwise, the engine available status = 1, indicating that there is currently an available engine.

[0019] Optionally, when there is an available engine and before allocating a suitable engine according to the message type, it is first determined whether there is a message-oriented processing engine instance in the attributes of the message. If the attribute exists, the message is directly sent to the designated engine instance for processing.

[0020] Optionally, the allocation of a suitable engine according to the message type is specifically: if the message type is a synchronous message, the message is sent to a regular engine or a super engine; if the message type is an asynchronous message, the message is sent to an MQ dedicated engine or a super engine.

[0021] Optionally, the engine instance is selected based on the load balancing algorithm, specifically: the operating status of each engine instance is judged in turn based on the load balancing algorithm: whether the engine instance is in maintenance status, whether the engine instance has reached full load operation status; if the above conditions are met, the message is sent to the engine instance for processing; if there are unsatisfied conditions, the operating status of other engine instances within the range is judged, and the message is sent to the engine instance that meets the conditions for processing.

[0022] Optionally, the receiving of the message may specifically be directly receiving a message sent by an endpoint, or may be receiving a message distributed via a unified interface Nginx.

[0023] In the second aspect, the device for scheduling the engine instance of the cluster manager is special in that it includes:

[0024] A message receiving module, used to receive a message, wherein the message includes the Token information of the endpoint;

[0025] An authentication module is used to identify the endpoint identity according to the Token information, authenticate the endpoint identity, and determine whether the endpoint has the right to send the message;

[0026] The engine status identification module is used to determine the current engine availability status when the message authentication passes;

[0027] The engine matching module is used to preliminarily allocate a suitable engine instance according to the message type when there is an available engine;

[0028] The load balancing processing module is used to select an engine instance according to a load balancing algorithm and send the message to the engine instance for processing.

[0029] In a third aspect, a computer device applied to a cluster manager includes a memory and a processor, wherein the memory stores a computer program, and the special feature of the device is that the processor implements the steps of the above method when executing the computer program.

[0030] In a fourth aspect, a computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the above method when executed by a processor.

[0031] The present invention has at least the following beneficial effects:

[0032] The present invention determines the engine instance to process the message through endpoint identity authentication, engine actual availability status judgment, engine instance type adaptation, and the running status of the engine instance in turn according to the load balancing algorithm. It can not only achieve the purpose of the engine instance calling load balancing, but also ensure that the message is effectively processed, thereby truly bringing into play the role of the cluster. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly explain the prior art and the present invention, the following briefly introduces the drawings required for describing the prior art and the embodiments of the present invention. Obviously, the drawings described below are only exemplary, and for those of ordinary skill in the art, other drawings can be derived from the provided drawings without creative work.

[0034] Figure 1 A schematic diagram of a cluster deployment architecture according to an embodiment of the present invention.

[0035] Figure 2 The present invention is a flowchart of a method for scheduling engine instances by a cluster manager according to an embodiment of the present invention.

[0036] Figure 3 It is a schematic diagram of querying and updating the available status of an engine in one embodiment of the present invention. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0038] A method for scheduling an engine instance of a cluster manager provided in an embodiment of the present application can be applied to Figure 1 The cluster deployment architecture shown in the figure. From the deployment architecture point of view, the third-party Nginx is an optional option to achieve centralized access. The endpoint sends messages to Nginx, and Nginx distributes them to the manager. It can also be decentralized. The endpoint sends messages to any cluster manager for cluster processing, which improves processing performance, eliminates single point vulnerabilities, increases the reliability of platform operation, and will not affect global operation due to a server failure.

[0039] Endpoints can only access the cluster manager, and engine instances can only be accessed by the cluster manager.

[0040] From the perspective of engine instances, the engine instance types can be subdivided and deployed separately to give full play to the efficiency of the engine. Conventional engines can be used to process only synchronous messages, MQ-specific engines can be used to process only asynchronous messages, and hybrid engines can process both synchronous and asynchronous messages. The cluster manager can determine which type of engine to call based on the type of message sent.

[0041] Table 1 Two-dimensional table of calling engine instance judgment mechanism

[0042]

[0043] In one embodiment, Figure 2 As shown, a method for a cluster manager scheduling engine instance is provided, comprising the following steps:

[0044] S1: Receive a message, which contains the endpoint's token information;

[0045] S2: Identify the endpoint identity according to the Token information, authenticate the endpoint identity, and determine whether the endpoint has the right to send the message;

[0046] S3: For messages that pass authentication, determine the current engine availability status;

[0047] S4: If there is an available engine, a corresponding engine instance is initially allocated according to the message type;

[0048] S5: An engine instance is selected based on the load balancing algorithm, and the message is sent to the engine instance for processing.

[0049] Before S4, it can also be determined whether there is a message directional processing engine instance in the attributes of the message. If the attribute exists, the message is directly sent to the designated engine instance for processing.

[0050] In this way, through endpoint identity authentication, engine actual availability status judgment, engine instance type adaptation, and the running status of the engine instance in turn according to the load balancing algorithm, the engine instance is finally determined to process the message. This can not only achieve the purpose of the engine instance calling the load balancing, but also ensure that the message is effectively processed, truly giving play to the role of the cluster.

[0051] In one embodiment, the cluster manager's access logic to the engine instance is as follows:

[0052] Judgment priority 1: Cluster manager authentication takes precedence over engine availability status judgment

[0053] The cluster manager is responsible for receiving messages, which contain the token information of the sender (hereinafter referred to as the endpoint). The cluster manager can identify the identity of the endpoint based on the token information and authenticate the identity (including the IP address and access rights of the endpoint). In other words, the message contains the message code to be sent, and the cluster manager can determine whether the endpoint has the right to send the message.

[0054] Judgment priority 2: The engine instance availability status has a higher priority than the engine instance targeting dimension

[0055] like Figure 3 As shown, after the message passes the authentication of the cluster manager, the cluster manager searches for the engine instance with the engine availability status = 1, and the cluster manager only calls the engine instance with the engine availability status = 1.

[0056] Determine the available status of the engine:

[0057] (1) Whether the engine instance address is accessible, access timeout, engine available status = 0

[0058] (2) Whether the engine instance can connect to the log database. If it cannot connect to the log database, the engine availability status = 0

[0059] (3) Engine instance heartbeat value, heartbeat value = 0, engine availability status = 0

[0060] For item (1), the cluster manager makes a direct judgment. For items (2) and (3), the cluster manager can obtain the status value through the getProcessorStatus method provided by the engine instance.

[0061] Judgment priority 3: The engine instance orientation dimension has a higher priority than the engine instance type dimension

[0062] The cluster manager finds that there is an engine instance with engine availability status = 1, and then determines whether there is a message-directed processing engine instance (optional) in the attributes of the message. When this attribute exists, the message can only be sent to the specified engine instance for processing.

[0063] Judgment priority 4: The engine instance type dimension has a higher priority than the engine instance running status

[0064] The cluster manager determines the type of message. If the message type is a synchronous message, the cluster manager needs to send the message to a regular engine or a super engine (or a hybrid engine). If the message type is an asynchronous message, the centralized manager needs to send the message to an MQ dedicated engine or a super engine (or a hybrid engine).

[0065] The number of engine instances can be configured, and there is no theoretical limit to the number. The engine type can be set for each engine instance.

[0066] Judgment priority 5: The running status of the engine instance determines which engine instance the manager can access.

[0067] Based on the judgments in the previous steps, the cluster manager also needs to judge the running status of the engine instance in turn according to the load balancing algorithm, whether the engine instance is in maintenance status, whether the engine instance has reached full load operation status, and if there is an unsatisfactory status, the cluster manager needs to judge the running status of other engine instances in the range. If the conditions are met, the message will be sent to the engine instance for processing.

[0068] Engine instance load status mechanism: When the cluster manager sends to the engine instance, the engine instance adds judgment before executing the integration project. The specific algorithm is as follows:

[0069] The number of available tokens for the engine instance does not exceed the limit (parameter setting number)

[0070] Can process messages

[0071] The number of available tokens for the engine instance exceeds the limit (parameter setting number)

[0072] Returns a failure message, the centralized manager tries to access another engine instance

[0073] The cluster manager cycles all regular engines or super engines according to the set number of times (PARA_TOKEN_RETRY_NUM), and the limit is still exceeded

[0074] The cluster manager returns information to the caller (the format is the same as the previous 310 format)

[0075] 077: The engine instance is busy, please try again later.

[0076] PARA_TOKEN_IF_USE = 1

[0077] For a message request, the engine instance determines that the number of tokens consumed + 1 > the maximum load parameter

[0078] Not established

[0079] ·TOKEN consumption number = TOKEN consumption number + 1

[0080] Allow request

[0081] ·The message is executed, the number of tokens consumed = the number of tokens consumed – 1, the minimum is 0

[0082] Established

[0083] Deny the request

[0084] This embodiment takes full consideration into account the purpose of achieving load balancing of engine instance calls and ensuring that messages are effectively processed to truly bring into play the role of the cluster, for example:

[0085] If the engine instance is unavailable, the cluster manager cannot process messages sent to the engine instance, affecting the interaction between business systems.

[0086] If the engine instance is busy, the cluster manager needs to wait even if it sends a message to the engine instance, which affects the interaction between business systems.

[0087] Taking the information management system of enterprises and institutions in the medical industry as an example, based on the solution provided in this embodiment, by classifying engine instances, engine instances can be deployed in a targeted manner according to the actual scenarios of the hospital:

[0088] If the hospital is large, generates many synchronous messages every day, and has a large concurrency, you can deploy regular engines on several high-configuration servers to handle synchronous messages, and deploy MQ-specific engines on several low-configuration servers to handle asynchronous messages. This can maximize the use of server resources and improve message processing efficiency.

[0089] If the hospital is relatively small and the message volume is not large, several hybrid engines can be deployed, which can save the hospital's hardware investment costs.

[0090] In one embodiment, a device for a cluster manager scheduling engine instance is also provided, comprising the following program modules:

[0091] A message receiving module, used to receive a message, wherein the message includes the Token information of the endpoint;

[0092] An authentication module is used to identify the endpoint identity according to the Token information, authenticate the endpoint identity, and determine whether the endpoint has the right to send the message;

[0093] The engine status identification module is used to determine the current engine availability status when the message authentication passes;

[0094] The engine matching module is used to preliminarily allocate a suitable engine instance according to the message type when there is an available engine;

[0095] The load balancing processing module is used to select an engine instance according to a load balancing algorithm and send the message to the engine instance for processing.

[0096] For the specific definition of the above-mentioned device, please refer to the definition of the method for scheduling the cluster manager engine instance above, which will not be repeated here. Each module in the above-mentioned device can be implemented by software. Each of the above-mentioned modules can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0097] In one embodiment, a computer device applied to a cluster manager is further provided, including a memory and a processor, wherein the memory stores a computer program involving all or part of the processes in the above-mentioned embodiment method.

[0098] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which involves all or part of the processes in the above-mentioned embodiment method.

[0099] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0100] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0101] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for a cluster manager to schedule an engine instance, comprising the following steps: S1: Receive a message, which contains the endpoint's token information; S2: Identify the endpoint identity according to the Token information, authenticate the endpoint identity, and determine whether the endpoint has the right to send the message; S3: For messages that pass authentication, determine the current engine availability status; S4: If there is an available engine, a corresponding engine instance is initially allocated according to the message type; S5: Select an engine instance based on the load balancing algorithm and send the message to the engine instance for processing; Before S4, it is first determined whether there is a message-oriented processing engine instance in the attributes of the message. If the attribute exists, the message is directly sent to the designated engine instance for processing; Through endpoint identity authentication, engine availability status judgment, engine instance type adaptation, and load balancing algorithm, the running status of the engine instance is judged in turn, and finally the engine instance is determined to process the message; The cluster manager's access logic to the engine instance is as follows: Judgment priority 1: Cluster manager authentication takes precedence over engine availability status judgment; The cluster manager is responsible for receiving messages, which contain the sender's token information. The sender is also called an endpoint. The cluster manager can identify the endpoint's identity based on the token information and authenticate the identity. The endpoint's identity includes the endpoint's IP address and access rights. In other words, the message contains the message code to be sent, and the cluster manager can determine whether the endpoint has the right to send messages. Judgment priority 2: The priority of the engine instance availability status is higher than the engine instance orientation dimension; After the message is authenticated by the cluster manager, the cluster manager searches for the engine instance with the engine availability status = 1. The cluster manager only calls the engine instance with the engine availability status = 1. Determination of engine availability status: (1) Whether the engine instance address is accessible, access timeout, engine availability status = 0; (2) Whether the engine instance can connect to the log database. If it cannot connect to the log database, the engine availability status = 0; (3) Engine instance heartbeat value, heartbeat value = 0, engine availability status = 0; For item (1), the cluster manager directly determines the status value. For items (2) and (3), the cluster manager can obtain the status value through the getProcessorStatus method provided by the engine instance. Judgment priority 3: The engine instance orientation dimension has a higher priority than the engine instance type dimension; The cluster manager finds that there is an engine instance with the engine available status = 1. Then it determines whether there is a message-directed processing engine instance in the message attributes. If this attribute exists, the message can only be sent to the specified engine instance for processing; Judgment priority 4: The engine instance type dimension has a higher priority than the engine instance running status; The cluster manager determines the type of message. If the message type is a synchronous message, the cluster manager needs to send the message to a regular engine or a hybrid engine. If the message type is an asynchronous message, the centralized manager needs to send the message to an MQ-specific engine or a hybrid engine. Among them, the regular engine is used to process only synchronous messages, the MQ-specific engine is used to process only asynchronous messages, and the hybrid engine is used to process synchronous or asynchronous messages. The number of engine instances can be configured, and there is no theoretical limit on the number. The engine type can be set for each engine instance. Judgment priority 5: The running status of the engine instance determines which engine instance the manager can access; Based on the judgments in the previous steps, the cluster manager also needs to judge the running status of the engine instance in turn according to the load balancing algorithm, whether the engine instance is in maintenance status, whether the engine instance has reached full load operation status, and if there is an unsatisfactory status, the cluster manager needs to judge the running status of other engine instances within the range. If the conditions are met, the message is sent to the engine instance for processing; Engine instance load status mechanism: When the cluster manager sends the information to the engine instance, the engine instance adds a judgment before executing the integration project. The specific algorithm includes: If the number of available tokens of the engine instance is within the limit, the message can be processed; if the number of available tokens of the engine instance exceeds the limit, a failure message is returned and the centralized manager tries to access another engine instance; according to the set number of times, the cluster manager cycles all regular engines, and the limit is still exceeded. The cluster manager returns a message to the caller that the engine instance is busy and please try again later.

2. A device for scheduling engine instances of a cluster manager, suitable for the method of claim 1, characterized in that: include: A message receiving module, used to receive a message, wherein the message includes the Token information of the endpoint; An authentication module is used to identify the endpoint identity according to the Token information, authenticate the endpoint identity, and determine whether the endpoint has the right to send the message; The engine status identification module is used to determine the current engine availability status when the message authentication passes; The engine matching module is used to preliminarily allocate a suitable engine instance according to the message type when there is an available engine. The load balancing processing module is used to select an engine instance according to a load balancing algorithm and send the message to the engine instance for processing.

3. A computer device applied to a cluster manager, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to claim 1 are implemented.

4. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to claim 1 are implemented.