CN112751898B - Load balancing method, device, medium and equipment - Google Patents

Load balancing method, device, medium and equipment Download PDF

Info

Publication number
CN112751898B
CN112751898B CN201911050572.XA CN201911050572A CN112751898B CN 112751898 B CN112751898 B CN 112751898B CN 201911050572 A CN201911050572 A CN 201911050572A CN 112751898 B CN112751898 B CN 112751898B
Authority
CN
China
Prior art keywords
client
request message
load balancer
service server
connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911050572.XA
Other languages
Chinese (zh)
Other versions
CN112751898A (en
Inventor
李逸骏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guizhou Baishancloud Technology Co Ltd
Original Assignee
Guizhou Baishancloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guizhou Baishancloud Technology Co Ltd filed Critical Guizhou Baishancloud Technology Co Ltd
Priority to CN201911050572.XA priority Critical patent/CN112751898B/en
Priority to PCT/CN2020/124879 priority patent/WO2021083284A1/en
Publication of CN112751898A publication Critical patent/CN112751898A/en
Application granted granted Critical
Publication of CN112751898B publication Critical patent/CN112751898B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure relates to a load balancing method, apparatus, medium and device. The load balancing method comprises the steps that a load balancer receives a request message of a client; analyzing the request message and determining a service server according to a load balancing rule; and encapsulating the request message of the client and sending the encapsulated request message to the service server. The load equalizer only needs to bear the analysis and forwarding of the incoming message, does not need to bear the output content, reduces one-time bandwidth forwarding, and can obviously reduce the bandwidth consumption in the cluster in a cloud computing scene.

Description

Load balancing method, device, medium and equipment
Technical Field
The present disclosure relates to the field of network communications technologies, and in particular, to a load balancing method, apparatus, medium, and device.
Background
In the related art, the existing 7-layer load balancing schemes all require the load balancer to provide a bidirectional forwarding function, so that the load balancer has higher load, consumes more resources, and requires twice the bandwidth consumption in the cluster. Meanwhile, if the load equalizer and the service server are deployed in a mixed mode, the network card has extra bandwidth consumption.
Disclosure of Invention
To overcome the problems in the related art, a load balancing method, apparatus, medium and device are provided herein.
According to a first aspect herein, there is provided a load balancing method comprising:
receiving a request message of a client;
analyzing the request message and determining a service server according to a load balancing rule;
and encapsulating the request message and sending the encapsulated request message to the service server.
The load balancing method further comprises the step of establishing connection with the client, and when the connection established with the client comprises a plurality of request messages, the step of analyzing the request messages and determining the service server according to the load balancing rule comprises the following steps: and determining a service server based on the content of each request message in the plurality of request messages.
The request message for encapsulating the client comprises: converting the message format, deleting the repeated message, and packaging the extension information;
When the service server determined based on a certain request message is the same as the service server determined based on an adjacent previous request message, the part which is the same as the expansion information of the previous request message is not encapsulated when the request message of the client is encapsulated.
The extension information includes: and the service server analyzes and responds to the information required by the request message.
The load balancing method further comprises the following steps:
Establishing a connection with the service server;
When the service server is a local machine, the connection comprises one of an IPC connection based on a shared memory, a Unix Socket, a pipeline and a shared memory;
When the service server is other servers in the cluster, the connection comprises one of a UDP connection, a TCP connection, RDMA and an encrypted tunnel.
The load balancing method is applied to the service server and comprises the following steps:
receiving an encapsulated request message sent by a load balancer;
And processing the packaged request message, generating a response message and sending the response message to the client.
The load balancing method is applied to the service server and further comprises the following steps:
And when the load balancer is not local, modifying the sending address of the response message as the address of the load balancer.
When the service server changes the connection state, the synchronization information is sent to the load balancer.
According to another aspect herein, there is provided a load balancing apparatus comprising:
the first receiving module is used for receiving a request message of the client;
the load balancing module is used for determining the service server according to the load balancing rule;
And the forwarding module is used for encapsulating the request message and sending the encapsulated request message to the service server.
The load balancing device also comprises a first connection module, a second connection module and a first connection module, wherein the first connection module is used for establishing connection with the client; when the connection established with the client includes a plurality of request messages, the parsing the request messages and determining the service server according to the load balancing rule includes: and determining a service server based on the content of each request message in the plurality of request messages.
The request message for encapsulating the client comprises: converting the message format, deleting the repeated message, and packaging the extension information;
When the service server determined based on a certain request message is the same as the service server determined based on an adjacent previous request message, the part which is the same as the expansion information of the previous request message is not encapsulated when the request message of the client is encapsulated.
The extension information includes: and the service server analyzes and responds to the information required by the request message.
The load balancing device further comprises:
the second connection module is used for establishing connection with the service server;
When the service server is a local machine, the connection comprises one of an IPC connection based on a shared memory, a Unix Socket, a pipeline and a shared memory;
When the service server is other servers in the cluster, the connection comprises one of a UDP connection, a TCP connection, RDMA and an encrypted tunnel.
The load balancing device further comprises:
the second receiving module is used for receiving the packaged request message sent by the load balancer;
And the response module is used for processing the request message, generating a response message and sending the response message to the client.
And the address changing module is used for modifying the sending address of the response message into the address of the load balancer when the load balancer is not the local machine.
And the information synchronization module is used for sending synchronization information to the load balancer when the service server changes the connection state.
According to another aspect herein, there is provided a computer readable storage medium having stored thereon a computer program which when executed implements the steps of a load balancing method.
According to another aspect herein, there is provided a computer device comprising a processor, a memory and a computer program stored on the memory, the processor implementing the steps of a load balancing method when executing the computer program.
According to the method, after the service server is determined, the service server directly responds to the request of the client, and under the condition that the load balancer is flexibly deployed, the load of the network in the cluster can be reduced, and the bandwidth of communication in the cluster can be reduced while the accurate scheduling is realized.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention as claimed.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure, illustrate and explain the disclosure, and do not constitute a limitation on the disclosure. In the drawings:
Fig. 1 is a flow chart illustrating a method of load balancing according to an exemplary embodiment.
Fig. 2 is a flow chart illustrating a method of load balancing according to an exemplary embodiment.
Fig. 3 is a schematic diagram of a hybrid deployment of a load balancer and a service server.
Fig. 4 is a schematic diagram of a load balancer deployed as a gateway.
Fig. 5 is a block diagram illustrating a load balancing apparatus according to an example embodiment.
Fig. 6 is a block diagram illustrating a load balancing apparatus according to an example embodiment.
Fig. 7 is a block diagram illustrating a load balancing apparatus according to an example embodiment.
Fig. 8 is a block diagram illustrating a load balancing apparatus according to an example embodiment.
Fig. 9 is a block diagram illustrating a load balancing apparatus according to an example embodiment.
Fig. 10 is a block diagram illustrating a load balancing apparatus according to an example embodiment.
FIG. 11 is a block diagram of a computer device, according to an example embodiment.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments herein more apparent, the technical solutions in the embodiments herein will be clearly and completely described below with reference to the accompanying drawings in the embodiments herein, and it is apparent that the described embodiments are some, but not all, embodiments herein. All other embodiments, based on the embodiments herein, which a person of ordinary skill in the art would obtain without undue burden, are within the scope of protection herein. It should be noted that, without conflict, the embodiments and features of the embodiments herein may be arbitrarily combined with each other.
Fig. 1 is a flow chart illustrating a method of load balancing according to an exemplary embodiment. Referring to fig. 1, the load balancing method is applied to a load balancer, and includes:
Step S11, receiving a request message of a client. The messages may be streaming media data carried on the udp, http/https data on the tcp, etc.
And step S12, analyzing the request message and determining the service server according to the load balancing rule. And analyzing the request message of the client to further determine the service server. The rule of the service server is determined, and the information such as the IP information of the client, the load of the service server, the resource distribution and the type of the service request, the configuration of the load balancer and the like is comprehensively determined, so that accurate scheduling is realized.
Step S13, the request message of the client is encapsulated, and the encapsulated request message is sent to the service server. And re-packaging the request message of the client, deleting the repeated message and the useless message, and then sending the re-packaged request message and the useless message to the determined service server, thereby reducing unnecessary bandwidth consumption as much as possible. In special cases, the message format is also converted according to the server performance. And simultaneously, the necessary information of the service server responding to the request message of the client is transmitted to the service server together, so that the service server responds to the request of the client.
In an embodiment, the load balancing method further includes establishing a connection with the client, and when the connection established with the client includes a plurality of request messages, parsing the request messages and determining the service server according to the load balancing rule includes: the service server is determined based on the content of each of the plurality of request messages.
In the same connection established with the client, a plurality of request messages may be included, after the load balancer determines the service server based on the request message with earlier time, when the next request message is processed, the message content is re-analyzed, and the service server is re-determined according to the message content and a preset load balancing rule, so that different service servers respond to the requests of different contents of the client, and accurate scheduling is realized. For example, a video server is used for processing a video class request of a client, and a download server is used for processing a download class request of the client, so that accurate scheduling is realized, and the service quality is improved.
In one embodiment, encapsulating the request message of the client includes: converting the message format, deleting the repeated message, and packaging the extension information; in order to further reduce the consumption of bandwidth resources, when the load balancer forwards the request message of the client, the load balancer encapsulates the request message first, for example, in order to enable the service server to smoothly respond to the request message of the client, a message format needs to be converted appropriately according to the specific configuration of the server, for example, the message in the http/2 format is converted into the message in the http/1.1 format. In the process of packaging the request message of the client, unnecessary contents, such as repeated messages, ACK messages when the load balancer establishes connection with the client, and the like, are removed. Meanwhile, in order to enable the service server to accurately analyze the request of the client and accurately respond, when the request message of the client is packaged, information such as the address of the client, an encryption tunnel established by the client and the like is also used as expansion information to be packaged. In this embodiment, only the necessary information required by the service server to parse and respond to the client request message is encapsulated, so as to further reduce the consumption of bandwidth resources.
The extension information includes: and the service server analyzes and responds to the information required by the request message. The related information contained in the protocol used for the connection with the client can be one or more of parameters negotiated when the load balancer establishes connection with the client, configuration information of the load balancer, connection state of the load balancer and the client, and state information of the TLS encrypted tunnel established by the load balancer and the client when the request message of the client is https message. The information required by the service server to parse and respond to the request message may be client address information or other information. By expanding the information, the service server can successfully analyze the request message of the client and correctly respond to the request message, for example, the load balancer packages the secret key negotiated with the client in the https handshake process and the address information of the client in a forwarding message, and the service server can analyze the request message encrypted by the client by using the secret key and send the response message to the client according to the address of the client. For another example, the load balancer sends the connection state with the client to the service server, and the service server can sense the change of the connection state of the load balancer and the client at any time and construct a response message according to the connection state information. And sending a response message to the correct client according to the address information of the client.
When the service server determined based on a certain request message is the same as the service server determined based on the adjacent previous request message, the request message of the client is packaged, and the part which is the same as the expansion information of the previous request message is not packaged. For the request messages of the continuous clients in the same connection, if the service servers determined based on the content of the request messages are the same, because the service servers already have the extension information related to the connection, when the load balancer encapsulates the request messages, only the necessary request messages are encapsulated, and the extension information is not repeatedly encapsulated. Further reducing the consumption of bandwidth resources.
In an embodiment, the load balancing method further comprises: establishing a connection with a service server; when the service server is local, the connection with the service server comprises one of local communication methods such as IPC connection of shared memory, unix Socket, pipeline, shared memory and the like; other local communication modes are also possible, and the present disclosure is not limited thereto.
When the service server is other servers in the cluster, the connection with the service server comprises one of UDP connection, TCP connection, RDMA and encrypted tunnel. Other possible communication means are possible, and are not limited herein.
The connection between the load balancer and the service server is used for forwarding the request message and the synchronous state of the client, and the UDP connection, the TCP connection, the encrypted tunnel connection or the like can be selected according to the requirements, so that the message transmission mode between the client and the load balancer can be not dependent. And different transmission modes can be selected according to the conditions of the same-machine deployment, the network connection mode, the network connection distance and the like between the service server and the load equalizer.
Fig. 2 is a flow chart illustrating a method of load balancing according to an exemplary embodiment. Referring to fig. 2, the load balancing method is applied to a service server, and includes:
Step S21, receiving the packaged request message sent by the load balancer;
Step S22, the packaged request message is processed, a response message is generated, and the response message is sent to the client.
In this embodiment, the response message of the service server responding to the client request is not sent to the load balancer any more, but is directly sent to the client, so as to reduce the resource consumption of the load balancer.
The service server and the load balancer can be deployed on the same server to realize mixed deployment, namely, each server deploys the load balancer and the service server in a cluster. The method can also be deployed separately from a load balancer, which is used as a gateway.
When the service server and the load balancer are deployed in the same machine, for example, the service server and the load balancer are connected, the connection comprises one of a shared memory-based IPC connection, a Unix Socket, a pipeline and a shared memory, and other types of connection modes are also included, which is not limited in the present disclosure. The service server may respond directly to the client request. When the service server is deployed separately from the load balancer, the connection includes one of UDP connection, TCP connection, RDMA, and encrypted tunnel, and of course, other types of connection modes, which are not limited herein. In order for the client to accurately receive the response message, the service server also needs to modify the sending address of the response message into the address of the load balancer when sending the response message.
When the service server changes the connection state, the synchronization information is sent to the load balancer. For example, when the server responds to the request of the client, the connection with the client is disconnected, and when the connection between the service server and the client is disconnected, the service server sends synchronization information to the load balancer, so that the load balancer sends the request of the next client to the service server.
For a better understanding of the load balancing method herein, the following is exemplified:
Embodiment 1, fig. 3 is a schematic diagram of a hybrid deployment of a load balancer and a service server. Referring to fig. 3, the load balancer receives a request message of a client, parses the request message of the client, and determines a service server according to a load balancing rule. For example, the load balancer establishes a TCP connection with the client, and the request of the client includes a request a and a request B. And the load balancer determines that the server A responds to the request A of the client and the service server B responds to the request B of the client according to the load balancing rule. The load balancer then parses the different requests of the same client to different traffic servers. For the service server A, the service server A and the load balancer are the same server, so that the client request A packaged by the load balancer can be received in a memory sharing mode, the request A is responded, and a response message is directly sent to the client. For the service server B, the load balancer is other servers in the cluster, so the load balancer needs to establish a connection with the service server B first for forwarding the encapsulated request message and the synchronization message. And the service server B analyzes the packaged request B sent by the load balancer according to the extension information and directly sends the response message to the client, and in order to enable the client to successfully receive the response message, the service server also needs to modify the sending address of the response message into the address of the load balancer.
Embodiment 2, fig. 4 is a schematic diagram of a load balancer deployed as a gateway. Referring to fig. 4, the load balancer receives a request message of a client, establishes a connection with the client, parses the request message of the client, and determines a service server according to load balancing rules. For example, the client request is an HTTPS request, and the load balancer handshakes with the client and negotiates an encryption key. The load balancer parses the client's request, including request a, request B. And the load balancer determines that the server A responds to the request A of the client and the service server B responds to the request B of the client according to the load balancing rule. In order to reduce bandwidth consumption, the load balancer encapsulates a request message of the client, clears a repeated message, and sends a message of the request A and an encryption key, a client address, a load balancer address and other information necessary for responding to the request A to the service server A, and sends a message of the request B and encryption information, a client address, a load balancer address and other information necessary for responding to the request B to the service server B after an ACK message when the load balancer handshakes with the client. The service server analyzes the encapsulated request message sent by the load balancer according to the extension information, encrypts the response message by using an encryption key and then directly sends the encrypted response message to the client, and in order to enable the client to successfully receive the response message, the service server also needs to modify the sending address of the response message into the address of the load balancer.
Through the above embodiment, by using the load balancing method in the present disclosure, the load balancer only needs to bear the parsing and forwarding of the incoming message, and does not need to bear the output content, so that one-time bandwidth forwarding is reduced, and the bandwidth consumption in the cluster can be obviously reduced in the CDN scenario. Accurate load balancing for messages with more than 4 layers is achieved, and load balancing based on content can be achieved for encrypted traffic. Meanwhile, the different requests in a single request can be balanced respectively aiming at long connection.
Fig. 5 is a block diagram illustrating a load balancing apparatus according to an example embodiment. Referring to fig. 5, the load balancing apparatus is applied to a load balancer, and includes a first receiving module 501, a load balancing module 502, and a forwarding module 503.
The first receiving module 501 is configured to receive a request message of a client.
The load balancing module 502 is configured to determine a traffic server according to load balancing rules.
The forwarding module 503 is configured to encapsulate a request packet of a client, and send the encapsulated request packet to the service server.
Fig. 6 is a block diagram illustrating a load balancing apparatus according to an example embodiment. Referring to fig. 6, the load balancing apparatus further comprises a first connection module 601, the first connection module 601 being configured to establish a connection with a client; when the connection established with the client includes a plurality of request messages, analyzing the request messages and determining the service server according to the load balancing rule includes: the service server is determined based on the content of each of the plurality of request messages. ;
The request message of the encapsulation client comprises: and converting the message format, deleting the repeated message, and packaging the extension information.
When the service server determined based on a certain request message is the same as the service server determined based on the adjacent previous request message, the request message of the client is packaged, and the part which is the same as the expansion information of the previous request message is not packaged.
The extension information includes: and the service server analyzes and responds to the information required by the request message.
Fig. 7 is a block diagram illustrating a load balancing apparatus according to an example embodiment. Referring to fig. 7, the load balancing apparatus further includes: a second connection module 701.
The second connection module 701 is configured for establishing a connection with a traffic server.
When the service server is a local machine, the connection comprises one of an IPC connection based on a shared memory, a Unix Socket, a pipeline and the shared memory;
when the service server is other servers in the cluster, the connection is one of a UDP connection, a TCP connection, RDMA and an encrypted tunnel.
Fig. 8 is a block diagram illustrating a load balancing apparatus according to an example embodiment. Referring to fig. 8, the load balancing apparatus applied to a service server includes: the second receiving module 801, the response module 802.
The second receiving module 801 is configured to receive the encapsulated request packet sent by the load balancer.
The response module 802 is configured to process the encapsulated request message, generate a response message, and send the response message to the client.
Fig. 9 is a block diagram illustrating a load balancing apparatus according to an example embodiment. Referring to fig. 9, the load balancing apparatus further includes: the address change module 901.
The address changing module 901 is configured to modify the transmission address of the response message to the address of the load balancer when the load balancer is not native.
Fig. 10 is a block diagram illustrating a load balancing apparatus according to an example embodiment. Referring to fig. 10, the load balancing apparatus further includes: the information synchronization module 1001.
The information synchronization module is configured to send synchronization information to the load balancer when the traffic server changes connection status.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 11 is a block diagram illustrating a computer device 1100 according to an example embodiment. For example, the computer device 1100 may be provided as a server. Referring to fig. 11, the computer device 1100 includes a processor 1101, and the number of processors may be set to one or more as needed. The computer device 1100 also includes a memory 1102 for storing instructions, such as application programs, that are executable by the processor 1101. The number of the memories can be set to one or more according to the requirement. Which may store one or more applications. The processor 1101 is configured to execute instructions to perform the method of load balancing described above.
It will be apparent to one of ordinary skill in the art that embodiments herein may be provided as a method, apparatus (device), or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied therein. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, including, but not limited to RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.
The description herein is with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices) and computer program products according to embodiments herein. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that an article or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such article or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other like elements in an article or apparatus that includes the element.
While preferred embodiments herein have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all alterations and modifications as fall within the scope herein.
It will be apparent to those skilled in the art that various modifications and variations can be made herein without departing from the spirit and scope of the disclosure. Thus, given that such modifications and variations herein fall within the scope of the claims herein and their equivalents, such modifications and variations are intended to be included herein.

Claims (16)

1. The load balancing method is applied to a load balancer, and the load balancer is a seven-layer load balancer and is characterized by comprising the following steps:
receiving a request message of a client, and establishing connection with the client, wherein the request message comprises an HTTPS message;
Analyzing the request message and determining a service server according to the content of the request message and the load balancing rule;
encapsulating the request message and sending the encapsulated request message to the service server;
the encapsulated request message comprises: expansion information;
The extension information includes: the method comprises the steps of establishing parameters negotiated when a load balancer is connected with a client, connecting the load balancer with the client, configuring information of the load balancer, establishing TLS encrypted tunnel state information between the load balancer and the client when a request message of the client is an HTTPS message, and client address information, so that a service server can successfully analyze the request message of the client, sense the change of the connecting state of the load balancer and the client at any time, construct a response message with a sending address of the load balancer according to the content of the request message and the connecting state information, and directly send the response message to the client according to the client address information.
2. The load balancing method of claim 1, wherein the load balancing method further comprises establishing a connection with the client, and when the connection established with the client comprises a plurality of request messages, the parsing the request messages and determining the traffic server according to the load balancing rule comprises: and determining a service server based on the content of each request message in the plurality of request messages.
3. The load balancing method of claim 2, wherein,
When the service server determined based on a certain request message is the same as the service server determined based on an adjacent previous request message, the part which is the same as the expansion information of the previous request message is not encapsulated when the request message of the client is encapsulated.
4. The load balancing method of claim 1, further comprising:
Establishing a connection with the service server;
When the service server is a local machine, the connection comprises one of an IPC connection based on a shared memory, a Unix Socket, a pipeline and a shared memory;
When the service server is other servers in the cluster, the connection comprises one of a UDP connection, a TCP connection, RDMA and an encrypted tunnel.
5. The load balancing method is applied to a service server and is characterized by comprising the following steps:
Receiving an encapsulated request message sent by a load balancer, wherein the load balancer is a seven-layer load balancer, and the request message comprises an HTTPS message;
the encapsulated request message comprises: expansion information;
the extension information includes: the method comprises the steps of establishing parameters negotiated when a load balancer is connected with a client, connecting states of the load balancer and the client, configuration information of the load balancer, state information of a TLS encrypted tunnel established by the load balancer and the client when a request message of the client is an HTTPS message, and client address information;
analyzing the request message of the client, sensing the change of the connection state of the load equalizer and the client at any time, constructing a response message with the address of the load equalizer according to the content and the connection state information of the request message, and directly transmitting the response message to the client according to the address information of the client.
6. The load balancing method of claim 5, further comprising:
And when the load balancer is not local, modifying the sending address of the response message as the address of the load balancer.
7. The load balancing method of claim 5, further comprising:
When the service server changes the connection state, the synchronization information is sent to the load balancer.
8. A load balancing device, applied to a load balancer, the load balancer being a seven-layer load balancer, comprising:
the first receiving module is used for receiving a request message of a client, establishing connection with the client, wherein the request message comprises an HTTPS message;
The load balancing module is used for determining a service server according to the content of the request message and the load balancing rule;
the forwarding module is used for encapsulating the request message and sending the encapsulated request message to the service server;
the encapsulated request message comprises: expansion information;
The extension information includes: the method comprises the steps of establishing parameters negotiated when a load balancer is connected with a client, connecting the load balancer with the client, configuring information of the load balancer, establishing TLS encrypted tunnel state information between the load balancer and the client when a request message of the client is an HTTPS message, and client address information, so that a service server can successfully analyze the request message of the client, sense the change of the connecting state of the load balancer and the client at any time, construct a response message with a sending address of the load balancer according to the content of the request message and the connecting state information, and directly send the response message to the client according to the client address information.
9. The load balancing apparatus of claim 8, further comprising a first connection module for establishing a connection with the client; when the connection established with the client includes a plurality of request messages, the parsing the request messages and determining the service server according to the load balancing rule includes: and determining a service server based on the content of each request message in the plurality of request messages.
10. The load balancing apparatus of claim 8, wherein,
When the service server determined based on a certain request message is the same as the service server determined based on an adjacent previous request message, the part which is the same as the expansion information of the previous request message is not encapsulated when the request message of the client is encapsulated.
11. The load balancing apparatus of claim 8, further comprising:
the second connection module is used for establishing connection with the service server;
When the service server is a local machine, the connection comprises one of an IPC connection based on a shared memory, a Unix Socket, a pipeline and a shared memory;
When the service server is other servers in the cluster, the connection comprises one of a UDP connection, a TCP connection, RDMA and an encrypted tunnel.
12. A load balancing device applied to a service server, comprising:
The second receiving module is used for receiving the packaged request message sent by the load balancer, wherein the request message comprises an HTTPS message; the load balancer is a seven-layer load balancer, and the packaged request message comprises: expansion information; the extension information includes: the method comprises the steps of establishing parameters negotiated when a load balancer is connected with a client, connecting states of the load balancer and the client, configuration information of the load balancer, state information of a TLS encrypted tunnel established by the load balancer and the client when a request message of the client is an HTTPS message, and client address information;
And the response module analyzes the request message of the client, perceives the change of the connection state of the load balancer and the client at any time, constructs a response message with the address of the load balancer according to the content of the request message and the connection state information, and directly sends the response message to the client according to the address information of the client.
13. The load balancing apparatus of claim 12, further comprising:
and the address changing module is used for modifying the sending address of the response message into the address of the load balancer when the load balancer is not the local machine.
14. The load balancing apparatus of claim 12, further comprising:
And the information synchronization module is used for sending synchronization information to the load balancer when the service server changes the connection state.
15. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed, implements the steps of the method according to any one of claims 1-7.
16. A computer device comprising a processor, a memory and a computer program stored on the memory, characterized in that the processor implements the steps of the method according to any of claims 1-7 when the computer program is executed.
CN201911050572.XA 2019-10-31 2019-10-31 Load balancing method, device, medium and equipment Active CN112751898B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201911050572.XA CN112751898B (en) 2019-10-31 2019-10-31 Load balancing method, device, medium and equipment
PCT/CN2020/124879 WO2021083284A1 (en) 2019-10-31 2020-10-29 Load balancing method and apparatus, medium and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911050572.XA CN112751898B (en) 2019-10-31 2019-10-31 Load balancing method, device, medium and equipment

Publications (2)

Publication Number Publication Date
CN112751898A CN112751898A (en) 2021-05-04
CN112751898B true CN112751898B (en) 2024-05-14

Family

ID=75641287

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911050572.XA Active CN112751898B (en) 2019-10-31 2019-10-31 Load balancing method, device, medium and equipment

Country Status (2)

Country Link
CN (1) CN112751898B (en)
WO (1) WO2021083284A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113746933A (en) * 2021-09-14 2021-12-03 京东科技信息技术有限公司 Method and device for displaying information
CN113810304A (en) * 2021-09-30 2021-12-17 深圳前海微众银行股份有限公司 Load balancing method, device, equipment and computer storage medium
CN114244846B (en) * 2021-12-15 2024-02-09 山石网科通信技术股份有限公司 Flow message forwarding method and device, intermediate equipment and storage medium
CN114422616A (en) * 2022-01-29 2022-04-29 杭州迪普科技股份有限公司 Data communication method, client, server and system
CN114827161B (en) * 2022-04-20 2023-07-25 微位(深圳)网络科技有限公司 Service call request sending method and device, electronic equipment and readable storage medium
CN114710496B (en) * 2022-04-24 2024-05-14 中国工商银行股份有限公司 Multi-node load balancing method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102761618A (en) * 2012-07-03 2012-10-31 杭州华三通信技术有限公司 Method, equipment and system for realizing load balancing
CN103428229A (en) * 2012-05-14 2013-12-04 百度在线网络技术(北京)有限公司 Data center system and device and method for providing service
CN106411907A (en) * 2016-10-13 2017-02-15 广西咪付网络技术有限公司 Data transmission method and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1276629C (en) * 2003-11-21 2006-09-20 清华大学深圳研究生院 Flow-media cluster service content scheduling method based on Netfilter architecture
CN101252591B (en) * 2008-04-03 2011-05-04 中国科学技术大学 Apparatus and method for realizing uplink and downlink data separation
CN102523302B (en) * 2011-12-26 2015-08-19 华为数字技术(成都)有限公司 The load-balancing method of cluster virtual machine, server and system
CN106686085B (en) * 2016-12-29 2020-06-16 华为技术有限公司 Load balancing method, device and system
CN106713499A (en) * 2017-01-23 2017-05-24 天地融科技股份有限公司 Load balancing method, equipment and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103428229A (en) * 2012-05-14 2013-12-04 百度在线网络技术(北京)有限公司 Data center system and device and method for providing service
CN102761618A (en) * 2012-07-03 2012-10-31 杭州华三通信技术有限公司 Method, equipment and system for realizing load balancing
CN106411907A (en) * 2016-10-13 2017-02-15 广西咪付网络技术有限公司 Data transmission method and system

Also Published As

Publication number Publication date
CN112751898A (en) 2021-05-04
WO2021083284A1 (en) 2021-05-06

Similar Documents

Publication Publication Date Title
CN112751898B (en) Load balancing method, device, medium and equipment
CN109412946B (en) Method, device, server and readable storage medium for determining back source path
CN110875799B (en) Transmission control method and device
CN106797335B (en) Data transmission method, data transmission device, electronic equipment and computer program product
KR101938623B1 (en) Openflow communication method, system, controller, and service gateway
US20160285820A1 (en) Method for processing address resolution protocol message, switch, and controller
EP4210297A1 (en) Edge application discovery method and apparatus, and edge application service support method and apparatus
EP3735768B1 (en) Improving qoe for video and web services using cross-layer information
EP3633949A1 (en) Method and system for performing ssl handshake
CN112751897B (en) Load balancing method, device, medium and equipment
WO2023151264A1 (en) Load balancing method and apparatus, node, and storage medium
CN112653656B (en) Data communication method and device based on application layer protocol
US9288225B1 (en) Server port sharing based on shared socket
CN104717041A (en) Method and device for transmitting data
US11671410B2 (en) Providing enrichment information using hypertext transfer protocol secure (HTTPS)
CN113301000A (en) Data transmission method, device, medium and equipment
CN114070833A (en) Multi-protocol service compatible method, system, device, medium, and program product
CN109600248B (en) Method and device for determining quality of service and storage medium
CN116366740A (en) Data transmission method, device, system, storage medium and processor
CN108064441B (en) Method and system for accelerating network transmission optimization
CN109067922A (en) A kind of data transmission method and device
CN112653716B (en) Service binding method and device
CN103428013B (en) Device management method, system and gateway device
CN114205185B (en) Proxy method and device for control message
CN115733898A (en) Data transmission method and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant