CN110990146A - Load balancing method, device, system and storage medium - Google Patents

Load balancing method, device, system and storage medium Download PDF

Info

Publication number
CN110990146A
CN110990146A CN201911061545.2A CN201911061545A CN110990146A CN 110990146 A CN110990146 A CN 110990146A CN 201911061545 A CN201911061545 A CN 201911061545A CN 110990146 A CN110990146 A CN 110990146A
Authority
CN
China
Prior art keywords
information
requested
target
server
load balancing
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
CN201911061545.2A
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.)
Beijing Infosec Technologies Co Ltd
Original Assignee
Beijing Infosec Technologies 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 Beijing Infosec Technologies Co Ltd filed Critical Beijing Infosec Technologies Co Ltd
Priority to CN201911061545.2A priority Critical patent/CN110990146A/en
Publication of CN110990146A publication Critical patent/CN110990146A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Abstract

The embodiment of the application provides a load balancing method, equipment, a system and a storage medium. In the embodiment of the application, different types of information are stored in different servers. Therefore, the load balancing device can generate a plurality of target request messages at least containing the identification of one type of information to be requested according to the identifications of a plurality of types of information to be requested contained in the original request message and the storage relation between the various types of information and the server, and obtain various types of information to be requested from a plurality of servers through the plurality of target request messages. According to the embodiment of the application, load balance can be realized among the servers, and each server does not need to store all kinds of information, so that the storage space can be saved, and the utilization rate of storage resources of the servers can be improved.

Description

Load balancing method, device, system and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a load balancing method, device, system, and storage medium.
Background
If only one server needs to process various data sent by hundreds of millions of clients, the performance of the server is greatly reduced, and slow running speed and even breakdown are possible. In order to relieve the pressure of a single server, load balancing technology is developed.
The existing load balancing is that a plurality of servers form a server set in a symmetrical mode, each server has an equivalent status, and the servers can individually provide services to the outside without the assistance of other servers. By means of some kind of load balancing technology, the externally sent requests are distributed homogeneously to some server in the symmetrical structure, and the server receiving the requests responds to the client's request independently. However, storage resource utilization is low for a server array.
Disclosure of Invention
Aspects of the present application provide a load balancing method, device, system, and storage medium, so as to improve utilization rate of server storage resources.
The embodiment of the application provides a load balancing method, which is suitable for load balancing equipment and comprises the following steps:
receiving an original request message sent by client equipment; the original request message contains the identifications of various types of information to be requested;
generating a plurality of target request messages according to the identifications of the various types of information to be requested and the storage relation between the various types of information and the server, wherein each target request message at least comprises the identification of one type of information to be requested;
and sending the target request messages to a plurality of servers providing different types of information so that the servers can provide required information for the client equipment.
An embodiment of the present application further provides a load balancing device, including: a memory, a processor, and a communications component; wherein the memory is for a computer program;
the processor is coupled to the memory for executing the computer program for: receiving an original request message sent by client equipment through the communication assembly; the original request message contains the identifications of various types of information to be requested; generating a plurality of target request messages according to the identifications of the various types of information to be requested and the storage relation between the various types of information and the server, wherein each target request message at least comprises the identification of one type of information to be requested; and sending the target request messages to a plurality of servers providing different types of information through the communication assembly, so that the servers can provide required information for the client equipment.
An embodiment of the present application further provides a network system, including: the system comprises client equipment, load balancing equipment and a plurality of servers; the servers store different types of information;
the client is used for sending an original request message to the load balancing equipment, wherein the original request message contains the identifiers of various types of information to be requested;
the load balancing device is used for generating a plurality of target request messages according to the identifiers of the various types of information to be requested contained in the original request message and the storage relationship between the various types of information and the server, wherein each target request message at least contains the identifier of one type of information to be requested; respectively sending the target request messages to a plurality of target servers in the plurality of servers;
the target servers are used for returning corresponding information to be requested to the load balancing equipment according to the received target request messages so that the load balancing equipment can send the information to be requested to the client equipment.
Embodiments of the present application also provide a computer-readable storage medium storing computer instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the above-described method.
In the embodiment of the application, different types of information are stored in different servers. Thus, the load balancing device can generate a plurality of target request messages at least containing the identification of one type of information to be requested according to the identifications of a plurality of types of information to be requested contained in the original request message and the storage relationship between each type of information and the server; and various types of information to be requested are obtained from a plurality of servers through a plurality of target request messages. Thus, the servers can provide the required information for the client according to the received target request message. According to the embodiment of the application, load balancing is achieved on the servers, and each server does not need to store all kinds of information, so that the storage space can be saved, and the utilization rate of storage resources of the servers can be improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1a is a schematic structural diagram of a network system according to an embodiment of the present application;
fig. 1b is a schematic structural diagram of an original request packet according to an embodiment of the present application;
fig. 1c is a schematic structural diagram of a target request packet according to an embodiment of the present application;
fig. 1d is a schematic structural diagram of a target response packet according to an embodiment of the present application;
fig. 1e is a schematic structural diagram of a response packet corresponding to an original request packet according to an embodiment of the present application;
fig. 2 is a signaling interaction flow chart of a load balancing process according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a load balancing method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a load balancing device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Aiming at the technical problem of low utilization rate of storage resources of the existing server, the embodiment of the application provides a solution, and the basic idea is as follows: different categories of information are stored in different servers. Thus, the load balancing device can generate a plurality of target request messages at least containing the identification of one type of information to be requested according to the identifications of a plurality of types of information to be requested contained in the original request message and the storage relationship between each type of information and the server; and various types of information to be requested are obtained from a plurality of servers through a plurality of target request messages. Thus, the servers can provide the required information for the client according to the received target request message. According to the embodiment of the application, load balancing is achieved on the servers, and each server does not need to store all kinds of information, so that the storage space can be saved, and the utilization rate of storage resources of the servers can be improved.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1a is a schematic structural diagram of a network system according to an embodiment of the present application. As shown in fig. 1a, the network system includes: a client device 10a, a load balancing device 10b and several servers 10 c. In the embodiments of the present application, a plurality of stations means 2 stations or 2 or more stations. In fig. 1a, the number of servers is only N, where N is an integer greater than or equal to 2.
In this embodiment, the load balancing device 10b may be connected to the client device 10a and the servers 10c wirelessly or by wire. Optionally, the load balancing device 10b may be communicatively connected to the client device 10a and several servers 10c through a mobile network, and accordingly, the network format of the mobile network may be any one of 2G (gsm), 2.5G (gprs), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS), 4G (LTE), 4G + (LTE +), 5G, WiMax, and the like. Alternatively, the load balancing device 10b may be communicatively coupled to the client device 10a and the servers 10c via bluetooth, WiFi, infrared, etc.
In this embodiment, the client device 10a refers to a computer device used by a user and having functions of accessing internet, communicating and the like, which are required by the user, and may be, for example, a smart phone, a tablet computer, a personal computer, a wearable device and the like. The client device 10a typically includes at least one processing unit and at least one memory. The number of processing units and memories depends on the configuration and type of client device 10 a. The Memory may include volatile, such as RAM, non-volatile, such as Read-Only Memory (ROM), flash Memory, etc., or both. The memory typically stores an Operating System (OS), one or more application software, such as instant messaging software corresponding to the server 10a, and program data. In addition to the processing unit and the memory, the client device 10a may also include a network card chip, an IO bus, an audio/video component, and other basic configurations. Optionally, depending on the implementation of the client device 10a, the client device 10a may also include some peripheral devices, such as a keyboard, a mouse, a stylus, a printer, etc. These peripheral devices are well known in the art and will not be described in detail herein.
In this embodiment, the load balancing device 10b is a hardware device that can distribute network requests to available servers in a server cluster. The load balancing device 10b may be a load balancer in a standalone sense, or may be a network device, such as a switch, a router, a gateway, or the like, integrated with the load balancing function provided in this embodiment. Alternatively, in some embodiments, the load balancing function provided by this embodiment may be integrated into the computer device through two network adapters, one connected to the ethernet and one connected to the internal network of several servers 10 c.
In this embodiment, the server 10c is a computer device capable of performing information management, responding to a request from the client device 10a, and providing information related to the request from the client device 10a to a user, and generally has the capability of assuming and securing a service. The server 10c may be a single server device, a cloud server array, or a Virtual Machine (VM) running in the cloud server array.
In the present embodiment, each server 10c stores different types of information. For example, in the application scenario of student achievement management, the server 1 stores therein personal information of students, wherein the personal information of students includes: name, school number, class, grade, etc. of the student; the server 2 stores attendance of students, the server 3 stores term comments of the students, the server N stores scores of the students, and the like, but is not limited thereto. Accordingly, the load balancing device 10b stores various information and server storage relationships. The various information in the storage relationship between the various information and the server is the category to which the information stored in the plurality of servers 10c belongs.
In this embodiment, during the information request process of the user, the client device 10a may send a request message to the load balancing device 10 b. For convenience of description and distinction, the request message sent by the client device 10a to the load balancing device 10b is defined as the original request message. The original request message contains the identifier of the information to be requested. The identifier of the information to be requested refers to information that can uniquely identify the type of information, and may be, for example, a category name, an attribute name, and the like of the information, but is not limited thereto. In the embodiments of the present application, the identifier of the information to be requested included in the original request packet may be an identifier of one type of information to be requested, or may be an identifier of multiple types of information to be requested. In this embodiment, "multiple classes" each refer to 2 classes or more than 2 classes, and the specific value thereof depends on the kind of information requested by the user. For example, as shown in fig. 1a, the original request message includes 4 types of information to be requested, and the identifications of the 4 types of information to be requested are A, B, C, D respectively. It is worth mentioning that, in the application embodiment, all the categories of information stored by the plurality of servers 10c include the category of the information to be identified requested by the client device 10 a.
It should be noted that, for the case that the original request message includes the identifier of a type of information to be requested, the load balancing device receives the original request message, can directly generate a target request message according to the identifier in the original request message and the relationship between the various types of information and the server, and sends the target request message to the corresponding server. The situation that the original request message includes the identifier of one type of information to be requested cannot reflect the load balancing effect achieved by the scheme provided in the embodiment of the present application, and therefore, the following focuses on an example that the original request message includes the identifiers of multiple types of information to be requested, and an exemplary description is given to the load balancing manner provided in the embodiment of the present application.
Accordingly, the load balancing device 10b receives the original request packet, and generates a plurality of target request packets according to the identifiers of the various types of information to be requested included in the original request packet and the storage relationship between the various types of information and the server. Wherein, each target request message at least contains an identifier of a type of information to be requested. In the embodiments of the present application, "a plurality" means 2 or more than 2. For example, as shown in fig. 1a, for an original request packet containing identifiers A, B, C and D of 4 types of information to be requested, the load balancing device 10b generates 3 target request packets according to the identifiers A, B, C and D and the storage relationship between the types of information and the server.
In fig. 1a, a server numbered 1 (for convenience of description, the server numbered 1 is hereinafter referred to simply as server 1) stores information corresponding to the identifier a, a server numbered 3 (for convenience of description, the server numbered 3 is hereinafter referred to simply as server 3) stores information identified as B, and a server numbered N (for convenience of description, the server numbered N is hereinafter referred to simply as server N) stores information identified as C and D. Based on this, the 3 target request messages include: the target request message 1 contains an identifier A and is used for requesting information corresponding to the identifier A from the server 1; the target request message 2 contains an identifier B for sending to the server 3; the target request message 3 includes identifiers C and D, and is used to request the server N for information corresponding to the identifiers C and D.
Further, the load balancing device 10b sends the generated target request messages to a plurality of target servers in the plurality of servers. The target server is a server storing information requested by the corresponding target request message, and different target servers correspond to different target request messages. Therefore, for the condition that a user requests multiple types of information, multiple target request messages can be sent to different target servers to request the information, and then tasks of providing the information are distributed to the different target servers, so that load balance is achieved among the servers. In this embodiment, the target server may be a part of the servers or all of the servers, and the number of the target servers is specifically determined by the number of the target request messages generated by the load balancing device 10 b. Preferably, the number of target servers is equal to the number of target request messages. The target server may be determined according to the category to which the information requested by the original request packet belongs, that is, determined by the category of the information to be requested. For example, in fig. 1a, information belonging to the information category corresponding to the identifier a is stored in the server 1, and information belonging to the information category corresponding to the identifier B is stored in the server 3; and the information belonging to the information categories corresponding to the identifiers C and D is stored in the server N, and the target servers are the servers 1, 3 and N in the N servers.
Accordingly, the plurality of target servers return corresponding information to the load balancing device 10b according to the respective received target request messages. Accordingly, the load balancing device 10b transmits the received information to the client device 10 a.
The specific implementation manner in which the multiple target servers return the corresponding information to be requested to the load balancing device 10b according to the target request messages received by the multiple target servers is as follows: the multiple target servers analyze respective corresponding identifiers of the information to be requested from respective received target request messages, and acquire information corresponding to the identifiers from respective stored information by using the respective analyzed identifiers of the information to be requested; thereafter, each target server returns information corresponding to the respective parsed identifier to the load balancing device 10 b. For ease of understanding, the process is exemplified by the server 1 in fig. 1 a. As shown in fig. 1a, a server 1 receives a target request message 1 containing an identity a. Then, the target server 1 parses the identifier a from the target request packet 1, and obtains the information 1 corresponding to the identifier a from the stored information. After that, the server 1 returns the information to be requested 1 to the load balancing apparatus 10 b. Similarly, the server 3 may obtain the information 2 corresponding to the identifier B, and return the information 2 to be requested to the load balancing device 10B; the server N may obtain the information 3 and 4 corresponding to the identifications C and D and return the information 3 and 4 to the load balancing device 10 b. Accordingly, the load balancing device 10b sends information 1, 2, 3, and 4 to the client device 10 a.
In the network system provided in this embodiment, different types of information are stored in different servers. Thus, the load balancing device can generate a plurality of target request messages at least containing the identification of one type of information to be requested according to the identifications of a plurality of types of information to be requested contained in the original request message and the storage relationship between each type of information and the server; and various types of information to be requested are obtained from a plurality of servers through a plurality of target request messages. Thus, the servers can provide the required information for the client according to the received target request message. According to the embodiment of the application, load balancing is achieved on the servers, and each server does not need to store all kinds of information, so that the storage space can be saved, and the utilization rate of storage resources of the servers can be improved.
On the other hand, in the network system provided in the embodiment of the present application, for multiple types of information requested by the client device, a network connection may be established once to obtain the information, which is beneficial to saving network resources and further beneficial to improving the utilization rate of the network resources. In this embodiment of the present application, as shown in fig. 1b, the original request packet includes a header (head) field and a data (data) field, where the data field is written with identifiers of multiple types of information to be requested. For example, the identifications A, B, C and D of the above-mentioned 4 types of information to be requested are written in the number field. Based on this, the load balancing device 10b may analyze the identifiers of multiple types of information to be requested from the data field of the request packet; dividing the identifications of various types of information to be requested into a plurality of data fragments according to the storage relation between the various types of information and the server; and then, packaging the plurality of data fragments as data fields respectively to obtain a plurality of target request messages. Wherein one data fragment generates one target request message.
Further, when dividing the identifiers of multiple types of information to be requested into multiple data segments, the load balancing device 10b may divide the identifier of one type of information to be requested into one data segment. However, considering that one target server may store multiple types of information in the information to be requested, if the multiple types of information located in the same target server are divided into different data segments, the target server needs to receive multiple target request messages, which undoubtedly increases the processing pressure of the target server on the target request messages. Therefore, in order to reduce the processing pressure of the target server on the target request message, the identifiers corresponding to the information to be requested, which is located in the same server, may be encapsulated in the same target request message. Correspondingly, when the load balancing device 10b divides the identifiers of the multiple types of information to be requested into multiple data fragments, the server where each type of information to be requested is located can be determined according to the identifiers of the multiple types of information to be requested and the storage relationship between each type of information and the server; and dividing the identifications of the information to be requested on the same server into the same data segment to obtain a plurality of data segments. For example, the information belonging to the information category corresponding to the identifier a in the above-described embodiment is stored in the server 1, the information belonging to the information category corresponding to the identifier B is stored in the server 3, and the information belonging to the information categories corresponding to the identifiers C and D is stored in the server N, so that the load balancing apparatus 10B can independently divide the identifier a into one data segment, independently divide the identifier B into another data segment, and commonly divide the identifiers C and D into another data segment.
In some embodiments, each server stores a type of information. Based on this, the load balancing device 10b divides the identifiers of the information to be requested on the same server into the same data segment, and actually divides the identifier of each type of information to be requested into one data segment.
Then, the load balancing device 10b encapsulates the multiple data segments as data fields, respectively, to obtain multiple target request messages. The following takes a first data fragment of the multiple data fragments as an example to illustrate the encapsulation process of the target request packet. The first data fragment is any one of a plurality of data fragments. For a first data segment, the first data segment may be encapsulated into a data field. Further, the load balancing device 10b operates in different protocol layers, and the information encapsulated in the header field of the target request message is different. Optionally, if the load balancing device 10b operates in four layers (a transmission layer), the port number of the load balancing device 10b is used as a source port, and the port number of the server corresponding to the first data segment is used as a destination port and is encapsulated in the header field, so as to obtain the target request packet corresponding to the first data segment. Correspondingly, the target request message corresponding to the first data segment is a TCP message.
It should be noted that, in the embodiment of the present application, the physical port number of the load balancing apparatus 10b and the port number providing the virtual service to the outside are collectively referred to as the port number of the load balancing apparatus 10 b. Alternatively, the port for communication between the load balancing device 10b and the server may be a physical port of the load balancing device 10b, and the port for communication between the load balancing device 10b and the client device 10a may be a port for the load balancing device 10b to provide a virtual service to the outside. For convenience of description and distinction, in the embodiment of the present application, a port for communication between the load balancing apparatus 10b and the server is defined as a first port. Accordingly, in the above embodiment, the first port number of the load balancing apparatus 10b may be used as a source port and encapsulated into a header field of the target request packet corresponding to the first data segment.
For example, as shown in fig. 1c, assuming that the first data segment is the identifier a, the identifier a may be encapsulated in the data field, the first port number of the load balancing device 10b is used as the source port, and the port number of the destination server 1 corresponding to the identifier a is used as the destination port and is encapsulated in the header field, so as to obtain the destination request packet 1 corresponding to the identifier a. Further, the load balancing device 10b may send the target request message corresponding to the first data fragment to the server corresponding to the first data fragment specified by the destination port of the header field.
Optionally, during the transmission process of the target request packet corresponding to the first data fragment, the target request packet may also pass through three layers (network layers) and two layers (data link layers), where the network devices in the three layers (network layers) and the two layers (data link layers) may add a destination address and a source address to the target request packet. The three layers of network equipment can take the IP address of the network equipment as a source address and take the IP address of the server corresponding to the first data fragment as a target address for packaging; the network device of the second layer may encapsulate the MAC address of the network device itself as a source address and the MAC address of the server corresponding to the first data segment as a destination address. And then, the data is sent to the server corresponding to the first data segment through the network equipment of the third layer and the network equipment of the second layer.
Optionally, if the load balancing device 10b operates in the second layer or the third layer, the address of the load balancing device 10b may be used as the source address, and the destination server address corresponding to the first data segment may be used as the destination address and encapsulated in the header field, so as to obtain the destination request message corresponding to the first data segment. In this way, the load balancing apparatus 10b may send the plurality of target request messages to the server specified by the destination address in the header field of each of the plurality of target request messages. If the load balancing device 10b works in the second layer, the target request message may be referred to as a target request data frame; if the load balancing device 10b operates in three layers, the target request packet may also be referred to as a target request packet.
It should be noted that, in the embodiment of the present application, the real address of the load balancing apparatus 10b and the address providing the virtual service to the outside are collectively referred to as the address of the load balancing apparatus 10 b. Alternatively, the address communicated between the load balancing device 10b and the server may be a real address of the load balancing device 10b, and the address communicated between the load balancing device 10b and the client device 10a may be an address of the load balancing device 10b providing the virtual service to the outside. For convenience of description and distinction, in the embodiment of the present application, an address of communication between the load balancing apparatus 10b and the server is defined as a first address. Accordingly, in the above embodiment, the first address of the load balancing device 10b may be used as a source address and encapsulated in the header field of the target request message corresponding to the first data segment.
Optionally, if the load balancing device 10b operates in a second layer (data link layer), the address of the load balancing device 10b is an MAC address; accordingly, the address of the target server is the MAC address of the target server. If the load balancing device 10b works in three layers (network layers), the address of the load balancing device 10b is an IP address; accordingly, the address of the target server is the IP address of the target server.
It should be noted that, in the above-mentioned embodiment and the following embodiments, the storage relationship between each type of information and the server may be a corresponding relationship between an identifier of each type of information and a server identifier, where the server identifier is any information that can uniquely identify a server, for example, the server identifier may be a number, a MAC address, an IP address, etc. of the server, but is not limited thereto. Further, if the server identifier is the server number, the load balancing device 10b may further store the correspondence between the server number and the server address, so that the load balancing device 10b may obtain the address of the server where each type of information to be requested is located based on the identifier of the information to be requested, the correspondence between the identifiers of each type of information and the server number, and the correspondence between the server number and the server address.
Further, in this embodiment, the load balancing device 10b sends the target request messages to a plurality of target servers that provide different types of information. Correspondingly, each target server returns a corresponding target response message according to the received target request message, wherein each target response message at least comprises a type of information to be requested. The category quantity of the information to be requested contained in each target response message can be determined according to the number of the identifiers of the information to be requested contained in the target request message received by the target server. For example, a target response message 1 returned by the target server 1 contains a type of information to be requested, and the type of information to be requested corresponds to the identifier a; and for the target server N, the returned target response message 3 contains 2 types of information to be requested, and the 2 types of information to be identified correspond to the identifiers C and D respectively.
Optionally, if the target response packet is a TCP packet, the source port in the header field of the target response packet may be the port number of the corresponding target server, and the destination port is the first port number of the load balancing device 10b, and the data field of the target response packet is the returned information corresponding to the identifier in the target request packet. For example, as shown in fig. 1d, for a target response packet 1 returned by the target server 1, the source port in the header field may be the port number of the target server 1, the destination port may be the first port number of the load balancing device 10b, and the data field of the target response packet is information 1 corresponding to the identifier a.
Or, if the target response message is two-layer protocol data or three-layer protocol data, the source address in the header field of the target response message may be the address of the corresponding target server, and the destination address is the address of the load balancing device 10b, and the data field of the target response message is the returned information corresponding to the identifier in the target request message. If the target response message is two-layer protocol data, the target response message can be called a target response data frame; if the target response packet is three-layer protocol data, it is also called a target response packet. The load balancing device 10b may send a plurality of target request messages to a plurality of target servers in parallel, which may improve sending efficiency, and further improve efficiency of subsequent target servers returning target response messages.
Further, the load balancing device 10b receives target response messages returned by the plurality of servers according to the received target request messages, and repackages the information to be requested in the plurality of target response messages to obtain response messages corresponding to the original request messages; and returning a response message corresponding to the original request message to the client device 10 a. Accordingly, the client device 10a receives the response packet corresponding to the original request packet, and obtains the various types of information to be requested from the response packet.
Optionally, when the load balancing device 10b repackages the information to be requested in the multiple target response messages, the information to be requested in the multiple target response messages may be spliced to obtain multiple types of information to be requested, and the multiple types of information to be requested are packaged into the data field. Further, if the load balancing device 10b operates in four layers, the port number of the load balancing device 10b is used as a source port, and the port number of the client device 10a is used as a destination port and encapsulated in a header field, so as to obtain a response packet corresponding to the original request packet. In this embodiment, the port number of the load balancing apparatus 10b may be a port number of a virtual service that connects with the client apparatus 10 a. For convenience of description and distinction, the port where the load balancing apparatus 10b and the client apparatus 10a are connected is defined as a second port. Accordingly, the second port number of the load balancing device 10b may be encapsulated as the source port into the header field of the response packet corresponding to the original request packet. For example, as shown in fig. 1e, for the 4 types of information to be requested, the load balancing device 10B may splice information 1 corresponding to the identifier a, information 2 corresponding to the identifier B, and information 3 and 4 corresponding to the identifiers C and D to obtain information 1 to 4, further, the load balancing device 10B may encapsulate the information 1 to 4 into a data field of a response packet corresponding to the original request packet, use the second port number of the load balancing device 10B as a source port, and encapsulate the port number of the client device 10a into a header field as a destination port, so as to obtain a response packet corresponding to the original request packet.
Optionally, if the load balancing device 10b operates in the second layer or the third layer, the address of the load balancing device 10b may be used as the source address, and the address of the client device 10a may be used as the destination address and encapsulated in the header field, so as to obtain the response message corresponding to the original request message. In this embodiment, the address of the load balancing device 10b may be an address of a virtual service related to the client device 10 a. For convenience of description and distinction, in the embodiment of the present application, an address for communication between the load balancing apparatus 10b and the client apparatus 10a is defined as a second address. Accordingly, in the above embodiment, the second address of the load balancing apparatus 10b may be used as a source address and encapsulated in the header field of the response message corresponding to the original request message.
Further, when the load balancing device 10b also splices the information to be requested in the target response messages, the splicing order of various types of information to be requested may not be limited, that is, the information to be requested in the target response messages may be randomly spliced. Or, the load balancing device 10b may also splice information to be requested in a plurality of target response messages according to the time of each target response message received by the load balancing device. Of course, the load balancing device 10b may also splice the information to be requested in the multiple target response messages according to the arrangement order of the identifiers of the multiple types of information to be requested in the original request message. For example, for the original request message shown in fig. 1b, since the identification sequence is A, B, C and D, the load balancing device 10b may splice information to be requested in multiple target response messages according to the sequence of the identifications A, B, C and D, and the obtained sequence of the information to be requested is information 1, 2, 3, and 4.
It should be noted that, in each embodiment of the present application, the original request packet may be various protocol packets, and accordingly, the target request packet, the target response packet, and the response packet corresponding to the original request packet are the protocol packets to which the original request packet belongs. For example, if the original request message is a TCP message, the target request message, the target response message, and the response message corresponding to the original request message are also all TCP messages, and the like, but not limited thereto.
It should be further noted that the formats of the messages provided in fig. 1b to 1e in the embodiments of the present application are only exemplary, and do not mean that the messages must include all the fields shown in fig. 1b to 1e, nor that the messages only include the fields shown in fig. 1b to 1 e. The format of each message can be encapsulated according to the format of the protocol message to which the message belongs.
In order to facilitate understanding of the above-mentioned mutual cooperation among the client device, the load balancing device, and the server, a process of load balancing is performed, and an example of a main interaction process of an original request message including identifiers a to D of 4 types of information to be requested is described below with reference to a signaling interaction flow between load balancing processes shown in fig. 2. The method mainly comprises the following steps:
step 1: the client device 10a sends an original request message to the load balancing device 10b, where the original request message includes the identifiers a-D of the 4 types of information to be requested.
Step 2: the load balancing device 10b receives the original request message and generates 3 target request messages (target request messages 1, 2, 3) according to the identifiers a-D and the storage relationship between various types of information and the server. The target request message 1 includes an identifier a, the target request message 2 includes an identifier B, and the target request message 3 includes identifiers C and D.
And step 3: the load balancing device 10b sends the target request messages 1, 2, 3 to the servers 1, 3 and N, respectively. Wherein, the servers 1, 3 and N are the target servers.
And 4, step 4: the servers 1, 3 and N respectively obtain information 1-3 corresponding to the identification in the target request message received by the servers according to the target request message received by the servers. Accordingly, server 1 encapsulates information 1 into a target response message 1, server 3 encapsulates information 2 into a target response message 2, and server N encapsulates information 3 and 4 into a target response message 3.
And 5: servers 1, 3 and N send target response messages 1-3, respectively, to load balancing device 10 b.
Step 6: the load balancing device 10b receives the target response messages 1-3, splices the information 1-4 contained therein, and repackages the spliced information 1-4 to obtain the response message of the original request message.
And 7: the load balancing device 10b sends a response message of the original request message to the client device 10 a.
And 8: the client device 10a receives the response message of the original request message and parses the information 1-4 from it, thereby obtaining the information it requested.
In addition to the network system provided in the foregoing embodiment, an embodiment of the present application also provides a load balancing method, and the following exemplarily illustrates the load balancing method provided in the embodiment of the present application from the perspective of a load balancing device.
Fig. 3 is a schematic flowchart of a load balancing method according to an embodiment of the present application. The method is suitable for the load balancing equipment. As shown in fig. 3, the method includes:
301. receiving an original request message sent by client equipment; the original request message contains the identifications of various types of information to be requested.
302. Generating a plurality of target request messages according to the identifications of the various types of information to be requested and the storage relationship between the various types of information and the server; each target request message at least comprises an identifier of a type of information to be requested.
303. And sending the target request messages to a plurality of servers providing different types of information so that the servers can provide required information for the client equipment.
In this embodiment, in the process of information request by a user, the client device may send a request message to the load balancing device. For convenience of description and distinction, the request message sent by the client device to the load balancing device is defined as an original request message. The original request message contains the identifier of the information to be requested. The identifier of the information to be requested is information that can uniquely identify a type of information, for example, a category name, an attribute name, and the like of the information, but is not limited thereto. In the embodiments of the present application, the identifier of the information to be requested included in the original request packet may be an identifier of one type of information to be requested, or may be an identifier of multiple types of information to be requested. In this embodiment, "multiple classes" each refer to 2 classes or more than 2 classes, and the specific value thereof depends on the kind of information requested by the user.
It should be noted that, for the case that the original request message includes the identifier of a type of information to be requested, the load balancing device receives the original request message, can directly generate a target request message according to the identifier in the original request message and the relationship between the various types of information and the server, and sends the target request message to the corresponding server. The situation that the original request message includes the identifier of one type of information to be requested cannot reflect the load balancing effect achieved by the scheme provided in the embodiment of the present application, and therefore, the following focuses on an example that the original request message includes the identifiers of multiple types of information to be requested, and an exemplary description is given to the load balancing manner provided in the embodiment of the present application.
In this embodiment, the original request packet includes identifiers of multiple types of information to be requested. In step 301, the load balancing device receives the original request message, and in step 302, generates a plurality of target request messages according to the identifiers of the various types of information to be requested contained in the original request message and the storage relationship between the various types of information and the server. Wherein, each target request message at least contains an identifier of a type of information to be requested. In the embodiments of the present application, "a plurality" means 2 or more than 2.
Further, in step 303, the load balancing device sends the generated target request message to a plurality of servers providing different types of information. The plurality of servers are servers storing information requested by corresponding target request messages, and different servers correspond to different target request messages. Therefore, for the condition that a user requests multiple types of information, multiple target request messages can be sent to different servers to request the information, and then tasks of providing the information are distributed to the different servers, so that load balance among the servers is achieved. In this embodiment, the number of the plurality of servers is specifically determined by the number of the target request packets generated by the load balancing device. Preferably, the number of servers is equal to the number of target request messages. The server may be determined according to the category to which the information requested by the original request message belongs, that is, the category of the information to be requested.
Correspondingly, the plurality of servers return corresponding information to the load balancing equipment according to the received target request messages. Accordingly, the load balancing device sends the received information to the client device. For a specific implementation manner in which the plurality of servers return the corresponding information to be requested to the load balancing device according to the target request packet received by the plurality of servers, reference may be made to relevant contents of the above embodiments, which is not described herein again.
In the present embodiment, different categories of information are stored in different servers. Thus, the load balancing device can generate a plurality of target request messages at least containing the identification of one type of information to be requested according to the identifications of a plurality of types of information to be requested contained in the original request message and the storage relationship between each type of information and the server; and various types of information to be requested are obtained from a plurality of servers through a plurality of target request messages. Thus, the servers can provide the required information for the client according to the received target request message. According to the embodiment of the application, load balancing is achieved on the servers, and each server does not need to store all kinds of information, so that the storage space can be saved, and the utilization rate of storage resources of the servers can be improved.
On the other hand, in the embodiment, for multiple types of information requested by the client device, network connection can be established once for obtaining, which is beneficial to saving network resources and further beneficial to improving the utilization rate of the network resources.
In this embodiment of the present application, as shown in fig. 1b, the original request packet includes a header (head) field and a data (data) field, where the data field is written with identifiers of multiple types of information to be requested. For example, the identifications A, B, C and D of the above-mentioned 4 types of information to be requested are written in the number field. Based on this, an alternative implementation of step 302 is: analyzing the identifiers of various types of information to be requested from the data field of the request message; dividing the identifications of various types of information to be requested into a plurality of data fragments according to the storage relation between the various types of information and the server; and then, packaging the plurality of data fragments as data fields respectively to obtain a plurality of target request messages. Wherein, a data segment generates a target request message to contain.
Further, when dividing the identifiers of multiple types of information to be requested into multiple data segments, the load balancing device may divide the identifier of one type of information to be requested into one data segment. However, considering that one target server may store multiple types of information in the information to be requested, if the multiple types of information located in the same target server are divided into different data segments, the target server needs to receive multiple target request messages, which undoubtedly increases the processing pressure of the target server on the target request messages. Therefore, in order to reduce the processing pressure of the server on the target request message, the identifiers corresponding to the information to be requested, which is located in the same server, can be encapsulated in the same target request message. Correspondingly, when the load balancing equipment divides the identifications of the various types of information to be requested into a plurality of data fragments, the load balancing equipment can determine the server where each type of information to be requested is located according to the identifications of the various types of information to be requested and the storage relation between each type of information and the server; and dividing the identifications of the information to be requested on the same server into the same data segment to obtain a plurality of data segments.
In some embodiments, each server stores a type of information. Based on this, the load balancing device divides the identifiers of the information to be requested on the same server into the same data segment, and actually divides the identifier of each type of information to be requested into one data segment.
And then, the load balancing equipment respectively takes the plurality of data fragments as data fields to carry out split charging to obtain a plurality of target request messages. The following takes a first data fragment of the multiple data fragments as an example to illustrate the encapsulation process of the target request packet. The first data fragment is any one of a plurality of data fragments. For a first data segment, the first data segment may be encapsulated into a data field. Further, the load balancing device works in different protocol layers, and the information encapsulated by the header field of the target request message is different. Optionally, if the load balancing device operates in four layers, the first port number of the load balancing device is used as a source port, and the port number of the server corresponding to the first data segment is used as a destination port and encapsulated in the header field, so as to obtain the target request packet corresponding to the first data segment. Correspondingly, the target request message corresponding to the first data segment is a TCP message. Further, the load balancing device 10b may send the target request message corresponding to the first data fragment to the server corresponding to the first data fragment specified by the destination port of the header field.
Optionally, if the load balancing device operates in the second layer or the third layer, the first address of the load balancing device may be used as the source address, and the server address corresponding to the first data fragment may be used as the destination address and encapsulated in the header field, so as to obtain the target request packet corresponding to the first data fragment. In this way, the load balancing device may send the plurality of target request messages to the server specified by the destination address in the header field of each of the plurality of target request messages.
It should be noted that, in the above-mentioned embodiment and the following embodiments, the storage relationship between each type of information and the server may be a corresponding relationship between the identifier of each type of information and the server identifier, where the server identifier may be any information that can uniquely identify one server, for example, the server identifier may be a number, a MAC address, an IP address, etc. of the server, but is not limited thereto. Further, if the server identifier is the server identifier, the load balancing device may further store the correspondence between the server identifier and the server address, so that the load balancing device may obtain the address of the server where each type of information to be requested is located based on the identifier of the information to be requested, the correspondence between the identifiers of each type of information and the server identifier, and the correspondence between the server identifier and the server address.
Further, in this embodiment of the present application, the load balancing device sends the multiple target request packets to multiple servers that provide different types of information. Correspondingly, each server returns a corresponding target response message according to the received target request message, wherein each target response message at least comprises a type of information to be requested. The category quantity of the information to be requested contained in each target response message can be determined according to the number of the identifiers of the information to be requested contained in the target request message received by the server. Further, if the target response packet is a TCP packet, the source port in the header field of the target response packet may be the port number of the corresponding target server, and the destination port is the port number of the load balancing device, and the data field of the target response packet is the returned information corresponding to the identifier in the target request packet.
If the target response message is two-layer protocol data or three-layer protocol data, the source address in the header field of the target response message may be the address of the server corresponding to the source address, and the destination address is the first address of the load balancing device, and the data field of the target response message is returned information corresponding to the identifier in the target request message.
The load balancing equipment can send the target request messages to the servers in parallel, so that the sending efficiency can be improved, and the efficiency of the subsequent servers for returning the target response messages is improved.
Further, after step 303, the load balancing device receives target response messages returned by the multiple servers according to the received target request messages, and repackages the information to be requested in the multiple target response messages to obtain response messages corresponding to the original request messages; and returning a response message corresponding to the original request message to the client equipment. Correspondingly, the client device receives a response message corresponding to the original request message, and obtains the requested multiple types of information to be requested from the response message.
Optionally, when the load balancing device repacks information to be requested in the multiple target response messages, the information to be requested in the multiple target response messages may be spliced to obtain multiple types of information to be requested, and the multiple types of information to be requested are encapsulated into the data field, further, if the load balancing device works in four layers, the second port number of the load balancing device is used as the source port, and the port number of the client device is used as the destination port and is encapsulated into the header field, so as to obtain a response message corresponding to the original request message.
Optionally, if the load balancing device operates in the second layer or the third layer, the second address of the load balancing device may be used as the source address, and the address of the client device may be used as the destination address and encapsulated in the header field, so as to obtain the response message corresponding to the original request message.
Further, when the load balancing device can also splice the information to be requested in the multiple target response messages, the splicing sequence of various types of information to be requested is not limited, that is, the information to be requested in the multiple target response messages can be randomly spliced. Or, the load balancing device may also splice information to be requested in a plurality of target response messages according to the time of each target response message received by the load balancing device. Of course, the load balancing device may also splice the information to be requested in the multiple target response messages according to the arrangement order of the identifiers of the multiple types of information to be requested in the original request message.
It should be noted that, in each embodiment of the present application, the original request packet may be various protocol packets, and accordingly, the target request packet, the target response packet, and the response packet corresponding to the original request packet are the protocol packets to which the original request packet belongs. For example, if the original request message is a TCP message, the target request message, the target response message, and the response message corresponding to the original request message are also all TCP messages, and the like, but not limited thereto.
It should be noted that the execution subjects of the steps of the methods provided in the above embodiments may be the same device, or different devices may be used as the execution subjects of the methods. For example, the execution subject of steps 301 and 302 may be device a; for another example, the execution subject of step 301 may be device a, and the execution subject of step 302 may be device B; and so on.
In addition, in some of the flows described in the above embodiments and the drawings, a plurality of operations are included in a specific order, but it should be clearly understood that the operations may be executed out of the order presented herein or in parallel, and the sequence numbers of the operations, such as 301, 302, etc., are merely used for distinguishing different operations, and the sequence numbers do not represent any execution order per se. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel.
Accordingly, embodiments of the present application also provide a computer-readable storage medium storing computer instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the load balancing method described above.
Fig. 4 is a schematic structural diagram of a load balancing device according to an embodiment of the present application. As shown in fig. 4, the load balancing apparatus includes: memory 40a, processor 40b and communication component 40 c. Memory 40a, among other things, is used for computer programs.
The processor 40b is coupled to the memory 40a for executing a computer program for: receiving an original request message sent by the client device through the communication component 40 c; the original request message contains the identifications of various types of information to be requested; generating a plurality of target request messages according to the identifications of the various types of information to be requested and the storage relationship between the various types of information and the server, wherein each target request message at least comprises the identification of one type of information to be requested; and sending the plurality of target request messages to a plurality of servers providing different types of information through the communication component 40c, so that the plurality of servers provide the client device with the required information.
In some embodiments, when the processor 40b generates a plurality of target request packets, it is specifically configured to: analyzing the identifiers of various types of information to be requested from the data field of the original request message; dividing the identifications of various types of information to be requested into a plurality of data fragments according to the storage relation between the various types of information and the server; and respectively packaging the plurality of data fragments as data fields to obtain a plurality of target request messages.
Further, when the identifier of multiple types of information to be requested is divided into multiple data fragments, the processor 40b is specifically configured to: determining a server where each type of information to be requested is located according to the identifications of the various types of information to be requested and the storage relation between the various types of information and the server; and dividing identifications of information to be requested on the same server into the same data segment to obtain a plurality of data segments.
Optionally, each server stores a type of information, and when the processor 40b divides the identifier of the information to be requested on the same server into the same data segment, the processor is specifically configured to: and respectively dividing the identifier of each type of information to be requested into one data fragment to obtain a plurality of data fragments.
In still other embodiments, when the processor 40b encapsulates the plurality of data fragments as data fields, it is specifically configured to: for a first data segment, packaging the first data segment into a data field, taking a first port number of a load balancing device as a source port, and packaging a port number of a server corresponding to the first data segment into a header field as a destination port to obtain a target request message corresponding to the first data segment; the first data fragment is any one of a plurality of data fragments.
Accordingly, when the processor 40b sends a plurality of target request messages to a plurality of servers providing different types of information through the communication component 40c, the processor is specifically configured to: and aiming at the first data segment, sending a target request message corresponding to the first data segment to a server corresponding to the first data segment appointed by a destination port of a header field of the target request message.
In still other embodiments, processor 40c, after sending a plurality of target request messages to a plurality of servers providing different types of information via communication component 40c, is further configured to: receiving target response messages returned by a plurality of servers according to the received target request messages through a communication component 40c, wherein each target response message at least comprises a type of information to be requested; repackaging the information to be requested in the target response messages to obtain response messages corresponding to the original request messages; and returning a response message corresponding to the original request message to the client device through the communication component 40c, so that the client device can obtain multiple types of information to be requested from the response message.
Further, when repackaging the information to be requested in the target response messages, the processor 40b is specifically configured to: splicing information to be requested in a plurality of target response messages to obtain a plurality of types of information to be requested; and packaging the various types of information to be requested into a data field, taking the second port number of the load balancing equipment as a source port, and packaging the port number of the client equipment as a destination port into a header field to obtain a response message corresponding to the original request message.
Further, when the processor 40b splices the information to be requested in the multiple target response messages, it is specifically configured to: and splicing the information to be requested in the target response messages according to the arrangement sequence of the identifiers of the various information to be requested in the original request message to obtain the various information to be requested.
It should be noted that, in this embodiment, the original request packet and the plurality of target request packets are both TCP packets. Correspondingly, the response messages corresponding to the target response messages and the original request messages are all TCP messages.
In some optional embodiments, as shown in fig. 4, the load balancing apparatus may further include: power supply component 40d, and the like. Only some of the components are shown schematically in fig. 4, and it is not meant that the load balancing apparatus must include all of the components shown in fig. 4, nor that the load balancing apparatus can include only the components shown in fig. 4.
In this embodiment, the memory is used to store computer programs and may be configured to store various other data to support operations on the load balancing device. Wherein the processor may execute a computer program stored in the memory to implement the corresponding control logic. The memory may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Wherein the communications component is configured to facilitate communications between the load balancing device and other devices in a wired or wireless manner. The load balancing device may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component may also be implemented based on Near Field Communication (NFC) technology, Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, or other technologies.
Wherein the power supply component is configured to provide power to the various components of the load balancing device. The power components may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device in which the power component is located.
The load balancing device provided in this embodiment may generate a plurality of target request messages including at least one type of identifier of information to be requested according to the identifiers of the types of information to be requested included in the original request message and the storage relationship between the types of information and the server, and obtain the types of information to be requested from the plurality of servers through the plurality of target request messages. According to the embodiment of the application, load balance can be realized among the servers, and each server does not need to store all kinds of information, so that the storage space can be saved, and the utilization rate of storage resources of the servers can be improved.
On the other hand, in this embodiment, for multiple types of information requested by the client device, a network connection may be established once to obtain the information, which is beneficial to saving network resources and further beneficial to improving the utilization rate of the network resources.
It should be noted that, the descriptions of "first", "second", etc. in this document are used to distinguish different ports, addresses, messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. 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 a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, 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 process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (14)

1. A load balancing method is suitable for load balancing equipment, and is characterized by comprising the following steps:
receiving an original request message sent by client equipment; the original request message contains the identifications of various types of information to be requested;
generating a plurality of target request messages according to the identifications of the various types of information to be requested and the storage relation between the various types of information and the server, wherein each target request message at least comprises the identification of one type of information to be requested;
and sending the target request messages to a plurality of servers providing different types of information so that the servers can provide required information for the client equipment.
2. The method according to claim 1, wherein the generating a plurality of target request messages according to the identifications of the multiple types of information to be requested and the storage relationship between the types of information and the server comprises:
analyzing the identifiers of the various types of information to be requested from the data field of the original request message;
dividing the identifications of the various types of information to be requested into a plurality of data fragments according to the storage relation between the various types of information and the server;
and respectively packaging the data fragments as data fields to obtain the target request messages.
3. The method according to claim 2, wherein said dividing the identities of the multiple types of information to be requested into multiple data segments according to the storage relationship between the types of information and the server comprises:
determining a server where each type of information to be requested is located according to the identifications of the types of information to be requested and the storage relation between each type of information and the server;
and dividing identifications of information to be requested on the same server into the same data segment to obtain a plurality of data segments.
4. The method of claim 3, wherein each server stores a type of information, and the dividing the identification of information to be requested on the same server into the same data segment to obtain a plurality of data segments comprises:
and respectively dividing the identifier of each type of information to be requested into one data fragment to obtain the plurality of data fragments.
5. The method according to claim 2, wherein encapsulating the plurality of data fragments as data fields respectively to obtain the plurality of target request packets comprises:
for a first data segment, encapsulating the first data segment into a data field, taking a first port number of the load balancing device as a source port, and encapsulating a port number of a server corresponding to the first data segment into a header field as a destination port, so as to obtain a target request message corresponding to the first data segment;
wherein the first data segment is any one of the plurality of data segments.
6. The method of claim 5, wherein sending the plurality of target request messages to a plurality of servers that provide different types of information comprises:
and aiming at the first data segment, sending a target request message corresponding to the first data segment to a server corresponding to the first data segment appointed by a destination port of a head field of the target request message.
7. The method according to any one of claims 1-6, further comprising, after sending the plurality of target request messages to a plurality of servers providing different types of information:
receiving target response messages returned by the plurality of servers according to the received target request messages respectively, wherein each target response message at least comprises a type of information to be requested;
repackaging the information to be requested in the target response messages to obtain response messages corresponding to the original request messages;
and returning a response message corresponding to the original request message to the client device so that the client device can obtain the multiple types of information to be requested.
8. The method according to claim 7, wherein the repackaging the information to be requested in the target response messages to obtain the response message of the original request message comprises:
splicing the information to be requested in the target response messages to obtain the multiple types of information to be requested;
and packaging the multiple types of information to be requested into a data field, using the second port number of the load balancing equipment as a source port, and packaging the port number of the client equipment as a destination port into a header field to obtain a response message corresponding to the original request message.
9. The method according to claim 8, wherein said concatenating the information to be requested in the target response messages to obtain the multiple types of information to be requested comprises:
and splicing the information to be requested in the target response messages according to the arrangement sequence of the identifiers of the various types of information to be requested in the original request message to obtain the various types of information to be requested.
10. The method according to any of claims 1-6, wherein the original request message and the plurality of target request messages are TCP messages.
11. The method according to claim 7, wherein the plurality of target response messages and the response message corresponding to the original request message are both TCP messages.
12. A load balancing device, comprising: a memory, a processor, and a communications component; wherein the memory is for a computer program;
the processor is coupled to the memory for executing the computer program for: receiving an original request message sent by client equipment through the communication assembly; the original request message contains the identifications of various types of information to be requested; generating a plurality of target request messages according to the identifications of the various types of information to be requested and the storage relation between the various types of information and the server, wherein each target request message at least comprises the identification of one type of information to be requested; and sending the target request messages to a plurality of servers providing different types of information through the communication assembly, so that the servers can provide required information for the client equipment.
13. A network system, comprising: the system comprises client equipment, load balancing equipment and a plurality of servers; the servers store different types of information;
the client device is configured to send an original request packet to the load balancing device, where the original request packet includes identifiers of multiple types of information to be requested;
the load balancing device is used for generating a plurality of target request messages according to the identifiers of the various types of information to be requested contained in the original request message and the storage relationship between the various types of information and the server, wherein each target request message at least contains the identifier of one type of information to be requested; respectively sending the target request messages to a plurality of target servers in the plurality of servers;
the plurality of target servers are configured to return corresponding information to the load balancing device according to the received target request message, so that the load balancing device sends the received information to the client device.
14. A computer-readable storage medium having stored thereon computer instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the method of any one of claims 1-11.
CN201911061545.2A 2019-11-01 2019-11-01 Load balancing method, device, system and storage medium Pending CN110990146A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911061545.2A CN110990146A (en) 2019-11-01 2019-11-01 Load balancing method, device, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911061545.2A CN110990146A (en) 2019-11-01 2019-11-01 Load balancing method, device, system and storage medium

Publications (1)

Publication Number Publication Date
CN110990146A true CN110990146A (en) 2020-04-10

Family

ID=70083031

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911061545.2A Pending CN110990146A (en) 2019-11-01 2019-11-01 Load balancing method, device, system and storage medium

Country Status (1)

Country Link
CN (1) CN110990146A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114090394A (en) * 2022-01-19 2022-02-25 山东卓朗检测股份有限公司 Distributed server cluster load abnormity analysis method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102075409A (en) * 2009-11-24 2011-05-25 华为技术有限公司 Method and system for processing request message as well as load balancer equipment
CN103944994A (en) * 2014-04-25 2014-07-23 中国联合网络通信集团有限公司 Distributed resource obtaining method and device
US20160234299A1 (en) * 2015-02-05 2016-08-11 Throughtek Technology (Shenzhen) Co., Ltd. Management server and operation method thereof and server system
CN106844405A (en) * 2015-12-07 2017-06-13 杭州海康威视数字技术股份有限公司 Data query method and apparatus
CN108737473A (en) * 2017-04-20 2018-11-02 贵州白山云科技有限公司 A kind of data processing method, apparatus and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102075409A (en) * 2009-11-24 2011-05-25 华为技术有限公司 Method and system for processing request message as well as load balancer equipment
CN103944994A (en) * 2014-04-25 2014-07-23 中国联合网络通信集团有限公司 Distributed resource obtaining method and device
US20160234299A1 (en) * 2015-02-05 2016-08-11 Throughtek Technology (Shenzhen) Co., Ltd. Management server and operation method thereof and server system
CN106844405A (en) * 2015-12-07 2017-06-13 杭州海康威视数字技术股份有限公司 Data query method and apparatus
CN108737473A (en) * 2017-04-20 2018-11-02 贵州白山云科技有限公司 A kind of data processing method, apparatus and system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
CARLOS GOMEZ-PANTOJA: "Load Balancing Distributed Inverted Files: Query Ranking", 《16TH EUROMICRO CONFERENCE ON PARALLEL, DISTRIBUTED AND NETWORK-BASED PROCESSING (PDP 2008)》 *
张尧学: "《计算机网络与Internet教程》", 31 July 1999 *
郭建: "网络社区数据存储及检索优化技术研究", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114090394A (en) * 2022-01-19 2022-02-25 山东卓朗检测股份有限公司 Distributed server cluster load abnormity analysis method
CN114090394B (en) * 2022-01-19 2022-04-22 山东卓朗检测股份有限公司 Distributed server cluster load abnormity analysis method

Similar Documents

Publication Publication Date Title
CN113821310B (en) Data processing method, programmable network card device, physical server and storage medium
US11956207B2 (en) Multi-tenant aware dynamic host configuration protocol (DHCP) mechanism for cloud networking
CN107196982B (en) User request processing method and device
US20200007445A1 (en) Enhanced service function chain
CN113676512B (en) Network system, resource processing method and equipment
US9253061B2 (en) Tunnel health check mechanism in overlay network
CN113312098B (en) Program loading method, device, system and storage medium
CN115086166B (en) Computing system, container network configuration method, and storage medium
CN115913617A (en) Cloud networking system, secure access method, device and storage medium
US20210103457A1 (en) Control apparatus, control system, control method, and program
CN110990146A (en) Load balancing method, device, system and storage medium
CN113301080B (en) Resource calling method, device, system and storage medium
EP3369217B1 (en) Multiple gateway operation on single operating system
CN113515387B (en) Data processing method and device and electronic device
CN114980359A (en) Data forwarding method, device, equipment, system and storage medium
CN115883283A (en) Deployment method and device of containerization VNF
CN110719303B (en) Containerization NRF method and system
CN111294221B (en) Network isolation configuration method and device based on haproxy
CN113037812A (en) Data packet scheduling method and device, electronic equipment, medium and intelligent network card
CN112583740A (en) Network communication method and device
CN116056240B (en) Resource allocation system, method and equipment
CN114422456B (en) Task processing method and device
CN115941426B (en) Multi-service resource collaboration method, system and computer equipment
CN114826919B (en) SDN-based load balancing software nanotube method, device, equipment and medium
CN117215752A (en) Cloud resource scheduling method and device, storage medium 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200410