A method, system, device and medium for load balancing of traffic

By using business metrics data for load balancing, the problem of Istio service mesh being unable to perceive the operation of upstream application endpoints was solved. This achieved efficient load balancing and flexible routing configuration, avoided the introduction of an API gateway, and improved system availability and resource utilization.

CN117370005BActive Publication Date: 2026-02-27E SURFING VISION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311296239.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-08
Publication Date
2026-02-27
Estimated Expiration
2043-10-08

AI Technical Summary

Technical Problem

The existing service mesh Istio load balancing mechanism cannot perceive the actual business operation status of each endpoint of the upstream application, resulting in poor load balancing effect. Furthermore, the introduction of API gateways in microservice systems increases system complexity and resource consumption, and cannot effectively balance load when the gateway fails.

Method used

By performing load balancing based on business metrics data, using a traffic proxy to obtain business metrics from the caching middleware, and matching them with load balancing rules and business metrics to determine the target instance address, load balancing of upstream applications is achieved without introducing an API gateway into the microservice system.

Benefits of technology

It improves load balancing performance, enhances cluster traffic availability and routing configuration flexibility, and reduces system complexity and resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117370005B_ABST
    Figure CN117370005B_ABST
Patent Text Reader

Abstract

The application discloses a service flow load balancing method, system, device and medium. The method comprises the following steps: receiving a service call request from a client; obtaining a service index in a cache middleware according to the service call request; performing load balancing on the service call request according to a load balancing rule and the service index to obtain a target instance address, wherein the load balancing rule comprises a service balancing rule and load balancing instance information; and sending the service call request to a corresponding service server according to the target instance address, so that the service server updates the service index in the cache middleware. The method can realize load balancing of an upstream application according to service index data, effectively improve the load balancing effect, and does not need to introduce an API gateway in a micro-service system, thereby effectively improving the availability of cluster flow and the flexibility of routing configuration. The application can be widely applied to the technical field of flow load.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of traffic load balancing technology, and in particular to a method, system, device and medium for load balancing of business traffic. Background Technology

[0002] As cloud-native technologies continue to develop and mature, more and more enterprises are migrating their IT systems to cloud-native container orchestration platforms such as Kubernetes, GKE, and EKS. While enterprise businesses are increasingly moving to the cloud, traditional traffic management solutions are facing continuous challenges, leading to the emergence of service mesh Istio as a cloud-native traffic management solution. Service mesh Istio provides a variety of traffic management functions, such as route splitting, timeout retries, traffic mirroring, circuit breaking, and rate limiting.

[0003] Currently, Istio's load balancing mechanism is based solely on traffic characteristics, such as request parameters and upstream service response status, and cannot perceive the actual business operation status of each endpoint of the upstream application. Furthermore, the industry typically requires the introduction of an additional API gateway into its microservice system to perceive business operation status. This approach not only increases the complexity of the microservice system but also leads to traffic loss and ineffective load balancing when the API gateway fails. The additional gateway also increases resource consumption and call chain latency.

[0004] Therefore, the problems existing in the current technology still need to be solved and optimized. Summary of the Invention

[0005] To address at least one of the aforementioned technical problems, this application provides a load balancing method for business traffic. This load balancing method can achieve load balancing of upstream applications based on business indicator data, effectively improving the load balancing effect. In addition, this load balancing method does not require the introduction of an API gateway in the microservice system, which can effectively improve the availability of cluster traffic and the flexibility of routing configuration.

[0006] According to a first aspect of this application, a load balancing method for business traffic is provided for a traffic proxy, the load balancing method comprising:

[0007] Receive business call requests from clients;

[0008] Retrieve business metrics from the cached middleware based on the business call request;

[0009] The service call request is load balanced according to the load balancing rules and the service metrics to obtain the target instance address. The load balancing rules include service balancing rules and load balancing instance information.

[0010] sending the service invocation request to a corresponding service server according to the target instance address, so that the service server updates the service metrics in the cache middleware.

[0011] Further, in the embodiment of the present application, before the step of obtaining the service metrics in the cache middleware according to the service invocation request, the load balancing method further comprises:

[0012] receiving a load balancing component and a load balancing rule corresponding to the load balancing component from a service mesh control plane.

[0013] Further, in the embodiment of the present application, the step of load balancing the service invocation request according to the load balancing rule and the service metrics to obtain the target instance address comprises:

[0014] performing first query processing on the service metrics to obtain index data;

[0015] performing matching processing on the service invocation request according to the index data and the service balancing rule to obtain a first matching result;

[0016] determining the target instance address of the service invocation request according to the first matching result and the load balancing instance information.

[0017] Further, in the embodiment of the present application, the step of performing matching processing on the service invocation request according to the index data and the service balancing rule to obtain a first matching result comprises:

[0018] performing hit matching processing on the index data of all instances according to the service requirements of the service invocation request to obtain a first instance group;

[0019] performing screening matching processing on the first instance group according to the service balancing rule to obtain a first matching result.

[0020] Further, in the embodiment of the present application, the step of determining the target instance address of the service invocation request according to the first matching result and the load balancing instance information comprises:

[0021] performing second query processing on the load balancing instance information according to the first matching result to obtain a routing result;

[0022] determining the target instance address of the service invocation request according to the routing result.

[0023] According to a second aspect of the present application, a load balancing method for service traffic is provided, which is used for a service server and comprises:

[0024] The traffic agent receives a service call request sent by a target instance address, and updates a service index in a cache middleware according to the service call request;

[0025] The target instance address is obtained by the following steps:

[0026] The traffic agent receives a service call request from a client;

[0027] The traffic agent obtains a service index in a cache middleware according to the service call request;

[0028] The traffic agent performs load balancing on the service call request according to a load balancing rule and the service index, and obtains a target instance address, wherein the load balancing rule includes a service balancing rule and load balancing instance information.

[0029] Further, in the embodiments of the present application, the updating of the service index in the cache middleware according to the service call request comprises:

[0030] performing state judgment processing on the service call request to obtain an execution state of the service call request;

[0031] If the execution state is a first state, the service index of the cache middleware is updated according to service data required by the service call request, wherein the first state represents a state of the service call request before or during execution; or if the execution state is a second state, the service index of the cache middleware is updated according to a current service state of the service server, wherein the second state represents a state of the service call request after execution.

[0032] According to a third aspect of the present application, a load balancing system for service traffic is provided, which is used for a traffic agent in communication connection with at least one service server, and the system comprises:

[0033] A receiving unit is configured to receive a service call request from a client;

[0034] An obtaining unit is configured to obtain a service index in a cache middleware according to the service call request;

[0035] A load unit is configured to perform load balancing on the service call request according to a load balancing rule and the service index, and obtain a target instance address, wherein the load balancing rule includes a service balancing rule and load balancing instance information.

[0036] A sending unit is configured to send the service invocation request to a corresponding service server according to the target instance address, so that the service server updates the service index in the cache middleware.

[0037] According to a fourth aspect of the present application, a computer device is provided, comprising:

[0038] at least one processor;

[0039] at least one memory for storing at least one program;

[0040] When the at least one program is executed by the at least one processor, the at least one processor implements the method according to the above aspect.

[0041] According to a fifth aspect of the present application, a computer readable storage medium is provided, wherein a processor executable program is stored, and the processor executable program is used to implement the method according to the above aspect when executed by the processor.

[0042] The technical scheme provided by the embodiments of the present application has the following beneficial effects:

[0043] The present application provides a service flow load balancing method, comprising receiving a service invocation request from a client; obtaining a service index in a cache middleware according to the service invocation request; performing load balancing on the service invocation request according to a load balancing rule and the service index, to obtain a target instance address, wherein the load balancing rule comprises a service balancing rule and load balancing instance information; sending the service invocation request to a corresponding service server according to the target instance address, so that the service server updates the service index in the cache middleware. The load balancing method can realize load balancing of upstream applications according to service index data, effectively improve the effect of load balancing, and does not need to introduce an API gateway in a micro-service system, which can effectively improve the availability of cluster traffic and the flexibility of routing configuration. BRIEF DESCRIPTION OF DRAWINGS

[0044] Figure 1 A flowchart of a first service flow balancing method provided by the embodiments of the present application is provided;

[0045] Figure 2 A detailed flowchart of step S103 provided by the embodiments of the present application is provided;

[0046] Figure 3 A detailed flowchart of step S1032 provided by the embodiments of the present application is provided;

[0047] Figure 4A detailed flowchart of step S1033 provided for an embodiment of this application;

[0048] Figure 5 A flowchart illustrating a second service traffic balancing method provided in an embodiment of this application;

[0049] Figure 6 A flowchart illustrating a third service traffic balancing method provided in an embodiment of this application;

[0050] Figure 7 A detailed flowchart of step S201 provided for an embodiment of this application;

[0051] Figure 8 A schematic diagram of the link flow of a load balancing method for service traffic provided in an embodiment of this application;

[0052] Figure 9 A structural block diagram of a load balancing system for service traffic provided in an embodiment of this application;

[0053] Figure 10 This is a structural block diagram of a computer device provided in an embodiment of this application. Detailed Implementation

[0054] The present application will be further described below with reference to the accompanying drawings and specific embodiments. The described embodiments should not be considered as limitations on the present application, and all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of the present application.

[0055] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0057] The following is an explanation of several terms used in this application:

[0058] Service Mesh Istio: Service Mesh Istio is an open-source service mesh that manages traffic between microservice components and discovers services to achieve service reliability, scalability, and security. In addition, Service Mesh Istio includes a service mesh control plane and a service mesh data plane.

[0059] WebAssembly extension mechanism: the WebAssembly extension mechanism is used to implement the capability of extending the service mesh Istio proxy (Envoy), which can improve the flexibility and scalability of the service mesh Istio.

[0060] SDK: the SDK is a collection of development tools for building application software for software packages, software frameworks, hardware platforms, operating systems, etc.

[0061] At present, the load balancing mechanism of the service mesh Istio is only based on traffic characteristics, such as request parameters, upstream service response conditions, etc., and cannot perceive the actual business running conditions of each endpoint of the upstream application. At present, the industry generally needs to introduce an additional API gateway into the microservice system to complete this function; after the API gateway fails, the traffic will fail, and effective load balancing cannot be achieved, and the additional gateway also increases resource occupation and call link delay.

[0062] Therefore, the embodiments of the present application provide a load balancing method for service traffic, which can realize load balancing of the upstream application according to business index data, effectively improve the effect of load balancing, and additionally, the load balancing method does not need to introduce an API gateway into the microservice system, which can effectively improve the availability of cluster traffic and the flexibility of routing configuration.

[0063] The load balancing method for service traffic, system, device and medium provided by the embodiments of the present application can be specifically explained by the following embodiments. First, a load balancing method for service traffic in the embodiments of the present application is described.

[0064] The load balancing method for service traffic provided by the embodiments of the present application can be applied to a cloud computing (cloud service) application scenario. In the cloud computing application scenario, the cloud computing service provider can perform load balancing processing on the traffic by using the load balancing method provided by the embodiments of the present application, which can flexibly improve the effect of load balancing and effectively improve the utilization rate of cloud computing node computing resources.

[0065] The load balancing method for service traffic provided by the embodiments of the present application can be applied to a database application scenario. In the database application scenario, the load balancing method provided by the embodiments of the present application can be used to balance the load of the database to multiple servers, which can effectively improve the response speed and reliability of the servers.

[0066] The load balancing method for service traffic provided by the embodiments of the present application can be applied to a website application scenario. In the website application scenario, the load balancing method provided by the embodiments of the present application can be used to perform load balancing processing on the access request traffic of users, so as to achieve the requirement of reasonably distributing the access request traffic to different servers, and effectively guarantee the high availability and high performance of the website.

[0067] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in a distributed computing environment in which tasks are performed by remote processing devices connected by a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0068] It should be noted that in each specific embodiment of the present application, when it is necessary to process relevant data related to the identity or characteristics of the user according to user information, user behavior data, user history data and user location information, the user's permission or consent will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiments of the present application need to obtain sensitive personal information of the user, the separate permission or separate consent of the user will be obtained through a pop-up window or a jump to a confirmation page, and after obtaining the separate permission or separate consent of the user, the necessary user-related data for the normal operation of the embodiments of the present application will be obtained.

[0069] It can be understood that the present application also introduces one of the deployment environments required for implementing the load balancing method for service traffic. The deployment environment can be to deploy a service mesh Istio in a Kubernetes container management platform, enable traffic proxy injection function for a business application environment, ensure that the service mesh completely proxies the traffic of the user business application, and deploy a business metric cache middleware, a business client and a business server that has integrated a business metric SDK in Kubernetes. The present application examples are only for illustration, and actual requirements can be met.

[0070] Reference Figure 1 , Figure 1is an optional flowchart of the first service traffic load balancing method provided in the embodiments of the present application, Figure 1 The method in the method can include, but is not limited to, steps S101 to S104.

[0071] Step S101, receiving a service call request from a client;

[0072] Step S102, obtaining a service index in a cache middleware according to the service call request;

[0073] In the embodiments of the present application, the service call request can be data generated by the client according to the instructions issued by the user. The cache middleware stores dynamically updated service indexes, and the traffic proxy can actively monitor the changes of the service indexes before load balancing the service call request, and assist in balancing the service call request according to the real-time service indexes. Specifically, the embodiments of the present application can deploy at least one of Prometheus, Cassandra, Redis and other middleware as a cache middleware.

[0074] Step S103, load balancing the service call request according to a load balancing rule and the service index, to obtain a target instance address, wherein the load balancing rule includes a service balancing rule and load balancing instance information;

[0075] Referring to Figure 2 , the step S103, load balancing the service call request according to a load balancing rule and the service index, to obtain a target instance address, includes:

[0076] Step S1031, performing first query processing on the service index to obtain index data;

[0077] In the embodiments of the present application, after obtaining the service index in the cache middleware, the traffic proxy queries the index data required in the load balancing in the service index. Specifically, the first query processing can be that the traffic proxy queries the cpu_usage (CPU usage) index and zone (location) index of all instances under the applicationA.svc.cluster.local domain name of the service index, and takes the queried cpu_usage and zone indexes as the index data. It should be noted that the specific content of the service index can be set according to the actual situation, and the present application will not be described in detail here.

[0078] Step S1032, performing matching processing on the service call request according to the index data and the service balancing rule, to obtain a first matching result;

[0079] Referring to Figure 3The step S1032 comprises: performing matching processing on the service invocation request according to the index data and the service balancing rule, to obtain a first matching result, comprising:

[0080] The step S10321 comprises: performing hit matching processing on the index data of all instances according to the service requirement of the service invocation request, to obtain a first instance group.

[0081] The step S10322 comprises: performing screening matching processing on the first instance group according to the service balancing rule, to obtain the first matching result.

[0082] It can be understood that, after obtaining the index data in the service index, the traffic broker can perform hit matching processing on the index data of all instances, to determine a plurality of specific instances, which meet the service requirement in the service invocation request. For example, in the embodiment of the present application, the judgment condition "predicate" and "value" in the load balancing rule can be used to determine whether the index data of the instances all hit the service requirement, and the first instance group can be generated after all hits. The first instance group can be composed of one or more instances. It is worth mentioning that, after obtaining the first instance group, the traffic broker can perform screening matching on the first instance group according to the service balancing rule, to screen out the instances meeting the service balancing rule, to obtain the first matching result.

[0083] In the embodiment of the present application, the traffic broker can be implemented by executing the configuration file in YAML format. For the convenience of understanding, the present application provides a simple configuration file in YAML format, and the configuration content is as follows:

[0084] host:applicationA.svc.cluster.local

[0085] rules:

[0086] -name:rule1

[0087] conditions:

[0088] -metric:cpu_usage#CPU usage

[0089] predicate:">="

[0090] value:0.80

[0091] -metric:zone#Zone 1

[0092] predicate:"=="

[0093] value:gz1#gz1

[0094] destination:

[0095] conditions:

[0096] -metric:zone#computer room2

[0097] predicate:"=="

[0098] value:gz2#gz2

[0099] -name:rule2

[0100] conditions:

[0101] -metric:api-A-success-rate#Success rate of API A

[0102] predicate:"<="

[0103] value: 0.90

[0104] -metric:cpu_limit#CPU usage limit

[0105] predicate:"<"

[0106] value:"1C"#1 core

[0107] destination:

[0108] conditions:

[0109] -metric:cpu_request#Minimum CPU usage

[0110] predicate:">="

[0111] value:"1C"

[0112] trafficPolicy: # Same as the definition of DestinationRule.spec.trafficPolicy in Istio

[0113] loadBalancer:

[0114] simple:LEAST_REQUEST # Least requests take precedence

[0115] It can be understood that the YAML format configuration file describes two rules for the service using "applicationA.svc.cluster.local" as a domain name: the first rule requires that the traffic to the gz1 machine room CPU usage greater than or equal to 0.8 instance is reloaded to the instance under the gz2 machine room; the second rule requires that the traffic to the instance with CPU usage upper limit of 1 core and interface A success rate less than or equal to 0.9 is reloaded to the instance with CPU usage lower limit of 1 core, and the least request priority load balancing strategy is used. It should be noted that the YAML format configuration file provided by the embodiments of the present application is a simple example, which is only used for example description, and the actual load balancing configuration content can be flexibly set according to actual needs, and the present application will not be described in detail here.

[0116] In step S1033, a target instance address of the service invocation request is determined according to the first matching result and the load balancing instance information.

[0117] With reference to Figure 4 In step S1033, a target instance address of the service invocation request is determined according to the first matching result and the load balancing instance information.

[0118] In step S10331, the load balancing instance information is secondly queried according to the first matching result, and a routing result is obtained.

[0119] In step S10332, the target instance address of the service invocation request is determined according to the routing result.

[0120] In the embodiments of the present application, the load balancing instance information includes instance name, instance IP address, instance listening port and the like, and after the traffic proxy obtains the first matching result, the instance to which the current traffic is to be sent is determined. Then, the traffic proxy can query the load balancing instance information according to the first matching result to obtain a routing result. If the routing result is abnormal routing content, the traffic proxy can reselect other instances to query; if the routing result is normal routing content, the traffic proxy can update the original routing content of the current traffic according to the routing result, so as to determine the target instance address of the current service invocation request.

[0121] In step S104, the service invocation request is sent to the corresponding service server according to the target instance address, so that the service server updates the service index in the cache middleware.

[0122] It can be understood that after obtaining the target instance address, the traffic agent can send the business call request to the corresponding business server, the business server receives and executes the business call request, and the business server updates the business index in the cache middleware according to the execution of the business call request.

[0123] With reference to Figure 5 Before the step S102, obtaining the business index in the cache middleware according to the business call request, the load balancing method further comprises:

[0124] Step S105, receiving the load balancing component issued by the service mesh control plane, and the load balancing rule corresponding to the load balancing component.

[0125] In the embodiment of the application, the WebAssembly load balancing component is implemented by WebAssembly technology, and is implemented through the WebAssembly extension mechanism of the service mesh Istio, is managed by the service mesh Istio, and loads the load controller and the load balancing rule published by the user through the service mesh control plane into the traffic agent in the service mesh data plane. Specifically, the load balancing component is loaded into the WebAssembly runtime module in the traffic agent, and the traffic agent of the service mesh actively listens to the change of the related business index according to the behavior strategy configured by the user, and selects the actual endpoint to which the traffic is to be routed according to the business index.

[0126] It can be understood that loading the load balancing component into the traffic agent can not need to additionally introduce an API gateway on the basis of the original architecture of the service mesh Istio, thereby reducing the complexity of the microservice system and reducing resource occupation. In addition, since the load balancing component is loaded in the traffic agent, the user can conveniently configure the load balancing rule through the service mesh control plane, thereby effectively guaranteeing the flexibility of the routing configuration. It should be noted that in the embodiment of the application, the load balancing rule includes a business service name, a load balancing condition, an actual load balancing target, etc., which can be set according to actual needs, and the application will not be described in detail here.

[0127] It should be noted that the embodiment of the application can directly implement the business-level load balancing capability at the traffic agent in the service mesh Istio by implementing the foregoing embodiment, and the load balancing component is published and the load balancing rule is issued through the service mesh control plane, thereby reducing the gateway layer (API gateway) additionally deployed in the traditional architecture, and improving the flexibility and availability of load balancing.

[0128] With reference to Figure 6 , Figure 6The second service traffic load balancing method provided in the embodiments of the present application is used for a service server, which can include but is not limited to step S201.

[0129] In step S201, the traffic proxy receives a service call request sent by a target instance address, and updates a service index in a cache middleware according to the service call request.

[0130] The target instance address is obtained through the following steps.

[0131] The traffic proxy receives a service call request from a client.

[0132] The traffic proxy obtains a service index in a cache middleware according to the service call request.

[0133] The traffic proxy performs load balancing on the service call request according to a load balancing rule and the service index, and obtains a target instance address, wherein the load balancing rule includes a service balancing rule and load balancing instance information.

[0134] It can be understood that in the embodiments of the present application, the service server can update the service index in the cache middleware through a service index SDK according to the processing of a service transaction corresponding to the service call request.

[0135] Reference Figure 7 The step S201 of receiving a service call request sent by a target instance address and updating a service index in a cache middleware according to the service call request includes the following steps.

[0136] In step S2011, a state judgment process is performed on the service call request, and an execution state of the service call request is obtained.

[0137] In step S2012, if the execution state is a first state, a service index of the cache middleware is updated according to service data required by the service call request, wherein the first state is used to represent a state of the service call request before or during execution; if the execution state is a second state, a service index of the cache middleware is updated according to a current service state of the service server, wherein the second state is used to represent a state of the service call request after execution.

[0138] In the embodiments of the present application, the service server can perform state judgment processing on the service call request according to time or phase conditions after receiving the service call request.

[0139] Specifically, for the execution state of the business call request is the first state, that is, before or during the execution of the business call request, the business server can determine the required business data resources of the corresponding business transaction according to the business call request, and adjust the business indicators in the cache middleware according to the determined business data resources, so as to realize the occupation of the business resources of the business server. For the execution state of the business call request is the second state, that is, the state when the business server has executed the business call request, the business server updates the business indicators in the cache middleware by obtaining the current business state, so as to realize the release of the business resources of the business server.

[0140] Or, further, after the execution state of the business call request is judged to be the first state, the business server can also periodically determine the remaining required business data resources according to the execution progress of the business call request, and update the business indicators in the cache middleware, so as to dynamically and continuously realize the release of the business resources of the business server.

[0141] In addition, if the business server has a business call request queue, the business server can obtain the business data situation of the business server by counting the business data resources required by the execution progress of the current business call request and the business data resources required by other business call requests in the business call request queue, and update the business indicators in the cache middleware according to the business data situation of the business server.

[0142] Reference Figure 8 The application will be described below in conjunction with specific embodiments, specifically:

[0143] I. System initialization configuration

[0144] 1a, deploy Istio service mesh in Kubernetes container management platform, and enable traffic proxy injection function for business environment to ensure that service mesh completely proxies the traffic of user business.

[0145] 1b, deploy business indicator cache middleware, business client and business server that has integrated business indicator SDK in Kubernetes.

[0146] 1c, publish WebAssembly business load balancing component to business client in Istio service mesh, and simultaneously issue user-defined business traffic load balancing rule configuration. A business traffic load balancing rule configuration includes service name, load balancing content, load balancing condition, actual load balancing target, etc.

[0147] 1d, the business indicator SDK in the business server updates the business indicator data saved in the business indicator cache middleware according to the business transaction processing.

[0148] II. Load balancing

[0149] 2a, a business client initiates a business request, which is delivered by a traffic proxy to a WebAssembly runtime for processing.

[0150] 2b, the WebAssembly runtime delivers the request to a WebAssembly business load balancing component for further routing.

[0151] 2c, the WebAssembly business load balancing component queries the business index cache middleware for business index data according to the issued business traffic load balancing rules. After obtaining the index data, the business load balancing component sends the request to the matched instance according to the business balancing rules in the load balancing rules and the existing load balancing instance information in the Istio traffic proxy.

[0152] Figure 9 A framework diagram of a business traffic load balancing system provided by an embodiment of the present application is provided for a traffic proxy, which is used for communication connection with at least one business server. The system comprises:

[0153] The receiving unit 310 is configured to receive a business call request from a client;

[0154] The obtaining unit 320 is configured to obtain business indexes in a cache middleware according to the business call request;

[0155] The load unit 330 is configured to perform load balancing on the business call request according to a load balancing rule and the business indexes, to obtain a target instance address, wherein the load balancing rule comprises a business balancing rule and load balancing instance information;

[0156] The sending unit 340 is configured to send the business call request to a corresponding business server according to the target instance address, so that the business server updates the business indexes in the cache middleware.

[0157] It can be understood that the contents in the above method embodiments are all applicable to the present system embodiment. The present system embodiment specifically implements the same functions as the above method embodiments, and achieves the same beneficial effects as the above method embodiments.

[0158] Figure 10 A structure diagram of a computer device provided by an embodiment of the present application comprises:

[0159] At least one processor 980;

[0160] at least one memory 920, configured to store at least one program;

[0161] The at least one program is executed by the at least one processor 980, so that the at least one processor 980 implements the method according to any one of the preceding embodiments.

[0162] The embodiment of the present application further provides a computer readable storage medium, which stores a program executable by a processor, and the program is executed by the processor 980 to implement the method according to any one of the preceding embodiments.

[0163] Figure 10 Specifically, the computer device can be a user terminal, or a server.

[0164] The embodiment of the present application takes the computer device as a user terminal for example, and specifically as follows:

[0165] As shown in Figure 10 The computer device 900 can include RF (Radio Frequency) circuit 910, memory 920 including one or more computer readable storage media, input unit 930, display unit 940, sensor 950, audio circuit 960, WiFi module 970, processor 980 including one or more processing cores, and power supply 990, etc. Those skilled in the art can understand that the structure of the device shown in the figure is not a limitation on the electronic device, and the electronic device can include more or less components than the figure, or combine some components, or different component arrangement. Figure 10 The structure of the device shown in the figure is not a limitation on the electronic device, and the electronic device can include more or less components than the figure, or combine some components, or different component arrangement.

[0166] The RF circuit 910 can be used for receiving and transmitting signals in the process of information or communication, particularly, receiving the downlink information from the base station and delivering it to the one or more processors 980 for processing, and transmitting the uplink data to the base station. Generally, the RF circuit 910 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, etc. In addition, the RF circuit 910 can communicate with the network and other devices through wireless communication. The wireless communication can use any communication standards or protocols, including but not limited to GSM (Global System for Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), Bluetooth, WLAN (Wireless Local Area Network), Wi-Fi, Zigbee, NFC (Near Field Communication), LTE-A (LTE-Advanced), etc.

[0167] The memory 920 can be used to store software programs and modules. The processor 980 performs various functions and data processing by running the software programs and modules stored in the memory 920. The memory 920 can mainly include a program storage area and a data storage area, wherein the program storage area can store operating systems, application programs required by at least one function (such as a sound playing function, an image playing function, etc.), etc.; the data storage area can store data created according to the use of the device 900 (such as audio data, a phone book, etc.), etc. In addition, the memory 920 can include a high-speed random access memory, and can further include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. Accordingly, the memory 920 can further include a memory controller to provide access to the memory 920 for the processor 980 and the input unit 930. Although Figure 10 The RF circuit 910 is shown, but it can be understood that it does not belong to the essential components of the device 900, and can be omitted as needed without changing the essence of the application.

[0168] The input unit 930 can be used to receive inputted digital or character information, and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls. Specifically, the input unit 930 can include a touch-sensitive surface 932 and other input devices 931. The touch-sensitive surface 932, also known as a touch display or touchpad, can collect touch operations (such as a user's operation on or near the touch-sensitive surface 932 using a finger, a stylus, or any suitable object or accessory) of the user thereon or there near, and drive corresponding connection devices according to pre-set programs. Optionally, the touch-sensitive surface 932 can include two parts of a touch detection device and a touch controller. Among them, the touch detection device detects the touch position of the user and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, and converts it into touch coordinates, and then sends it to the processor 980, and can receive the commands from the processor 980 and execute them. In addition, the touch-sensitive surface 932 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 932, the input unit 930 can also include other input devices 931. Specifically, the other input devices 931 can include one or more of a physical keyboard, function keys (such as volume control keys, on-off keys, etc.), trackballs, mice, joysticks, etc.

[0169] The display unit 940 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the control 900, which can be composed of graphics, text, icons, video, and any combination thereof. The display unit 940 can include a display panel 941, which can be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 932 can be overlaid on the display panel 941, and when the touch-sensitive surface 932 detects a touch operation thereon or there near, it transmits to the processor 980 to determine the type of touch event, and then the processor 980 provides corresponding visual output on the display panel 941 according to the type of touch event. Although in the Figure 10 , the touch-sensitive surface 932 and the display panel 941 are implemented as two independent components to realize input and input functions, in some embodiments, the touch-sensitive surface 932 and the display panel 941 can be integrated to realize input and output functions.

[0170] The computer device 900 can also include at least one sensor 950, such as an optical sensor, a motion sensor, and other sensors. Specifically, the optical sensor can include an ambient light sensor to adjust the brightness of the display panel 941 according to the brightness of ambient light, and a proximity sensor to turn off the display panel 941 and / or the backlight when the device 900 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and when at rest, the gravity acceleration sensor can detect the magnitude and direction of gravity, which can be used for applications such as identifying the posture of the mobile phone (such as switching between landscape and portrait screens, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometers, taps), and the like. As for other sensors that can also be configured on the device 900, such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, and the like, they will not be described here.

[0171] The audio circuit 960, the speaker 961, and the microphone 962 can provide an audio interface between the user and the device 900. The audio circuit 960 can convert received audio data into an electrical signal, transmit the electrical signal to the speaker 961, and convert the electrical signal into a sound signal output by the speaker 961; on the other hand, the microphone 962 converts the collected sound signal into an electrical signal, which is received by the audio circuit 960 and converted into audio data. After the audio data is processed by the processor 980, the audio data is transmitted to another control device via the RF circuit 910, or the audio data is output to the memory 920 for further processing. The audio circuit 960 can also include a jack for providing communication between an external earphone and the device 900.

[0172] The device 900 can transmit information to the wireless transmission module provided on the opponent device via the WiFi module 970.

[0173] The processor 980 is the control center of the device 900, which connects each part of the control device through various interfaces and lines, executes various functions of the device 900 and processes data by running or executing software programs and / or modules stored in the memory 920 and calling data stored in the memory 920, and thus monitors the control device as a whole. Optionally, the processor 980 can include one or more processing cores; optionally, the processor 980 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, the user interface, and the application program, and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 950.

[0174] The device 900 also includes a power supply 990, such as a battery, for powering various components of the device 900. Preferably, the power supply 990 is configured to deliver power to the processor 980 via the power management system. Additionally or alternatively, the power supply 990 can be configured to deliver power to the processor 980 via a power management system other than the power management system. The power supply 990 can also be recharged from an external source or be coupled to a power source for recharging. The power supply 990 can also comprise one or more AC or DC power sources, a recharge system, a power failure detection circuit, a power converter or inverter, a power status indicator light, and any other components associated with the generation, management, and distribution of power in support of the operation of the device 900.

[0175] Although not shown, the device 900 can also include a camera, a Bluetooth module, and the like, which will not be described herein.

[0176] The embodiments of the present application further provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor, so that the processor executes the method in the foregoing various embodiments.

[0177] The terms "first", "second", "third", "fourth" and the like in the description of the application and in the claims, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of these terms herein is to be construed to cover a change in the order, sequence, position, and / or configuration of the individual steps comprising the method embodiment of the present application. Further, it is to be understood that the terms "comprises" and / or "comprising", or "includes" and / or "including" when used in this specification, specify the presence of stated features, steps, elements, and / or components, but do not preclude the presence or addition of one or more other features, steps, elements, components, and / or groups thereof.

[0178] It should be understood that, in the present application, "at least one" means one or more, and "multiple" means two or more. "And / or" is used to describe the relationship between associated objects, which means that there can be three relationships, for example, "A and / or B" can mean that there are three cases: only A, only B, and A and B at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or the like means any combination of these items, including single or multiple combinations. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be singular or plural.

[0179] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other manners. For example, the described device embodiments are merely schematic. The division of the units is merely a logical function division. There can be another division manner for the actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.

[0180] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0181] In addition, each functional unit in the various embodiments of the present application can be integrated into a processing unit, or each unit can exist physically, or two or more units can be integrated into one unit. The integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0182] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that makes a contribution to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0183] For the step numbers in the above method embodiments, they are set only for the convenience of description and explanation, and the order between the steps is not limited in any way. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0184] The above describes the preferred embodiments of the present application, but the present application is not limited to the described embodiments, and those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the present application.

Claims

1. A load balancing method for business traffic, characterized in that, A traffic broker for the service mesh data plane, wherein the load balancing method includes: Receive business call requests from clients; Retrieve business metrics from the cached middleware based on the business call request; The service call request is load balanced according to the load balancing rules and the service metrics to obtain the target instance address. The load balancing rules include service balancing rules and load balancing instance information. The business call request is sent to the corresponding business server based on the target instance address, so that the business server updates the business metrics in the cache middleware. Before the step of retrieving business metrics from the cached middleware based on the business call request, the load balancing method further includes: Receive a load balancing component and a load balancing rule corresponding to the load balancing component from the service mesh control plane, and load the load balancing component is loaded into the traffic proxy; The step of load balancing the service call requests according to the load balancing rules and the service metrics to obtain the target instance address includes: Perform a first query on the business metrics to obtain the metric data; Based on the indicator data and the business balancing rules, the business call request is matched to obtain a first matching result; Based on the first matching result and the load balancing instance information, the target instance address of the service call request is determined.

2. The load balancing method for service traffic according to claim 1, characterized in that, The process of matching the indicator data and the business balancing rules, and matching the business call requests to obtain a first matching result, includes: Based on the business requirements of the business call request, the indicator data of all instances are matched to obtain the first instance group; According to the business balancing rules, the first instance group is filtered and matched to obtain the first matching result.

3. The load balancing method for service traffic according to claim 1, characterized in that, The step of determining the target instance address of the service call request based on the first matching result and the load balancing instance information includes: Based on the first matching result, a second query process is performed on the load balancing instance information to obtain the routing result; Based on the routing results, the target instance address of the service call request is determined.

4. A load balancing method for business traffic, characterized in that, For use on the business server side, the load balancing method includes: Receive the business call request sent by the traffic proxy based on the target instance address, and update the business metrics in the cache middleware according to the business call request; The target instance address is obtained through the following steps: The traffic proxy receives service call requests from clients and load balancing components issued from the service mesh control plane, as well as load balancing rules corresponding to the load balancing components. The load balancing components are loaded into the traffic proxy. The traffic proxy obtains the business metrics from the cached middleware based on the business call request. The traffic proxy performs load balancing on the service call requests according to the load balancing rules and the service metrics to obtain the target instance address, wherein the load balancing rules include service balancing rules and load balancing instance information; The step of load balancing the service call requests according to the load balancing rules and the service metrics to obtain the target instance address includes: Perform a first query on the business metrics to obtain the metric data; Based on the indicator data and the business balancing rules, the business call request is matched to obtain a first matching result; Based on the first matching result and the load balancing instance information, the target instance address of the service call request is determined.

5. The load balancing method for service traffic according to claim 4, characterized in that, The step of updating the business metrics in the cache middleware according to the business call request includes: The status of the business call request is determined by processing the status of the business call request. If the execution state is the first state, the business metrics of the cache middleware are updated according to the business data required by the business call request, wherein the first state is used to characterize the state of the business call request before or during execution; or, if the execution state is the second state, the business metrics of the cache middleware are updated according to the current business state of the business server, wherein the second state is used to characterize the state after the business call request is executed.

6. A load balancing system for business traffic, characterized in that, A traffic proxy for the service mesh data plane, the traffic proxy being used to communicate with at least one service server, the system comprising: The receiving unit is used to receive business call requests from clients; The acquisition unit is used to acquire business metrics from the cached middleware based on the business call request. A load unit is used to perform load balancing on the service call request according to the load balancing rules and the service metrics to obtain the target instance address, wherein the load balancing rules include service balancing rules and load balancing instance information. The sending unit is used to send the business call request to the corresponding business server according to the target instance address, so that the business server updates the business metrics in the cache middleware. Before the acquisition unit in the load balancing system performs the step of obtaining the business metrics in the cache middleware based on the business call request, the load balancing system also performs the following steps: Receive a load balancing component and a load balancing rule corresponding to the load balancing component from the service mesh control plane, and load the load balancing component is loaded into the traffic proxy; The step of load balancing the service call requests according to the load balancing rules and the service metrics to obtain the target instance address includes: Perform a first query on the business metrics to obtain the metric data; Based on the indicator data and the business balancing rules, the business call request is matched to obtain a first matching result; Based on the first matching result and the load balancing instance information, the target instance address of the service call request is determined.

7. A computer device, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method as described in any one of claims 1-5.

8. A computer-readable storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to implement the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Load balancer monitoring method and device, equipment and storage medium

    CN114064377A

  • Load balancing method and device, computer equipment, storage medium and program product

    CN115134424A