A load balancing adjustment control method, system and storage medium
Patent Information
- Application Number
- CN202311831893.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2026-10-13
- Estimated Expiration
- 2043-12-27
AI Technical Summary
现有技术中容易产生网络异常数据无法到达终端而导致终端进退两难,导致终端在服务端离线;由于负载器需要提前设置,或由软件在初始化之处即获取,则其获取到的地址均为固定,无法由终端自由选择使用广域网带宽或局域网带宽
[0069]本实施例中央调度模块经过负载算法判断后,生成终端属于当前中继均衡模块的持有信息,或者不生成持有信息(终端不属于当前中继均衡模块);中举均衡模块若获得终端属于当前中继均衡模块的持有信息,则回复终端并与终端进行连接,否则不回复终端。本实施例实现了对中继均衡模块的负载计算,若中继均衡模块已经存在相当庞大数量的终端连接,则不再接收终端进行连接。而终端就会寻找下一个服务器目标地址进行连接请求,本实施例实现了在服务器目标地址列表中,以优先级高低为顺序选择一个优先级高又可以连接终端的中继均衡模块与终端进行连接,实现负载的均衡调整。
Smart Images

Figure CN117768468B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of load balancing technology, and in particular to a control method, system, and storage medium for load balancing adjustment. Background Technology
[0002] In a server system, when the number of terminals reaches a certain level, a single service module may not be able to support the massive number of terminals. The more terminals there are, the more logic the service module needs to process and the more data it needs to send. If a terminal needs to play audio, and thousands of terminals are connected to a single service, the server's network bandwidth will be under excessive data pressure. If the audio being played is PCM real-time capture or WAV audio files, the network bandwidth pressure will be even more severe.
[0003] Current server load balancing methods utilize a scheduling server to distribute data to appropriate terminals using certain strategies. The terminals then reconnect to new load balancer services based on the IP address and port configuration provided by the server. Existing technologies are prone to network anomalies that prevent data from reaching the terminals, leaving them in a dilemma and causing them to go offline on the server side. Furthermore, because load balancers need to be configured in advance or obtained by the software during initialization, the addresses they obtain are fixed, preventing terminals from freely choosing between WAN and LAN bandwidth. Summary of the Invention
[0004] This invention provides a load balancing adjustment control method, system, and storage medium to select a high-priority relay balancing module that can connect to a terminal from a server target address list in order of priority, thereby achieving load balancing adjustment.
[0005] This invention provides a load balancing adjustment control method applied to a relay balancing module, wherein the relay balancing module is connected to several terminals and is connected to a central scheduling module.
[0006] The control method includes:
[0007] In response to a connection request from any terminal, holding information is obtained; the holding information is generated by the central scheduling module after determining whether the relay balancing module can connect to the terminal; the determination operation is triggered when any terminal requests to connect to the first server target address corresponding to the relay balancing module;
[0008] Based on the result of obtaining the holding information, determine whether to connect with the terminal; if so, reply to the terminal, connect with the terminal, and push the terminal's online information to the central scheduling module.
[0009] Furthermore, before determining whether to connect to the terminal based on the result of obtaining the holding information, the process further includes:
[0010] The preset protocol is pushed to the central scheduling module and the terminal to notify the central scheduling module and the terminal to go online.
[0011] Furthermore, the step of determining whether to connect to the terminal based on the result of obtaining the holding information specifically involves:
[0012] If obtaining holding information fails, it is determined that a connection with the terminal is not being established, and no heartbeat response is sent to the terminal.
[0013] If the terminal obtains the holding information of belonging to the relay equalization module, then it is determined to connect to the terminal.
[0014] Furthermore, it also includes:
[0015] If the terminal disconnects its heartbeat for a preset duration, it reports this to the central scheduling module, so that the central scheduling module removes the terminal's ownership information from the relay balancing module.
[0016] This invention provides another load balancing adjustment control method, applied to a terminal, wherein the terminal is connected to a first relay balancing module, and the first relay balancing module is connected to a central scheduling module;
[0017] The control method includes:
[0018] In response to the terminal's online configuration request, a connection request is made to each server target address in the server target address list in sequence until a response is received from the requesting relay balance module; the server target address list includes several server target addresses, and the terminal is configured by the configuration tool; one server target address corresponds to one relay balance module;
[0019] If a response is received from the requesting relay balancing module, a connection is established with the responding relay balancing module. The response is sent by the requesting relay balancing module when it determines whether to connect with the terminal based on the result of obtaining holding information. The holding information is generated by the central scheduling module after determining whether the relay balancing module can connect to the terminal. The determination operation is triggered when any terminal requests to connect to the first server target address corresponding to the relay balancing module.
[0020] Furthermore, the step of sequentially requesting connections to each server target address in the server target address list specifically involves:
[0021] Send heartbeat packets to each server target address in the server target address list in turn;
[0022] If no heartbeat response is received within the preset time, a heartbeat packet is sent to the next target server address.
[0023] Furthermore, if a response is received from the requested relay balancing module, then a connection is established with the relay balancing module that responded, specifically as follows:
[0024] When the terminal receives a heartbeat response from the second relay equalization module and the terminal is online, a long connection is established with the second relay equalization module.
[0025] This invention provides another load balancing adjustment control method, applied to a central scheduling module, wherein the central scheduling module is connected to several relay balancing modules; each of the relay balancing modules is connected to several corresponding terminals;
[0026] The control method includes:
[0027] When any terminal requests to connect to the first server target address corresponding to the first relay balancing module, it is determined whether the first relay balancing module can connect to the terminal; the first server target address is configured by the configuration tool for the terminal; the first server target address corresponds to the first relay balancing module;
[0028] If so, the holding information of the first relay balancing module is generated, and the holding information is pushed to all relay balancing modules so that the first relay balancing module can respond to the terminal based on the result of obtaining the holding information, connect with the terminal, and push the terminal online information to the central scheduling module.
[0029] As a preferred embodiment, this invention allows a terminal to configure two or more server target addresses by configuring its server target address list. Each terminal's server target address list is manually configured, and the terminal can be freely configured for either a wide area network (WAN) connection or a local area network (LAN) connection. This invention can select a high-priority relay balancing module from the server target address list, in descending order of priority, to connect to the terminal, thereby achieving load balancing.
[0030] Other features and advantages of the present invention will be described in detail in the following detailed description section.
[0031] Accordingly, the present invention also provides a load balancing adjustment control system, comprising: a central scheduling module, a relay module, and a terminal module; the relay module includes a plurality of relay balancing modules; the terminal module includes a plurality of terminals; the central scheduling module is connected to the plurality of relay balancing modules; each relay balancing module is connected to its corresponding plurality of terminals;
[0032] The terminal is used to respond to the terminal's online configuration request by sequentially requesting a connection to each server target address in the server target address list until a response is received from the requesting relay balancer module; the server target address list includes several server target addresses, which are configured by the configuration tool; one server target address corresponds to one relay balancer module; if a response is received from the requesting relay balancer module, a connection is established with the responding relay balancer module;
[0033] The relay balancing module is used to respond to the connection request of any terminal, obtain holding information; determine whether to connect with the terminal based on the result of obtaining the holding information; if so, reply to the terminal, connect with the terminal, and push the terminal's online information to the central scheduling module.
[0034] The central scheduling module is used to determine whether the first relay balancing module can connect to the terminal when any terminal requests to connect to the first server target address corresponding to the first relay balancing module; the first server target address is configured for the terminal by a configuration tool; the first server target address corresponds to the first relay balancing module; if so, holding information of the first relay balancing module is generated and pushed to all relay balancing modules, so that the first relay balancing module can respond to the terminal based on the result of obtaining the holding information, connect to the terminal, and push the terminal's online information to the central scheduling module.
[0035] Accordingly, the present invention also provides a computer-readable storage medium comprising a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform any of the load balancing adjustment control methods described in the present invention. Attached Figure Description
[0036] Figure 1 This is a flowchart illustrating an embodiment of the load balancing adjustment control method provided by the present invention;
[0037] Figure 2 This is a flowchart illustrating another embodiment of the load balancing adjustment control method provided by the present invention;
[0038] Figure 3 This is a flowchart illustrating another embodiment of the load balancing adjustment control method provided by the present invention;
[0039] Figure 4 This is a schematic diagram of an embodiment of the load balancing adjustment control system provided by the present invention. Detailed Implementation
[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0041] Example 1
[0042] Please refer to Figure 1 This invention provides a load balancing adjustment control method, applied to a relay balancing module, which is connected to several terminals and is connected to a central scheduling module.
[0043] The control method includes steps S101-S102:
[0044] Step S101: In response to a connection request from any terminal, obtain holding information; the holding information is generated by the central scheduling module after determining whether the relay balancing module can connect to the terminal; the determination operation is triggered when any terminal requests to connect to the first server target address corresponding to the relay balancing module.
[0045] Furthermore, the terminal sequentially requests a connection to each server target address in the server target address list, which includes several server target addresses and is configured by a configuration tool; each server target address corresponds to a relay balancer module; the operation of the terminal sequentially requesting a connection to each server target address in the server target address list is triggered when the terminal makes an online configuration request.
[0046] Step S102: Determine whether to connect with the terminal based on the result of obtaining the holding information; if yes, reply to the terminal, connect with the terminal, and push the terminal online information to the central scheduling module.
[0047] Furthermore, based on the result of obtaining the holding information, it is determined whether to connect to the terminal, specifically as follows:
[0048] If obtaining holding information fails, it is determined that a connection with the terminal is not being established, and no heartbeat response is sent to the terminal.
[0049] If the terminal obtains the holding information of belonging to the relay equalization module, then it is determined to connect to the terminal.
[0050] In this embodiment, failure to obtain holding information includes: not being able to obtain holding information, or obtaining holding information indicating that the terminal does not belong to the current relay equalization module.
[0051] As a preferred implementation, failure to obtain holding information is defined as: holding information cannot be obtained.
[0052] The terminal sequentially requests a connection to each server target address in the server target address list. After the terminal requests a server target address, the central scheduling module determines whether the relay balancing module corresponding to the server target address can connect to the terminal. Only when the current relay balancing module can connect to the terminal will it generate holding information indicating that the terminal belongs to the relay balancing module, and stop requesting connections to subsequent server target addresses in the server target address list.
[0053] When a terminal requests to connect to the current relay equalization module, all relay equalization modules before the current relay equalization module are unable to connect to the terminal, and no holding information indicating that the terminal belongs to any relay equalization module is generated.
[0054] If the current relay balancing module can connect to the terminal, the central scheduling module will generate holding information indicating that the terminal belongs to the relay balancing module. The current relay balancing module can successfully obtain the holding information and determine to connect to the terminal.
[0055] If the current relay balancing module cannot connect to the terminal, the central scheduling module will not generate holding information indicating that the terminal belongs to the relay balancing module. The current relay balancing module will then fail to obtain holding information, confirming that it is not connecting to the terminal and will not respond to the terminal. The terminal will then request a connection to the next server target address.
[0056] As another preferred implementation, failure to obtain holding information occurs when the terminal does not belong to the current relay equalization module.
[0057] The terminal connects to the current relay balancing module (the first relay balancing module), which then notifies the central scheduling module. The central scheduling module, after load balancing algorithm evaluation, determines which relay balancing module the terminal belongs to in the server target address list. If the second relay balancing module is the same as the first, meaning the terminal belongs to the first relay balancing module, the terminal's affiliation information is pushed to all relay balancing modules. The first relay balancing module responds to and connects to the terminal based on this information. Relay balancing modules other than the first do not respond with a heartbeat. If the second relay balancing module is different from the first, meaning the terminal does not belong to the first relay balancing module, the first relay balancing module does not respond with a heartbeat, and neither do any other relay balancing module. The second relay balancing module takes over, receiving the terminal's heartbeat response and pushing the terminal's online information to the central scheduling module.
[0058] Furthermore, before determining whether to connect to the terminal based on the result of obtaining the holding information, the process also includes:
[0059] The preset protocol is pushed to the central scheduling module and the terminal to notify the central scheduling module and the terminal to go online.
[0060] In this embodiment, before sending the preset protocol, the relay equalizer module sends Protocol 1: The relay equalizer (relay equalizer module) requests to obtain the terminal slave master equalizer (current relay equalizer module);
[0061] The default protocol is Protocol 2: The relay equalizer (relay equalization module) notifies the central dispatch module that the terminal connection is successful;
[0062] Before sending Protocol 2, the terminal is still in the state of attempting scheduling and is not officially online. Business operations are not allowed until the terminal connects to the relay balancer set up by the central dispatcher. Only then can the user know that the terminal is connected to the server and can perform business operations. This is because if the connection is not to the primary balancer, the terminal is still in the scheduling state, which may cause business process anomalies. Only when the terminal is in a stable state is it allowed to provide the user with its online status.
[0063] Furthermore, it also includes:
[0064] If the terminal disconnects its heartbeat for a preset duration, it reports this to the central scheduling module, so that the central scheduling module removes the terminal's ownership information from the relay balancing module.
[0065] In this embodiment, the terminal may experience a network communication failure with the current relay equalization module x, resulting in a disconnection. If no response is received after sending a heartbeat packet for five seconds, it is determined that the current connection target service is abnormal or is not a service that the terminal should be connecting to; a notification is sent to the central scheduling module; and the terminal's information belonging to the current relay equalization module is removed.
[0066] The terminal will attempt to connect to other relay balance modules configured by itself. If the terminal successfully communicates with relay balance module y, relay balance module y will notify the central scheduling module. The central scheduling module will determine the relay balance module y according to the corresponding algorithm and generate the terminal's ownership information of the relay balance module y.
[0067] If the terminal is only configured with server target addresses x and y, the central scheduling module will know that the terminal has disconnected from the relay balancing module x, and will therefore reduce the priority of the relay balancing module x; thus, the terminal will be reassigned to the relay balancing module y.
[0068] Implementing the embodiments of the present invention has the following effects:
[0069] In this embodiment, the central scheduling module, after determining the load using a load algorithm, generates holding information for a terminal belonging to the current relay balancing module, or does not generate holding information (the terminal does not belong to the current relay balancing module). If the relay balancing module obtains holding information indicating that a terminal belongs to the current relay balancing module, it replies to the terminal and establishes a connection; otherwise, it does not reply. This embodiment implements load calculation for the relay balancing module. If the relay balancing module already has a substantial number of terminal connections, it will no longer accept connection requests from terminals. The terminal will then search for the next server target address to make a connection request. This embodiment selects a high-priority relay balancing module that can connect to the terminal from the server target address list, in descending order of priority, thus achieving load balancing adjustment.
[0070] In addition, if the connection between the terminal and the relay balancing module is lost, the terminal's ownership information belonging to the relay balancing module is removed, allowing the terminal to search for the server target address again and request a connection, thereby further realizing the load balancing adjustment.
[0071] Example 2
[0072] Please refer to Figure 2 This invention provides another load balancing adjustment control method, applied to a terminal, wherein the terminal is connected to a first relay balancing module, and the first relay balancing module is connected to a central scheduling module.
[0073] The control method includes steps S201-S202:
[0074] Step S201: In response to the terminal's online configuration request, a connection request is made to each server target address in the server target address list in sequence until a response is received from the requesting relay balance module; the server target address list includes several server target addresses, and the terminal is configured by the configuration tool; one server target address corresponds to one relay balance module;
[0075] Step S202: If a response is received from the requesting relay balancing module, then a connection is established with the relay balancing module that responded; the response is sent by the requesting relay balancing module when it determines to connect with the terminal based on the result of obtaining holding information; the holding information is generated by the central scheduling module after judging whether the relay balancing module can connect to the terminal; the judgment operation is triggered when any terminal requests to connect to the first server target address corresponding to the relay balancing module.
[0076] Furthermore, connections are requested sequentially for each server target address in the server target address list, specifically as follows:
[0077] Send heartbeat packets to each server target address in the server target address list in turn;
[0078] If no heartbeat response is received within the preset time, a heartbeat packet is sent to the next target server address.
[0079] Furthermore, until a response is received from the requested relay balancing module, a connection is established with the responding relay balancing module, specifically as follows:
[0080] When the terminal receives a heartbeat response from the second relay equalization module and the terminal is online, a long connection is established with the second relay equalization module.
[0081] In a preferred embodiment, the terminal sequentially requests connection to each server target address in the server target address list by sending heartbeat packets. After the terminal requests a server target address, the central scheduling module determines whether the relay balancing module corresponding to the server target address can connect to the terminal. Only when the current relay balancing module can connect to the terminal will it generate holding information indicating that the terminal belongs to the relay balancing module, and stop requesting connection to subsequent server target addresses in the server target address list.
[0082] When a terminal requests to connect to the current relay equalization module, all relay equalization modules before the current relay equalization module are unable to connect to the terminal, and no holding information indicating that the terminal belongs to any relay equalization module is generated.
[0083] If the current relay balancing module can connect to the terminal, the central scheduling module will generate holding information indicating that the terminal belongs to the relay balancing module. The current relay balancing module can successfully obtain this holding information and determine to connect with the terminal. After confirming the connection with the terminal, the relay balancing module will send a heartbeat response to the terminal. When the terminal receives the requested heartbeat response from the relay balancing module and the terminal is online, it will establish a long-term connection with the second relay balancing module.
[0084] If the current relay balancing module cannot connect to the terminal, the central scheduling module will not generate holding information indicating that the terminal belongs to the relay balancing module. The current relay balancing module will then fail to obtain holding information, confirming that it is not connecting to the terminal and will not send a heartbeat response to the terminal. If the terminal does not receive a heartbeat response within a preset time, it will send a heartbeat packet to the next server target address.
[0085] In another preferred implementation, the terminal connects to the current relay balancing module (the first relay balancing module), which then notifies the central scheduling module. The central scheduling module, after load balancing algorithm evaluation, determines which relay balancing module the terminal belongs to in the server target address list. If the second relay balancing module is the same as the first relay balancing module (i.e., the terminal belongs to the first relay balancing module), the terminal's affiliation information is pushed to all relay balancing modules. The first relay balancing module responds to and connects to the terminal based on this information. Relay balancing modules other than the first relay balancing module do not respond with a heartbeat. If the second relay balancing module is different from the first relay balancing module (i.e., the terminal does not belong to the first relay balancing module), the first relay balancing module does not respond with a heartbeat, and neither do any other relay balancing module. The second relay balancing module takes over, receiving the terminal's heartbeat response and pushing the terminal's online information to the central scheduling module.
[0086] In this embodiment, the terminal may experience a network communication failure with the current relay equalization module x, resulting in a disconnection. If no response is received after sending a heartbeat packet for five seconds, it is determined that the current connection target service is abnormal or is not a service that the terminal should be connecting to; a notification is sent to the central scheduling module; and the terminal's information belonging to the current relay equalization module is removed.
[0087] The terminal will attempt to connect to other relay balance modules configured by itself. If the terminal successfully communicates with relay balance module y, relay balance module y will notify the central scheduling module. The central scheduling module will determine the relay balance module y according to the corresponding algorithm and generate the terminal's ownership information of the relay balance module y.
[0088] If the terminal is only configured with server target addresses x and y, the central scheduling module will know that the terminal has disconnected from the relay balancing module x, and will therefore reduce the priority of the relay balancing module x; thus, the terminal will be reassigned to the relay balancing module y.
[0089] Implementing the embodiments of the present invention has the following effects:
[0090] This embodiment implements load calculation for the relay balancing module. If the relay balancing module already has a large number of terminal connections, it will no longer accept connection requests from terminals. Instead, the terminals will search for the next server target address to make connection requests. This embodiment selects a high-priority relay balancing module that can connect to the terminal from the server target address list in descending order of priority, thereby achieving load balancing adjustment.
[0091] Example 3
[0092] Please refer to Figure 3 This invention provides another load balancing adjustment control method, applied to a central scheduling module, which is connected to several relay balancing modules; each relay balancing module is connected to several corresponding terminals.
[0093] The control method includes steps S301-S302:
[0094] Step S301: When any terminal requests to connect to the first server target address corresponding to the first relay balancing module, determine whether the first relay balancing module can connect to the terminal; the first server target address is configured by the configuration tool for the terminal; the first server target address corresponds to the first relay balancing module;
[0095] Furthermore, the terminal sequentially requests a connection to each server target address in the server target address list, which includes several server target addresses and is configured by a configuration tool; each server target address corresponds to a relay balancer module; the operation of the terminal sequentially requesting a connection to each server target address in the server target address list is triggered when the terminal makes an online configuration request.
[0096] Step S302: If yes, then generate holding information for the first relay balancing module, push the holding information to all relay balancing modules, so that the first relay balancing module can respond to the terminal based on the result of obtaining the holding information, connect with the terminal, and push the terminal online information to the central scheduling module.
[0097] In this embodiment, the central scheduling module is the main logic processing module and the scheduling center that aggregates all relay balancing modules;
[0098] In a preferred embodiment, the terminal connects to the first relay balancing module, which then notifies the central scheduling module. The central scheduling module, after determining the load using a load algorithm, pushes the terminal's affiliation information (belonging to the first relay balancing module) to all relay balancing modules. The first relay balancing module responds to and connects to the terminal based on this affiliation information. If the terminal does not belong to the first relay balancing module, the first relay balancing module stops responding to heartbeats. The terminal then requests the next server target address to connect.
[0099] In another preferred embodiment, the terminal connects to the first relay balancing module, which then notifies the central scheduling module. The central scheduling module, after load balancing algorithm evaluation, determines which second relay balancing module the terminal belongs to in the server target address list. If the second relay balancing module is the same as the first, meaning the terminal belongs to the first relay balancing module, the terminal's affiliation information is pushed to all relay balancing modules. The first relay balancing module responds to and connects to the terminal based on this information. Relay balancing modules other than the first do not respond with a heartbeat. If the second relay balancing module is different from the first, meaning the terminal does not belong to the first relay balancing module, the first relay balancing module does not respond with a heartbeat, and neither do any other relay balancing module. The second relay balancing module takes over, receiving the terminal's heartbeat response and pushing the terminal's online information to the central scheduling module.
[0100] In this embodiment, the business display and business logic are handled by the front-end interface.
[0101] Implementing the embodiments of the present invention has the following effects:
[0102] This invention allows a terminal to configure two or more server target addresses by configuring its server target address list. Each terminal's server target address list is manually configured, and the terminal can be freely set up for wide area network (WAN) or local area network (LAN) connections. This invention can select a high-priority relay balancing module from the server target address list, in descending order of priority, to connect to the terminal, thereby achieving load balancing.
[0103] Example 4
[0104] Please refer to Figure 4This invention provides a load balancing adjustment control system, comprising: a central scheduling module 401, a relay module 402, and a terminal module 403; the relay module 402 includes a plurality of relay balancing modules (relay balancing modules 1-N); the terminal module 403 includes a plurality of terminals (terminals 1-M); N and M are natural numbers; the central scheduling module is connected to the plurality of relay balancing modules; each relay balancing module is connected to its corresponding plurality of terminals;
[0105] The terminal is used to respond to the terminal's online configuration request by sequentially requesting a connection to each server target address in the server target address list until a response is received from the requesting relay balancer module; the server target address list includes several server target addresses, which are configured by the configuration tool; one server target address corresponds to one relay balancer module; if a response is received from the requesting relay balancer module, a connection is established with the responding relay balancer module;
[0106] The relay balancing module is used to respond to the connection request of any terminal, obtain holding information; determine whether to connect with the terminal based on the result of obtaining the holding information; if so, reply to the terminal, connect with the terminal, and push the terminal's online information to the central scheduling module.
[0107] The central scheduling module is used to determine whether the first relay balancing module can connect to the terminal when any terminal requests to connect to the first server target address corresponding to the first relay balancing module; the first server target address is configured for the terminal by a configuration tool; the first server target address corresponds to the first relay balancing module; if so, holding information of the first relay balancing module is generated and pushed to all relay balancing modules, so that the first relay balancing module can respond to the terminal based on the result of obtaining the holding information, connect to the terminal, and push the terminal's online information to the central scheduling module.
[0108] The load balancing adjustment control system described above can implement the load balancing adjustment control method of the above method embodiments. The options in the above method embodiments are also applicable to this embodiment, and will not be detailed here. The remaining content of this application embodiment can be referred to the content of the above method embodiments, and will not be repeated in this embodiment.
[0109] Example 5
[0110] Accordingly, the present invention also provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the load balancing adjustment control method as described in any of the above embodiments.
[0111] For example, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.
[0112] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0113] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.
[0114] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc.; the data storage area may store data created based on the use of the mobile terminal, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0115] Wherein, if the modules / units integrated in the terminal device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, it can implement the steps of the various method embodiments described above. Wherein, the computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0116] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A load balancing adjustment control method, characterized in that, It is applied to a relay balancing module, including multiple relay balancing modules, each of which can connect to several terminals, and each of which is connected to a central scheduling module. The control method includes: The terminal sequentially requests connection to server target addresses in the server target address list, which includes several server target addresses. The terminal is configured by a configuration tool. Each server target address corresponds to a relay balancer module. In response to a connection request from any terminal, the relay balancer module requests holding information from the central scheduling module. The holding information is generated by the central scheduling module after determining whether the relay balancer module can connect to the terminal. The determination operation is triggered when any terminal requests to connect to the server target address corresponding to the relay balancer module. If the holding information is successfully obtained, it is determined that the relay balancing module can connect to the terminal. The module then responds to the terminal, establishes a connection, and pushes the terminal's online information to the central scheduling module. The terminal stops requesting connections to server target addresses later in the server target address list. If obtaining the holding information fails, it is determined that a connection cannot be established with the terminal, and no heartbeat response is sent. If the terminal does not receive a heartbeat response within a preset time, it sends a heartbeat packet to the next server target address to initiate a connection request.
2. The load balancing adjustment control method as described in claim 1, characterized in that, Before determining whether to connect to the terminal based on the result of obtaining the holding information, the process also includes: The preset protocol is pushed to the central scheduling module and the terminal to notify the central scheduling module and the terminal to go online.
3. The load balancing adjustment control method as described in claim 1, characterized in that, Also includes: If the terminal disconnects its heartbeat for a preset duration, it reports this to the central scheduling module, so that the central scheduling module removes the terminal's ownership information from the relay balancing module.
4. A load balancing adjustment control method, characterized in that, Applied to a terminal, the terminal is connected to one of multiple relay balancing modules, and the relay balancing module is connected to a central scheduling module; The control method includes: In response to the terminal's online configuration request, a connection request is made to each server target address in the server target address list in sequence until a response is received from the relay balance module. The server target address list includes several server target addresses, which are configured by the configuration tool for the terminal. Each server target address corresponds to one relay balance module. If a response is received from the requesting relay balancing module, a connection is established with the responding relay balancing module, and the terminal's online information is pushed to the central scheduling module. The terminal then stops requesting connections to server target addresses later in the server target address list. The response is sent by the requesting relay balancing module when it successfully obtains holding information from the central scheduling module. The holding information is generated by the central scheduling module after determining whether the relay balancing module can connect to the terminal. This determination is triggered when any terminal requests a connection to the server target address corresponding to the relay balancing module. If the requesting relay balancing module fails to obtain holding information, it is determined that it is not connecting to the terminal, and no heartbeat response is sent to the terminal. If the terminal does not receive a heartbeat response within a preset time, it sends a heartbeat packet to the next server target address to request a connection.
5. The load balancing adjustment control method as described in claim 4, characterized in that, If a response is received from the requested relay balancing module, then a connection is established with the relay balancing module that responded, specifically as follows: When the terminal receives a heartbeat response from the relay balancing module and the terminal is online, a long connection is established with the relay balancing module.
6. A load balancing adjustment control method, characterized in that, It is applied to a central dispatch module, which is connected to several relay balancing modules; each of the relay balancing modules is connected to several corresponding terminals. The control method includes: The terminal sequentially requests connection to the server target addresses in the server target address list, and determines whether the requested relay balance module can connect to the terminal; the server target address list includes several server target addresses, and the terminal is configured by a configuration tool; one server target address corresponds to one relay balance module; If so, then the holding information of the relay balancing module is generated, and the holding information is pushed to all relay balancing modules, so that the requested relay balancing module responds to the terminal based on the result of obtaining the holding information, connects with the terminal, and pushes the terminal online information to the central scheduling module. If not, the central scheduling module will not generate holding information, and the request relay balancing module will not send a heartbeat response to the terminal. If the terminal does not receive a heartbeat response within a preset time, it will send a heartbeat packet to the next server target address to make a connection request.
7. A load balancing adjustment control system, characterized in that, include: The system comprises a central dispatch module, a relay module, and a terminal module; the relay module includes several relay balancing modules; the terminal module includes several terminals; the central dispatch module is connected to several relay balancing modules; each relay balancing module is connected to its corresponding number of terminals. The terminal is used to respond to the terminal's online configuration request by sequentially requesting a connection to each server target address in the server target address list until a response is received from the requesting relay balancer module; the server target address list includes several server target addresses, which are configured by the configuration tool; one server target address corresponds to one relay balancer module; if a response is received from the requesting relay balancer module, a connection is established with the responding relay balancer module; The relay balancing module is used to respond to the connection request of any terminal by requesting holding information from the central scheduling module; if the holding information is successfully obtained, the module replies to the terminal, connects to the terminal, and pushes the terminal's online information to the central scheduling module. The central scheduling module is used to determine whether a relay balancing module can connect to a terminal when any terminal requests a connection to the server target address corresponding to the relay balancing module. The server target address is configured for the terminal by a configuration tool. The server target address corresponds to a relay balancing module. If so, the module generates holding information for the relay balancing module and pushes the holding information to all relay balancing modules, so that the requested relay balancing module can respond to the terminal based on the obtained holding information, connect to the terminal, and push the terminal's online information to the central scheduling module.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform a load balancing adjustment control method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Gateway device, load balancing method for gateway device and load balancing program of gateway device
JP2008225644A
Relay server and relay server program
JP2009140115A