Resource load balancing method and device

By obtaining the server's capacity index and current utilization rate through the gateway, the server with the lightest load is identified, which solves the problem of uneven resource allocation caused by the client's own selection and realizes dynamic real-time load balancing and timely response of the server.

CN116208614BActive Publication Date: 2026-04-03NEW H3C TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-15
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

When clients choose a server, there is a probability that they will choose a server with a high load, resulting in uneven resource allocation and the inability to respond to client requests in a timely manner.

Method used

The gateway receives the service attribute messages from the client, obtains the capacity index and current utilization of each server, uses this information to determine the target server with the lightest load, and sends the address information of that server to the client.

Benefits of technology

Dynamic real-time load balancing on the server side is achieved, ensuring that client requests can be responded to in a timely manner and avoiding the problem of uneven resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116208614B_ABST
    Figure CN116208614B_ABST
Patent Text Reader

Abstract

This application provides a resource load balancing method and apparatus. The method is applied to a gateway and includes: receiving a first message sent by a client, the first message including service attributes required by the client; sending a second message to at least one selected server according to the service attributes required by the client, the second message being used to obtain the capacity index and current utilization rate of each server; receiving a third message sent by each server, the third message including the server's capacity index and current utilization rate; determining a target server using the server's capacity index and current utilization rate; and sending a fourth message to the client, the fourth message including the address information of the target server, so that the client can access the target server according to the address information of the target server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a resource load balancing method and apparatus. Background Technology

[0002] Currently, when multiple services exist on the network (e.g., printers, cameras, HTTP servers, FTP servers, etc.), configuring the address information of the server hosting the service is cumbersome, and the address information needs to be reconfigured after the server changes. Since there are many services, the client usually does not configure the address information of multiple servers locally.

[0003] When a client needs to use a service, it can automatically discover various services through the ws-discovery protocol. When a service comes online, it proactively sends a hello multicast message, which the client can receive and save. When a client needs a service, it sends a probe or resolve multicast message to search for the service. If a service receives the multicast message and determines that it can provide the corresponding service, it sends a probematch message (a response to a probe request) or a resolvematch message (a response to a resolve message) to the client. The client then uses the web address included in the message to access the service.

[0004] like Figure 1 As shown, Figure 1 This is a network diagram illustrating the existing client and server (also known as service provider) topology. Figure 1 In this system, clients and servers typically communicate through a gateway (switch or router). When a client requests a service, it sends a probe message to the gateway. Upon receiving the message, the gateway broadcasts it within the corresponding VLAN. The server's response probematch message is also sent to the client via the gateway. The gateway, in this process, also transmits ws-discovery messages.

[0005] In practical applications, when multiple servers that meet the client's requirements exist within the network—for example, three servers (A, B, and C) providing FTP or HTTP services—each server sends a probematch message to the gateway. The gateway then forwards all three probematch messages to the client. The client then selects one of the three servers as the service provider, and the selected server subsequently provides the service to the client.

[0006] However, in the above process, due to differences in the capabilities of each server (e.g., memory size, number of CPUs) and the varying levels of workload (e.g., the number of unprocessed FTP or HTTP requests that the client is unaware of), if the client is allowed to choose, there is a certain probability that the client will still choose the server with the higher load as the service provider, leading to uneven resource allocation and subsequent requests from the client not receiving timely responses. Summary of the Invention

[0007] In view of this, this application provides a resource load balancing method and apparatus to solve the problem that when existing clients select a server, they have a certain probability of choosing a server with a higher load as the service provider, resulting in uneven resource allocation and subsequent requests from the client not being responded to in a timely manner.

[0008] In a first aspect, this application provides a resource load balancing method, the method being applied to a gateway, the method comprising:

[0009] Receive a first message sent by the client, the first message including the service attributes required by the client;

[0010] Based on the service attributes required by the client, a second message is sent to at least one selected server. The second message is used to obtain the capability index and current utilization rate of each server.

[0011] Receive a third message sent by each of the servers, the third message including the server's capability index and current utilization rate;

[0012] The target server is determined using the server's capability index and current usage rate.

[0013] A fourth message is sent to the client, the fourth message including the address information of the target server, so that the client can access the target server according to the address information of the target server.

[0014] Secondly, this application provides a resource load balancing device, which is applied to a gateway, and the device includes:

[0015] A receiving unit is configured to receive a first message sent by a client, the first message including the service attributes required by the client;

[0016] The sending unit is configured to send a second message to at least one selected server according to the service attributes required by the client. The second message is used to obtain the capability index and current utilization rate of each server.

[0017] The receiving unit is further configured to receive a third message sent by each server, the third message including the server's capability index and current utilization rate;

[0018] The determining unit is used to determine the target server by utilizing the server's capability index and current utilization rate;

[0019] The sending unit is further configured to send a fourth message to the client, the fourth message including the address information of the target server, so that the client can access the target server according to the address information of the target server.

[0020] Thirdly, this application provides a network device including a processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, which in turn cause the processor to perform the method provided in the first aspect of this application.

[0021] Therefore, using the resource load balancing method and apparatus provided in this application, the gateway receives a first message sent by the client, the first message including the service attributes required by the client; based on the service attributes required by the client, the gateway sends a second message to at least one selected server, the second message being used to obtain the capacity index and current utilization rate of each server; the gateway receives a third message sent by each server, the third message including the server's capacity index and current utilization rate; using the server's capacity index and current utilization rate, the gateway determines the target server; the gateway sends a fourth message to the client, the fourth message including the address information of the target server, so that the client can access the target server based on the target server's address information.

[0022] In this way, by obtaining the capacity index and current utilization rate from the server, the gateway can select the target server with the least load from the servers that currently meet the client's request conditions, thereby achieving dynamic real-time load balancing on the server side. This solves the problem that, when clients choose a server themselves, there is a certain probability that they will choose the server with the highest load as the service provider, resulting in uneven resource allocation and subsequent requests from the client not receiving timely responses. Attached Figure Description

[0023] Figure 1 A diagram illustrating the existing client and server network topology;

[0024] Figure 2 A flowchart of the resource load balancing method provided in the embodiments of this application;

[0025] Figure 3 This is a structural diagram of the resource load balancing device provided in the embodiments of this application;

[0026] Figure 4 The network device hardware structure provided in the embodiments of this application. Detailed Implementation

[0027] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0028] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the corresponding listed items.

[0029] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0030] The resource load balancing method provided in the embodiments of this application will be described in detail below. See also Figure 1 , Figure 1 This is a flowchart illustrating a resource load balancing method provided in an embodiment of this application. The method is applied to a gateway (e.g., an ONVIF gateway), and the resource load balancing method provided in this embodiment may include the following steps.

[0031] Step 210: Receive a first message sent by the client, the first message including the service attributes required by the client;

[0032] Specifically, there are multiple servers in the network, each providing at least one service. Clients communicate and interconnect with multiple servers by connecting to the same gateway (switch or router).

[0033] When a client needs to use a service, the client generates and sends a first message to the gateway, which includes the service attributes required by the client.

[0034] In this embodiment of the application, the first message may specifically be a probe message in the ws-discovery protocol. It is understood that the probe message includes a type field and a scope field. The type field indicates the type of server to be searched, such as a computer, HTTP server, printer, etc.; the scope field describes the LDAP directory relationship followed by the URI, such as ldap: / / / ou=engineering,o=examplecom,c=us.

[0035] After receiving the first message, the gateway obtains the service attributes required by the client from it.

[0036] Step 220: Based on the service attributes required by the client, send a second message to at least one selected server. The second message is used to obtain the capability index and current utilization rate of each server.

[0037] Specifically, as described in step 210, after the gateway obtains the service attributes required by the client, it generates and sends a second message to at least one selected server based on the required service attributes. This second message is used to obtain the capacity index and current utilization rate of each server.

[0038] Optionally, in the first implementation, the specific process by which the gateway sends the second message to at least one selected server is as follows:

[0039] If the gateway already stores server information, the gateway retrieves at least one server from the stored server information that matches the service attributes (type field and scope field) and is in the same VLAN as the client; the gateway then sends a second message to each server.

[0040] The server information can be stored in the gateway in the form of a table, with each server information entry corresponding to a server. The server information entries include, but are not limited to, the following fields: server URI, server UUID, server version information, server VLAN, etc.

[0041] The scope field included in the above service attributes is an optional field.

[0042] In the first implementation, the second message can be a resolve message in the ws-discovery protocol, but this resolve message needs to be extended with the protocol.

[0043] Optionally, in the second implementation, the specific process by which the gateway sends the second message to at least one selected server is as follows:

[0044] If the gateway does not store server information, the gateway will send a second message within the VLAN to which the client belongs.

[0045] In the second implementation, the second message can be a probe message in the ws-discovery protocol, but the probe message needs to be extended with the protocol.

[0046] Understandably, regardless of the implementation method described above, the gateway can obtain the VLAN to which the client belongs through the first message sent by the client.

[0047] The following sections provide a detailed explanation of each resolve and probe message that undergoes protocol extension.

[0048] First, the resolve message that requires protocol extension will be explained.

[0049] The `resolve` message is expanded as follows: Add the following fields to the existing `body / resolve`. These added fields indicate the server's capability index and current usage rate. The `Capability` field represents the server's capability index, and the `Usage` field represents the server's current usage rate. The two fields are separated by a semicolon.

[0050]

[0051] Secondly, the probe message that requires protocol extension is explained.

[0052] The probe message is expanded as follows: Add the following fields to the existing body / resolve. These added fields indicate that the server's capability index and current usage rate need to be obtained. Specifically, the Capability field represents the server's capability index, and the Usage field represents the server's current usage rate. The two fields are separated by a semicolon:

[0053]

[0054]

[0055] Step 230: Receive the third message sent by each server, the third message including the server's capability index and current utilization rate;

[0056] Specifically, as described in step 220, after receiving the second message, each server retrieves the value matching each of the two fields included in the second message from its local machine and generates a third message. This third message includes the server's capability index and current utilization rate.

[0057] Each server sends a third message to the gateway. Upon receiving the third message, the gateway retrieves the server's capacity index and current utilization rate from it.

[0058] Optionally, the server retrieves the value matching each field from the local machine, specifically including:

[0059] The server's capability index is initially set in the server's system by the network administrator or service provider. The network administrator or service provider knows the hardware and software configuration of each server, the maximum number of connections it can accept, and other information. The value of the capability index can be determined by considering the server's CPU, memory, installed software, and other hardware and software information. Understandably, other servers of the same type in the network should also have their capability indices set according to the same principles.

[0060] The current utilization rate on the server side is calculated by the server using the capability index and the corresponding current attribute value. For example, the current utilization rate is the quotient of the current attribute value and the capability index.

[0061] For example, when the server is an HTTP server, its capacity index can be represented by the maximum number of requests it receives. The network includes three servers: HTTP server A, HTTP server B, and HTTP server C. Currently, HTTP server A has the best hardware and software performance, capable of handling a maximum of 5000 requests simultaneously. If HTTP server A has received 3000 requests, its current utilization rate is 60%. HTTP server C has the next best hardware and software performance, capable of handling a maximum of 4000 requests simultaneously. If HTTP server C has received 1000 requests, its current utilization rate is 25%. HTTP server B has the next best hardware and software performance (e.g., less memory or fewer CPUs than HTTP server A), capable of handling a maximum of 2000 requests simultaneously. If HTTP server B has received 1000 requests, its current utilization rate is 50%.

[0062] As described above, after each server obtains the capability index and current utilization rate, it fills these values ​​into the Capability and Usage fields of the third message. Each server then sends the third message to the client.

[0063] It is understandable that, corresponding to the second message described in step 220 above, the third message generated by the server and sent to the gateway also needs to be extended with a protocol.

[0064] Optionally, in the first implementation, when the second message sent by the gateway to the server is a resolve message, the third message generated and sent by the server is a resolvematch message, but the resolvematch message needs to be extended with the protocol.

[0065] Optionally, in the second implementation, when the second message sent by the gateway to the server is a probe message, the third message generated and sent by the server is a probematch message, but the probematch message needs to be extended with the protocol.

[0066] The following sections provide a detailed explanation of each resolvematch and probematch message that undergoes protocol extension.

[0067] First, the resolvematch message, which requires protocol extension, will be explained.

[0068] The `resolvematch` message is expanded as follows: The following fields are added to the existing `body / resolve` element. These added fields represent the server's capability index and current usage rate. Specifically, the `Capability` field represents the server's capability index, filled with "XX" (e.g., 5000), expressed as a number; the `Usage` field represents the server's current usage rate, filled with "YY" (e.g., 60%), expressed as a percentage. The two fields are separated by a semicolon.

[0069]

[0070] Secondly, the probematch message that requires protocol extension is explained.

[0071] The probematch message is expanded as follows: The following fields are added to the existing body / resolve, representing the server's capability index and current usage rate. Specifically, the Capability field represents the server's capability index, filled with XX (e.g., 5000), expressed as a number; the Usage field represents the server's current usage rate, filled with YY (e.g., 60%), expressed as a percentage. The two fields are separated by a semicolon.

[0072]

[0073] Step 240: Determine the target server using the server's capability index and current usage rate;

[0074] Specifically, according to the description of step 230, after the gateway obtains the server's capability index and current utilization rate from the third message, it uses the server's capability index and current utilization rate to determine the target server.

[0075] Optionally, the specific process by which the gateway determines the target server using the server's capability index and current utilization rate is as follows: using the server's capability index and current utilization rate, the gateway calculates the remaining capability value of the server; the gateway selects the server corresponding to the maximum value among the remaining capability values ​​as the target server.

[0076] According to the example in step 230, after the gateway receives the third message sent by HTTP server A, it obtains the capacity index of HTTP server A (5000) and the current utilization rate (60%), and calculates the remaining capacity value of HTTP server A as 2000. After the gateway receives the third message sent by HTTP server B, it obtains the capacity index of HTTP server B (2000) and the current utilization rate (50%), and calculates the remaining capacity value of HTTP server B as 1000. After the gateway receives the third message sent by HTTP server C, it obtains the capacity index of HTTP server C (4000) and the current utilization rate (25%), and calculates the remaining capacity value of HTTP server C as 3000.

[0077] Based on the above calculations, the gateway determines that the server corresponding to the maximum remaining capacity value of 3000 is HTTP server C. The gateway then sets HTTP server C as the target server.

[0078] Step 250: Send a fourth message to the client, the fourth message including the address information of the target server, so that the client can access the target server according to the address information of the target server.

[0079] Specifically, according to the description of step 240, after the gateway determines the target server, it obtains the address information of the target server from the third message sent by the target server.

[0080] The gateway generates and sends a fourth message to the client, which includes the address information of the target server, so that the client can access the target server based on the address information.

[0081] It is understood that, corresponding to the first message described in step 210 above, the fourth message generated by the gateway and sent to the client can specifically be a probematch message in the ws-discovery protocol. This probematch message does not require protocol extension.

[0082] Following the example in step 240, after the gateway determines that HTTP server C is the target server, it obtains the address information of HTTP server C from the third message sent by HTTP server C. The gateway generates a probematch message, which includes the address information of HTTP server C. The gateway then sends the probematch message to the client.

[0083] After receiving the probematch message, the client retrieves the address information of the HTTP server C and uses this information to access the service. When sending messages to the client, the gateway only provides information about one server. This server must be online; otherwise, it will not respond to the resolve / probe message. The gateway selects the server with the lightest load from the reply resolvematch / probematch messages and provides it to the client, thus achieving server load balancing.

[0084] Therefore, applying the resource load balancing method provided in this application, the gateway receives a first message sent by the client, the first message including the service attributes required by the client; based on the service attributes required by the client, the gateway sends a second message to at least one selected server, the second message being used to obtain the capacity index and current utilization rate of each server; the gateway receives a third message sent by each server, the third message including the server's capacity index and current utilization rate; using the server's capacity index and current utilization rate, the gateway determines the target server; the gateway sends a fourth message to the client, the fourth message including the address information of the target server, so that the client can access the target server based on the address information of the target server.

[0085] In this way, by obtaining the capacity index and current utilization rate from the server, the gateway can select the target server with the least load from the servers that currently meet the client's request conditions, thereby achieving dynamic real-time load balancing on the server side. This solves the problem that, when clients choose a server themselves, there is a certain probability that they will choose the server with the highest load as the service provider, resulting in uneven resource allocation and subsequent requests from the client not receiving timely responses.

[0086] Optionally, in this embodiment of the application, the process of the gateway generating and storing server-side information locally is also included.

[0087] Specifically, if the gateway can store server information, the gateway generates a fifth message and periodically sends the fifth message within the network.

[0088] In this embodiment, the fifth message may specifically be a probe message in the ws-discovery protocol. It is understood that the probe message includes a type field and a scope field.

[0089] The scope field mentioned above is optional.

[0090] After receiving the fifth message, each server generates and sends a sixth message to the gateway. This sixth message includes the server's attribute information. The server's attribute information includes, but is not limited to, the following fields: server URI, server UUID, server version information, server VLAN, etc.

[0091] In this embodiment of the application, the sixth message may specifically be the probematch message in the ws-discovery protocol.

[0092] After receiving the sixth message sent by each server, the gateway obtains the server's attribute information from it; based on the server's attribute information, the gateway generates the corresponding server information locally; the gateway stores the server information.

[0093] Optionally, in this embodiment of the application, the process of the gateway updating server information is also included.

[0094] Specifically, after updating its own attribute information, each server also periodically generates and sends a seventh message to the gateway, which includes the updated attribute information of the server.

[0095] After receiving the seventh message sent by each server, the gateway obtains the updated attribute information of the server from it; based on the updated attribute information of the server, the gateway finds the corresponding server information and updates the server information.

[0096] In this embodiment of the application, the seventh message may specifically be the hello / bye message in the ws-discovery protocol.

[0097] Based on the same inventive concept, embodiments of this application also provide a resource load balancing device corresponding to the resource load balancing method. See also Figure 3 , Figure 3 The resource load balancing device provided in this application embodiment is applied to a gateway, and the device includes:

[0098] The receiving unit 310 is configured to receive a first message sent by the client, the first message including the service attributes required by the client;

[0099] The sending unit 320 is configured to send a second message to at least one selected server according to the service attributes required by the client. The second message is used to obtain the capability index and current utilization rate of each server.

[0100] The receiving unit 310 is further configured to receive a third message sent by each server, the third message including the server's capability index and current utilization rate;

[0101] The determining unit 330 is used to determine the target server by utilizing the server's capability index and current usage rate;

[0102] The sending unit 320 is further configured to send a fourth message to the client, the fourth message including the address information of the target server, so that the client can access the target server according to the address information of the target server.

[0103] Optionally, the sending unit 320 is specifically used to, if the gateway already stores server information, obtain at least one server that matches the service attribute and is in the same VLAN as the client from the stored server information;

[0104] The second message is sent to each of the servers respectively.

[0105] Optionally, the sending unit 320 is specifically used to send the second message within the VLAN to which the client belongs if the server information is not stored in the gateway.

[0106] Optionally, the determining unit 330 is specifically used to calculate the remaining capacity value of the server using the server's capacity index and current utilization rate;

[0107] The server corresponding to the maximum value among the remaining capacity values ​​is taken as the target server.

[0108] Optionally, the sending unit 320 is further configured to periodically send a fifth message;

[0109] The receiving unit is further configured to receive a sixth message sent by each server, the sixth message including the attribute information of the server;

[0110] The device further includes: a generation unit (not shown in the figure), used to generate corresponding server information locally based on the attribute information of the server;

[0111] A storage unit (not shown in the figure) is used to store the server information.

[0112] Optionally, the receiving unit 310 is further configured to receive a seventh message sent by each server, the seventh message including updated attribute information of the server;

[0113] The device further includes an update unit (not shown in the figure), used to update the server information according to the updated server attribute information.

[0114] Therefore, using the resource load balancing device provided in this application, the gateway receives a first message sent by the client, the first message including the service attributes required by the client; based on the service attributes required by the client, the gateway sends a second message to at least one selected server, the second message being used to obtain the capacity index and current utilization rate of each server; the gateway receives a third message sent by each server, the third message including the server's capacity index and current utilization rate; using the server's capacity index and current utilization rate, the gateway determines the target server; the gateway sends a fourth message to the client, the fourth message including the address information of the target server, so that the client can access the target server based on the address information of the target server.

[0115] In this way, by obtaining the capacity index and current utilization rate from the server, the gateway can select the target server with the least load from the servers that currently meet the client's request conditions, thereby achieving dynamic real-time load balancing on the server side. This solves the problem that, when clients choose a server themselves, there is a certain probability that they will choose the server with the highest load as the service provider, resulting in uneven resource allocation and subsequent requests from the client not receiving timely responses.

[0116] Based on the same inventive concept, embodiments of this application also provide a network device, such as... Figure 4 As shown, the system includes a processor 410, a transceiver 420, and a machine-readable storage medium 430. The machine-readable storage medium 430 stores machine-executable instructions that can be executed by the processor 410. The processor 410 is prompted by the machine-executable instructions to execute the resource load balancing method provided in the embodiments of this application. (The foregoing...) Figure 3 The resource load balancing device shown can be used as follows: Figure 4 The hardware structure of the network device shown is implemented.

[0117] The aforementioned computer-readable storage medium 430 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the computer-readable storage medium 430 may also be at least one storage device located remotely from the aforementioned processor 410.

[0118] The processor 410 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0119] In this embodiment of the application, the processor 410 reads the machine-executable instructions stored in the machine-readable storage medium 430, and is prompted by the machine-executable instructions to enable the processor 410 itself and the transceiver 420 to execute the resource load balancing method described in the aforementioned embodiment of the application.

[0120] In addition, this application provides a machine-readable storage medium 430 that stores machine-executable instructions. When called and executed by the processor 410, the machine-executable instructions cause the processor 410 itself and the transceiver 420 to execute the resource load balancing method described in the aforementioned application.

[0121] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0122] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0123] For the resource load balancing device and machine-readable storage medium embodiments, since the methods involved are basically similar to the aforementioned method embodiments, the description is relatively simple, and relevant details can be found in the descriptions of the method embodiments.

[0124] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A resource load balancing method, characterized in that, The method is applied to a gateway that connects clients and multiple servers. The method includes: Receive a first message sent by the client, the first message including the service attributes required by the client, the service attributes including a type field and a scope field; Based on the service attributes required by the client, a second message is sent to at least one selected server. The second message is used to obtain the capability index and current utilization rate of each server. Receive a third message sent by each of the servers, the third message including the server's capability index and current utilization rate; The target server is determined using the server's capability index and current usage rate. A fourth message is sent to the client, the fourth message including the address information of the target server, so that the client can access the target server according to the address information of the target server; Sending the second message to at least one selected server specifically includes: If the gateway already stores server information, then retrieve at least one server that matches the service attribute and is in the same VLAN as the client from the stored server information. Send the second message to each of the servers respectively; The process of determining the target server using the server's capability index and current usage rate specifically includes: Calculate the remaining capacity value of the server using the server's capacity index and current utilization rate; The server corresponding to the maximum value among the remaining capacity values ​​is taken as the target server.

2. The method according to claim 1, characterized in that, Sending the second message to at least one selected server specifically includes: If the gateway does not store the server information, the second message is sent within the VLAN to which the client belongs.

3. The method according to claim 1, characterized in that, Before receiving the first message sent by the client, the method further includes: The fifth message is sent periodically; Receive a sixth message sent by each server, the sixth message including the attribute information of the server; Based on the attribute information of the server, generate the corresponding server information locally; Store the server information.

4. The method according to claim 3, characterized in that, Before receiving the first message sent by the client, the method further includes: Receive the seventh message sent by each server, the seventh message including the updated attribute information of the server; Update the server information based on the updated server attribute information.

5. A resource load balancing device, characterized in that, The device is used in a gateway that connects clients and multiple servers, and the device includes: A receiving unit is configured to receive a first message sent by a client, the first message including service attributes required by the client, the service attributes including a type field and a scope field; The sending unit is configured to send a second message to at least one selected server according to the service attributes required by the client. The second message is used to obtain the capability index and current utilization rate of each server. The receiving unit is further configured to receive a third message sent by each server, the third message including the server's capability index and current utilization rate; The determining unit is used to determine the target server by utilizing the server's capability index and current utilization rate; The sending unit is further configured to send a fourth message to the client, the fourth message including the address information of the target server, so that the client can access the target server according to the address information of the target server; The sending unit is specifically used to, if the gateway already stores server information, retrieve at least one server from the stored server information that matches the service attribute and is in the same VLAN as the client. Send the second message to each of the servers respectively; The determining unit is specifically used to calculate the remaining capacity value of the server using the server's capacity index and current utilization rate. The server corresponding to the maximum value among the remaining capacity values ​​is taken as the target server.

6. The apparatus according to claim 5, characterized in that, The sending unit is specifically used to send the second message within the VLAN to which the client belongs if the server information is not stored in the gateway.

7. The apparatus according to claim 5, characterized in that, The sending unit is also used to periodically send a fifth message; The receiving unit is further configured to receive a sixth message sent by each server, the sixth message including the attribute information of the server; The device further includes: a generation unit, configured to generate corresponding server information locally based on the attribute information of the server; A storage unit is used to store the server information.

8. The apparatus according to claim 7, characterized in that, The receiving unit is further configured to receive a seventh message sent by each server, the seventh message including updated attribute information of the server; The device further includes an update unit, configured to update the server information based on the updated server attribute information.

Citation Information

Patent Citations

  • A message processing method and apparatus

    CN109040243A

  • Communication method and device

    CN114513549A