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

Load balancing method, device, medium and equipment Download PDF

Info

Publication number
CN112751898A
CN112751898A CN201911050572.XA CN201911050572A CN112751898A CN 112751898 A CN112751898 A CN 112751898A CN 201911050572 A CN201911050572 A CN 201911050572A CN 112751898 A CN112751898 A CN 112751898A
Authority
CN
China
Prior art keywords
service server
request message
client
load balancing
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.)
Pending
Application number
CN201911050572.XA
Other languages
Chinese (zh)
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/CN112751898A/en
Priority to PCT/CN2020/124879 priority patent/WO2021083284A1/en
Publication of CN112751898A publication Critical patent/CN112751898A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • 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

Abstract

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 packaging the request message of the client, and sending the packaged request message to the service server. The load balancer only needs to undertake the analysis and forwarding of the incoming messages and does not need to undertake the output content, primary bandwidth forwarding is reduced, and bandwidth consumption in a cluster can be obviously reduced in a cloud computing scene.

Description

Load balancing method, device, medium and equipment
Technical Field
The present disclosure relates to the field of network communication technologies, and in particular, to a load balancing method, apparatus, medium, and device.
Background
In the related art, existing 7-layer load balancing schemes all require a load balancer to provide a bidirectional forwarding function, so that the load balancer has a higher load and consumes more resources, and twice the bandwidth consumption is required in a cluster. Meanwhile, if the load balancer and the service server are deployed in a mixed mode, the network card can consume extra bandwidth.
Disclosure of Invention
To overcome the problems in the related art, a load balancing method, apparatus, medium, and device are provided.
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 packaging the request message, and sending the packaged request message to the service server.
The load balancing method also comprises the steps of establishing connection with the client, and when the connection established with the client comprises a plurality of request messages, the steps of analyzing the request messages and determining the service server according to a load balancing rule comprise: 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 message formats, deleting repeated messages, and packaging extended information;
and 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 part which is the same as the extension information of the previous request message is not packaged when the request message of the client is packaged.
The extended information includes: and the service server analyzes and responds to the information required by the request message according to the related information contained in the protocol used for connecting the client.
The load balancing method further comprises the following steps:
establishing connection with the service server;
when the service server is a local server, the connection comprises one of IPC connection based on shared memory, Unix Socket, pipeline and shared memory;
when the service server is other servers in the cluster, the connection comprises one of UDP connection, TCP connection, RDMA and encryption tunnel.
The load balancing method is applied to a service server and comprises the following steps:
receiving a packaged request message sent by a load balancer;
and processing the encapsulated request message, generating a response message and sending the response message to the client.
The load balancing method applied to the service server further comprises the following steps:
and when the load balancer is not local, modifying the sending address of the response message into the address of the load balancer.
When the service server changes the connection state, the synchronous 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 a 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 packaging the request message and sending the packaged request message to the service server.
The load balancing device also comprises a first connection module used for establishing connection with the client; when the connection established with the client comprises a plurality of request messages, the analyzing the request messages and determining the service 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.
The request message for encapsulating the client comprises: converting message formats, deleting repeated messages, and packaging extended information;
and 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 part which is the same as the extension information of the previous request message is not packaged when the request message of the client is packaged.
The extended information includes: and the service server analyzes and responds to the information required by the request message according to the related information contained in the protocol used for connecting the client.
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 server, the connection comprises one of IPC connection based on shared memory, Unix Socket, pipeline and shared memory;
when the service server is other servers in the cluster, the connection comprises one of UDP connection, TCP connection, RDMA and encryption tunnel.
The load balancing device further comprises:
the second receiving module is used for receiving the encapsulated 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 a 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, performs the steps of the load balancing method.
According to another aspect herein, there is provided a computer apparatus comprising a processor, a memory and a computer program stored on the memory, the processor implementing the steps of the 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 accurate scheduling is realized, meanwhile, the load of a network in a cluster can be reduced, and the bandwidth of internal communication of the cluster is reduced.
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 incorporated in and constitute a part of this specification, are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification. In the drawings:
fig. 1 is a flow diagram illustrating a method of load balancing according to an example embodiment.
Fig. 2 is a flow diagram illustrating a method of load balancing according to an example embodiment.
Fig. 3 is a schematic diagram of a hybrid deployment of a load balancer and a traffic server.
Fig. 4 is a schematic diagram of a load balancer as a gateway.
Fig. 5 is a block diagram illustrating a load balancing apparatus in accordance with an example embodiment.
Fig. 6 is a block diagram illustrating a load balancing apparatus in accordance with an example embodiment.
Fig. 7 is a block diagram illustrating a load balancing apparatus in accordance with an example embodiment.
Fig. 8 is a block diagram illustrating a load balancing apparatus in accordance with an example embodiment.
Fig. 9 is a block diagram illustrating a load balancing apparatus in accordance with an example embodiment.
Fig. 10 is a block diagram illustrating a load balancing apparatus in accordance with an example embodiment.
FIG. 11 is a block diagram illustrating a computer device in accordance with an example embodiment.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the drawings of the embodiments of the present invention, and it is obvious that the described embodiments are some but not all of the embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments herein without making any creative effort, shall fall within the scope of protection. It should be noted that the embodiments and features of the embodiments may be arbitrarily combined with each other without conflict.
Fig. 1 is a flow diagram illustrating a method of load balancing according to an example embodiment. Referring to fig. 1, the load balancing method is applied to a load balancer, and includes:
step S11, receiving a request message from the client. The message may be streaming media data carried on udp, http/https data on 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. And determining rules of the service server, and determining by integrating information such as client IP information, service server load, resource distribution and type of service request, configuration of a load balancer and the like, so as to realize accurate scheduling.
And step S13, packaging the request message of the client, and sending the packaged request message to the service server. And repackaging the request message of the client, deleting the repeated message and the useless message, and sending the message to the determined service server to reduce unnecessary bandwidth consumption as much as possible. Under special conditions, the message format is also converted according to the performance of the server. And simultaneously, the necessary information of the service server responding to the client request message is sent 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: and determining a service server based on the content of each request message in the plurality of request messages.
The load balancer determines a service server based on an earlier request message, and then re-analyzes the message content when processing the next request message, and re-determines the service server according to the message content and a preset load balancing rule, so that different service servers respond to requests of different contents of the client, and accurate scheduling is realized. For example, a video server is used for processing a video request of a client, and a download server is used for processing a download request of the client, so that accurate scheduling is realized, and the service quality is improved.
In an embodiment, encapsulating the request message of the client includes: converting message formats, deleting repeated messages, and packaging extended information; in order to further reduce consumption of bandwidth resources, when forwarding a request packet of a client, a load balancer packages the request packet first, for example, in order to enable a service server to smoothly respond to the request packet of the client, it is necessary to appropriately convert a packet format according to a specific configuration of the server, for example, convert a packet in an http/2 format into a packet in an http/1.1 format. In the process of encapsulating the request message of the client, some 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 correctly analyze the request of the client and correctly respond, when the request message of the client is encapsulated, information such as the address of the client and an encrypted tunnel established with the client is also encapsulated as extension information. In this embodiment, only necessary information required by the service server to analyze and respond to the client request packet is encapsulated, thereby further reducing consumption of bandwidth resources.
The extension information includes: and the service server analyzes and responds to the information required by the request message according to the related information contained in the protocol used for connecting the client. The related information contained in the protocol used for connection with the client may 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 a TLS encrypted tunnel established by the load balancer and the client when the request message of the client is an https message. The information required for the service server to parse and respond to the request message may be client address information or other information. Through the extension information, the service server can smoothly analyze the request message of the client and correctly respond to the request message, for example, the load balancer encapsulates the key negotiated with the client and the client address information in the https handshake process into the 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 client address. 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 between 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 a service server determined based on a certain request message is the same as a service server determined based on an adjacent previous request message, the request message of the client is packaged, and the part same as the extension 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, the load balancer only encapsulates the necessary request messages when encapsulating the request messages, and does not repeatedly encapsulate the extension information. Further reducing consumption of bandwidth resources.
In an embodiment, the load balancing method further includes: establishing connection with a service server; when the service server is a local machine, the connection with the service server comprises one of local machine 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 document is not limited.
When the service server is other servers in the cluster, the connection with the service server includes one of UDP connection, TCP connection, RDMA, and encryption tunnel. Other possible communication methods are also possible, and are not limited herein.
The connection between the load balancer and the service server is used for forwarding client request messages and synchronization states, UDP connection, TCP connection or encryption tunnel connection and the like can be selected according to needs, and the connection does not depend on the message transmission mode of the client and the load balancer. And different transmission modes can be selected according to the conditions of co-machine deployment, network connection modes, network connection distance and the like between the service server and the load balancer.
Fig. 2 is a flow diagram illustrating a method of load balancing according to an example 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;
and step S22, processing the packaged request message, generating a response message and sending the response message to the client.
In this embodiment, the response packet 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 that resource consumption of the load balancer is reduced.
The service servers and the load balancer can be deployed on the same server to realize mixed deployment, namely, in a cluster, each server deploys the load balancer and the service servers. Or may be deployed separately from the load balancer, which acts as a gateway.
When the service server and the load balancer are deployed in the same manner, for example, the service server and the load balancer establish a connection, where the connection includes one of an IPC connection based on a shared memory, a Unix Socket, a pipeline, and a shared memory, and of course, other types of connection manners are also included, which is not limited herein. The service server can directly respond to the client request. When the traffic server is deployed separately from the load balancer, the connection includes one of UDP connection, TCP connection, RDMA, and encryption tunnel, and of course, other types of connection manners are also included, which is not limited herein. In order for the client to correctly receive the response packet, when the service server sends the response packet, the service server also needs to modify the sending address of the response packet to the address of the load balancer.
When the service server changes the connection state, the synchronous information is sent to the load balancer. For example, after the server responds to the request of the client, the server will disconnect from the client, and after the service server and the client disconnect, the service server will send synchronization information to the load balancer, so that the load balancer sends the request of the next client to the service server.
To better understand the load balancing method herein, the following is illustrated:
embodiment 1, fig. 3 is a schematic diagram of a hybrid deployment of a load balancer and a traffic server. Referring to fig. 3, the load balancer receives a request packet from a client, parses the request packet from 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 request a and 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 resolves different requests of the same client to different traffic servers. For the service server A, as the service server A and the load balancer are the same server, the client request A packaged by the load balancer can be received in a memory sharing mode, the request A is responded, and the response message is directly sent to the client. For the service server B, the relative load balancer is another server in the cluster, so the load balancer needs to establish a connection with the service server B first to forward the encapsulated request message and the synchronization message. And the service server B analyzes the encapsulated 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 as a gateway. Referring to fig. 4, the load balancer receives a request packet from a client, establishes a connection with the client, parses the request packet from the client, and determines a service server according to a load balancing rule. For example, the request of the client is an HTTPS request, and the load balancer handshakes with the client and negotiates an encryption key. The load balancer analyzes the request of the client, wherein the request comprises 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. Therefore, the load balancer resolves different requests of the same client to different service servers, in order to reduce bandwidth consumption, the load balancer packages a request message of the client, removes a repeat message, and sends a message of the request A, 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 after an ACK message is handshake with the client, and sends a message of the request B, encryption information, a client address, a load balancer address and other information necessary for responding to the request B to the service server B. 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.
By the above embodiments, with the load balancing method in the present disclosure, the load balancer only needs to undertake the parsing and forwarding of the incoming packet, and does not need to undertake the content of the output, thereby reducing the bandwidth forwarding once, and significantly reducing the bandwidth consumption in the cluster in the CDN scenario. The method realizes accurate load balance aiming at the messages with more than 4 layers, and can realize load balance based on contents for the encrypted flow. Meanwhile, the respective balancing of different requests in a single request can be realized for long connections.
Fig. 5 is a block diagram illustrating a load balancing apparatus in accordance with 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 a load balancing rule.
The forwarding module 503 is configured to encapsulate the request packet of the client, and send the encapsulated request packet to the service server.
Fig. 6 is a block diagram illustrating a load balancing apparatus in accordance with an example embodiment. Referring to fig. 6, the load balancing apparatus further includes a first connection module 601, where the first connection module 601 is configured to establish a connection with the client; when the connection established with the client comprises a plurality of request messages, analyzing the request messages and determining a service server according to a 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. (ii) a
The request message for packaging the client comprises the following steps: and converting the format of the message, deleting the repeated message and packaging the extended information.
When a service server determined based on a certain request message is the same as a service server determined based on an adjacent previous request message, the request message of the client is packaged, and the part same as the extension 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 according to the related information contained in the protocol used for connecting the client.
Fig. 7 is a block diagram illustrating a load balancing apparatus in accordance with 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 to establish a connection with a service server.
When the service server is a local server, the connection comprises one of IPC connection based on shared memory, Unix Socket, pipeline and shared memory;
when the service server is other servers in the cluster, the connection is one of UDP connection, TCP connection, RDMA and encryption tunnel.
Fig. 8 is a block diagram illustrating a load balancing apparatus in accordance with an example embodiment. Referring to fig. 8, the load balancing apparatus applied to the traffic server includes: a second receiving module 801 and a response module 802.
The second receiving module 801 is configured to receive an encapsulated request packet sent by a load balancer.
The response module 802 is configured to process the encapsulated request packet, generate a response packet, and send the response packet to the client.
Fig. 9 is a block diagram illustrating a load balancing apparatus in accordance with an example embodiment. Referring to fig. 9, the load balancing apparatus further includes: an address change module 901.
The address change module 901 is configured to modify the sending address of the response packet 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 in accordance with an example embodiment. Referring to fig. 10, the load balancing apparatus further includes: an information synchronization module 1001.
The information synchronization module is configured to send synchronization information to the load balancer when the traffic server changes the connection state.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 11 is a block diagram illustrating a computer device 1100 in accordance with an example embodiment. For example, the computer device 1100 may be provided as a server. Referring to fig. 11, the computer apparatus 1100 includes a processor 1101, and the number of processors may be set to one or more as necessary. The computer device 1100 also includes a memory 1102 for storing instructions, such as an application program, that are executable by the processor 1101. The number of the memories can be set to one or more according to needs. Which may store one or more application programs. The processor 1101 is configured to execute instructions to perform the method of load balancing described above.
As will be appreciated by one skilled in the art, the 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 in the medium. 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 Disks (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 the computer, and the like. In addition, 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 as known to those skilled in the art.
The present disclosure is described 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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 additional like elements in the article or device comprising the element.
While the preferred embodiments herein have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following appended claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of this disclosure.
It will be apparent to those skilled in the art that various changes and modifications may be made herein without departing from the spirit and scope thereof. Thus, it is intended that such changes and modifications be included herein, provided they come within the scope of the appended claims and their equivalents.

Claims (16)

1. A load balancing method is applied to a load balancer and is characterized by comprising the following steps:
receiving a request message of a client;
analyzing the request message and determining a service server according to a load balancing rule;
and packaging the request message, and sending the packaged request message to the service server.
2. The load balancing method according to claim 1, wherein the load balancing method further comprises establishing a connection with the client, and when the connection established with the client includes 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 method of load balancing according to claim 2,
the request message for encapsulating the client comprises: converting message formats, deleting repeated messages, and packaging extended information;
and 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 part which is the same as the extension information of the previous request message is not packaged when the request message of the client is packaged.
The extended information includes: and the service server analyzes and responds to the information required by the request message according to the related information contained in the protocol used for connecting the client.
4. The load balancing method of claim 1, further comprising:
establishing connection with the service server;
when the service server is a local server, the connection comprises one of IPC connection based on shared memory, Unix Socket, pipeline and shared memory;
when the service server is other servers in the cluster, the connection comprises one of UDP connection, TCP connection, RDMA and encryption tunnel.
5. A load balancing method is applied to a service server, and is characterized by comprising the following steps:
receiving a packaged request message sent by a load balancer;
and processing the encapsulated request message, generating a response message and sending the response message to the client.
6. The method of load balancing according to claim 5, further comprising:
and when the load balancer is not local, modifying the sending address of the response message into the address of the load balancer.
7. The method of load balancing according to claim 5, further comprising:
when the service server changes the connection state, the synchronous information is sent to the load balancer.
8. A load balancing device applied to a load balancer is characterized by comprising:
the first receiving module is used for receiving a request message of a 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 packaging the request message and sending the packaged request message to the service server.
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 comprises a plurality of request messages, the analyzing the request messages and determining the service 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.
10. The load balancing apparatus according to claim 8, wherein the encapsulating the request packet of the client comprises: converting message formats, deleting repeated messages, and packaging extended information;
and 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 part which is the same as the extension information of the previous request message is not packaged when the request message of the client is packaged.
The extended information includes: and the service server analyzes and responds to the information required by the request message according to the related information contained in the protocol used for connecting the client.
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 server, the connection comprises one of IPC connection based on shared memory, Unix Socket, pipeline and shared memory;
when the service server is other servers in the cluster, the connection comprises one of UDP connection, TCP connection, RDMA and encryption tunnel.
12. A load balancing device applied to a service server is characterized by comprising:
the second receiving module is used for receiving the encapsulated 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.
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 a 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 arrangement comprising a processor, a memory and a computer program stored on the memory, characterized in that the steps of the method according to any of claims 1-7 are implemented when the computer program is executed by the processor.
CN201911050572.XA 2019-10-31 2019-10-31 Load balancing method, device, medium and equipment Pending CN112751898A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201911050572.XA CN112751898A (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 CN112751898A (en) 2019-10-31 2019-10-31 Load balancing method, device, medium and equipment

Publications (1)

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

Family

ID=75641287

Family Applications (1)

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

Country Status (2)

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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114710496A (en) * 2022-04-24 2022-07-05 中国工商银行股份有限公司 Multi-node load balancing method and device

Families Citing this family (4)

* 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
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

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 (4)

* 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
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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114710496A (en) * 2022-04-24 2022-07-05 中国工商银行股份有限公司 Multi-node load balancing method and device

Also Published As

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

Similar Documents

Publication Publication Date Title
CN112751898A (en) Load balancing method, device, medium and equipment
CN110198363B (en) Method, device and system for selecting mobile edge computing node
CN109412946B (en) Method, device, server and readable storage medium for determining back source path
Jin et al. CoDaaS: An experimental cloud-centric content delivery platform for user-generated contents
EP3735768B1 (en) Improving qoe for video and web services using cross-layer information
CN112751897B (en) Load balancing method, device, medium and equipment
WO2023151264A1 (en) Load balancing method and apparatus, node, and storage medium
JP2020517132A (en) Method, apparatus and system for implementing policy control
CN112653656B (en) Data communication method and device based on application layer protocol
US20220164453A1 (en) Network based media processing security
US11671410B2 (en) Providing enrichment information using hypertext transfer protocol secure (HTTPS)
CN113301000B (en) Data transmission method, device, medium and equipment
US9288225B1 (en) Server port sharing based on shared socket
CN108064441B (en) Method and system for accelerating network transmission optimization
CN115695523A (en) Data transmission control method and device, electronic equipment and storage medium
CN109067922A (en) A kind of data transmission method and device
CN112653716B (en) Service binding method and device
CN114125080A (en) Message link terminal protocol stack construction method and analysis method, device and terminal
CN114205185B (en) Proxy method and device for control message
US11595708B2 (en) Method for determining a play duration estimate of an adaptive bit rate media presentation
CN107196984A (en) A kind of sharing method of metadata, metadata sources equipment and network intermediary device
US11108592B2 (en) Systems and methods for implementing a layer two proxy for wireless network data
CN116963021A (en) Data acquisition method, device, communication equipment and readable storage medium
CN115442784A (en) Communication method, device and equipment of Bluetooth equipment
CN116112261A (en) Gatekeeper penetration method, gatekeeper penetration system, MQTT client, MQTT server and electronic 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