Load balancing methods, systems, devices, equipment and readable storage media

By creating resource objects associated with business services in Kubernetes and obtaining configuration information to determine target instances, the complexity of load balancing is solved, and a simplified load balancing process is achieved.

CN114816727BActive Publication Date: 2026-05-05MIGU CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MIGU CO LTD
Filing Date
2022-02-24
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Load balancing in Kubernetes is highly complex and requires the introduction of additional components and access mapping routes.

Method used

By creating resource objects associated with business services, configuration information is obtained, and the target instance for processing request messages is determined based on the configuration information, thus achieving load balancing and avoiding the introduction of additional components and routes.

Benefits of technology

It reduces the complexity of Kubernetes load balancing and simplifies the load balancing implementation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114816727B_ABST
    Figure CN114816727B_ABST
Patent Text Reader

Abstract

The application discloses a load balancing method, system, device, equipment and readable storage medium. The load balancing method comprises the following steps: creating a resource object associated with a service; obtaining configuration information of the service through the resource object when a creation request of the service is received; obtaining instance information corresponding to the service based on the configuration information; determining a target instance for processing a request message of the service in an instance corresponding to the instance information according to the instance information and the configuration information, and completing load balancing. The complexity of the load balancing system in realizing load balancing is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information technology, and in particular to a load balancing method, system, apparatus, device, and readable storage medium. Background Technology

[0002] With the development of microservices and containerization, many container orchestration engines have emerged for managing containers. Kubernetes, for example, is an open-source container orchestration and scheduling system. In Kubernetes, multiple containers can be created, each running an application instance. Then, through built-in load balancing strategies, the management, discovery, and access of this group of application instances can be achieved.

[0003] Kubernetes provides Layer 7 load balancing capabilities through Ingress and backend components (Nginx, Traefik, etc.) for clients outside the cluster to access. Using this approach requires introducing additional components and access mapping routes. In other words, implementing load balancing in container orchestration engines is currently quite complex. Summary of the Invention

[0004] The main objective of this invention is to provide a load balancing method, system, apparatus, device, and readable storage medium, which aims to reduce the complexity of load balancing systems in achieving load balancing.

[0005] To achieve the above objectives, the present invention provides a load balancing method, which includes the following steps:

[0006] Create resource objects associated with the business service;

[0007] Upon receiving the request to create the service, the configuration information of the service is obtained through the resource object;

[0008] Based on the configuration information, the instance information corresponding to the business service is obtained. According to the instance information and the configuration information, the target instance for processing the request message of the business service is determined from the instances corresponding to the instance information, and load balancing is completed.

[0009] In one embodiment, the configuration information includes host information, network port information, and instance selector information. The step of obtaining the instance information corresponding to the service based on the configuration information includes:

[0010] The control service listener determines whether the current host meets the host requirements of the service based on the host information.

[0011] When the host meets the host requirements, determine the usage status of the network port corresponding to the network port information;

[0012] When the network port is in an unoccupied state, the instance information of the instance selector corresponding to the instance selector information is obtained.

[0013] In one embodiment, after determining the usage status of the network port, the method further includes:

[0014] When the network port is in an occupied state, an error message is output to change the network port.

[0015] In one embodiment, the configuration information includes a load balancing strategy. The step of determining the target instance for processing the request packet of the service based on the instance information and the configuration information within the instance corresponding to the instance information, and completing the load balancing step, includes:

[0016] The load balancer is controlled to parse the request message and determine whether the request message has any associated messages;

[0017] When the request message does not have the associated message, the instance that satisfies the load balancing strategy is determined from the instance information as the target instance for processing the request message.

[0018] In one embodiment, after determining whether the request message has an associated message, the method further includes:

[0019] If the request message has an associated message, obtain an instance of the associated message to process;

[0020] The instance that processes the associated message is identified as the target instance, and the request message is forwarded to the target instance.

[0021] To achieve the above objectives, the present invention also provides a load balancing system, the load balancing system comprising:

[0022] A resource object, which is used to store the configuration information of the business service when a creation request for the business service is received;

[0023] A business service listener is used to receive configuration information of a resource object and determine the instance information of the business service based on the configuration information.

[0024] A load balancer, which, upon receiving a request message, determines the target instance to process the request message and forwards the request message to the target instance.

[0025] In one embodiment, the load balancer obtains the request message based on the network port information in the configuration information.

[0026] To achieve the above objectives, the present invention also provides a load balancing device, the load balancing device comprising:

[0027] The creation module is used to create resource objects associated with business services;

[0028] The acquisition module is used to acquire the configuration information of the business service through the resource object when the creation request of the business service is received;

[0029] The load balancing module is used to obtain the instance information corresponding to the business service based on the configuration information, and determine the target instance for processing the request message of the business service from the instances corresponding to the instance information according to the instance information and the configuration information, so as to complete the load balancing.

[0030] To achieve the above objectives, the present invention also provides a load balancing device, the load balancing device including a memory, a processor, and a load balancing program stored in the memory and executable on the processor, wherein the load balancing program, when executed by the processor, implements the various steps of the load balancing method as described in any of the preceding claims.

[0031] To achieve the above objectives, the present invention also provides a computer-readable storage medium storing a load balancing program, which, when executed by a processor, implements the various steps of the load balancing method as described in any of the preceding claims.

[0032] This invention provides a load balancing method, system, apparatus, device, and readable storage medium. First, a resource object associated with a business service is created. Upon receiving a creation request for the business service, configuration information of the business service is obtained through the resource object. Based on the configuration information, instance information corresponding to the business service is obtained. Then, based on the instance information and the configuration information, a target instance for processing the request message of the business service is determined from the instances corresponding to the instance information, thus completing load balancing. By creating a resource object associated with the business service to obtain configuration information and determining the target instance for processing the request message of the business service based on the configuration information, load balancing is achieved. This eliminates the need for container orchestration engines to introduce additional components and access mapping routes, reducing the complexity of implementing load balancing. Attached Figure Description

[0033] Figure 1 This is a schematic diagram of the hardware structure of the load balancing device involved in an embodiment of the present invention;

[0034] Figure 2 This is a flowchart illustrating the first embodiment of the load balancing method of the present invention;

[0035] Figure 3This is a detailed flowchart of step S30 in the second embodiment of the load balancing method of the present invention.

[0036] Figure 4 This is a detailed flowchart of step S30 in the third embodiment of the load balancing method of the present invention.

[0037] Figure 5 This is a schematic diagram of the modules of the load balancing method of the present invention.

[0038] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0039] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0040] The main solution of this invention is: to create a resource object associated with a business service; when a creation request for the business service is received, to obtain the configuration information of the business service through the resource object; to obtain the instance information corresponding to the business service based on the configuration information; and to determine the target instance for processing the request message of the business service in the instance corresponding to the instance information according to the instance information and the configuration information, thereby completing load balancing.

[0041] As one implementation solution, load balancing devices can be like Figure 1 As shown.

[0042] The embodiments of this invention relate to a load balancing device, which includes: a processor 101, such as a CPU, a memory 102, and a communication bus 103. The communication bus 103 is used to enable communication between these components.

[0043] Memory 102 can be high-speed RAM or stable memory (non-volatile memory), such as disk storage. Figure 1 As shown, the memory 102, which is a computer-readable storage medium, may include a load balancing program; and the processor 101 may be used to invoke the load balancing program stored in the memory 102 and perform the following operations:

[0044] Create resource objects associated with the business service;

[0045] Upon receiving the request to create the service, the configuration information of the service is obtained through the resource object;

[0046] Based on the configuration information, the instance information corresponding to the business service is obtained. According to the instance information and the configuration information, the target instance for processing the request message of the business service is determined from the instances corresponding to the instance information, and load balancing is completed.

[0047] In one embodiment, the processor 101 can be used to invoke a load balancing program stored in the memory 102 and perform the following operations:

[0048] The control service listener determines whether the current host meets the host requirements of the service based on the host information.

[0049] When the host meets the host requirements, determine the usage status of the network port corresponding to the network port information;

[0050] When the network port is in an unoccupied state, the instance information of the instance selector corresponding to the instance selector information is obtained.

[0051] In one embodiment, the processor 101 can be used to invoke a load balancing program stored in the memory 102 and perform the following operations:

[0052] When the network port is in an occupied state, an error message is output to change the network port.

[0053] In one embodiment, the processor 101 can be used to invoke a load balancing program stored in the memory 102 and perform the following operations:

[0054] The load balancer is controlled to parse the request message and determine whether the request message has any associated messages;

[0055] When the request message does not have the associated message, the instance that satisfies the load balancing strategy is determined from the instance information as the target instance for processing the request message.

[0056] In one embodiment, the processor 101 can be used to invoke a load balancing program stored in the memory 102 and perform the following operations:

[0057] If the request message has an associated message, obtain an instance of the associated message to process;

[0058] The instance that processes the associated message is identified as the target instance, and the request message is forwarded to the target instance.

[0059] Based on the hardware architecture of the load balancing device described above, an embodiment of the load balancing method of the present invention is proposed.

[0060] Reference Figure 2 , Figure 2This is a first embodiment of the load balancing method of the present invention, the load balancing method comprising the following steps:

[0061] Step S10: Create resource objects associated with the business service;

[0062] Step S20: Upon receiving the request to create the service, obtain the configuration information of the service through the resource object;

[0063] Step S30: Obtain instance information corresponding to the service based on the configuration information; determine the target instance for processing the request message of the service from the instances corresponding to the instance information according to the instance information and the configuration information, and complete load balancing.

[0064] Kubernetes is an open-source container orchestration and scheduling system. In Kubernetes, multiple containers can be created, each running an application instance. Built-in load balancing strategies enable the management, discovery, and access to this group of application instances. Currently, Kubernetes provides Layer 7 load balancing capabilities through Ingress and backend components (Nginx, Traefik, etc.) for clients outside the cluster to access. This approach requires the introduction of additional components and access mapping routes, thus increasing the complexity of load balancing. Therefore, this invention proposes a load balancing method to reduce the complexity of Kubernetes load balancing.

[0065] The entity implementing this application may be a load balancing system built on Kubernetes.

[0066] Users can create business services through the Kubernetes user interface, and these services are used to implement a specific function. When Kubernetes detects a user's request to create a business service via the user interface, it creates a resource object. This resource object is an AppService resource object, used to store the configuration information for the created business request.

[0067] Optionally, when creating a service request, the configuration information can be determined by the user entering information through the operation interface. The configuration information includes: the name of the service, host information, network port information, instance selector information, container port, host port, load balancing policy, etc.

[0068] The business service name is used to uniquely identify the business service. The naming format can be set by the user. For example, it can be aa_1. In this embodiment, there is no limitation on the naming method of the business service name.

[0069] Host information is used to identify the host executing business services within a Kubernetes cluster, and it can be selected by the user. For example, the user can use a dropdown menu to select hosts in the user interface. When a click is detected on a specific control, the host corresponding to the selected space is identified as the host executing the business services, and host information is generated. This host information may include a unique host identifier.

[0070] Instance selector information, which is the information corresponding to the selector that generates multiple instances. The instance selector generates a set of multiple instances that process the request message.

[0071] Container ports are used in Kubernetes clusters where multiple containers exist, each running an instance. When an instance receives a request message, it sends back the corresponding response data. These containers share a separate network, and the container port is a listening port on that network. The load balancing in this application forwards request messages received from the host's network port to the container port, enabling the container to send back the appropriate response data upon receiving the request message.

[0072] Load balancing strategies include: load averaging, weighted strategies, least connections strategies, round-robin strategies, IPhash strategies, etc.

[0073] Load averaging strategy refers to averaging the load across instances in a Kubernetes cluster; weighted strategy mainly calculates weights based on the response time of each instance and selects target instances based on the weights, with instances having a higher probability of being selected if their response time is shorter; least connections strategy performs load balancing based on the current connection status of instances, selecting the instance with the fewest current connections to handle the request message when it arrives; round-robin strategy distributes request messages to instances in the Kubernetes cluster in turn; IPhash strategy directs request messages with the same source IP address to the same instance.

[0074] In this embodiment, after receiving the creation request for the business service, the resource object obtains the configuration information of the business service and stores the configuration information in the resource object.

[0075] After obtaining the configuration information, the instance information for processing business services is obtained based on the configuration information. The instance information includes information about multiple instances that process request messages.

[0076] Furthermore, in this embodiment, after Kubernetes obtains the configuration information and instance information, it obtains the load balancing strategy in the configuration information, determines the instance that meets the load balancing strategy among the instances corresponding to the instance information as the target instance for processing the request message of the business service, and sends the request message to the target instance for processing to complete the load balancing.

[0077] In this embodiment, Kubernetes first creates a resource object associated with the business service. Upon receiving a creation request for the business service, it obtains the configuration information of the business service through the resource object. Based on the configuration information, it obtains the instance information corresponding to the business service. Then, based on the instance information and the configuration information, it determines the target instance from the instances corresponding to the instance information to process the request message of the business service, thus completing load balancing. By creating a resource object associated with the business service to obtain configuration information and determining the target instance for processing the request message of the business service based on the configuration information, load balancing is achieved. The container orchestration engine does not need to introduce additional components and access mapping routes, reducing the complexity of implementing load balancing.

[0078] Reference Figure 3 , Figure 3 In a second embodiment of the load balancing method of the present invention, based on the first embodiment, step S30 includes:

[0079] Step S31: Control the service listener to determine whether the current host meets the host requirements of the service based on the host information;

[0080] Step S32: When the host meets the host requirements, determine the usage status of the network port corresponding to the network port information;

[0081] Step S33: When the network port is in an unoccupied state, obtain the instance information of the instance selector corresponding to the instance selector information.

[0082] In this embodiment, a business service listener (appsvc-watch service) is first installed. After the resource object obtains the configuration information, it forwards the configuration information to the business service listener. The business service listener receives the configuration information and determines whether the current host meets the host requirements of the business service based on the host information in the configuration information.

[0083] Understandably, multiple hosts can run in Kubernetes to implement multiple business services. Each host has its own corresponding host information. After obtaining the host information from the configuration information, the current host information is compared with the obtained host information to determine whether the current host meets the host requirements of the currently created business service.

[0084] Optionally, in this embodiment, the operating speeds of the hosts are different. The selection of the hosts is determined based on the workload of the created service.

[0085] When determining that the current host meets the host requirements of the business service, the system checks the usage status of the network port corresponding to the network port information in the configuration information. If the network port is in an unoccupied state, it further determines the instance information in the instance selector corresponding to the instance selector information. Kubernetes receives request packets from the business service through the network port. A unique network port is assigned to each created business service to receive request packets.

[0086] If the current host does not meet the requirements, the current host will be replaced until a host that meets the requirements of the current business service is found in Kubernetes.

[0087] Once it is confirmed that a network port is available, its usage status is changed to prevent it from being occupied by other services. The instance selector corresponding to the instance selector information is then obtained, leading to the instance information of the service.

[0088] When the network port is determined to be occupied, an error message indicating that the network port is occupied is output to the display interface, so that the user can change the network port of the current business service according to the error message and update the configuration information according to the changed network port information.

[0089] In this embodiment, the control service listener determines whether the current host meets the host requirements of the service based on the host information; if the host meets the host requirements, it determines the usage status of the network port corresponding to the network port information; if the network port usage status is unoccupied, it obtains the instance information of the instance selector corresponding to the instance selector information. Obtaining the instance information of the service through the service listener supports reducing the business complexity of Kubernetes.

[0090] Reference Figure 4 , Figure 4 This is a third embodiment of the load balancing method of the present invention. Based on the first embodiment, step S30 includes:

[0091] Step S34: Control the load balancer to parse the request message and determine whether the request message has any associated messages;

[0092] Step S35: When the request message does not have the associated message, determine the instance that satisfies the load balancing strategy from the instance information as the target instance for processing the request message.

[0093] The service listener sends the received configuration information and instance information to the load balancer (kernel module service req-balance). After receiving the configuration information, the load balancer obtains the network port information from the configuration information, determines the network port of the service, and receives the terminal's request message through the network port.

[0094] After receiving a request message, the load balancer parses it and identifies whether there are related messages based on application layer protocol characteristics. If related messages are found, the load balancer obtains an instance that processes the related message and determines it as the target instance for processing the currently received request message. The load balancer then sends the request message to the target instance, causing the target instance to send corresponding response data back to the terminal. By determining the target instance for processing the request message when related messages are identified, the load balancer achieves rapid request message processing.

[0095] In this embodiment, after obtaining instance information, the load balancer determines the health status of the corresponding instance based on the instance information and uses the healthy instance to process the request message. This avoids the situation where the request message is sent to the target instance but no response data is received.

[0096] When the request message does not have the associated message, the instance that satisfies the load balancing strategy is determined from the instance information as the target instance for processing the request message.

[0097] For example, when the load balancer determines that there is no associated message in the request message, it currently obtains instance information corresponding to 5 instances. Based on the load balancing strategy in the configuration information, it selects instances from these 5 instances that meet the load balancing strategy. The load balancing strategy can be any one of the following: load averaging strategy, weighted strategy, least connections strategy, round-robin strategy, or IPhash strategy, and it is determined when a request for creating a business service is made.

[0098] After the target instance finishes processing the request message, update the target instance's processing information, such as processing time, number of network connections to the instance, and number of requests processed.

[0099] In this example, the target instance for processing request packets is determined by the load balancer, and request packet parsing and load balancing are implemented at the kernel level, which reduces the length of the request processing link and improves the efficiency of business service processing.

[0100] In this embodiment, the load balancer is controlled to parse the request message and determine whether the request message has any associated messages. If the request message does not have any associated messages, the instance that satisfies the load balancing strategy is determined from the instance information as the target instance for processing the request message. By controlling the load balancer to determine the target instance for processing the request message, the complexity of Kubernetes in implementing load balancing is reduced.

[0101] The present invention also provides a load balancing system, the load balancing system comprising:

[0102] A resource object, which is used to store the configuration information of the business service when a creation request for the business service is received;

[0103] A business service listener is used to receive configuration information of a resource object and determine the instance information of the business service based on the configuration information.

[0104] A load balancer, which determines the target instance to process a request message when it is received, and forwards the request message to the target instance.

[0105] The load balancer obtains the request message based on the network port information in the configuration information.

[0106] In this embodiment, the load balancing system is Kubernetes. Kubernetes first creates resource objects associated with the business service. Upon receiving a creation request for the business service, it obtains the configuration information of the business service through the resource object, sends the configuration information to the business service listener to obtain the instance information corresponding to the business service, and then controls the load balancer to determine the target instance for processing the request packets of the business service from the instances corresponding to the instance information, based on the instance information and the configuration information, thus completing load balancing. By creating resource objects associated with the business service to obtain configuration information and determining the target instance for processing the request packets of the business service based on the configuration information, Kubernetes achieves load balancing. Kubernetes does not need to introduce additional components and access mapping routes, reducing the complexity of implementing load balancing.

[0107] Reference Figure 5 , Figure 5 This is a schematic diagram of the load balancing device of this application. To achieve the above objectives, the present invention also provides a load balancing device, which includes:

[0108] Create module 10, which is used to create resource objects associated with business services;

[0109] The acquisition module 20 is used to obtain the configuration information of the business service through the resource object when it receives the creation request of the business service;

[0110] The load balancing module 30 is used to obtain instance information corresponding to the business service based on the configuration information, and determine the target instance for processing the request message of the business service from the instances corresponding to the instance information according to the instance information and the configuration information, thereby completing load balancing.

[0111] In one embodiment, regarding obtaining instance information corresponding to the service based on the configuration information, the load balancing module 30 is specifically used for:

[0112] The control service listener determines whether the current host meets the host requirements of the service based on the host information.

[0113] When the host meets the host requirements, determine the usage status of the network port corresponding to the network port information;

[0114] When the network port is in an unoccupied state, the instance information of the instance selector corresponding to the instance selector information is obtained.

[0115] In one embodiment, after determining the usage status of the network port, the load balancing module 30 is specifically used for:

[0116] When the network port is in an occupied state, an error message is output to change the network port.

[0117] In one embodiment, regarding determining the target instance for processing the request message of the business service from the instances corresponding to the instance information based on the instance information and the configuration information, and completing load balancing, the load balancing module 30 is specifically used for:

[0118] The load balancer is controlled to parse the request message and determine whether the request message has any associated messages;

[0119] When the request message does not have the associated message, the instance that satisfies the load balancing strategy is determined from the instance information as the target instance for processing the request message.

[0120] In one embodiment, after determining whether the request message has an associated message, the load balancing module 30 is specifically used for:

[0121] If the request message has an associated message, obtain an instance of the associated message to process;

[0122] The instance that processes the associated message is identified as the target instance, and the request message is forwarded to the target instance.

[0123] To achieve the above objectives, the present invention also provides a load balancing device, the load balancing device including a memory, a processor, and a load balancing program stored in the memory and executable on the processor, wherein the load balancing program, when executed by the processor, implements the various steps of the load balancing method as described in any of the preceding claims.

[0124] To achieve the above objectives, the present invention also provides a computer-readable storage medium storing a load balancing program, which, when executed by a processor, implements the various steps of the load balancing method as described in any of the preceding claims.

[0125] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0126] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, system, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, system, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, system, article, or apparatus that includes that element.

[0127] Through the above description of the embodiments, those skilled in the art can clearly understand that the systems described in the above embodiments can be implemented using software plus necessary general-purpose hardware platforms. Of course, they can also be implemented using hardware, but in many cases, the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a computer-readable storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, parking management device, air conditioner, or network device, etc.) to execute the systems described in the various embodiments of the present invention.

[0128] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A load balancing method, characterized in that, The load balancing method includes: Create resource objects associated with the business service; When a request to create the service is received, the configuration information of the service is obtained through the resource object. The configuration information includes host information, network port information, instance selector information, and load balancing strategy. Based on the configuration information, the instance information corresponding to the business service is obtained. According to the instance information and the configuration information, the target instance for processing the request message of the business service is determined from the instances corresponding to the instance information to complete load balancing. The steps of obtaining instance information corresponding to the business service based on the configuration information, determining the target instance for processing the request message of the business service from the instances corresponding to the instance information according to the instance information and the configuration information, and completing load balancing, include: The control service listener determines whether the current host meets the host requirements of the service based on the host information. When the host meets the host requirements, determine the usage status of the network port corresponding to the network port information; When the network port is in an unoccupied state, the instance information of the instance selector corresponding to the instance selector information is obtained; The load balancer is controlled to parse the request message and determine whether the request message has any associated messages; When the request message does not have the associated message, the instance that satisfies the load balancing strategy is determined from the instance information as the target instance for processing the request message.

2. The load balancing method as described in claim 1, characterized in that, After determining the usage status of the network port, the method further includes: When the network port is in an occupied state, an error message is output to change the network port.

3. The load balancing method as described in claim 1, characterized in that, After determining whether the request message has an associated message, the method further includes: If the request message has an associated message, obtain an instance of the associated message to process; The instance that processes the associated message is identified as the target instance, and the request message is forwarded to the target instance.

4. A load balancing system, characterized in that, The load balancing system includes: A resource object is used to store the configuration information of a business service when a creation request for a business service is received. The configuration information includes host information, network port information, instance selector information, and load balancing strategy. A business service listener is configured to receive configuration information of a resource object and determine the instance information of the business service based on the configuration information. The business service listener is also configured to determine whether the current host meets the host requirements of the business service based on the host information. If the host meets the host requirements, the listener determines the usage status of the network port corresponding to the network port information. If the network port usage status is unoccupied, the listener obtains the instance information of the instance selector corresponding to the instance selector information. A load balancer, which, upon receiving a request message, determines a target instance for processing the request message and forwards the request message to the target instance; the step of determining a target instance for processing the request message and forwarding the request message to the target instance includes: parsing the request message to determine whether the request message has an associated message; if the request message does not have an associated message, determining from the instance information the instance corresponding to the load balancing strategy as the target instance for processing the request message.

5. The load balancing system as described in claim 4, characterized in that, The load balancer obtains the request message based on the network port information in the configuration information.

6. A load balancing device, characterized in that, The load balancing device includes: The creation module is used to create resource objects associated with business services; The acquisition module is used to acquire the configuration information of the business service through the resource object when it receives the creation request of the business service. The configuration information includes host information, network port information, instance selector information, and load balancing strategy. The load balancing module is used to obtain instance information corresponding to the business service based on the configuration information, and determine the target instance for processing the request packet of the business service from the instances corresponding to the instance information according to the instance information and the configuration information, thereby completing load balancing. The steps of obtaining instance information corresponding to the business service based on the configuration information and determining the target instance for processing the request packet of the business service from the instances corresponding to the instance information according to the instance information and the configuration information, thereby completing load balancing, include: controlling the business service listener to determine whether the current host meets the host requirements of the business service based on the host information; when the host meets the host requirements, determining the usage status of the network port corresponding to the network port information; when the usage status of the network port is unoccupied, obtaining the instance information of the instance selector corresponding to the instance selector information; controlling the load balancer to parse the request packet and determine whether the request packet has an associated packet; when the request packet does not have an associated packet, determining the instance that meets the load balancing strategy from the instance information as the target instance for processing the request packet.

7. A load balancing device, characterized in that, The load balancing device includes a memory, a processor, and a load balancing program stored in the memory and executable on the processor, wherein the load balancing program, when executed by the processor, implements the various steps of the load balancing method as described in any one of claims 1-3.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a load balancing program, which, when executed by a processor, implements the steps of the load balancing method as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Application service framework, service control method and device and computer readable storage medium

    CN112181501A

  • Information processing method and device and storage medium

    CN113268308A