CN111371825A - Load balancing method, device and equipment based on HTTP2.0 protocol - Google Patents

Load balancing method, device and equipment based on HTTP2.0 protocol Download PDF

Info

Publication number
CN111371825A
CN111371825A CN201811603261.7A CN201811603261A CN111371825A CN 111371825 A CN111371825 A CN 111371825A CN 201811603261 A CN201811603261 A CN 201811603261A CN 111371825 A CN111371825 A CN 111371825A
Authority
CN
China
Prior art keywords
server
connection
registration
load balancing
client
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
CN201811603261.7A
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.)
Ubtech Robotics Corp
Original Assignee
Ubtech Robotics Corp
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 Ubtech Robotics Corp filed Critical Ubtech Robotics Corp
Priority to CN201811603261.7A priority Critical patent/CN111371825A/en
Publication of CN111371825A publication Critical patent/CN111371825A/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
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • 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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Abstract

A load balancing method based on HTTP2.0 protocol comprises the following steps: when the HTTP2.0 server is started, registering an HTTP2.0 server access address to the registration server, and updating the connection number to the registration server when the connection number changes; the client sends an HTTP2.0 server access request to the registration server, and the registration server returns the registered HTTP2.0 server access address to the client according to the updated connection number of the HTTP2.0 server; and the client establishes HTTP2.0 connection with the HTTP2.0 server according to the returned HTTP2.0 server access address. Because the registration server can return the real HTTP2.0 server access address according to the load balancing strategy, the HTTP2.0 connection is directly established with the HTTP2.0 server, the advantages of the HTTP2.0 connection can be effectively utilized, the number of the HTTP2.0 connections can be reduced, and the network performance can be improved.

Description

Load balancing method, device and equipment based on HTTP2.0 protocol
Technical Field
The application belongs to the field of internet, and particularly relates to a load balancing method, device and equipment based on an HTTP2.0 protocol.
Background
The purpose of the HTTP2.0 protocol is to reduce latency by supporting multiplexing of requests and responses, reduce protocol overhead by compressing HTTPs header fields, while increasing request priority and server-side push support. The HTTP2.0 protocol enables a client to establish a long connection with a server, and any number of bidirectional data streams are carried over one connection in a binary framing manner, thereby avoiding the need for HTTP1 to reestablish a connection between the client and the server every time the client requests.
Currently, load balancing of HTTP2.0 requests is usually implemented by using a nginx reverse proxy method, and there are two general methods for this reverse proxy method to proxy a backend server:
in the mode 1, HTTP2.0 connection communication is established between a client and a proxy server, and the degradation between the proxy server and a back-end server is HTTP 1.1;
in the mode 2, HTTP2.0 connection communication is established between the customer service side and the proxy server, and HTTP2.0 connection is established between the proxy server and the back-end server.
In the mode 1, the proxy server and the backend server are degraded to HTTP1.1, so that the advantage of using HTTP2.0 is not effectively embodied, and in the mode 2, an extra connection number which is twice as many as the number of connections needs to be established and maintained, which is not beneficial to improving the network performance.
Disclosure of Invention
In view of this, embodiments of the present application provide a load balancing method, an apparatus, and a device based on an HTTP2.0 protocol, so as to solve the problem that the load balancing method in the prior art cannot embody the advantage of the HTTP2.0, or needs to establish and maintain twice as many connections, which is not beneficial to improving network performance.
A first aspect of an embodiment of the present application provides a load balancing method based on an HTTP2.0 protocol, where the load balancing method based on the HTTP2.0 protocol includes:
when the HTTP2.0 server is started, registering an HTTP2.0 server access address to the registration server, and updating the connection number to the registration server when the connection number changes;
the client sends an HTTP2.0 server access request to the registration server, and the registration server returns the registered HTTP2.0 server access address to the client according to the updated connection number of the HTTP2.0 server;
and the client establishes HTTP2.0 connection with the HTTP2.0 server according to the returned HTTP2.0 server access address.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the updating, when the number of connections changes, the number of connections to the registration server includes:
when the HTTP2.0 server establishes HTTP2.0 connection with the client or disconnects HTTP2.0 connection, the updated connection number of the HTTP2.0 server is sent to the registration server;
when the HTTP2.0 server is turned off, the server access address is revoked from the registration server.
In a second aspect, an embodiment of the present application provides a load balancing method based on an HTTP2.0 protocol, which is applied to a client, where the load balancing method based on the HTTP2.0 protocol includes:
sending an access request to a registration server, so that the registration server searches an HTTP2.0 server access address meeting a load balancing strategy according to the registered HTTP2.0 server and the number of connections of the registered HTTP2.0 server;
receiving an HTTP2.0 server access address returned by a registration server;
and establishing HTTP2.0 connection with an HTTP2.0 server according to the HTTP2.0 server access address.
With reference to the second aspect, in a first possible implementation manner of the second aspect, the method further includes:
and when the HTTP2.0 connection establishment with the HTTP2.0 server is unsuccessful or the HTTP2.0 connection with the HTTP2.0 server fails, the access request is sent to the registration server again.
In a third aspect, an embodiment of the present application provides a load balancing method based on an HTTP2.0 protocol, which is applied to an HTTP2.0 server, and the load balancing method based on the HTTP2.0 protocol includes:
when the HTTP2.0 server is started, registering an HTTP2.0 server access address to the registration server, and updating the connection number to the registration server when the connection number changes, so that when the registration server receives an access request of a client, the HTTP2.0 server access address is returned to the client according to the updated connection number and a load balancing strategy;
and receiving an access request initiated by the client, and establishing an HTTP2.0 connection with the client.
With reference to the third aspect, in a first possible implementation manner of the third aspect, the step of updating, when the number of connections changes, the number of connections to the registration server includes:
when the HTTP2.0 server establishes HTTP2.0 connection with the client or disconnects HTTP2.0 connection, the updated connection number of the HTTP2.0 server is sent to the registration server;
when the HTTP2.0 server is turned off, the server access address is revoked from the registration server.
In a fourth aspect, an embodiment of the present application provides a load balancing method based on an HTTP2.0 protocol, which is applied to a registration server, where the load balancing method based on the HTTP2.0 protocol includes:
receiving a registration request of an HTTP2.0 server, storing an HTTP2.0 server access address, and updating the connection number of the HTTP2.0 server;
and receiving an access request of the client, and returning an HTTP2.0 server access address to the client according to the updated connection number of the HTTP2.0 server, so that the client establishes an HTTP2.0 connection with the HTTP2.0 server according to the HTTP2.0 server access address.
A fifth aspect of an embodiment of the present application provides a load balancing apparatus based on an HTTP2.0 protocol, where the load balancing apparatus based on the HTTP2.0 protocol includes:
a registration updating unit for registering an HTTP2.0 server access address with the registration server when the HTTP2.0 server is started, and updating the connection number with the registration server when the connection number changes;
an address returning unit, configured to, when the client sends an HTTP2.0 server access request to the registration server, return, by the registration server, the registered HTTP2.0 server access address to the client according to the updated connection number of the HTTP2.0 server;
and the connection establishing unit is used for establishing HTTP2.0 connection with the HTTP2.0 server by the client according to the returned HTTP2.0 server access address.
A sixth aspect of the embodiments of the present application provides a network device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor, when executing the computer program, implements the steps of the HTTP2.0 protocol-based load balancing method according to any one of the first to fourth aspects.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the HTTP2.0 protocol-based load balancing method according to any one of the first to fourth aspects.
Compared with the prior art, the embodiment of the application has the advantages that: according to the method and the device, the HTTP2.0 server access address is registered to the registration server, and the connection number of the HTTP2.0 server is updated in real time, so that when the client needs to access the HTTP2.0 server, the registration server can return the real HTTP2.0 server access address according to a load balancing strategy, and then the HTTP2.0 connection is directly established with the HTTP2.0 server, so that the advantages of HTTP2.0 connection can be effectively utilized, the number of HTTP2.0 connections can be reduced, and the network performance is favorably improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flow chart of an implementation of a load balancing method based on the HTTP2.0 protocol according to an embodiment of the present application;
fig. 2 is a schematic diagram of a system architecture for load balancing based on the HTTP2.0 protocol according to an embodiment of the present application;
fig. 3 is a schematic diagram of a load balancing apparatus based on the HTTP2.0 protocol according to an embodiment of the present application;
fig. 4 is a schematic diagram of a network device provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Fig. 1 is a schematic flow chart of an implementation of a load balancing method based on the HTTP2.0 protocol according to an embodiment of the present application, which is detailed as follows:
in step S101, when the HTTP2.0 server is started, registering an HTTP2.0 server access address with the registration server, and updating the connection number with the registration server when the connection number changes;
specifically, the HTTP2.0 server described in the embodiment of the present application, that is, the content server for which the client needs to establish the HTTP2.0 connection. A registration task may be set in the start item, and when the HTTP2.0 server starts, the HTTP2.0 server automatically completes registering with the registration server.
The step of registering the HTTP2.0 server access address with the registration server may specifically be:
when the HTTP2.0 server is started, the access address of the local HTTP2.0 server and the identifier of the server are obtained, the server identifier and the access address of the local HTTP2.0 server, namely the access address of the HTTP2.0 server, are sent to a registration server, and the registration server registers the access address of the HTTP2.0 server corresponding to the server identifier.
The server identifier may be a name of the HTTP2.0 server, or may also be an identifier such as a MAC address of the HTTP2.0 server.
And after receiving the registration request of the HTTP2.0 server, the registration server stores the corresponding relation between the server identification and the HTTP2.0 server access address. When the registration server detects that the HTTP2.0 server is closed, or receives a closing request sent by the HTTP2.0 server, or establishes the HTTP2.0 server closing fed back by HTTP2.0 connection according to the HTTP2.0 server access address returned by the registration server at the client, the service of the HTTP2.0 server can be cancelled at the registration server, and the corresponding relation between the mark of the HTTP2.0 server and the HTTP2.0 server access address is deleted.
In the application, the HTTP2.0 server may establish an HTTP2.0 connection between the HTTP2.0 server and the client according to an HTTP2.0 server access address acquired by the client, and in order to effectively achieve load balancing, when the number of connections between the HTTP2.0 server and the client changes, the change information is updated to the registration server, so that the registration server can acquire state data of the number of connections of the HTTP2.0 server, but when the client initiates an access request to the HTTP2.0 server to the registration server, the HTTP2.0 server access address required to be sent to the client may be effectively determined according to a load balancing policy.
In step S102, the client sends an HTTP2.0 server access request to the registration server, and the registration server returns the registered HTTP2.0 server access address to the client according to the updated number of connections of the HTTP2.0 server;
the access address of the registration server may be pre-stored in the client, and the client establishes a connection with the registration server through a general communication protocol, such as HTTP1, and sends a request for finding the access address of the HTTP2.0 server to the registration server. The registration server may select, for example, an HTTP2.0 server access address with a smaller number of connections to send to the client according to the currently stored number of connections established between the HTTP2.0 server and other clients and according to a load balancing policy.
In this step, the updating, by the registration server, the connection number of the HTTP2.0 server may include the following steps:
when the HTTP2.0 server is disconnected from the HTTP2.0 of the client, the disconnected connection information may be sent to the registration server, and the registration server may determine the current valid connection number of the HTTP2.0 server according to the disconnected connection information.
When the HTTP2.0 server establishes a new HTTP2.0 connection with the client, the newly created connection information may be sent to the registration server, and the registration server determines the current effective connection number of the HTTP2.0 server according to the newly created connection information.
Of course, the HTTP2.0 server may also count the number of changed connections when the number of connections changes, and send the counted number of connections to the registration server, and the registration server updates the number of connections directly according to the statistical result.
In addition, in the present application, when the HTTP2.0 server is closed, the state of the HTTP2.0 server in the registration server may be updated in different manners according to the type of the closing.
When the HTTP2.0 server is normally closed, a closing request may be sent to the registration server to request to cancel information such as the HTTP2.0 server access address and the HTTP2.0 server connection number stored in the registration server.
When the HTTP2.0 server is abnormally closed and a registration server receives an access request of a client, an HTTP2.0 server access address is sent to the client according to a load balancing strategy, when the client establishes an HTTP2.0 connection request according to the HTTP2.0 server access address, a connection failure result is returned, the HTTP2.0 server is determined to be closed according to the returned result, the detection result can be sent to the registration server, and the registration server registers information such as the connection number and the access address of the HTTP2.0 server.
In step S103, the client establishes an HTTP2.0 connection with the HTTP2.0 server according to the returned HTTP2.0 server access address.
And the client initiates a request for establishing the HTTP2.0 connection to the HTTP2.0 server access address after receiving the HTTP2.0 server access address returned by the registration server. If the HTTP2.0 server access address is valid, an HTTP2.0 connection of the client with the HTTP2.0 server can be established. And because the registration server considers the number of connections of the HTTP2.0 server when allocating the address, and the HTTP2.0 server access address is analyzed according to the load balancing strategy, a proper HTTP2.0 server can be effectively selected to establish the connection.
In the application, the interaction between the HTTP2.0 server and the registration server, and the interaction between the client and the registration server may be established through a single request, for example, the HTTP1 protocol may be used to establish a connection, and it is not necessary to consume a large amount of system resources to maintain the established connection.
According to the method and the device, the HTTP2.0 server access address is registered to the registration server, and the connection number of the HTTP2.0 server is updated in real time, so that when the client needs to access the HTTP2.0 server, the registration server can return the real HTTP2.0 server access address according to a load balancing strategy, and then the HTTP2.0 connection is directly established with the HTTP2.0 server, so that the advantages of HTTP2.0 connection can be effectively utilized, the number of HTTP2.0 connections can be reduced, and the network performance is favorably improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 2 is a schematic structural diagram of a load balancing system based on the HTTP2.0 protocol according to an embodiment of the present application, and as shown in fig. 2, the system includes a server cluster formed by a plurality of HTTP2.0 servers, a client for accessing data in the HTTP2.0 servers, and a registration center formed by a registration server for providing a real and effective HTTP2.0 server access address for the client. The following description is made in conjunction with the system workflow:
1. when the HTTP2.0 server is started, the HTTP2.0 server registers an access address to a registration center, namely a registration server;
2. before establishing the connection between the client and the HTTP2.0 server, the client firstly sends a request to a service registration center to request to acquire a real HTTP2.0 server access address;
3. the method comprises the following steps that a registry, namely a registration server returns a real HTTP2.0 server access address to a client according to a load balancing strategy, wherein the load balancing strategy can select an HTTP2.0 server with a small number of connections according to the number of connections of the HTTP2.0 server;
4. after obtaining a real HTTP2.0 server access address, the client interacts with the HTTP2.0 server access address to request to establish HTTP2.0 connection;
5. after the client establishes connection with the HTTP2.0 server, the HTTP2.0 server can update the connection number of the HTTP2.0 server to the service registration center;
6. after the client is disconnected from the HTTP2.0 server, the HTTP2.0 server updates the connection number of the HTTP2.0 server to the registration center;
7. after the HTTP2.0 server is closed, the HTTP2.0 server can log out the access address from the registration center. Of course, the access address can also be logged off to the registry by the client.
The HTTP2.0 protocol-based load balancing system shown in fig. 2 corresponds to the HTTP2.0 protocol-based load balancing method shown in fig. 1.
Fig. 3 is a schematic structural diagram of a load balancing apparatus based on the HTTP2.0 protocol according to an embodiment of the present application, where the load balancing apparatus based on the HTTP2.0 protocol includes:
a registration update unit 301 configured to register an HTTP2.0 server access address with the registration server when the HTTP2.0 server is started, and update the connection number with the registration server when the connection number changes;
an address returning unit 302, configured to, when the client sends an HTTP2.0 server access request to the registration server, return, by the registration server, the registered HTTP2.0 server access address to the client according to the updated connection number of the HTTP2.0 server;
and a connection establishing unit 303, configured to establish, by the client, an HTTP2.0 connection with the HTTP2.0 server according to the returned HTTP2.0 server access address.
Of course, the present application may also use the client, the registration server, and the HTTP2.0 server as description touch to determine a plurality of corresponding load balancing apparatuses based on the HTTP2.0 protocol, such as:
the HTTP2.0 protocol-based load balancing apparatus may include:
the system comprises a first request module, a second request module and a third request module, wherein the first request module is used for sending an access request to a registration server so that the registration server searches an HTTP2.0 server access address meeting a load balancing strategy according to a registered HTTP2.0 server and the number of connections of the registered HTTP2.0 server;
the first address returning module is used for receiving the HTTP2.0 server access address returned by the registration server;
and the first connection module is used for establishing HTTP2.0 connection with the HTTP2.0 server according to the HTTP2.0 server access address.
Alternatively, the load balancing method based on the HTTP2.0 protocol may include:
the registration module is used for registering an HTTP2.0 server access address to the registration server when the HTTP2.0 server is started, and updating the connection number to the registration server when the connection number changes, so that the registration server returns the HTTP2.0 server access address to the client according to the updated connection number and the load balancing strategy when receiving an access request of the client;
and the second connection module is used for receiving an access request initiated by the client and establishing HTTP2.0 connection with the client.
Alternatively, the load balancing method based on the HTTP2.0 protocol may include:
the second request module is used for receiving a registration request of the HTTP2.0 server, storing an HTTP2.0 server access address and updating the connection number of the HTTP2.0 server;
and the second address returning module is used for receiving an access request of the client and returning an HTTP2.0 server access address to the client according to the updated connection number of the HTTP2.0 server, so that the client establishes an HTTP2.0 connection with the HTTP2.0 server according to the HTTP2.0 server access address.
Fig. 4 is a schematic diagram of a network device according to an embodiment of the present application. As shown in fig. 4, the network device 4 of this embodiment includes: a processor 40, a memory 41 and a computer program 42 stored in said memory 41 and executable on said processor 40, such as a load balancing program based on the HTTP2.0 protocol. The processor 40 implements the steps in each of the above embodiments of the HTTP2.0 protocol-based load balancing method when executing the computer program 42. Alternatively, the processor 40 implements the functions of the modules/units in the above-described device embodiments when executing the computer program 42.
Illustratively, the computer program 42 may be partitioned into one or more modules/units that are stored in the memory 41 and executed by the processor 40 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 42 in the network device 4. For example, the computer program 42 may be divided into:
a registration updating unit for registering an HTTP2.0 server access address with the registration server when the HTTP2.0 server is started, and updating the connection number with the registration server when the connection number changes;
an address returning unit, configured to, when the client sends an HTTP2.0 server access request to the registration server, return, by the registration server, the registered HTTP2.0 server access address to the client according to the updated connection number of the HTTP2.0 server;
and the connection establishing unit is used for establishing HTTP2.0 connection with the HTTP2.0 server by the client according to the returned HTTP2.0 server access address.
Or the load balancing device can be divided into modules corresponding to the load balancing devices based on the HTTP2.0 protocol respectively positioned at the client, the HTTP2.0 server or the registration server.
The network device may include, but is not limited to, a processor 40, a memory 41. Those skilled in the art will appreciate that fig. 4 is merely an example of a network device 4 and does not constitute a limitation of network device 4 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the network device may also include input-output devices, network access devices, buses, etc.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 41 may be an internal storage unit of the network device 4, such as a hard disk or a memory of the network device 4. The memory 41 may also be an external storage device of the network device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the network device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the network device 4. The memory 41 is used for storing the computer program and other programs and data required by the network device. The memory 41 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. . Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A load balancing method based on HTTP2.0 protocol is characterized in that the load balancing method based on HTTP2.0 protocol comprises the following steps:
when the HTTP2.0 server is started, registering an HTTP2.0 server access address to the registration server, and updating the connection number to the registration server when the connection number changes;
the client sends an HTTP2.0 server access request to the registration server, and the registration server returns the registered HTTP2.0 server access address to the client according to the updated connection number of the HTTP2.0 server;
and the client establishes HTTP2.0 connection with the HTTP2.0 server according to the returned HTTP2.0 server access address.
2. The HTTP2.0 protocol based load balancing method as recited in claim 1, wherein the step of updating the number of connections to the registration server when the number of connections changes comprises:
when the HTTP2.0 server establishes HTTP2.0 connection with the client or disconnects HTTP2.0 connection, the updated connection number of the HTTP2.0 server is sent to the registration server;
when the HTTP2.0 server is turned off, the server access address is revoked from the registration server.
3. A load balancing method based on HTTP2.0 protocol is applied to a client, and is characterized in that the load balancing method based on HTTP2.0 protocol comprises the following steps:
sending an access request to a registration server, so that the registration server searches an HTTP2.0 server access address meeting a load balancing strategy according to the registered HTTP2.0 server and the number of connections of the registered HTTP2.0 server;
receiving an HTTP2.0 server access address returned by a registration server;
and establishing HTTP2.0 connection with an HTTP2.0 server according to the HTTP2.0 server access address.
4. The HTTP2.0 protocol based load balancing method of claim 3, further comprising:
and when the HTTP2.0 connection establishment with the HTTP2.0 server is unsuccessful or the HTTP2.0 connection with the HTTP2.0 server fails, the access request is sent to the registration server again.
5. A load balancing method based on HTTP2.0 protocol is applied to an HTTP2.0 server, and is characterized in that the load balancing method based on the HTTP2.0 protocol comprises the following steps:
when the HTTP2.0 server is started, registering an HTTP2.0 server access address to the registration server, and updating the connection number to the registration server when the connection number changes, so that when the registration server receives an access request of a client, the HTTP2.0 server access address is returned to the client according to the updated connection number and a load balancing strategy;
and receiving an access request initiated by the client, and establishing an HTTP2.0 connection with the client.
6. The HTTP2.0 protocol based load balancing method as recited in claim 5, wherein the step of updating the number of connections to the registration server when the number of connections changes comprises:
when the HTTP2.0 server establishes HTTP2.0 connection with the client or disconnects HTTP2.0 connection, the updated connection number of the HTTP2.0 server is sent to the registration server;
when the HTTP2.0 server is turned off, the server access address is revoked from the registration server.
7. A load balancing method based on HTTP2.0 protocol is applied to a registration server, and is characterized in that the load balancing method based on HTTP2.0 protocol comprises the following steps:
receiving a registration request of an HTTP2.0 server, storing an HTTP2.0 server access address, and updating the connection number of the HTTP2.0 server;
and receiving an access request of the client, and returning an HTTP2.0 server access address to the client according to the updated connection number of the HTTP2.0 server, so that the client establishes an HTTP2.0 connection with the HTTP2.0 server according to the HTTP2.0 server access address.
8. An HTTP2.0 protocol-based load balancing apparatus, wherein the HTTP2.0 protocol-based load balancing apparatus comprises:
a registration updating unit for registering an HTTP2.0 server access address with the registration server when the HTTP2.0 server is started, and updating the connection number with the registration server when the connection number changes;
an address returning unit, configured to, when the client sends an HTTP2.0 server access request to the registration server, return, by the registration server, the registered HTTP2.0 server access address to the client according to the updated connection number of the HTTP2.0 server;
and the connection establishing unit is used for establishing HTTP2.0 connection with the HTTP2.0 server by the client according to the returned HTTP2.0 server access address.
9. A network device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the HTTP2.0 protocol based load balancing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the HTTP2.0 protocol-based load balancing method according to one of claims 1 to 7.
CN201811603261.7A 2018-12-26 2018-12-26 Load balancing method, device and equipment based on HTTP2.0 protocol Pending CN111371825A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811603261.7A CN111371825A (en) 2018-12-26 2018-12-26 Load balancing method, device and equipment based on HTTP2.0 protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811603261.7A CN111371825A (en) 2018-12-26 2018-12-26 Load balancing method, device and equipment based on HTTP2.0 protocol

Publications (1)

Publication Number Publication Date
CN111371825A true CN111371825A (en) 2020-07-03

Family

ID=71212213

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811603261.7A Pending CN111371825A (en) 2018-12-26 2018-12-26 Load balancing method, device and equipment based on HTTP2.0 protocol

Country Status (1)

Country Link
CN (1) CN111371825A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114285857A (en) * 2021-12-31 2022-04-05 中企云链(北京)金融信息服务有限公司 Load balancing method, device and system
CN115134227A (en) * 2022-06-17 2022-09-30 京东科技信息技术有限公司 Method and apparatus for maintaining server

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101808118A (en) * 2010-03-02 2010-08-18 浪潮(北京)电子信息产业有限公司 Access method, device and system of server
CN103634382A (en) * 2013-11-20 2014-03-12 安徽科大讯飞信息科技股份有限公司 System and method for realizing real-time interaction in webpage
CN104580538A (en) * 2015-02-12 2015-04-29 山东大学 Method for improving load balance efficiency of Nginx server
US20150189010A1 (en) * 2013-12-30 2015-07-02 Alcatel-Lucent Canada Inc. Communication network with load balancing functionality
CN105101140A (en) * 2015-06-30 2015-11-25 北京奇虎科技有限公司 Traffic-saving method for visiting network, proxy server and network access system
CN105516221A (en) * 2014-09-24 2016-04-20 阿里巴巴集团控股有限公司 Information push system and method
CN105532013A (en) * 2013-07-12 2016-04-27 佳能株式会社 Adaptive data streaming method with push messages control

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101808118A (en) * 2010-03-02 2010-08-18 浪潮(北京)电子信息产业有限公司 Access method, device and system of server
CN105532013A (en) * 2013-07-12 2016-04-27 佳能株式会社 Adaptive data streaming method with push messages control
CN103634382A (en) * 2013-11-20 2014-03-12 安徽科大讯飞信息科技股份有限公司 System and method for realizing real-time interaction in webpage
US20150189010A1 (en) * 2013-12-30 2015-07-02 Alcatel-Lucent Canada Inc. Communication network with load balancing functionality
CN105516221A (en) * 2014-09-24 2016-04-20 阿里巴巴集团控股有限公司 Information push system and method
CN104580538A (en) * 2015-02-12 2015-04-29 山东大学 Method for improving load balance efficiency of Nginx server
CN105101140A (en) * 2015-06-30 2015-11-25 北京奇虎科技有限公司 Traffic-saving method for visiting network, proxy server and network access system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HTTP 长连接、短连接、长轮询、短轮询: "Http 长连接、短连接、长轮询、短轮询", 《百度HTTPS://WWW.JIANSHU.COM/P/22DABFEF3785》 *
张慧芳: "基于动态反馈的加权最小连接数服务器负载均衡算法研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114285857A (en) * 2021-12-31 2022-04-05 中企云链(北京)金融信息服务有限公司 Load balancing method, device and system
CN114285857B (en) * 2021-12-31 2024-01-26 中企云链(北京)金融信息服务有限公司 Load balancing method, device and system
CN115134227A (en) * 2022-06-17 2022-09-30 京东科技信息技术有限公司 Method and apparatus for maintaining server

Similar Documents

Publication Publication Date Title
US10912018B2 (en) PDU type setting method, UE policy setting method, and related entity
CN110311983B (en) Service request processing method, device and system, electronic equipment and storage medium
CN111163130B (en) Network service system and data transmission method thereof
US20090119388A1 (en) Content relaying device and content relaying method
US8977758B2 (en) Service bus system, service bus device, and method for assuring connection uniqueness
EP2633667A2 (en) System and method for on the fly protocol conversion in obtaining policy enforcement information
CN113472817B (en) Gateway access method and device for large-scale IPSec and electronic equipment
US11025738B2 (en) Systems and methods for determining a destination location for transmission of packetized data in a network system based on an application server attribute
US20140122723A1 (en) Dynamic registration of listener resources for cloud services
CN113127168A (en) Service distribution method, system, device, server and medium
EP2783498A1 (en) Content distribution through blind-cache instantiation
CN109995738A (en) A kind of access control method, gateway and cloud server
CN111638891A (en) Equipment upgrading method and device, terminal equipment and storage medium
CN111371825A (en) Load balancing method, device and equipment based on HTTP2.0 protocol
CN110704158A (en) Method, apparatus and storage medium for forwarding access requests within a container cluster
US20150006622A1 (en) Web contents transmission method and apparatus
CN112565334A (en) Access method and device of Internet of things equipment and MQTT gateway
CN110545230B (en) Method and device for forwarding VXLAN message
CN117042115A (en) Network node, terminal device and method therein for edge application
CN111404975A (en) Message transmission method, device, equipment and computer storage medium
CN101753561B (en) Business cluster processing method and cluster system
CN110572476A (en) Remote control method, device and equipment
CN105871972A (en) Video resource distributed cathe method, device and system
CN113055254B (en) Address configuration method, device, access server and storage medium
CN113553206A (en) Data event execution method and device, electronic equipment and computer readable medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200703

RJ01 Rejection of invention patent application after publication